update libcosmic
This commit is contained in:
parent
f3e26664b8
commit
102a3f1d2d
3 changed files with 45 additions and 36 deletions
|
|
@ -20,8 +20,16 @@ pub enum AppTheme {
|
|||
impl AppTheme {
|
||||
pub fn theme(&self) -> theme::Theme {
|
||||
match self {
|
||||
Self::Dark => theme::Theme::dark(),
|
||||
Self::Light => theme::Theme::light(),
|
||||
Self::Dark => {
|
||||
let mut t = theme::system_dark();
|
||||
t.theme_type.prefer_dark(Some(true));
|
||||
t
|
||||
}
|
||||
Self::Light => {
|
||||
let mut t = theme::system_light();
|
||||
t.theme_type.prefer_dark(Some(false));
|
||||
t
|
||||
}
|
||||
Self::System => theme::system_preference(),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
14
src/menu.rs
14
src/menu.rs
|
|
@ -5,10 +5,10 @@ use cosmic::widget::menu::{items as menu_items, root as menu_root, Item as MenuI
|
|||
use cosmic::{
|
||||
iced::{widget::column, widget::horizontal_rule, Alignment, Background, Length},
|
||||
iced_core::Border,
|
||||
menu_button, theme,
|
||||
theme,
|
||||
widget::{
|
||||
self, horizontal_space,
|
||||
menu::{ItemHeight, ItemWidth, MenuBar, Tree as MenuTree},
|
||||
menu::{menu_button, ItemHeight, ItemWidth, MenuBar, Tree as MenuTree},
|
||||
segmented_button,
|
||||
},
|
||||
Element,
|
||||
|
|
@ -29,11 +29,11 @@ pub fn context_menu<'a>(
|
|||
break;
|
||||
}
|
||||
}
|
||||
menu_button!(
|
||||
widget::text(menu_label),
|
||||
horizontal_space(Length::Fill),
|
||||
widget::text(key)
|
||||
)
|
||||
menu_button(vec![
|
||||
widget::text(menu_label).into(),
|
||||
horizontal_space(Length::Fill).into(),
|
||||
widget::text(key).into(),
|
||||
])
|
||||
.on_press(Message::TabContextAction(entity, menu_action))
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue