[latexila] Fix icons in menus
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [latexila] Fix icons in menus
- Date: Tue, 8 Oct 2013 14:33:50 +0000 (UTC)
commit 2f45e2397b680eca70fc6c078cda75b6bb77cad2
Author: Sébastien Wilmet <swilmet gnome org>
Date: Mon Sep 23 21:24:14 2013 +0200
Fix icons in menus
GtkSettings was not the good way to do this.
src/main_window.vala | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/src/main_window.vala b/src/main_window.vala
index a62b5b1..7d83ed3 100644
--- a/src/main_window.vala
+++ b/src/main_window.vala
@@ -157,6 +157,7 @@ public class MainWindow : Window
_main_window_documents = new MainWindowDocuments (this, _ui_manager);
_main_window_structure = new MainWindowStructure (_ui_manager);
+ show_images_in_menu ();
set_file_actions_sensitivity (false);
/* Main vertical grid */
@@ -180,14 +181,8 @@ public class MainWindow : Window
viewport.add (menu);
menu_paned.add1 (viewport);
menu_paned.show_all ();
-
main_vgrid.add (menu_paned);
- // Force to show icons in the menu.
- // In the LaTeX and Math menu, icons are needed.
- unowned Gtk.Settings gtk_settings = menu.get_settings ();
- gtk_settings.gtk_menu_images = true;
-
/* Main and edit toolbars */
Toolbar main_toolbar = get_main_toolbar ();
@@ -272,6 +267,19 @@ public class MainWindow : Window
show ();
}
+ // Force to show icons in the menu.
+ // In the LaTeX and Math menu, icons are needed.
+ private void show_images_in_menu ()
+ {
+ foreach (Gtk.ActionGroup action_group in _ui_manager.get_action_groups ())
+ {
+ foreach (Gtk.Action action in action_group.list_actions ())
+ {
+ action.set_always_show_image (true);
+ }
+ }
+ }
+
private void initialize_ui_manager ()
{
_action_group = new Gtk.ActionGroup ("ActionGroup");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]