From 98f3ef2689de06e8ab8b46a91acfa7dd2056a3a6 Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Mon, 5 Mar 2012 12:19:59 +0100 Subject: Imported Upstream version 0.5.1 --- src/renderers/pieRenderer.vala | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) (limited to 'src/renderers/pieRenderer.vala') diff --git a/src/renderers/pieRenderer.vala b/src/renderers/pieRenderer.vala index 67a6b56..09c5f7a 100644 --- a/src/renderers/pieRenderer.vala +++ b/src/renderers/pieRenderer.vala @@ -58,23 +58,23 @@ public class PieRenderer : GLib.Object { public bool turbo_mode { get; private set; default=false; } ///////////////////////////////////////////////////////////////////// - /// All SliceRenderers used to draw this Pie. + /// True if the pie is currently navigated with the keyboard. This is + /// set to false as soon as the mouse moves. ///////////////////////////////////////////////////////////////////// - private Gee.ArrayList slices; + public bool key_board_control { get; set; default=false; } ///////////////////////////////////////////////////////////////////// - /// The renderer for the center of this pie. + /// All SliceRenderers used to draw this Pie. ///////////////////////////////////////////////////////////////////// - private CenterRenderer center; + private Gee.ArrayList slices; ///////////////////////////////////////////////////////////////////// - /// True if the pie is currently navigated with the keyboard. This is - /// set to false as soon as the mouse moves. + /// The renderer for the center of this pie. ///////////////////////////////////////////////////////////////////// - private bool key_board_control = false; + private CenterRenderer center; ///////////////////////////////////////////////////////////////////// /// C'tor, initializes members. @@ -130,9 +130,21 @@ public class PieRenderer : GLib.Object { ///////////////////////////////////////////////////////////////////// public void activate() { - if (this.active_slice >= 0 && this.active_slice < this.slices.size) + if (this.active_slice >= 0 && this.active_slice < this.slices.size) { slices[active_slice].activate(); - this.cancel(); + + if (this.active_slice == this.quickaction) + Logger.stats("ACTIVATE QUICKACTION %d".printf(this.active_slice)); + else + Logger.stats("ACTIVATE %d".printf(this.active_slice)); + } else { + Logger.stats("CANCEL"); + } + + foreach (var slice in this.slices) + slice.fade_out(); + + center.fade_out(); } ///////////////////////////////////////////////////////////////////// @@ -144,6 +156,8 @@ public class PieRenderer : GLib.Object { slice.fade_out(); center.fade_out(); + + Logger.stats("CANCEL"); } ///////////////////////////////////////////////////////////////////// @@ -161,6 +175,8 @@ public class PieRenderer : GLib.Object { this.set_highlighted_slice(this.active_slice+1); else if (this.active_slice != top) this.set_highlighted_slice((this.active_slice-1+this.slice_count())%this.slice_count()); + + this.key_board_control = true; } ///////////////////////////////////////////////////////////////////// @@ -178,6 +194,8 @@ public class PieRenderer : GLib.Object { this.set_highlighted_slice(this.active_slice-1); else if (this.active_slice != bottom) this.set_highlighted_slice((this.active_slice+1)%this.slice_count()); + + this.key_board_control = true; } ///////////////////////////////////////////////////////////////////// @@ -195,6 +213,8 @@ public class PieRenderer : GLib.Object { this.set_highlighted_slice(this.active_slice-1); else if (this.active_slice < left) this.set_highlighted_slice(this.active_slice+1); + + this.key_board_control = true; } ///////////////////////////////////////////////////////////////////// @@ -212,6 +232,8 @@ public class PieRenderer : GLib.Object { this.set_highlighted_slice((this.active_slice+1)%this.slice_count()); else if (this.active_slice < left && this.active_slice != right) this.set_highlighted_slice((this.active_slice-1+this.slice_count())%this.slice_count()); + + this.key_board_control = true; } ///////////////////////////////////////////////////////////////////// @@ -292,8 +314,6 @@ public class PieRenderer : GLib.Object { foreach (var slice in this.slices) slice.set_active_slice(active); - - this.key_board_control = true; } } } -- cgit v1.2.3