Skip to content

Commit

Permalink
update libcosmic
Browse files Browse the repository at this point in the history
  • Loading branch information
wash2 authored and jackpot51 committed May 30, 2024
1 parent f3e2666 commit 102a3f1
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 36 deletions.
55 changes: 28 additions & 27 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
}
Expand Down
14 changes: 7 additions & 7 deletions src/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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))
};

Expand Down

0 comments on commit 102a3f1

Please sign in to comment.