From 4b19e75939c5b7122d1429f6f258d4b83cd90dde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 26 Aug 2016 16:35:54 +0200 Subject: Imported Upstream version 0.6.9 --- src/gui/triggerSelectButton.vala | 44 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'src/gui/triggerSelectButton.vala') diff --git a/src/gui/triggerSelectButton.vala b/src/gui/triggerSelectButton.vala index eb34066..c870f84 100644 --- a/src/gui/triggerSelectButton.vala +++ b/src/gui/triggerSelectButton.vala @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 by Simon Schneegans // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -53,7 +53,7 @@ public class TriggerSelectButton : Gtk.ToggleButton { |Gdk.ModifierType.LOCK_MASK; ///////////////////////////////////////////////////////////////////// - /// C'tor, constructs a new TriggerSelectWindow. + /// C'tor, constructs a new TriggerSelectButton. ///////////////////////////////////////////////////////////////////// public TriggerSelectButton(bool enable_mouse) { @@ -132,31 +132,31 @@ public class TriggerSelectButton : Gtk.ToggleButton { private bool on_button_press(Gdk.EventButton event) { if (this.active) { - Gtk.Allocation rect; - this.get_allocation(out rect); - if (event.x < 0 || event.x > rect.width - || event.y < 0 || event.y > rect.height) { - - this.cancel(); - return true; - } - } - - if (this.active && this.enable_mouse) { - Gdk.ModifierType state = event.state & ~ this.lock_modifiers; - var new_trigger = new Trigger.from_values((int)event.button, state, true, - false, false, false, false, 5); - - if (new_trigger.key_code != 1) this.update_trigger(new_trigger); - else this.cancel(); + Gtk.Allocation rect; + this.get_allocation(out rect); + if (event.x < 0 || event.x > rect.width + || event.y < 0 || event.y > rect.height) { - return true; - } else if (this.active) { this.cancel(); return true; } + } + + if (this.active && this.enable_mouse) { + Gdk.ModifierType state = event.state & ~ this.lock_modifiers; + var new_trigger = new Trigger.from_values((int)event.button, state, true, + false, false, false, false, 5); - return false; + if (new_trigger.key_code != 1) this.update_trigger(new_trigger); + else this.cancel(); + + return true; + } else if (this.active) { + this.cancel(); + return true; + } + + return false; } } -- cgit v1.2.3