Make full bar clock open calendar
This commit is contained in:
1 parent
2bab33758b
commit
a72a9e9ae8
1 file changed
+17
-15
@@ -2149,11 +2149,21 @@ impl FereseShell {
|
||||
.width(Length::Fill)
|
||||
.height(bar.control_height);
|
||||
let (date, time) = self.clock.split_once(", ").unwrap_or(("", &self.clock));
|
||||
let clock = container(
|
||||
let clock = container(motion::button(
|
||||
button::custom(
|
||||
row![
|
||||
motion::button(
|
||||
button::custom(text(date).size(12))
|
||||
.padding([4, 2])
|
||||
text(date)
|
||||
.size(12)
|
||||
.class(theme::Text::Color(color(shell_theme.text_muted))),
|
||||
text(time)
|
||||
.size(bar.text_size)
|
||||
.class(theme::Text::Color(foreground)),
|
||||
]
|
||||
.spacing(8)
|
||||
.align_y(cosmic::iced::Alignment::Center),
|
||||
)
|
||||
.padding([4, 8])
|
||||
.height(bar.control_height)
|
||||
.name("Open calendar")
|
||||
.on_press_with_rectangle(move |offset, bounds| {
|
||||
cosmic::Action::App(Message::OpenMenuOn(
|
||||
@@ -2167,22 +2177,14 @@ impl FereseShell {
|
||||
},
|
||||
))
|
||||
}),
|
||||
color(shell_theme.text_muted),
|
||||
foreground,
|
||||
self.menu
|
||||
.as_ref()
|
||||
.is_some_and(|menu| menu.kind == status_ui::Menu::Calendar),
|
||||
1.0
|
||||
),
|
||||
text(time)
|
||||
.size(bar.text_size)
|
||||
.class(theme::Text::Color(foreground)),
|
||||
]
|
||||
.spacing(8)
|
||||
.align_y(cosmic::iced::Alignment::Center),
|
||||
)
|
||||
1.0,
|
||||
))
|
||||
.height(bar.control_height)
|
||||
.align_y(alignment::Vertical::Center)
|
||||
.padding([0, 8])
|
||||
.class(theme::Container::custom(move |_| {
|
||||
bar_group_style(shell_theme)
|
||||
}));
|
||||
|
||||
Reference in new issue
Block a user