diff --git a/Makefile b/Makefile index 3c69cba..b12a5ef 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -prefix ?= /usr/local +prefix ?= /usr bindir = $(prefix)/bin libdir = $(prefix)/lib includedir = $(prefix)/include diff --git a/src/main.rs b/src/main.rs index ca5b5d3..9083bbf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -658,7 +658,6 @@ impl Application for App { } fn view_window(&self, id: iced::window::Id) -> cosmic::prelude::Element { - use iced::widget::*; if let Some(surface) = self.layer_surfaces.get(&id) { return view::layer_surface(self, surface); } @@ -670,7 +669,7 @@ impl Application for App { } } log::info!("NO VIEW"); - text("workspaces").into() + widget::text("workspaces").into() } fn on_close_requested(&self, _id: SurfaceId) -> Option { diff --git a/src/view/mod.rs b/src/view/mod.rs index af00e2a..72fa8d9 100644 --- a/src/view/mod.rs +++ b/src/view/mod.rs @@ -146,7 +146,7 @@ fn workspace_item<'a>( let is_active = workspace.is_active; column![ // TODO editable name? - widget::button(column![image, widget::text(&workspace.name)]) + widget::button(column![image, widget::text::body(&workspace.name)]) .selected(workspace.is_active) .style(cosmic::theme::Button::Custom { active: Box::new(move |_focused, theme| workspace_item_appearance( @@ -231,7 +231,7 @@ fn workspaces_sidebar<'a>( let new_workspace_button = widget::button( widget::container(row![ widget::icon::from_name("list-add-symbolic").symbolic(true), - widget::text(fl!("new-workspace")) + widget::text::body(fl!("new-workspace")) ]) .width(iced::Length::Fill) .align_x(iced::alignment::Horizontal::Center), @@ -266,9 +266,14 @@ fn workspaces_sidebar<'a>( icon_color: Some(theme.cosmic().on_bg_color().into()), background: Some(iced::Color::from(theme.cosmic().background.base).into()), border: Border { - radius: (12.0).into(), - width: 0.0, - color: iced::Color::TRANSPARENT, + color: theme.cosmic().bg_divider().into(), + width: 1.0, + radius: theme + .cosmic() + .radius_s() + // Increase radius by 1/2 of `sidebar_entries_container` padding + .map(|x| if x < 4.0 { x } else { x + 6.0 }) + .into(), }, shadow: Shadow::default(), } @@ -281,13 +286,14 @@ fn workspaces_sidebar<'a>( } fn toplevel_preview(toplevel: &Toplevel, is_being_dragged: bool) -> cosmic::Element { - let label = widget::text(&toplevel.info.title); + let label = widget::text::body(&toplevel.info.title); let label = if let Some(icon) = &toplevel.icon { row![widget::icon(widget::icon::from_path(icon.clone())), label].spacing(4) } else { row![label] } - .padding(4); + .align_items(iced::Alignment::Center) + .padding([4, 12]); let alpha = if is_being_dragged { 0.5 } else { 1.0 }; crate::widgets::toplevel_item( vec![ @@ -302,9 +308,24 @@ fn toplevel_preview(toplevel: &Toplevel, is_being_dragged: bool) -> cosmic::Elem .style(cosmic::theme::Button::Image) .on_press(Msg::ActivateToplevel(toplevel.handle.clone())) .into(), - widget::button(label) - .on_press(Msg::ActivateToplevel(toplevel.handle.clone())) - .into(), + widget::container( + widget::button(label) + .on_press(Msg::ActivateToplevel(toplevel.handle.clone())) + .style(cosmic::theme::Button::Icon), + ) + .style(cosmic::theme::Container::custom(|theme| { + let mut label_background = theme.cosmic().background.base; + label_background.alpha = 0.8; + cosmic::iced_style::container::Appearance { + background: Some(iced::Color::from(label_background).into()), + border: Border { + radius: theme.cosmic().radius_xl().into(), + ..Default::default() + }, + ..Default::default() + } + })) + .into(), ], Axis::Vertical, )