Skip to content

Commit 49e9a9a

Browse files
committed
added function focused and focused_horizontal to theme.rs
1 parent eaa2238 commit 49e9a9a

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

native/src/widget/scrollable.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ pub fn draw<Renderer>(
859859
} else if mouse_over_scrollable {
860860
theme.focused(style)
861861
} else {
862-
theme.focused(style)
862+
theme.active(style)
863863
};
864864

865865
draw_scrollbar(renderer, style, &scrollbar);
@@ -874,7 +874,7 @@ pub fn draw<Renderer>(
874874
} else if mouse_over_scrollable {
875875
theme.focused_horizontal(style)
876876
} else {
877-
theme.focused_horizontal(style)
877+
theme.active_horizontal(style)
878878
};
879879

880880
draw_scrollbar(renderer, style, &scrollbar);

style/src/theme.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,13 @@ impl scrollable::StyleSheet for Theme {
935935
}
936936
}
937937

938+
fn focused(&self, style: &Self::Style) -> scrollable::Scrollbar {
939+
match style {
940+
Scrollable::Default => self.active(style),
941+
Scrollable::Custom(custom) => custom.focused(self),
942+
}
943+
}
944+
938945
fn active_horizontal(&self, style: &Self::Style) -> scrollable::Scrollbar {
939946
match style {
940947
Scrollable::Default => self.active(style),
@@ -958,6 +965,16 @@ impl scrollable::StyleSheet for Theme {
958965
Scrollable::Custom(custom) => custom.dragging_horizontal(self),
959966
}
960967
}
968+
969+
fn focused_horizontal(
970+
&self,
971+
style: &Self::Style,
972+
) -> scrollable::Scrollbar {
973+
match style {
974+
Scrollable::Default => self.active_horizontal(style),
975+
Scrollable::Custom(custom) => custom.focused_horizontal(self),
976+
}
977+
}
961978
}
962979

963980
/// The style of text.

0 commit comments

Comments
 (0)