refactor: make Theme a generic parameter for the button
This makes the button possible to use with custom themes in cosmic-time
This commit is contained in:
parent
11ac07010b
commit
82dfab633a
5 changed files with 84 additions and 71 deletions
|
|
@ -122,7 +122,7 @@ impl ColorPickerModel {
|
|||
&self,
|
||||
f: T,
|
||||
icon_portion: Option<u16>,
|
||||
) -> crate::widget::Button<'a, Message, crate::Renderer> {
|
||||
) -> crate::widget::Button<'a, Message, crate::Theme, crate::Renderer> {
|
||||
color_button(
|
||||
Some(f(ColorPickerUpdate::ToggleColorPicker)),
|
||||
self.applied_color,
|
||||
|
|
@ -755,7 +755,7 @@ pub fn color_button<'a, Message: 'static>(
|
|||
on_press: Option<Message>,
|
||||
color: Option<Color>,
|
||||
icon_portion: Length,
|
||||
) -> crate::widget::Button<'a, Message, crate::Renderer> {
|
||||
) -> crate::widget::Button<'a, Message, crate::Theme, crate::Renderer> {
|
||||
let spacing = THEME.with(|t| t.borrow().cosmic().spacing);
|
||||
|
||||
button(if color.is_some() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue