tangled
alpha
login
or
join now
lesbian.skin
/
nanel
1
fork
atom
[MIRROR] https://codeberg.org/naomi/nanel
1
fork
atom
overview
issues
pulls
pipelines
Add tooltip to systray hidden menu button
lesbian.skin
1 year ago
ce4192cd
23a9ebf7
+24
-7
1 changed file
expand all
collapse all
unified
split
src
panel.rs
+24
-7
src/panel.rs
···
4
4
Alignment, Background, Element, Font, Length, Subscription, Task, Theme, border,
5
5
theme::palette::{self},
6
6
time,
7
7
-
widget::{Text, button, column, row, text, vertical_rule},
7
7
+
widget::{Text, button, column, container, row, text, tooltip, vertical_rule},
8
8
};
9
9
use iced_layershell::{
10
10
Application,
···
52
52
.font(Font::with_name("Selawik"))
53
53
.align_x(Alignment::Center)
54
54
.align_y(Alignment::Center)
55
55
+
}
56
56
+
57
57
+
pub fn rounded_container(theme: &Theme) -> container::Style {
58
58
+
let palette = theme.extended_palette();
59
59
+
60
60
+
container::Style {
61
61
+
background: Some(palette.background.weak.color.into()),
62
62
+
border: border::rounded(CORNER_RADIUS),
63
63
+
..container::Style::default()
64
64
+
}
55
65
}
56
66
57
67
fn styled(pair: palette::Pair) -> button::Style {
···
202
212
"taskbar" => Some(text!("TODO: taskbar").into()),
203
213
"system_tray" => Some(match self.hidden_menu.unwrap_or(false) {
204
214
false => text!("TODO: systray").into(),
205
205
-
true => button(angle_up_solid().size(16))
206
206
-
.height(BUTTON_SIZE)
207
207
-
.padding(BUTTON_PADDING)
208
208
-
.on_press(Message::UserOpenedSystrayMenu)
209
209
-
.style(transparent)
210
210
-
.into(),
215
215
+
true => tooltip(
216
216
+
button(angle_up_solid().size(16))
217
217
+
.height(BUTTON_SIZE)
218
218
+
.padding(BUTTON_PADDING)
219
219
+
.on_press(Message::UserOpenedSystrayMenu)
220
220
+
.style(transparent),
221
221
+
container("Show hidden icons")
222
222
+
.padding(BUTTON_PADDING)
223
223
+
.style(rounded_container),
224
224
+
tooltip::Position::Left,
225
225
+
)
226
226
+
.snap_within_viewport(false)
227
227
+
.into(),
211
228
}),
212
229
"notification_tray" => Some(
213
230
button(bell_regular().size(16))