gnome-panel r10817 - trunk/gnome-panel



Author: vuntz
Date: Mon Feb 11 14:11:47 2008
New Revision: 10817
URL: http://svn.gnome.org/viewvc/gnome-panel?rev=10817&view=rev

Log:
2008-02-11  Vincent Untz  <vuntz gnome org>

	Switch back to 24x24 icons again.
	Based on patch by Matthias Clasen <mclasen redhat com>
	Fix bug #487051

	* button-widget.c: (button_widget_size_allocate): handle 24x24 icons
	too
	* menu.c: (panel_make_menu_icon): scale the icon to the size only if
	it's not a bit smaller (ie, don't scale to 24 if we get 22)
	* panel-stock-icons.c: (panel_init_stock_icons_and_items): use 24x24
	for the menu bar icon
	* panel-stock-icons.h: default menu icon size is 24


Modified:
   trunk/gnome-panel/ChangeLog
   trunk/gnome-panel/button-widget.c
   trunk/gnome-panel/menu.c
   trunk/gnome-panel/panel-stock-icons.c
   trunk/gnome-panel/panel-stock-icons.h

Modified: trunk/gnome-panel/button-widget.c
==============================================================================
--- trunk/gnome-panel/button-widget.c	(original)
+++ trunk/gnome-panel/button-widget.c	Mon Feb 11 14:11:47 2008
@@ -512,8 +512,10 @@
 
 	if (size < 22)
 		size = 16;
-	else if (size < 32)
+	else if (size < 24)
 		size = 22;
+	else if (size < 32)
+		size = 24;
 	else if (size < 48)
 		size = 32;
 	else

Modified: trunk/gnome-panel/menu.c
==============================================================================
--- trunk/gnome-panel/menu.c	(original)
+++ trunk/gnome-panel/menu.c	Mon Feb 11 14:11:47 2008
@@ -382,8 +382,27 @@
 	}
 
 	if (pb == NULL) {
-		pb = gdk_pixbuf_new_from_file_at_size (file, size, size, NULL);
-		
+		pb = gdk_pixbuf_new_from_file (file, NULL);
+		if (pb) {
+			gint width, height;
+
+			width = gdk_pixbuf_get_width (pb);
+			height = gdk_pixbuf_get_height (pb);
+			
+			/* if we want 24 and we get 22, do nothing;
+			 * else scale */
+			if (!(size - 2 <= width && width <= size &&
+                              size - 2 <= height && height <= size)) {
+				GdkPixbuf *tmp;
+
+				tmp = gdk_pixbuf_scale_simple (pb, size, size,
+							       GDK_INTERP_BILINEAR);
+
+				g_object_unref (pb);
+				pb = tmp;
+			}
+		}
+				
 		/* add icon to the hash table so we don't load it again */
 		loaded = TRUE;
 	}

Modified: trunk/gnome-panel/panel-stock-icons.c
==============================================================================
--- trunk/gnome-panel/panel-stock-icons.c	(original)
+++ trunk/gnome-panel/panel-stock-icons.c	Mon Feb 11 14:11:47 2008
@@ -128,7 +128,9 @@
 						       PANEL_DEFAULT_MENU_ICON_SIZE,
 						       PANEL_DEFAULT_MENU_ICON_SIZE);
 
-	panel_menu_bar_icon_size = gtk_icon_size_register ("panel-foobar", 20, 20);
+	panel_menu_bar_icon_size = gtk_icon_size_register ("panel-foobar",
+							   PANEL_DEFAULT_MENU_ICON_SIZE,
+							   PANEL_DEFAULT_MENU_ICON_SIZE);
 
 	factory = gtk_icon_factory_new ();
 	gtk_icon_factory_add_default (factory);

Modified: trunk/gnome-panel/panel-stock-icons.h
==============================================================================
--- trunk/gnome-panel/panel-stock-icons.h	(original)
+++ trunk/gnome-panel/panel-stock-icons.h	Mon Feb 11 14:11:47 2008
@@ -31,7 +31,7 @@
 G_BEGIN_DECLS
 
 /* themeable size - "panel-menu" */
-#define PANEL_DEFAULT_MENU_ICON_SIZE 	22
+#define PANEL_DEFAULT_MENU_ICON_SIZE 	24
 
 /* stock icons */
 #define PANEL_STOCK_FORCE_QUIT          "gnome-panel-force-quit"



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