Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::paintable::svg_picture_colorized;
use glib::object::Cast;
use glib::timeout_add_local_once;
use glib_macros::{clone, closure};
use gtk4::prelude::{BoxExt, ButtonExt, GObjectPropertyExpressionExt, GtkWindowExt, WidgetExt};
use gtk4::prelude::{BoxExt, ButtonExt, EventControllerExt, GObjectPropertyExpressionExt, GtkWindowExt, WidgetExt};
use gtk4::{EventControllerKey, GestureClick, PropagationPhase};
use gtk4_layer_shell::{KeyboardMode, LayerShell};
use libadwaita::prelude::AdwApplicationWindowExt;
Expand Down Expand Up @@ -339,6 +339,20 @@ pub fn create_app(config: &Arc<AppConfig>, app: &libadwaita::Application) -> Wle
move |_| on_option(&action, delay_ms, service_mode, window)
));

let event_controller_motion = gtk4::EventControllerMotion::new();
event_controller_motion.connect_enter(
|controller, _x, _y| {
let control_button = controller.widget();
match control_button {
Some(control_button) => {
control_button.grab_focus();
}
None => { }
}
}
);
button.add_controller(event_controller_motion);

button.set_child(Some(&overlay));

buttons_container.append(&button);
Expand Down