summaryrefslogtreecommitdiff
path: root/src/gui/triggerSelectButton.vala
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/triggerSelectButton.vala')
-rw-r--r--src/gui/triggerSelectButton.vala44
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;
}
}