mirror of
https://github.com/elementary/gala.git
synced 2024-12-03 03:15:15 +03:00
Use ClickAction for FramedBackground and close buttons (#1579)
This commit is contained in:
parent
97b33173e2
commit
79453b324d
@ -111,7 +111,7 @@ namespace Gala {
|
||||
|
||||
// block propagation of button presses on the close button, otherwise
|
||||
// the click action on the icon group will act weirdly
|
||||
close_button.button_press_event.connect (() => { return Gdk.EVENT_STOP; });
|
||||
close_button.button_release_event.connect (() => { return Gdk.EVENT_STOP; });
|
||||
|
||||
add_child (close_button);
|
||||
|
||||
|
@ -119,12 +119,15 @@ public class Gala.WindowClone : Clutter.Actor {
|
||||
add_action (drag_action);
|
||||
}
|
||||
|
||||
var close_button_action = new Clutter.ClickAction ();
|
||||
close_button_action.clicked.connect (() => {
|
||||
close_window ();
|
||||
});
|
||||
close_button = Utils.create_close_button ();
|
||||
close_button.opacity = 0;
|
||||
close_button.button_press_event.connect (() => {
|
||||
close_window ();
|
||||
return Gdk.EVENT_STOP;
|
||||
});
|
||||
// block propagation of button release event to window clone
|
||||
close_button.button_release_event.connect (() => { return Gdk.EVENT_STOP; });
|
||||
close_button.add_action (close_button_action);
|
||||
|
||||
var scale_factor = InternalUtils.get_ui_scaling_factor ();
|
||||
|
||||
|
@ -40,6 +40,8 @@ namespace Gala {
|
||||
css_class = "workspace"
|
||||
};
|
||||
add_effect (effect);
|
||||
|
||||
reactive = true;
|
||||
}
|
||||
|
||||
public override void paint (Clutter.PaintContext context) {
|
||||
@ -170,12 +172,12 @@ namespace Gala {
|
||||
unowned Meta.Display display = workspace.get_display ();
|
||||
var monitor_geometry = display.get_monitor_geometry (display.get_primary_monitor ());
|
||||
|
||||
background = new FramedBackground (display);
|
||||
background.reactive = true;
|
||||
background.button_release_event.connect (() => {
|
||||
var background_click_action = new Clutter.ClickAction ();
|
||||
background_click_action.clicked.connect (() => {
|
||||
selected (true);
|
||||
return Gdk.EVENT_PROPAGATE;
|
||||
});
|
||||
background = new FramedBackground (display);
|
||||
background.add_action (background_click_action);
|
||||
|
||||
window_container = new WindowCloneContainer (wm, gesture_tracker);
|
||||
window_container.window_selected.connect ((w) => { window_selected (w); });
|
||||
|
Loading…
Reference in New Issue
Block a user