fix: header icon improvements
This commit is contained in:
parent
28de69024f
commit
ade8c76425
2 changed files with 10 additions and 3 deletions
|
|
@ -158,7 +158,7 @@ phf = { version = "0.13.1", features = ["macros"] }
|
|||
|
||||
[dependencies.icetron_assets]
|
||||
git = "ssh://git@bitbucket.org/playtron-one/icetron.git"
|
||||
rev = "a40c757"
|
||||
rev = "a1bf042"
|
||||
|
||||
[dependencies.cosmic-theme]
|
||||
path = "cosmic-theme"
|
||||
|
|
|
|||
|
|
@ -363,7 +363,8 @@ impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> {
|
|||
widget::text::title3(title).into()
|
||||
};
|
||||
|
||||
// SSD icon: 18px, color #1B1B1B; gap 8px
|
||||
// SSD icon: request high-res source (128px lookup in resolve_app_icon),
|
||||
// display at 18px with Contain to preserve aspect ratio.
|
||||
let title_element: Element<'a, Message> =
|
||||
if let Some(icon_handle) = self.app_icon.take() {
|
||||
let (icon_size, icon_gap) = if self.is_ssd {
|
||||
|
|
@ -371,7 +372,13 @@ impl<'a, Message: Clone + 'static> HeaderBar<'a, Message> {
|
|||
} else {
|
||||
(24, space_xxs)
|
||||
};
|
||||
let icon_widget = widget::icon::icon(icon_handle).size(icon_size);
|
||||
let icon_widget = if self.is_ssd {
|
||||
widget::icon::icon(icon_handle)
|
||||
.size(icon_size)
|
||||
.content_fit(iced::ContentFit::Contain)
|
||||
} else {
|
||||
widget::icon::icon(icon_handle).size(icon_size)
|
||||
};
|
||||
widget::row::with_capacity(2)
|
||||
.push(icon_widget)
|
||||
.push(title_text)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue