From cc3fddd1e56b44a2bd98582b72080093bb5c9800 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Tue, 23 Nov 2021 20:34:01 -0500 Subject: [PATCH] Added in check to make sure you can use a scrollbar on a split. --- data/core/rootview.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/data/core/rootview.lua b/data/core/rootview.lua index 49da2923..bedea557 100644 --- a/data/core/rootview.lua +++ b/data/core/rootview.lua @@ -877,11 +877,11 @@ end function RootView:on_mouse_pressed(button, x, y, clicks) local div = self.root_node:get_divider_overlapping_point(x, y) - if div then + local node = self.root_node:get_child_overlapping_point(x, y) + if div and (node and not node.active_view:scrollbar_overlaps_point(x, y)) then self.dragged_divider = div return true end - local node = self.root_node:get_child_overlapping_point(x, y) if node.hovered_scroll_button > 0 then node:scroll_tabs(node.hovered_scroll_button) return true @@ -1030,7 +1030,7 @@ function RootView:on_mouse_moved(x, y, dx, dy) local tab_index = self.overlapping_node and self.overlapping_node:get_tab_overlapping_point(x, y) if self.overlapping_node and self.overlapping_node:get_scroll_button_index(x, y) then core.request_cursor("arrow") - elseif div then + elseif div and (self.overlapping_node and not self.overlapping_node.active_view:scrollbar_overlaps_point(x, y)) then core.request_cursor(div.type == "hsplit" and "sizeh" or "sizev") elseif tab_index then core.request_cursor("arrow") @@ -1125,10 +1125,10 @@ function RootView:update_drag_overlay() if split_type == "tab" and (over ~= self.dragged_node.node or #over.views > 1) then local tab_index, tab_x, tab_y, tab_w, tab_h = over:get_drag_overlay_tab_position(self.mouse.x, self.mouse.y) self:set_drag_overlay(self.drag_overlay_tab, - tab_x + (tab_index and 0 or tab_w), tab_y, - style.caret_width, tab_h, - -- avoid showing tab overlay moving between nodes - over ~= self.drag_overlay_tab.last_over) + tab_x + (tab_index and 0 or tab_w), tab_y, + style.caret_width, tab_h, + -- avoid showing tab overlay moving between nodes + over ~= self.drag_overlay_tab.last_over) self:set_show_overlay(self.drag_overlay, false) self.drag_overlay_tab.last_over = over else