gimp r24889 - in branches/weskaggs: . app/widgets



Author: weskaggs
Date: Fri Feb 15 17:35:33 2008
New Revision: 24889
URL: http://svn.gnome.org/viewvc/gimp?rev=24889&view=rev

Log:
Bill Skaggs  <weskaggs primate ucdavis edu>

	* app/widgets/gimpcontainerentry.[ch]
	* app/widgets/gimpviewablebox.[ch]: Change appearance of
	selector widgets, and add code for packing the components
	into a table.


Modified:
   branches/weskaggs/ChangeLog
   branches/weskaggs/app/widgets/gimpcontainerentry.c
   branches/weskaggs/app/widgets/gimpcontainerentry.h
   branches/weskaggs/app/widgets/gimpviewablebox.c
   branches/weskaggs/app/widgets/gimpviewablebox.h

Modified: branches/weskaggs/app/widgets/gimpcontainerentry.c
==============================================================================
--- branches/weskaggs/app/widgets/gimpcontainerentry.c	(original)
+++ branches/weskaggs/app/widgets/gimpcontainerentry.c	Fri Feb 15 17:35:33 2008
@@ -129,12 +129,13 @@
                              NULL);
 
   store = gtk_list_store_new (GIMP_CONTAINER_ENTRY_NUM_COLUMNS,
-                              GIMP_TYPE_VIEW_RENDERER,
-                              G_TYPE_STRING);
+                              G_TYPE_STRING,
+                              GIMP_TYPE_VIEW_RENDERER);
 
   gtk_entry_completion_set_model (completion, GTK_TREE_MODEL (store));
   g_object_unref (store);
 
+  gtk_entry_set_has_frame (GTK_ENTRY (entry), FALSE);
   gtk_entry_set_completion (GTK_ENTRY (entry), completion);
 
   g_signal_connect (completion, "match-selected",

Modified: branches/weskaggs/app/widgets/gimpcontainerentry.h
==============================================================================
--- branches/weskaggs/app/widgets/gimpcontainerentry.h	(original)
+++ branches/weskaggs/app/widgets/gimpcontainerentry.h	Fri Feb 15 17:35:33 2008
@@ -28,8 +28,8 @@
 
 enum
 {
-  GIMP_CONTAINER_ENTRY_COLUMN_RENDERER,
   GIMP_CONTAINER_ENTRY_COLUMN_NAME,
+  GIMP_CONTAINER_ENTRY_COLUMN_RENDERER,
   GIMP_CONTAINER_ENTRY_NUM_COLUMNS
 };
 

Modified: branches/weskaggs/app/widgets/gimpviewablebox.c
==============================================================================
--- branches/weskaggs/app/widgets/gimpviewablebox.c	(original)
+++ branches/weskaggs/app/widgets/gimpviewablebox.c	Fri Feb 15 17:35:33 2008
@@ -429,8 +429,7 @@
                                      dialog_stock_id,
                                      dialog_tooltip);
 
-  g_object_set_data (G_OBJECT (hbox), "viewable-button", button);
-
+  gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
   gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
   gtk_widget_show (button);
 
@@ -443,9 +442,44 @@
   gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
   gtk_widget_show (entry);
 
+  g_object_set_data (G_OBJECT (hbox), "viewable-button", button);
+  g_object_set_data (G_OBJECT (hbox), "viewable-entry",  entry);
+
   return hbox;
 }
 
+/*
+ * remove the button and entry from a viewable box, and
+ * insert them into a table at specified location
+ */
+void
+gimp_viewable_box_table_attach (GtkTable  *table,
+                                GtkWidget *box,
+                                gint       row,
+                                gint       button_start_col,
+                                gint       button_end_col,
+                                gint       entry_start_col,
+                                gint       entry_end_col)
+{
+  GtkWidget *button = g_object_get_data (G_OBJECT (box), "viewable-button");
+  GtkWidget *entry  = g_object_get_data (G_OBJECT (box), "viewable-entry");
+
+  g_object_ref (button);
+  g_object_ref (entry);
+
+  gtk_container_remove (GTK_CONTAINER (box), button);
+  gtk_container_remove (GTK_CONTAINER (box), entry);
+
+  gtk_table_attach_defaults (table, button,
+                             button_start_col, button_end_col, row, row + 1);
+  gtk_table_attach_defaults (table, entry,
+                             entry_start_col, entry_end_col, row, row + 1);
+
+  g_object_unref (button);
+  g_object_unref (entry);
+}
+
+
 static GtkWidget *
 view_props_connect (GtkWidget   *box,
                     GimpContext *context,

Modified: branches/weskaggs/app/widgets/gimpviewablebox.h
==============================================================================
--- branches/weskaggs/app/widgets/gimpviewablebox.h	(original)
+++ branches/weskaggs/app/widgets/gimpviewablebox.h	Fri Feb 15 17:35:33 2008
@@ -67,5 +67,12 @@
                                         const gchar   *view_type_prop,
                                         const gchar   *view_size_prop);
 
+void    gimp_viewable_box_table_attach (GtkTable      *table,
+                                        GtkWidget     *box,
+                                        gint           row,
+                                        gint           button_start_col,
+                                        gint           button_end_col,
+                                        gint           entry_start_col,
+                                        gint           entry_end_col);
 
 #endif /* __GIMP_VIEWABLE_BOX_H__ */



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