diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/aboutWindow.vala | 1 | ||||
-rw-r--r-- | src/gui/indicator.vala | 30 | ||||
-rw-r--r-- | src/gui/piePreviewAddSign.vala | 18 | ||||
-rw-r--r-- | src/gui/preferencesWindow.vala | 6 |
4 files changed, 37 insertions, 18 deletions
diff --git a/src/gui/aboutWindow.vala b/src/gui/aboutWindow.vala index b4d1e5e..896d2ba 100644 --- a/src/gui/aboutWindow.vala +++ b/src/gui/aboutWindow.vala @@ -44,6 +44,7 @@ public class AboutWindow: Gtk.AboutDialog { "Magnun Leno <magnun@codecommunity.org> (PT-BR)", "Kim Boram <Boramism@gmail.com> (KO)", "Eduardo Anabalon <lalo1412@gmail.com> (ES)", + "Moo <hazap@hotmail.com> (LT)", "Gabriel Dubatti <gdubatti@gmail.com> (ES)", "Grégoire Bellon-Gervais <greggbg@gmail.com> (FR)", "Alex Maxime <cad.maxime@gmail.com> (FR)", diff --git a/src/gui/indicator.vala b/src/gui/indicator.vala index b46ee59..ddb85e6 100644 --- a/src/gui/indicator.vala +++ b/src/gui/indicator.vala @@ -67,25 +67,37 @@ public class Indicator : GLib.Object { ///////////////////////////////////////////////////////////////////// public Indicator() { - string icon = ""; + string icon = "gnome-pie-symbolic"; var screen = (Gdk.X11.Screen)Gdk.Screen.get_default(); + bool gnome_shell = false; - if (screen.get_window_manager_name() == "Mutter") + if (screen.get_window_manager_name() == "GNOME Shell") { icon = "gnome-pie"; - else - icon = "gnome-pie-symbolic"; + gnome_shell = true; + } #if HAVE_APPINDICATOR - string path = ""; + string path = ""; try { path = GLib.Path.get_dirname(GLib.FileUtils.read_link("/proc/self/exe"))+"/resources"; } catch (GLib.FileError e) { warning("Failed to get path of executable!"); } - this.indicator = new AppIndicator.Indicator.with_path("Gnome-Pie", icon, - AppIndicator.IndicatorCategory.APPLICATION_STATUS, path); + if (gnome_shell) { + + if (GLib.File.new_for_path(path).query_exists()) { + this.indicator = new AppIndicator.Indicator("Gnome-Pie", path + "/" + icon + ".svg", + AppIndicator.IndicatorCategory.APPLICATION_STATUS); + } else { + this.indicator = new AppIndicator.Indicator("Gnome-Pie", icon, + AppIndicator.IndicatorCategory.APPLICATION_STATUS); + } + } else { + this.indicator = new AppIndicator.Indicator.with_path("Gnome-Pie", icon, + AppIndicator.IndicatorCategory.APPLICATION_STATUS, path); + } var menu = new Gtk.Menu(); #else this.indicator = new Gtk.StatusIcon(); @@ -136,7 +148,9 @@ public class Indicator : GLib.Object { // quit item item = new Gtk.ImageMenuItem.with_mnemonic(_("_Quit")); - item.activate.connect(Gtk.main_quit); + item.activate.connect(()=>{ + GLib.Application.get_default().release(); + }); item.show(); menu.append(item); diff --git a/src/gui/piePreviewAddSign.vala b/src/gui/piePreviewAddSign.vala index 4a92067..b3f6f7b 100644 --- a/src/gui/piePreviewAddSign.vala +++ b/src/gui/piePreviewAddSign.vala @@ -185,14 +185,18 @@ public class PiePreviewAddSign : GLib.Object { ///////////////////////////////////////////////////////////////////// public void on_mouse_move(double angle) { - double direction = 2.0 * PI * position/parent.slice_count(); - double diff = fabs(angle-direction); + if (parent.slice_count() > 0) { + double direction = 2.0 * PI * position/parent.slice_count(); + double diff = fabs(angle-direction); - if (diff > PI) - diff = 2 * PI - diff; + if (diff > PI) + diff = 2 * PI - diff; - if (diff < 0.5*PI/parent.slice_count()) this.activity.reset_target(1.0, 1.0); - else this.activity.reset_target(-3.0, 1.5); + if (diff < 0.5*PI/parent.slice_count()) this.activity.reset_target(1.0, 1.0); + else this.activity.reset_target(-3.0, 1.5); + } else { + this.activity.reset_target(1.0, 1.0); + } } ///////////////////////////////////////////////////////////////////// @@ -211,8 +215,8 @@ public class PiePreviewAddSign : GLib.Object { public void on_button_release(double x, double y) { if (this.clicked.end == 0.9) { - this.clicked.reset_target(1.0, 0.1); this.on_clicked((int)this.position); + this.clicked.reset_target(1.0, 0.1); } } } diff --git a/src/gui/preferencesWindow.vala b/src/gui/preferencesWindow.vala index a1dacac..fe3eeb0 100644 --- a/src/gui/preferencesWindow.vala +++ b/src/gui/preferencesWindow.vala @@ -70,7 +70,7 @@ public class PreferencesWindow : GLib.Object { Gdk.EventMask.KEY_PRESS_MASK | Gdk.EventMask.POINTER_MOTION_MASK); - if (Deamon.header_bar) { + if (!Deamon.disable_header_bar) { var headerbar = new Gtk.HeaderBar(); headerbar.show_close_button = true; headerbar.title = _("Gnome-Pie Settings"); @@ -80,7 +80,7 @@ public class PreferencesWindow : GLib.Object { this.notebook = builder.get_object("notebook") as Gtk.Notebook; - if (Deamon.stack_switcher) { + if (!Deamon.disable_stack_switcher) { var main_box = builder.get_object("main-box") as Gtk.Box; var pie_settings = builder.get_object("pie-settings") as Gtk.Box; var general_settings = builder.get_object("general-settings") as Gtk.Box; @@ -241,7 +241,7 @@ public class PreferencesWindow : GLib.Object { this.captions.sensitive = false; } - if (Deamon.stack_switcher) { + if (!Deamon.disable_stack_switcher) { this.stack.set_visible_child_full("2", Gtk.StackTransitionType.NONE); } else { this.notebook.set_current_page(1); |