[gnome-panel] panel: remove unused PanelMenuBarObject



commit 4c2c98efb6e1d1c0b727352f865fb5940fb69881
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Tue Sep 11 16:47:54 2018 +0300

    panel: remove unused PanelMenuBarObject

 gnome-panel/Makefile.am             |   2 -
 gnome-panel/panel-menu-bar-object.c | 324 ------------------------------------
 gnome-panel/panel-menu-bar-object.h |  67 --------
 gnome-panel/panel-menu-items.c      |  40 ++++-
 4 files changed, 39 insertions(+), 394 deletions(-)
---
diff --git a/gnome-panel/Makefile.am b/gnome-panel/Makefile.am
index 4c1ae953e..5b3802253 100644
--- a/gnome-panel/Makefile.am
+++ b/gnome-panel/Makefile.am
@@ -37,7 +37,6 @@ panel_sources =                       \
        panel-stock-icons.c     \
        panel-action-button.c   \
        panel-image-menu-item.c \
-       panel-menu-bar-object.c \
        panel-menu-button.c     \
        panel-menu-items.c      \
        panel-recent.c          \
@@ -73,7 +72,6 @@ panel_headers =                       \
        panel-stock-icons.h     \
        panel-action-button.h   \
        panel-image-menu-item.h \
-       panel-menu-bar-object.h \
        panel-menu-button.h     \
        panel-menu-items.h      \
        panel-recent.h          \
diff --git a/gnome-panel/panel-menu-items.c b/gnome-panel/panel-menu-items.c
index f9162e246..6e31e21d3 100644
--- a/gnome-panel/panel-menu-items.c
+++ b/gnome-panel/panel-menu-items.c
@@ -52,7 +52,6 @@
 #include "panel-action-button.h"
 #include "panel-icon-names.h"
 #include "panel-lockdown.h"
-#include "panel-menu-bar-object.h"
 #include "panel-recent.h"
 #include "panel-stock-icons.h"
 #include "panel-util.h"
@@ -91,6 +90,45 @@ struct _PanelDesktopMenuItemPrivate {
        GtkIconSize  icon_size;
 };
 
+/* themeable size - "panel-menu-bar" -- This is only used for the icon of the
+ * Applications item in the menu bar. To set it, use this in gtk+'s
+ * settings.ini: "gtk-icon-sizes = panel-menu-bar=16,16" */
+#define PANEL_DEFAULT_MENU_BAR_OBJECT_ICON_SIZE       16
+
+static GtkIconSize panel_menu_bar_object_icon_size = 0;
+
+static GtkIconSize
+panel_menu_bar_object_icon_get_size (void)
+{
+       if (panel_menu_bar_object_icon_size == 0) {
+               GSettings *settings = g_settings_new ("org.gnome.gnome-panel.general");
+               panel_menu_bar_object_icon_size = (GtkIconSize) g_settings_get_enum (settings, 
"panel-menu-bar");
+               g_object_unref (settings);
+       }
+
+       return panel_menu_bar_object_icon_size;
+}
+
+static int
+panel_menu_bar_object_icon_get_pixel_size (GtkIconSize size)
+{
+  switch (size)
+  {
+    case GTK_ICON_SIZE_DIALOG:
+      return 48;
+    case GTK_ICON_SIZE_DND:
+      return 32;
+    case GTK_ICON_SIZE_LARGE_TOOLBAR:
+      return 24;
+    case GTK_ICON_SIZE_SMALL_TOOLBAR:
+    case GTK_ICON_SIZE_BUTTON:
+    case GTK_ICON_SIZE_MENU:
+    case GTK_ICON_SIZE_INVALID:
+    default:
+      return 16;
+  }
+}
+
 static void
 activate_uri_on_screen (const char *uri,
                        GdkScreen  *screen)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]