From 7d2d813343baae10c2667590463385d50abb784c Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Mon, 23 Jan 2023 16:57:24 +0100 Subject: added new style for scrollable, to be applied when mouse is over the scrollable area --- native/src/widget/scrollable.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'native') diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs index 82286036..de6eacb5 100644 --- a/native/src/widget/scrollable.rs +++ b/native/src/widget/scrollable.rs @@ -856,6 +856,8 @@ pub fn draw( theme.dragging(style) } else if mouse_over_y_scrollbar { theme.hovered(style) + } else if mouse_over_scrollable { + theme.focused(style) } else { theme.active(style) }; @@ -869,6 +871,8 @@ pub fn draw( theme.dragging_horizontal(style) } else if mouse_over_x_scrollbar { theme.hovered_horizontal(style) + } else if mouse_over_scrollable { + theme.focused_horizontal(style) } else { theme.active_horizontal(style) }; -- cgit From eaa2238600a0d3055b379592c7a3f8e6453b9dc7 Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Mon, 23 Jan 2023 17:32:08 +0100 Subject: debugging focused style not working --- native/src/widget/scrollable.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'native') diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs index de6eacb5..71814034 100644 --- a/native/src/widget/scrollable.rs +++ b/native/src/widget/scrollable.rs @@ -859,7 +859,7 @@ pub fn draw( } else if mouse_over_scrollable { theme.focused(style) } else { - theme.active(style) + theme.focused(style) }; draw_scrollbar(renderer, style, &scrollbar); @@ -874,7 +874,7 @@ pub fn draw( } else if mouse_over_scrollable { theme.focused_horizontal(style) } else { - theme.active_horizontal(style) + theme.focused_horizontal(style) }; draw_scrollbar(renderer, style, &scrollbar); -- cgit From 49e9a9a5379c1e9a9469045ca9a51ffb860ee620 Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Mon, 23 Jan 2023 17:56:39 +0100 Subject: added function focused and focused_horizontal to theme.rs --- native/src/widget/scrollable.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'native') diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs index 71814034..de6eacb5 100644 --- a/native/src/widget/scrollable.rs +++ b/native/src/widget/scrollable.rs @@ -859,7 +859,7 @@ pub fn draw( } else if mouse_over_scrollable { theme.focused(style) } else { - theme.focused(style) + theme.active(style) }; draw_scrollbar(renderer, style, &scrollbar); @@ -874,7 +874,7 @@ pub fn draw( } else if mouse_over_scrollable { theme.focused_horizontal(style) } else { - theme.focused_horizontal(style) + theme.active_horizontal(style) }; draw_scrollbar(renderer, style, &scrollbar); -- cgit From c337bf297d1836c429cd24964e8b3bdcc13850be Mon Sep 17 00:00:00 2001 From: Giuliano Bellini s294739 Date: Sat, 25 Mar 2023 01:05:56 +0100 Subject: renamed scrollable styles --- native/src/widget/scrollable.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'native') diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs index b88b77e5..be81bee1 100644 --- a/native/src/widget/scrollable.rs +++ b/native/src/widget/scrollable.rs @@ -858,9 +858,9 @@ pub fn draw( let style = if state.y_scroller_grabbed_at.is_some() { theme.dragging(style) } else if mouse_over_y_scrollbar { - theme.hovered(style) + theme.hovered_scrollbar(style) } else if mouse_over_scrollable { - theme.focused(style) + theme.hovered(style) } else { theme.active(style) }; @@ -873,9 +873,9 @@ pub fn draw( let style = if state.x_scroller_grabbed_at.is_some() { theme.dragging_horizontal(style) } else if mouse_over_x_scrollbar { - theme.hovered_horizontal(style) + theme.hovered_scrollbar_horizontal(style) } else if mouse_over_scrollable { - theme.focused_horizontal(style) + theme.hovered_horizontal(style) } else { theme.active_horizontal(style) }; -- cgit From c407b4504cd5e7dcb04a8fd31ad0400c891fc3e1 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 27 Mar 2023 15:51:32 +0200 Subject: Introduce `is_mouse_over_scrollbar` to `StyleSheet::hovered` for `Scrollable` --- native/src/widget/scrollable.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'native') diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs index be81bee1..d9cdf296 100644 --- a/native/src/widget/scrollable.rs +++ b/native/src/widget/scrollable.rs @@ -857,10 +857,8 @@ pub fn draw( if let Some(scrollbar) = scrollbars.y { let style = if state.y_scroller_grabbed_at.is_some() { theme.dragging(style) - } else if mouse_over_y_scrollbar { - theme.hovered_scrollbar(style) } else if mouse_over_scrollable { - theme.hovered(style) + theme.hovered(style, mouse_over_y_scrollbar) } else { theme.active(style) }; @@ -872,10 +870,8 @@ pub fn draw( if let Some(scrollbar) = scrollbars.x { let style = if state.x_scroller_grabbed_at.is_some() { theme.dragging_horizontal(style) - } else if mouse_over_x_scrollbar { - theme.hovered_scrollbar_horizontal(style) } else if mouse_over_scrollable { - theme.hovered_horizontal(style) + theme.hovered_horizontal(style, mouse_over_x_scrollbar) } else { theme.active_horizontal(style) }; -- cgit