From 8ddf5cf111a08d6a5fd85767bdd7c8242816bac2 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Thu, 12 Mar 2015 14:14:26 +0100 Subject: [PATCH] windowsclone: Transform some lambdas to override-methods --- src/Widgets/WindowClone.vala | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/Widgets/WindowClone.vala b/src/Widgets/WindowClone.vala index 4cdf89f5..1a084b74 100644 --- a/src/Widgets/WindowClone.vala +++ b/src/Widgets/WindowClone.vala @@ -122,14 +122,6 @@ namespace Gala close_window (); return true; }); - enter_event.connect (() => { - close_button.opacity = 255; - return false; - }); - leave_event.connect (() => { - close_button.opacity = 0; - return false; - }); window_icon = new WindowIcon (window, WINDOW_ICON_SIZE); window_icon.opacity = 0; @@ -146,11 +138,6 @@ namespace Gala load_clone (); } - public override bool button_press_event (Clutter.ButtonEvent event) - { - return true; - } - ~WindowClone () { window.unmanaged.disconnect (unmanaged); @@ -390,6 +377,25 @@ namespace Gala clone.allocate (alloc, flags); } + public override bool button_press_event (Clutter.ButtonEvent event) + { + return true; + } + + public override bool enter_event (Clutter.CrossingEvent event) + { + close_button.opacity = 255; + + return false; + } + + public override bool leave_event (Clutter.CrossingEvent event) + { + close_button.opacity = 0; + + return false; + } + /** * Place the widgets, that is the close button and the WindowIcon of the window, * at their positions inside the actor for a given width and height.