aboutsummaryrefslogtreecommitdiff
path: root/src/gui/FileChooser.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-12-29 20:51:56 +0100
committerdec05eba <dec05eba@protonmail.com>2024-12-29 20:51:56 +0100
commitfdeebe22003faefe3de5e3bc61acdf5a9f071d42 (patch)
treefbb56bb5de667447063b495512ddee01cb9d1cd6 /src/gui/FileChooser.cpp
parenta119220961d3df6d8f5f96d3a646adedb5d99554 (diff)
Fix scrollbar not working with mouse, fix being able to click filechooser items outside area
Diffstat (limited to 'src/gui/FileChooser.cpp')
-rw-r--r--src/gui/FileChooser.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/FileChooser.cpp b/src/gui/FileChooser.cpp
index 03a44c1..2612365 100644
--- a/src/gui/FileChooser.cpp
+++ b/src/gui/FileChooser.cpp
@@ -96,7 +96,12 @@ namespace gsr {
selected_item_background.set_color(get_color_theme().tint_color);
window.draw(selected_item_background);
}
- if(!has_parent_with_selected_child_widget() && mouse_over_item == -1 && mgl::FloatRect(item_pos, item_size).contains(mouse_pos)) {
+
+ if(!has_parent_with_selected_child_widget() && mouse_over_item == -1 &&
+ mouse_pos.x >= scissor.position.x && mouse_pos.x <= scissor.position.x + scissor.size.x &&
+ mouse_pos.y >= scissor.position.y && mouse_pos.y <= scissor.position.y + scissor.size.y &&
+ mgl::FloatRect(item_pos, item_size).contains(mouse_pos))
+ {
// mgl::Rectangle selected_item_background(item_size.floor());
// selected_item_background.set_position(item_pos.floor());
// selected_item_background.set_color(mgl::Color(20, 20, 20, 150));