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
Alignment, Background, Element, Font, Length, Subscription, Task, Theme, border,
5
theme::palette::{self},
6
time,
7
-
widget::{Text, button, column, row, text, vertical_rule},
8
};
9
use iced_layershell::{
10
Application,
···
52
.font(Font::with_name("Selawik"))
53
.align_x(Alignment::Center)
54
.align_y(Alignment::Center)
0
0
0
0
0
0
0
0
0
0
55
}
56
57
fn styled(pair: palette::Pair) -> button::Style {
···
202
"taskbar" => Some(text!("TODO: taskbar").into()),
203
"system_tray" => Some(match self.hidden_menu.unwrap_or(false) {
204
false => text!("TODO: systray").into(),
205
-
true => button(angle_up_solid().size(16))
206
-
.height(BUTTON_SIZE)
207
-
.padding(BUTTON_PADDING)
208
-
.on_press(Message::UserOpenedSystrayMenu)
209
-
.style(transparent)
210
-
.into(),
0
0
0
0
0
0
0
211
}),
212
"notification_tray" => Some(
213
button(bell_regular().size(16))
···
4
Alignment, Background, Element, Font, Length, Subscription, Task, Theme, border,
5
theme::palette::{self},
6
time,
7
+
widget::{Text, button, column, container, row, text, tooltip, vertical_rule},
8
};
9
use iced_layershell::{
10
Application,
···
52
.font(Font::with_name("Selawik"))
53
.align_x(Alignment::Center)
54
.align_y(Alignment::Center)
55
+
}
56
+
57
+
pub fn rounded_container(theme: &Theme) -> container::Style {
58
+
let palette = theme.extended_palette();
59
+
60
+
container::Style {
61
+
background: Some(palette.background.weak.color.into()),
62
+
border: border::rounded(CORNER_RADIUS),
63
+
..container::Style::default()
64
+
}
65
}
66
67
fn styled(pair: palette::Pair) -> button::Style {
···
212
"taskbar" => Some(text!("TODO: taskbar").into()),
213
"system_tray" => Some(match self.hidden_menu.unwrap_or(false) {
214
false => text!("TODO: systray").into(),
215
+
true => tooltip(
216
+
button(angle_up_solid().size(16))
217
+
.height(BUTTON_SIZE)
218
+
.padding(BUTTON_PADDING)
219
+
.on_press(Message::UserOpenedSystrayMenu)
220
+
.style(transparent),
221
+
container("Show hidden icons")
222
+
.padding(BUTTON_PADDING)
223
+
.style(rounded_container),
224
+
tooltip::Position::Left,
225
+
)
226
+
.snap_within_viewport(false)
227
+
.into(),
228
}),
229
"notification_tray" => Some(
230
button(bell_regular().size(16))