diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-08-26 16:35:54 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-08-26 16:35:54 +0200 |
commit | 4b19e75939c5b7122d1429f6f258d4b83cd90dde (patch) | |
tree | c1af105b3b9f98326bb59a7c0a5f516f15b9f1f4 /src/gui/triggerSelectButton.vala | |
parent | d9c48b3d78430c190a8077f0ec1fb65de1fc8b09 (diff) |
Imported Upstream version 0.6.9upstream/0.6.9
Diffstat (limited to 'src/gui/triggerSelectButton.vala')
-rw-r--r-- | src/gui/triggerSelectButton.vala | 44 |
1 files changed, 22 insertions, 22 deletions
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; } } |