gimp r25152 - in trunk: . app/widgets



Author: mitch
Date: Fri Mar 21 13:34:09 2008
New Revision: 25152
URL: http://svn.gnome.org/viewvc/gimp?rev=25152&view=rev

Log:
2008-03-21  Michael Natterer  <mitch gimp org>

	* app/widgets/gimpdock.h (struct GimpDock): added member "ID"
	for themeing.

	* app/widgets/gimpdock.c (gimp_dock_init): assign unique IDs
	and set unique widget names based on the ID.

	(gimp_dock_style_set): set individual styles for each dock based
	on the widget name so docks on different screens get the correct
	font size. Use PANGO_SCALE_SMALL instead of a hardcoded factor of
	0.8.



Modified:
   trunk/ChangeLog
   trunk/app/widgets/gimpdock.c
   trunk/app/widgets/gimpdock.h

Modified: trunk/app/widgets/gimpdock.c
==============================================================================
--- trunk/app/widgets/gimpdock.c	(original)
+++ trunk/app/widgets/gimpdock.c	Fri Mar 21 13:34:09 2008
@@ -163,11 +163,18 @@
 static void
 gimp_dock_init (GimpDock *dock)
 {
-  GtkWidget *separator;
+  static gint  dock_ID = 1;
+  GtkWidget   *separator;
+  gchar       *name;
 
   dock->context        = NULL;
   dock->dialog_factory = NULL;
   dock->dockbooks      = NULL;
+  dock->ID             = dock_ID++;
+
+  name = g_strdup_printf ("gimp-dock-%d", dock->ID);
+  gtk_widget_set_name (GTK_WIDGET (dock), name);
+  g_free (name);
 
   gtk_window_set_role (GTK_WINDOW (dock), "gimp-dock");
   gtk_window_set_resizable (GTK_WINDOW (dock), TRUE);
@@ -377,7 +384,7 @@
   font_desc = pango_font_description_copy (font_desc);
 
   font_size = pango_font_description_get_size (font_desc);
-  font_size = 0.8 * font_size;
+  font_size = PANGO_SCALE_SMALL * font_size;
   pango_font_description_set_size (font_desc, font_size);
 
   font_str = pango_font_description_to_string (font_desc);
@@ -388,8 +395,9 @@
                      "{"
                      "  font_name = \"%s\""
                      "}"
-                     "widget_class \"<GimpDock>.*\" style \"gimp-dock-style\"",
-                     font_str);
+                     "widget \"gimp-dock-%d.*\" style \"gimp-dock-style\"",
+                     font_str,
+                     GIMP_DOCK (widget)->ID);
   g_free (font_str);
 
   gtk_rc_parse_string (rc_string);

Modified: trunk/app/widgets/gimpdock.h
==============================================================================
--- trunk/app/widgets/gimpdock.h	(original)
+++ trunk/app/widgets/gimpdock.h	Fri Mar 21 13:34:09 2008
@@ -47,6 +47,8 @@
   GtkWidget         *vbox;
 
   GList             *dockbooks;
+
+  gint               ID; /* for themeing */
 };
 
 struct _GimpDockClass



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