diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/CustomRendererWidget.cpp | 2 | ||||
-rw-r--r-- | src/gui/GsrPage.cpp | 2 | ||||
-rw-r--r-- | src/gui/ScrollablePage.cpp | 18 | ||||
-rw-r--r-- | src/gui/SettingsPage.cpp | 5 | ||||
-rw-r--r-- | src/gui/StaticPage.cpp | 2 |
5 files changed, 22 insertions, 7 deletions
diff --git a/src/gui/CustomRendererWidget.cpp b/src/gui/CustomRendererWidget.cpp index cfb113b..4cb7adf 100644 --- a/src/gui/CustomRendererWidget.cpp +++ b/src/gui/CustomRendererWidget.cpp @@ -20,7 +20,7 @@ namespace gsr { mgl_scissor prev_scissor; mgl_window_get_scissor(window.internal_window(), &prev_scissor); - mgl_scissor new_scissor = { + const mgl_scissor new_scissor = { mgl_vec2i{(int)draw_pos.x, (int)draw_pos.y}, mgl_vec2i{(int)size.x, (int)size.y} }; diff --git a/src/gui/GsrPage.cpp b/src/gui/GsrPage.cpp index e6ee5fc..68ee292 100644 --- a/src/gui/GsrPage.cpp +++ b/src/gui/GsrPage.cpp @@ -106,7 +106,7 @@ namespace gsr { mgl_window_get_scissor(window.internal_window(), &prev_scissor); const mgl::vec2f inner_size = get_inner_size(); - mgl_scissor new_scissor = { + const mgl_scissor new_scissor = { mgl_vec2i{(int)position.x, (int)position.y}, mgl_vec2i{(int)inner_size.x, (int)inner_size.y} }; diff --git a/src/gui/ScrollablePage.cpp b/src/gui/ScrollablePage.cpp index 74dd715..94da907 100644 --- a/src/gui/ScrollablePage.cpp +++ b/src/gui/ScrollablePage.cpp @@ -19,9 +19,23 @@ namespace gsr { if(!visible) return true; - offset = position + offset + mgl::vec2f(0.0f, scroll_y); + offset = position + offset; + + const mgl::vec2f content_size = get_inner_size(); + const mgl::vec2i scissor_pos(offset.x, offset.y); + const mgl::vec2i scissor_size(content_size.x, content_size.y); + + offset.y += scroll_y; Widget *selected_widget = selected_child_widget; + if(event.type == mgl::Event::MouseButtonPressed || event.type == mgl::Event::MouseButtonReleased) { + if(!mgl::IntRect(scissor_pos, scissor_size).contains({event.mouse_button.x, event.mouse_button.y})) + return true; + } else if(event.type == mgl::Event::MouseMoved) { + if(!mgl::IntRect(scissor_pos, scissor_size).contains({event.mouse_move.x, event.mouse_move.y})) + return true; + } + if(event.type == mgl::Event::MouseButtonReleased && moving_scrollbar_with_cursor) { moving_scrollbar_with_cursor = false; remove_widget_as_selected_in_parent(); @@ -79,7 +93,7 @@ namespace gsr { mgl_window_get_scissor(window.internal_window(), &prev_scissor); const mgl::vec2f content_size = get_inner_size(); - mgl_scissor new_scissor = { + const mgl_scissor new_scissor = { mgl_vec2i{(int)offset.x, (int)offset.y}, mgl_vec2i{(int)content_size.x, (int)content_size.y} }; diff --git a/src/gui/SettingsPage.cpp b/src/gui/SettingsPage.cpp index dc6f2c7..28821d1 100644 --- a/src/gui/SettingsPage.cpp +++ b/src/gui/SettingsPage.cpp @@ -64,8 +64,9 @@ namespace gsr { // record_area_box->add_item("Window", "window"); if(capture_options.focused) record_area_box->add_item("Follow focused window", "focused"); - if(capture_options.screen) - record_area_box->add_item("All monitors", "screen"); + // Do we really need this? it's only available on nvidia x11 + //if(capture_options.screen) + // record_area_box->add_item("All monitors", "screen"); for(const auto &monitor : capture_options.monitors) { char name[256]; snprintf(name, sizeof(name), "Monitor %s (%dx%d)", monitor.name.c_str(), monitor.size.x, monitor.size.y); diff --git a/src/gui/StaticPage.cpp b/src/gui/StaticPage.cpp index a89fc42..c014f38 100644 --- a/src/gui/StaticPage.cpp +++ b/src/gui/StaticPage.cpp @@ -39,7 +39,7 @@ namespace gsr { mgl_scissor prev_scissor; mgl_window_get_scissor(window.internal_window(), &prev_scissor); - mgl_scissor new_scissor = { + const mgl_scissor new_scissor = { mgl_vec2i{(int)draw_pos.x, (int)draw_pos.y}, mgl_vec2i{(int)size.x, (int)size.y} }; |