fix(app-list): toplevel preview styling
This commit is contained in:
parent
dba87b6204
commit
2c79ca44e2
2 changed files with 25 additions and 26 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
|
@ -1449,7 +1449,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-notifications-config"
|
name = "cosmic-notifications-config"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/cosmic-notifications#76c237b0509ea6f724076db2195a7fab6942f33c"
|
source = "git+https://github.com/pop-os/cosmic-notifications#df1d1de03468b0be9f0c971d0edd0b1938203a4e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cosmic-config",
|
"cosmic-config",
|
||||||
"serde",
|
"serde",
|
||||||
|
|
@ -1458,7 +1458,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-notifications-util"
|
name = "cosmic-notifications-util"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/cosmic-notifications#76c237b0509ea6f724076db2195a7fab6942f33c"
|
source = "git+https://github.com/pop-os/cosmic-notifications#df1d1de03468b0be9f0c971d0edd0b1938203a4e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"fast_image_resize",
|
"fast_image_resize",
|
||||||
|
|
@ -1485,7 +1485,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-panel-config"
|
name = "cosmic-panel-config"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/cosmic-panel#fcaaeaf3b9dbaea7458b69de5742a4ae97909d73"
|
source = "git+https://github.com/pop-os/cosmic-panel#4a777bc4f6c77b409d1fd3aa5b09ecfb1c25ded1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"cosmic-config",
|
"cosmic-config",
|
||||||
|
|
@ -7479,7 +7479,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "xdg-shell-wrapper-config"
|
name = "xdg-shell-wrapper-config"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/cosmic-panel#fcaaeaf3b9dbaea7458b69de5742a4ae97909d73"
|
source = "git+https://github.com/pop-os/cosmic-panel#4a777bc4f6c77b409d1fd3aa5b09ecfb1c25ded1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"wayland-protocols-wlr",
|
"wayland-protocols-wlr",
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ use cosmic::{
|
||||||
rectangle_tracker::{rectangle_tracker_subscription, RectangleTracker, RectangleUpdate},
|
rectangle_tracker::{rectangle_tracker_subscription, RectangleTracker, RectangleUpdate},
|
||||||
svg, text, DndDestination, Image,
|
svg, text, DndDestination, Image,
|
||||||
},
|
},
|
||||||
Element, Task,
|
Apply, Element, Task,
|
||||||
};
|
};
|
||||||
use cosmic_app_list_config::{AppListConfig, APP_ID};
|
use cosmic_app_list_config::{AppListConfig, APP_ID};
|
||||||
use cosmic_protocols::{
|
use cosmic_protocols::{
|
||||||
|
|
@ -442,12 +442,11 @@ where
|
||||||
container(
|
container(
|
||||||
column![
|
column![
|
||||||
container(if let Some(img) = img {
|
container(if let Some(img) = img {
|
||||||
Element::from(
|
Element::from(Image::new(Handle::from_rgba(
|
||||||
Image::new(Handle::from_rgba(img.width, img.height, img.img.clone()))
|
img.width,
|
||||||
.width(Length::Fill)
|
img.height,
|
||||||
.height(Length::Fill)
|
img.img.clone(),
|
||||||
.content_fit(cosmic::iced_core::ContentFit::Contain),
|
)))
|
||||||
)
|
|
||||||
} else {
|
} else {
|
||||||
Image::new(Handle::from_rgba(1, 1, vec![0, 0, 0, 255])).into()
|
Image::new(Handle::from_rgba(1, 1, vec![0, 0, 0, 255])).into()
|
||||||
})
|
})
|
||||||
|
|
@ -462,9 +461,11 @@ where
|
||||||
}
|
}
|
||||||
})))
|
})))
|
||||||
.padding(border as u16)
|
.padding(border as u16)
|
||||||
.height(Length::Fill)
|
.height(Length::Shrink)
|
||||||
.width(Length::Fill),
|
.width(Length::Shrink)
|
||||||
container(text::body(title).align_x(Alignment::Center)).center_x(Length::Fill),
|
.apply(container)
|
||||||
|
.center_y(Length::Fixed(90.0)),
|
||||||
|
text::body(title),
|
||||||
]
|
]
|
||||||
.spacing(4)
|
.spacing(4)
|
||||||
.align_x(Alignment::Center),
|
.align_x(Alignment::Center),
|
||||||
|
|
@ -479,10 +480,14 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
fn window_menu_style(selected: bool) -> cosmic::theme::Button {
|
fn window_menu_style(selected: bool) -> cosmic::theme::Button {
|
||||||
|
let radius = theme::active()
|
||||||
|
.cosmic()
|
||||||
|
.radius_m()
|
||||||
|
.map(|x| if x < 8.0 { x } else { x - 4.0 });
|
||||||
|
|
||||||
Button::Custom {
|
Button::Custom {
|
||||||
active: Box::new(move |focused, theme| {
|
active: Box::new(move |focused, theme| {
|
||||||
let a = button::Catalog::active(theme, focused, selected, &Button::AppletMenu);
|
let a = button::Catalog::active(theme, focused, selected, &Button::AppletMenu);
|
||||||
let rad_s = theme.cosmic().corner_radii.radius_s;
|
|
||||||
button::Style {
|
button::Style {
|
||||||
background: if selected {
|
background: if selected {
|
||||||
Some(Background::Color(
|
Some(Background::Color(
|
||||||
|
|
@ -491,39 +496,33 @@ fn window_menu_style(selected: bool) -> cosmic::theme::Button {
|
||||||
} else {
|
} else {
|
||||||
a.background
|
a.background
|
||||||
},
|
},
|
||||||
border_radius: rad_s.into(),
|
border_radius: radius.into(),
|
||||||
outline_width: 0.0,
|
outline_width: 0.0,
|
||||||
..a
|
..a
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
hovered: Box::new(move |focused, theme| {
|
hovered: Box::new(move |focused, theme| {
|
||||||
let focused = selected || focused;
|
let focused = selected || focused;
|
||||||
let rad_s = theme.cosmic().corner_radii.radius_s;
|
|
||||||
|
|
||||||
let text = button::Catalog::hovered(theme, focused, focused, &Button::AppletMenu);
|
let text = button::Catalog::hovered(theme, focused, focused, &Button::AppletMenu);
|
||||||
button::Style {
|
button::Style {
|
||||||
border_radius: rad_s.into(),
|
border_radius: radius.into(),
|
||||||
outline_width: 0.0,
|
outline_width: 0.0,
|
||||||
..text
|
..text
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
disabled: Box::new(|theme| {
|
disabled: Box::new(move |theme| {
|
||||||
let rad_s = theme.cosmic().corner_radii.radius_s;
|
|
||||||
|
|
||||||
let text = button::Catalog::disabled(theme, &Button::AppletMenu);
|
let text = button::Catalog::disabled(theme, &Button::AppletMenu);
|
||||||
button::Style {
|
button::Style {
|
||||||
border_radius: rad_s.into(),
|
border_radius: radius.into(),
|
||||||
outline_width: 0.0,
|
outline_width: 0.0,
|
||||||
..text
|
..text
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
pressed: Box::new(move |focused, theme| {
|
pressed: Box::new(move |focused, theme| {
|
||||||
let focused = selected || focused;
|
let focused = selected || focused;
|
||||||
let rad_s = theme.cosmic().corner_radii.radius_s;
|
|
||||||
|
|
||||||
let text = button::Catalog::pressed(theme, focused, focused, &Button::AppletMenu);
|
let text = button::Catalog::pressed(theme, focused, focused, &Button::AppletMenu);
|
||||||
button::Style {
|
button::Style {
|
||||||
border_radius: rad_s.into(),
|
border_radius: radius.into(),
|
||||||
outline_width: 0.0,
|
outline_width: 0.0,
|
||||||
..text
|
..text
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue