[gtk+] Completely remove any use of GtkWindow allow-grow and allow-shrink properties



commit 3ccc617052cbd85a066aba2d17c6983551f6d499
Author: Javier Jardón <jjardon gnome org>
Date:   Sat Aug 7 17:07:17 2010 +0200

    Completely remove any use of GtkWindow allow-grow and allow-shrink properties
    
    These have been deprecated and removed from master.
    GtkWindow:resizable should be used instead.
    This completes commit 1a03a65e36b6288f7854da30bf89b86ad3592726
    
    Reported by Benjamin Otte

 demos/testpixbuf.c         |    1 -
 docs/sizing-test.txt       |    3 +--
 docs/tutorial/gtk-tut.sgml |    1 -
 gtk/gtk.symbols            |    1 +
 gtk/gtkwindow-decorate.c   |    4 ++--
 gtk/gtkwindow.c            |    4 ----
 tests/simple.c             |    3 +--
 tests/testgtk.c            |   36 ++++++++----------------------------
 tests/testmultiscreen.c    |    3 +--
 tests/testrgb.c            |    1 -
 10 files changed, 14 insertions(+), 43 deletions(-)
---
diff --git a/demos/testpixbuf.c b/demos/testpixbuf.c
index 2c4ee01..296a87e 100644
--- a/demos/testpixbuf.c
+++ b/demos/testpixbuf.c
@@ -390,7 +390,6 @@ new_testrgb_window (GdkPixbuf *pixbuf, gchar *title)
 				 "GtkObject::user_data", NULL,
 				 "GtkWindow::type", GTK_WINDOW_TOPLEVEL,
 				 "GtkWindow::title", title ? title : "testrgb",
-				 "GtkWindow::allow_shrink", TRUE,
 				 NULL);
 	g_signal_connect (window, "destroy",
 			  G_CALLBACK (quit_func), NULL);
diff --git a/docs/sizing-test.txt b/docs/sizing-test.txt
index 6954612..86183a2 100644
--- a/docs/sizing-test.txt
+++ b/docs/sizing-test.txt
@@ -106,8 +106,7 @@ GtkWindow::default_width, GtkWindow::default_height:
  - default_height is -1 if unset, or >= 0 if
    a default height is set
 
-GtkWindow::allow_grow, GtkWindow::resizable:
- - equivalent properties; changing one notifies on the other
+GtkWindow::resizable:
  - if FALSE, we set the min size to the max size in the geometry 
    hints. 
  - If the app programmer has called gtk_window_set_geometry_hints()
diff --git a/docs/tutorial/gtk-tut.sgml b/docs/tutorial/gtk-tut.sgml
index 24861b4..734fe2e 100755
--- a/docs/tutorial/gtk-tut.sgml
+++ b/docs/tutorial/gtk-tut.sgml
@@ -7599,7 +7599,6 @@ int main (int argc, char *argv[])
   dialog = gtk_dialog_new ();
   gtk_window_set_title (GTK_WINDOW (dialog), "GTKToolbar Tutorial");
   gtk_widget_set_size_request (GTK_WIDGET (dialog), 600, 300);
