summaryrefslogtreecommitdiff
path: root/src/renderers/pieRenderer.vala
diff options
context:
space:
mode:
authorAlessandro Ghedini <al3xbio@gmail.com>2012-03-05 12:19:59 +0100
committerAlessandro Ghedini <al3xbio@gmail.com>2012-03-05 12:19:59 +0100
commit98f3ef2689de06e8ab8b46a91acfa7dd2056a3a6 (patch)
treeb98e438ac1082925e12af6dfec6d9ebeb4e3035e /src/renderers/pieRenderer.vala
parenta824c3e5bdab686901b02667609282e7d596a6af (diff)
Imported Upstream version 0.5.1
Diffstat (limited to 'src/renderers/pieRenderer.vala')
-rw-r--r--src/renderers/pieRenderer.vala42
1 files changed, 31 insertions, 11 deletions
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<SliceRenderer?> 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<SliceRenderer?> 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;
}
}
}