Skip to content

Commit b7a34bd

Browse files
git-f0xDrakulix
authored andcommitted
fix(menu): styling
Also improves the styling of resize indicators, and removes the unnecessary `.density()` method call for the SSD header.
1 parent be38da4 commit b7a34bd

File tree

11 files changed

+70
-81
lines changed

11 files changed

+70
-81
lines changed

Cargo.lock

Lines changed: 36 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/shell/element/resize_indicator.rs

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ impl Program for ResizeIndicatorInternal {
8686
} else {
8787
"go-down-symbolic"
8888
})
89-
.size(32)
89+
.size(20)
9090
.prefer_svg(true)
9191
.apply(container)
92-
.padding(2)
92+
.padding(8)
9393
.style(icon_container_style())
9494
.width(Length::Shrink)
9595
.apply(container)
@@ -106,10 +106,10 @@ impl Program for ResizeIndicatorInternal {
106106
} else {
107107
"go-next-symbolic"
108108
})
109-
.size(32)
109+
.size(20)
110110
.prefer_svg(true)
111111
.apply(container)
112-
.padding(4)
112+
.padding(8)
113113
.style(icon_container_style())
114114
.width(Length::Shrink)
115115
.apply(container)
@@ -120,23 +120,11 @@ impl Program for ResizeIndicatorInternal {
120120
horizontal_space(36).into()
121121
},
122122
row(vec![
123-
text(&self.shortcut1)
124-
.font(cosmic::font::FONT_SEMIBOLD)
125-
.size(14)
126-
.into(),
127-
text(fl!("grow-window"))
128-
.font(cosmic::font::FONT)
129-
.size(14)
130-
.into(),
123+
text::heading(&self.shortcut1).into(),
124+
text::body(fl!("grow-window")).into(),
131125
horizontal_space(40).into(),
132-
text(&self.shortcut2)
133-
.font(cosmic::font::FONT_SEMIBOLD)
134-
.size(14)
135-
.into(),
136-
text(fl!("shrink-window"))
137-
.font(cosmic::font::FONT)
138-
.size(14)
139-
.into(),
126+
text::heading(&self.shortcut2).into(),
127+
text::body(fl!("shrink-window")).into(),
140128
])
141129
.apply(container)
142130
.center_x()
@@ -158,10 +146,10 @@ impl Program for ResizeIndicatorInternal {
158146
} else {
159147
"go-previous-symbolic"
160148
})
161-
.size(32)
149+
.size(20)
162150
.prefer_svg(true)
163151
.apply(container)
164-
.padding(4)
152+
.padding(8)
165153
.style(icon_container_style())
166154
.height(Length::Shrink)
167155
.apply(container)
@@ -181,10 +169,10 @@ impl Program for ResizeIndicatorInternal {
181169
} else {
182170
"go-up-symbolic"
183171
})
184-
.size(32)
172+
.size(20)
185173
.prefer_svg(true)
186174
.apply(container)
187-
.padding(4)
175+
.padding(8)
188176
.style(icon_container_style())
189177
.width(Length::Shrink)
190178
.apply(container)

src/shell/element/stack/tab.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ impl<Message: TabMessage + 'static> Tab<Message> {
158158
id,
159159
app_icon: from_name(app_id.into()).size(16).icon(),
160160
title: title.into(),
161-
font: cosmic::font::FONT,
161+
font: cosmic::font::default(),
162162
close_message: None,
163163
press_message: None,
164164
right_click_message: None,

src/shell/element/stack/tab_text.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl TabText {
3939
TabText {
4040
width: Length::Shrink,
4141
height: Length::Shrink,
42-
font: cosmic::font::DEFAULT,
42+
font: cosmic::font::default(),
4343
font_size: 14.0,
4444
selected,
4545
text,

src/shell/element/stack/tabs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ where
134134
} else {
135135
TabBackgroundTheme::ActiveDeactivated
136136
})
137-
.font(cosmic::font::FONT_SEMIBOLD)
137+
.font(cosmic::font::semibold())
138138
.active()
139139
} else if i.checked_sub(1) == Some(active) {
140140
tab.rule_style(rule).non_active()

src/shell/element/stack_hover.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ impl Program for StackHoverInternal {
3939
.icon()
4040
.into(),
4141
horizontal_space(16).into(),
42-
text(fl!("stack-windows"))
43-
.font(cosmic::font::FONT)
44-
.size(24)
45-
.into(),
42+
text::title3(fl!("stack-windows")).into(),
4643
])
4744
.align_items(Alignment::Center)
4845
.apply(container)

src/shell/element/swap_indicator.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ impl Program for SwapIndicatorInternal {
3535
.icon()
3636
.into(),
3737
horizontal_space(16).into(),
38-
text(fl!("swap-windows"))
39-
.font(cosmic::font::FONT)
40-
.size(24)
41-
.into(),
38+
text::title3(fl!("swap-windows")).into(),
4239
])
4340
.align_items(Alignment::Center)
4441
.apply(container)

src/shell/element/window.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ use crate::{
1111
},
1212
};
1313
use calloop::LoopHandle;
14-
use cosmic::{
15-
config::Density,
16-
iced::{Color, Command},
17-
};
14+
use cosmic::iced::{Color, Command};
1815
use smithay::{
1916
backend::{
2017
input::KeyState,
@@ -503,7 +500,6 @@ impl Program for CosmicWindowInternal {
503500
.on_drag(Message::DragStart)
504501
.on_close(Message::Close)
505502
.focused(self.window.is_activated(false))
506-
.density(Density::Compact)
507503
.on_double_click(Message::Maximize)
508504
.on_right_click(Message::Menu);
509505

0 commit comments

Comments
 (0)