Skip to content

Commit

Permalink
frameworkd: Add right-click handler
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Schaefer <[email protected]>
  • Loading branch information
JohnAZoidberg committed Nov 15, 2024
1 parent 10b14f3 commit 54fedbc
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions frameworkd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const FWK_GUIDES: &str = "https://guides.frame.work/c/Root";

#[derive(Copy, Clone, Eq, PartialEq, Debug)]
enum Events {
ClickTrayIcon,
RightClickTrayIcon,
LeftClickTrayIcon,
DoubleClickTrayIcon,
Exit,
LaunchVia,
Expand Down Expand Up @@ -361,8 +362,9 @@ fn main() {
let _ = s.send(*e);
})
.icon_from_buffer(icon)
.tooltip("Cool Tray 👀 Icon")
.on_click(Events::ClickTrayIcon)
.tooltip("Framework Computer")
.on_right_click(Events::RightClickTrayIcon)
.on_click(Events::LeftClickTrayIcon)
.on_double_click(Events::DoubleClickTrayIcon)
.menu(add_menu(MenuBuilder::new(), icon, Events::NumLockOn))
.build()
Expand Down Expand Up @@ -426,7 +428,10 @@ fn main() {
dev.set(50).unwrap();
}
}
Events::ClickTrayIcon => {
Events::RightClickTrayIcon => {
tray_icon.show_menu().unwrap();
}
Events::LeftClickTrayIcon => {
println!("Single click");
let devs = brightness::blocking::brightness_devices();
for dev in devs {
Expand Down

0 comments on commit 54fedbc

Please sign in to comment.