summaryrefslogtreecommitdiff
path: root/src/gui
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/gui
parenta824c3e5bdab686901b02667609282e7d596a6af (diff)
Imported Upstream version 0.5.1
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/aboutWindow.vala5
-rw-r--r--src/gui/newSliceWindow.vala1
-rw-r--r--src/gui/piePreview.vala3
-rw-r--r--src/gui/settingsWindow.vala38
-rw-r--r--src/gui/themeList.vala12
-rw-r--r--src/gui/triggerSelectButton.vala4
6 files changed, 57 insertions, 6 deletions
diff --git a/src/gui/aboutWindow.vala b/src/gui/aboutWindow.vala
index 2df8c46..6c5820b 100644
--- a/src/gui/aboutWindow.vala
+++ b/src/gui/aboutWindow.vala
@@ -42,7 +42,8 @@ public class AboutWindow: Gtk.AboutDialog {
"Magnun Leno <magnun@codecommunity.org> (PT-BR)",
"Kim Boram <Boramism@gmail.com> (KO)",
"Eduardo Anabalon <lalo1412@gmail.com> (ES)",
- "Gregoire Bellon-Gervais <greggbg@gmail.com> (FR)",
+ "Grégoire Bellon-Gervais <greggbg@gmail.com> (FR)",
+ "Alex Maxime <cad.maxime@gmail.com> (FR)",
"Eugene Roskin <pams@imail.ru> (RU)"
};
@@ -68,7 +69,7 @@ public class AboutWindow: Gtk.AboutDialog {
logo_icon_name: "gnome-pie",
website: "http://www.simonschneegans.de/?page_id=12",
website_label: "www.gnome-pie.simonschneegans.de",
- version: "0.4.2"
+ version: Deamon.version
);
}
}
diff --git a/src/gui/newSliceWindow.vala b/src/gui/newSliceWindow.vala
index 7bd6340..ade6432 100644
--- a/src/gui/newSliceWindow.vala
+++ b/src/gui/newSliceWindow.vala
@@ -258,6 +258,7 @@ public class NewSliceWindow : GLib.Object {
break;
case "key":
this.current_custom_icon = action.icon;
+ this.current_hotkey = action.real_command;
this.key_select.set_trigger(new Trigger.from_string(action.real_command));
break;
case "pie":
diff --git a/src/gui/piePreview.vala b/src/gui/piePreview.vala
index 5745fcb..4963bb2 100644
--- a/src/gui/piePreview.vala
+++ b/src/gui/piePreview.vala
@@ -111,6 +111,9 @@ class PiePreview : Gtk.DrawingArea {
this.new_slice_window.on_select.connect((new_action, as_new_slice, at_position) => {
var pie = PieManager.all_pies[this.current_id];
+ debug(new_action.actions[0].name);
+ debug(new_action.actions[0].real_command);
+
if (new_action.has_quickaction())
renderer.disable_quickactions();
diff --git a/src/gui/settingsWindow.vala b/src/gui/settingsWindow.vala
index 1eaa0b4..0e7af20 100644
--- a/src/gui/settingsWindow.vala
+++ b/src/gui/settingsWindow.vala
@@ -32,6 +32,7 @@ public class SettingsWindow : GLib.Object {
private ThemeList? theme_list = null;
private Gtk.ToggleButton? indicator = null;
private Gtk.ToggleButton? autostart = null;
+ private Gtk.ToggleButton? captions = null;
/////////////////////////////////////////////////////////////////////
/// C'tor creates, the dialog.
@@ -47,6 +48,14 @@ public class SettingsWindow : GLib.Object {
this.window = builder.get_object("window") as Gtk.Dialog;
this.theme_list = new ThemeList();
+ this.theme_list.on_select_new.connect(() => {
+ this.captions.active = Config.global.show_captions;
+ if (Config.global.theme.has_slice_captions) {
+ this.captions.sensitive = true;
+ } else {
+ this.captions.sensitive = false;
+ }
+ });
var scroll_area = builder.get_object("theme-scrolledwindow") as Gtk.ScrolledWindow;
scroll_area.add(this.theme_list);
@@ -59,6 +68,9 @@ public class SettingsWindow : GLib.Object {
this.indicator = (builder.get_object("indicator-checkbox") as Gtk.ToggleButton);
this.indicator.toggled.connect(on_indicator_toggled);
+ this.captions = (builder.get_object("captions-checkbox") as Gtk.ToggleButton);
+ this.captions.toggled.connect(on_captions_toggled);
+
var scale_slider = (builder.get_object("scale-hscale") as Gtk.HScale);
scale_slider.set_range(0.5, 2.0);
scale_slider.set_increments(0.05, 0.25);
@@ -108,8 +120,15 @@ public class SettingsWindow : GLib.Object {
public void show() {
this.indicator.active = Config.global.show_indicator;
- this.autostart.active = Config.global.auto_start;
-
+ this.autostart.active = Config.global.auto_start;
+ this.captions.active = Config.global.show_captions;
+
+ if (Config.global.theme.has_slice_captions) {
+ this.captions.sensitive = true;
+ } else {
+ this.captions.sensitive = false;
+ }
+
this.window.show_all();
}
@@ -119,6 +138,12 @@ public class SettingsWindow : GLib.Object {
private void on_close_button_clicked() {
this.window.hide();
+
+ Logger.stats("SETTINGS " + Config.global.theme.name +
+ (this.indicator.active ? " INDICATOR" : "") +
+ (this.autostart.active ? " AUTOSTART" : "") +
+ (this.captions.active ? " CAPTIONS" : "") +
+ " %f".printf(Config.global.global_scale));
}
/////////////////////////////////////////////////////////////////////
@@ -169,6 +194,15 @@ public class SettingsWindow : GLib.Object {
var check = check_box as Gtk.CheckButton;
Config.global.show_indicator = check.active;
}
+
+ /////////////////////////////////////////////////////////////////////
+ /// Shows or hides the captions of Slices.
+ /////////////////////////////////////////////////////////////////////
+
+ private void on_captions_toggled(Gtk.ToggleButton check_box) {
+ var check = check_box as Gtk.CheckButton;
+ Config.global.show_captions = check.active;
+ }
}
}
diff --git a/src/gui/themeList.vala b/src/gui/themeList.vala
index 7aaecc6..1c038a9 100644
--- a/src/gui/themeList.vala
+++ b/src/gui/themeList.vala
@@ -24,6 +24,15 @@ namespace GnomePie {
class ThemeList : Gtk.TreeView {
/////////////////////////////////////////////////////////////////////
+ /// This signal gets emitted, when a new theme is selected by the
+ /// user. This new theme is applied automatically, with this signal
+ /// actions may be triggered which should be executed AFTER the
+ /// change to a new theme.
+ /////////////////////////////////////////////////////////////////////
+
+ public signal void on_select_new();
+
+ /////////////////////////////////////////////////////////////////////
/// The currently selected row.
/////////////////////////////////////////////////////////////////////
@@ -69,6 +78,9 @@ class ThemeList : Gtk.TreeView {
Timeout.add(10, () => {
int index = int.parse(data.get_path(active).to_string());
Config.global.theme = Config.global.themes[index];
+
+ this.on_select_new();
+
Config.global.theme.load();
Config.global.theme.load_images();
return false;
diff --git a/src/gui/triggerSelectButton.vala b/src/gui/triggerSelectButton.vala
index eeb37e2..fd8505a 100644
--- a/src/gui/triggerSelectButton.vala
+++ b/src/gui/triggerSelectButton.vala
@@ -132,8 +132,8 @@ public class TriggerSelectButton : Gtk.ToggleButton {
if (this.active) {
Gtk.Allocation rect;
this.get_allocation(out rect);
- if (event.x < rect.x || event.x > rect.x + rect.width
- || event.y < rect.y || event.y > rect.y + rect.height) {
+ if (event.x < 0 || event.x > rect.width
+ || event.y < 0 || event.y > rect.height) {
this.cancel();
return true;