diff --git a/cosmic-app-list/src/app.rs b/cosmic-app-list/src/app.rs index c06920e5..e7286aed 100755 --- a/cosmic-app-list/src/app.rs +++ b/cosmic-app-list/src/app.rs @@ -25,7 +25,6 @@ use cosmic::iced::widget::vertical_space; use cosmic::iced::widget::{column, dnd_source, mouse_area, row, Column, Row}; use cosmic::iced::Color; use cosmic::iced::{window, Subscription}; -use cosmic::iced_core::window::Icon; use cosmic::iced_core::Border; use cosmic::iced_core::Padding; use cosmic::iced_core::Shadow; @@ -326,7 +325,7 @@ async fn try_get_gpus() -> Option> { pub fn menu_button<'a, Message>( content: impl Into>, -) -> cosmic::widget::Button<'a, Message, cosmic::Renderer> { +) -> cosmic::widget::Button<'a, Message, cosmic::Theme, cosmic::Renderer> { cosmic::widget::Button::new(content) .style(Button::AppletMenu) .padding(menu_control_padding()) @@ -916,7 +915,7 @@ impl cosmic::Application for CosmicAppList { let (w, h, favorites, active, divider) = if is_horizontal { ( - Length::Fill, + Length::Shrink, Length::Shrink, dnd_listener(row(favorites)), row(active).into(), @@ -927,7 +926,7 @@ impl cosmic::Application for CosmicAppList { } else { ( Length::Shrink, - Length::Fill, + Length::Shrink, dnd_listener(column(favorites)), column(active).into(), container(divider::horizontal::default()) @@ -983,7 +982,7 @@ impl cosmic::Application for CosmicAppList { ] }; - let content = match &self.core.applet.anchor { + let mut content = match &self.core.applet.anchor { PanelAnchor::Left | PanelAnchor::Right => container( Column::with_children(content_list) .spacing(4) @@ -999,6 +998,10 @@ impl cosmic::Application for CosmicAppList { .width(w), ), }; + if self.active_list.is_empty() && self.favorite_list.is_empty() { + let suggested_size = self.core.applet.suggested_size(); + content = content.width(suggested_size.0).height(suggested_size.1); + } if self.popup.is_some() { mouse_area(content) .on_right_release(Message::ClosePopup) @@ -1115,7 +1118,11 @@ impl cosmic::Application for CosmicAppList { }; self.core.applet.popup_container(content).into() } else { - iced::widget::text("").into() + let suggested = self.core.applet.suggested_size(); + iced::widget::row!() + .width(Length::Fixed(suggested.0 as f32)) + .height(Length::Fixed(suggested.1 as f32)) + .into() } } diff --git a/cosmic-applet-audio/src/main.rs b/cosmic-applet-audio/src/main.rs index 4b93b3f8..91dcc2ac 100644 --- a/cosmic-applet-audio/src/main.rs +++ b/cosmic-applet-audio/src/main.rs @@ -801,7 +801,7 @@ fn revealer_head( title: String, selected: String, toggle: Message, -) -> cosmic::widget::Button<'static, Message, Renderer> { +) -> cosmic::widget::Button<'static, Message, cosmic::Theme, Renderer> { menu_button(column![ text(title).width(Length::Fill).size(14), text(selected).size(10), diff --git a/cosmic-applet-battery/src/app.rs b/cosmic-applet-battery/src/app.rs index 009aea24..9245afad 100644 --- a/cosmic-applet-battery/src/app.rs +++ b/cosmic-applet-battery/src/app.rs @@ -24,7 +24,7 @@ use cosmic::iced::{ window, Alignment, Length, Subscription, }; use cosmic::iced_core::alignment::Vertical; -use cosmic::iced_core::{Background, Color}; +use cosmic::iced_core::{Background, Border, Color, Shadow}; use cosmic::iced_runtime::core::layout::Limits; use cosmic::iced_style::application; use cosmic::iced_widget::{Column, Row}; @@ -379,9 +379,12 @@ impl cosmic::Application for CosmicBatteryApplet { |theme| container::Appearance { text_color: Some(Color::TRANSPARENT), background: Some(Background::Color(theme.cosmic().accent_color().into())), - border_radius: 2.0.into(), - border_width: 0.0, - border_color: Color::TRANSPARENT, + border: Border { + radius: 2.0.into(), + width: 0.0, + color: Color::TRANSPARENT, + }, + shadow: Shadow::default(), icon_color: Some(Color::TRANSPARENT), }, ))) @@ -558,9 +561,12 @@ impl cosmic::Application for CosmicBatteryApplet { background: Some(Background::Color( theme.cosmic().accent_color().into(), )), - border_radius: 4.0.into(), - border_width: 0.0, - border_color: Color::TRANSPARENT, + border: Border { + radius: 4.0.into(), + width: 0.0, + color: Color::TRANSPARENT, + }, + shadow: Default::default(), icon_color: Some(Color::TRANSPARENT), }, ))), diff --git a/cosmic-applet-power/src/main.rs b/cosmic-applet-power/src/main.rs index 27a0ac5f..9b7f07ec 100644 --- a/cosmic-applet-power/src/main.rs +++ b/cosmic-applet-power/src/main.rs @@ -355,11 +355,15 @@ impl cosmic::Application for Power { } } -fn power_buttons(name: &str, msg: String) -> cosmic::widget::Button { +fn power_buttons( + name: &str, + msg: String, +) -> cosmic::widget::Button { cosmic::widget::button( column![text_icon(name, 40), text(msg).size(14)] .spacing(4) - .align_items(Alignment::Center), + .align_items(Alignment::Center) + .width(Length::Fill), ) .width(Length::Fill) .height(Length::Fixed(76.0)) diff --git a/cosmic-applet-status-area/src/components/status_menu.rs b/cosmic-applet-status-area/src/components/status_menu.rs index 6fa643a1..c4cce8e1 100644 --- a/cosmic-applet-status-area/src/components/status_menu.rs +++ b/cosmic-applet-status-area/src/components/status_menu.rs @@ -152,7 +152,9 @@ fn layout_view(layout: &Layout, expanded: Option) -> cosmic::Element { .into() } -fn row_button(content: Vec>) -> cosmic::widget::Button { +fn row_button( + content: Vec>, +) -> cosmic::widget::Button { menu_button( iced::widget::Row::with_children(content) .spacing(8) diff --git a/cosmic-applet-time/src/window.rs b/cosmic-applet-time/src/window.rs index d7444d06..ce92be8f 100644 --- a/cosmic-applet-time/src/window.rs +++ b/cosmic-applet-time/src/window.rs @@ -330,7 +330,7 @@ fn date_button( day: u32, is_month: bool, is_day: bool, -) -> Button<'static, Message, cosmic::Renderer> { +) -> Button<'static, Message, cosmic::Theme, cosmic::Renderer> { let style = if is_day { cosmic::widget::button::Style::Suggested } else {