Skip to content

Commit

Permalink
Use mousearea outside of scrollable to get tab size, fixes #164
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpot51 committed May 17, 2024
1 parent 059d70f commit e451bd3
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/tab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2264,8 +2264,7 @@ impl Tab {
.on_press(move |_point_opt| Message::Click(None))
.on_release(|_| Message::ClickRelease(None))
.on_back_press(move |_point_opt| Message::GoPrevious)
.on_forward_press(move |_point_opt| Message::GoNext)
.on_resize(Message::Resize);
.on_forward_press(move |_point_opt| Message::GoNext);

if self.context_menu.is_some() {
mouse_area = mouse_area.on_right_press(move |_point_opt| Message::ContextMenu(None));
Expand All @@ -2285,11 +2284,14 @@ impl Tab {
tab_column = tab_column.push(location_view);
if can_scroll {
tab_column = tab_column.push(
widget::scrollable(popover)
.id(self.scrollable_id.clone())
.on_scroll(Message::Scroll)
.width(Length::Fill)
.height(Length::Fill),
mouse_area::MouseArea::new(
widget::scrollable(popover)
.id(self.scrollable_id.clone())
.on_scroll(Message::Scroll)
.width(Length::Fill)
.height(Length::Fill),
)
.on_resize(Message::Resize),
);
} else {
tab_column = tab_column.push(popover);
Expand Down

0 comments on commit e451bd3

Please sign in to comment.