-  GTK_WINDOW (dialog)->allow_shrink = TRUE;
 
   /* typically we quit if someone tries to close us */
   g_signal_connect (dialog, "delete-event",
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index 94f9e61..5378217 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -1968,6 +1968,7 @@ gtk_false G_GNUC_CONST
 gtk_true G_GNUC_CONST
 gtk_events_pending
 gtk_disable_setlocale
+gtk_distribute_natural_allocation
 gtk_set_locale
 gtk_check_version
 gtk_get_default_language
diff --git a/gtk/gtkwindow-decorate.c b/gtk/gtkwindow-decorate.c
index e291360..010b76e 100644
--- a/gtk/gtkwindow-decorate.c
+++ b/gtk/gtkwindow-decorate.c
@@ -717,7 +717,7 @@ gtk_decorated_window_recalculate_regions (GtkWindow *window)
   n_regions += 2; /* close, Title */
   if (deco->maximizable)
     n_regions += 1;
-  if (window->allow_shrink || window->allow_grow)
+  if (gtk_window_get_resizable (window))
     n_regions += 2;
 
   if (deco->n_regions != n_regions)
@@ -759,7 +759,7 @@ gtk_decorated_window_recalculate_regions (GtkWindow *window)
   region->type = GTK_WINDOW_REGION_TITLE;
   region++;
   
-  if (window->allow_shrink || window->allow_grow)
+  if (gtk_window_get_resizable (window))
     {
       region->rect.x = width - (DECORATION_BORDER_RIGHT + 10);
       region->rect.y = height - DECORATION_BORDER_BOTTOM;
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 02adf0a..f2230c9 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -7331,10 +7331,6 @@ gtk_window_get_resizable (GtkWindow *window)
 {
   g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
 
-  /* allow_grow is most likely to indicate the semantic concept we
-   * mean by "resizable" (and will be a reliable indicator if
-   * set_policy() hasn't been called)
-   */
   return window->resizable;
 }
 
diff --git a/tests/simple.c b/tests/simple.c
index 19a19aa..9a017d2 100644
--- a/tests/simple.c
+++ b/tests/simple.c
@@ -41,8 +41,7 @@ main (int argc, char *argv[])
 					     "user_data", NULL,
 					     "type", GTK_WINDOW_TOPLEVEL,
 					     "title", "hello world",
-					     "allow_grow", FALSE,
-					     "allow_shrink", FALSE,
+					     "resizable", FALSE,
 					     "border_width", 10,
 					     NULL),
 			     "signal::destroy", gtk_main_quit, NULL,
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 977164d..b727eca 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -3375,8 +3375,7 @@ create_tooltips (GtkWidget *widget)
 			"GtkWindow::type", GTK_WINDOW_TOPLEVEL,
 			"GtkContainer::border_width", 0,
 			"GtkWindow::title", "Tooltips",
-			"GtkWindow::allow_shrink", TRUE,
-			"GtkWindow::allow_grow", FALSE,
+			"GtkWindow::resizable", FALSE,
 			NULL);
 
       gtk_window_set_screen (GTK_WINDOW (window),
@@ -3495,8 +3494,8 @@ create_image (GtkWidget *widget)
       /* this is bogus for testing drawing when allocation < request,
        * don't copy into real code
        */
-      g_object_set (window, "allow_shrink", TRUE, "allow_grow", TRUE, NULL);
-      
+      gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
+
       g_signal_connect (window, "destroy",
 			G_CALLBACK (gtk_widget_destroyed),
 			&window);
@@ -6573,7 +6572,7 @@ create_rulers (GtkWidget *widget)
       gtk_window_set_screen (GTK_WINDOW (window),
 			     gtk_widget_get_screen (widget));
 
-      g_object_set (window, "allow_shrink", TRUE, "allow_grow", TRUE, NULL);
+      gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
 
       g_signal_connect (window, "destroy",
 			G_CALLBACK (gtk_widget_destroyed),
@@ -8331,22 +8330,11 @@ set_geometry_callback (GtkWidget *entry,
 }
 
 static void
-allow_shrink_callback (GtkWidget *widget,
-                       gpointer   data)
-{
-  g_object_set (g_object_get_data (data, "target"),
-                "allow_shrink",
-                GTK_TOGGLE_BUTTON (widget)->active,
-                NULL);
-}
-
-static void
-allow_grow_callback (GtkWidget *widget,
+resizable_callback (GtkWidget *widget,
                      gpointer   data)
 {
   g_object_set (g_object_get_data (data, "target"),
-                "allow_grow",
-                GTK_TOGGLE_BUTTON (widget)->active,
+                "resizable", GTK_TOGGLE_BUTTON (widget)->active,
                 NULL);
 }
 
@@ -8719,20 +8707,12 @@ window_controls (GtkWidget *window)
 		    G_CALLBACK (move_to_position_callback),
 		    control_window);
   gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0);
-  
-  button = gtk_check_button_new_with_label ("Allow shrink");
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), FALSE);
-  g_signal_connect (button,
-		    "toggled",
-		    G_CALLBACK (allow_shrink_callback),
-		    control_window);
-  gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0);
 
-  button = gtk_check_button_new_with_label ("Allow grow");
+  button = gtk_check_button_new_with_label ("Allow resize");
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
   g_signal_connect (button,
 		    "toggled",
-		    G_CALLBACK (allow_grow_callback),
+		    G_CALLBACK (resizable_callback),
                     control_window);
   gtk_box_pack_end (GTK_BOX (vbox), button, FALSE, FALSE, 0);
   
diff --git a/tests/testmultiscreen.c b/tests/testmultiscreen.c
index ebf1438..e47c60f 100644
--- a/tests/testmultiscreen.c
+++ b/tests/testmultiscreen.c
@@ -116,8 +116,7 @@ main (int argc, char *argv[])
 				  "user_data", NULL,
 				  "type", GTK_WINDOW_TOPLEVEL,
 				  "title", label,
-				  "allow_grow", FALSE,
-				  "allow_shrink", FALSE,
+                                  "resizable", FALSE,
 				  "border_width", 10, NULL,
 				  NULL);
       g_signal_connect (window[i], "destroy",
diff --git a/tests/testrgb.c b/tests/testrgb.c
index b050183..ebea6c7 100644
--- a/tests/testrgb.c
+++ b/tests/testrgb.c
@@ -286,7 +286,6 @@ new_testrgb_window (void)
 			   "GtkObject::user_data", NULL,
 			   "GtkWindow::type", GTK_WINDOW_TOPLEVEL,
 			   "GtkWindow::title", "testrgb",
-			   "GtkWindow::allow_shrink", FALSE,
 			   NULL);
   g_signal_connect (window, "destroy",
 		    G_CALLBACK (quit_func), NULL);



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