summaryrefslogtreecommitdiff
path: root/src/ui.vala
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui.vala')
-rw-r--r--src/ui.vala44
1 files changed, 23 insertions, 21 deletions
diff --git a/src/ui.vala b/src/ui.vala
index 2117a9a..c12b1cd 100644
--- a/src/ui.vala
+++ b/src/ui.vala
@@ -682,11 +682,10 @@ public class UserInterface : Gtk.ApplicationWindow
return true;
else
return false;
- case Gtk.ResponseType.CANCEL:
- return false;
case Gtk.ResponseType.NO:
- default:
return true;
+ default:
+ return false;
}
}
@@ -1660,16 +1659,6 @@ public class UserInterface : Gtk.ApplicationWindow
copy_to_clipboard_menuitem.sensitive = true;
}
- private bool shell_shows_menubar
- {
- get
- {
- bool shell_shows_menubar;
- Gtk.Settings.get_default ().get ("gtk-shell-shows-menubar", out shell_shows_menubar);
- return shell_shows_menubar;
- }
- }
-
private void load ()
{
Gtk.IconTheme.get_default ().append_search_path (ICON_DIR);
@@ -1678,7 +1667,13 @@ public class UserInterface : Gtk.ApplicationWindow
var app = Application.get_default () as Gtk.Application;
- if (!shell_shows_menubar)
+ if (is_desktop ("Unity") || is_desktop ("XFCE"))
+ {
+ set_titlebar (null);
+ menubar.visible = true;
+ toolbar.visible = true;
+ }
+ else
{
app.add_action_entries (action_entries, this);
@@ -1717,12 +1712,6 @@ public class UserInterface : Gtk.ApplicationWindow
app.add_accelerator ("F1", "app.help", null);
app.add_accelerator ("<Ctrl>Q", "app.quit", null);
}
- else
- {
- set_titlebar (null);
- menubar.visible = true;
- toolbar.visible = true;
- }
app.add_window (this);
/* Add InfoBar (not supported in Glade) */
@@ -1867,7 +1856,20 @@ public class UserInterface : Gtk.ApplicationWindow
progress_dialog = new ProgressBarDialog (this, _("Saving document..."));
book.saving.connect (book_saving_cb);
}
-
+
+ private bool is_desktop (string name)
+ {
+ var desktop_name_list = Environment.get_variable ("XDG_CURRENT_DESKTOP");
+ if (desktop_name_list == null)
+ return false;
+
+ foreach (var n in desktop_name_list.split (":"))
+ if (n == name)
+ return true;
+
+ return false;
+ }
+
private string state_filename
{
owned get { return Path.build_filename (Environment.get_user_cache_dir (), "simple-scan", "state"); }