Commit 3ccc6170 authored by Javier Jardón's avatar Javier Jardón

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 1a03a65e

Reported by Benjamin Otte
parent 4198dd85
......@@ -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);
......
......@@ -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()
......
......@@ -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",
......
......@@ -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
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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,
......
......@@ -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);
......
......@@ -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",
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment