Remove GtkWindow:allow-grow and GtkWindow::allow_shrink deprecated properties

This commit is contained in:
Javier Jardón 2010-07-01 05:17:15 +02:00
parent 1f38a7ac10
commit 1a03a65e36
2 changed files with 12 additions and 75 deletions

View File

@ -573,38 +573,6 @@ gtk_window_class_init (GtkWindowClass *klass)
NULL, NULL,
GTK_PARAM_WRITABLE)); GTK_PARAM_WRITABLE));
/**
* GtkWindow:allow-shrink:
*
* If %TRUE, the window has no mimimum size. Setting this to %TRUE is
* 99% of the time a bad idea.
*
* Deprecated: 2.22: Use GtkWindow:resizable property instead.
*/
g_object_class_install_property (gobject_class,
PROP_ALLOW_SHRINK,
g_param_spec_boolean ("allow-shrink",
P_("Allow Shrink"),
/* xgettext:no-c-format */
P_("If TRUE, the window has no mimimum size. Setting this to TRUE is 99% of the time a bad idea"),
FALSE,
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
/**
* GtkWindow:allow-grow:
*
* If %TRUE, users can expand the window beyond its minimum size.
*
* Deprecated: 2.22: Use GtkWindow:resizable property instead.
*/
g_object_class_install_property (gobject_class,
PROP_ALLOW_GROW,
g_param_spec_boolean ("allow-grow",
P_("Allow Grow"),
P_("If TRUE, users can expand the window beyond its minimum size"),
TRUE,
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class,
PROP_RESIZABLE, PROP_RESIZABLE,
g_param_spec_boolean ("resizable", g_param_spec_boolean ("resizable",
@ -985,8 +953,7 @@ gtk_window_init (GtkWindow *window)
window->focus_widget = NULL; window->focus_widget = NULL;
window->default_widget = NULL; window->default_widget = NULL;
window->configure_request_count = 0; window->configure_request_count = 0;
window->allow_shrink = FALSE; window->resizable = TRUE;
window->allow_grow = TRUE;
window->configure_notify_received = FALSE; window->configure_notify_received = FALSE;
window->position = GTK_WIN_POS_NONE; window->position = GTK_WIN_POS_NONE;
window->need_default_size = TRUE; window->need_default_size = TRUE;
@ -1053,19 +1020,9 @@ gtk_window_set_property (GObject *object,
case PROP_STARTUP_ID: case PROP_STARTUP_ID:
gtk_window_set_startup_id (window, g_value_get_string (value)); gtk_window_set_startup_id (window, g_value_get_string (value));
break; break;
case PROP_ALLOW_SHRINK:
window->allow_shrink = g_value_get_boolean (value);
gtk_widget_queue_resize (GTK_WIDGET (window));
break;
case PROP_ALLOW_GROW:
window->allow_grow = g_value_get_boolean (value);
gtk_widget_queue_resize (GTK_WIDGET (window));
g_object_notify (G_OBJECT (window), "resizable");
break;
case PROP_RESIZABLE: case PROP_RESIZABLE:
window->allow_grow = g_value_get_boolean (value); window->resizable = g_value_get_boolean (value);
gtk_widget_queue_resize (GTK_WIDGET (window)); gtk_widget_queue_resize (GTK_WIDGET (window));
g_object_notify (G_OBJECT (window), "allow-grow");
break; break;
case PROP_MODAL: case PROP_MODAL:
gtk_window_set_modal (window, g_value_get_boolean (value)); gtk_window_set_modal (window, g_value_get_boolean (value));
@ -1168,14 +1125,8 @@ gtk_window_get_property (GObject *object,
case PROP_TITLE: case PROP_TITLE:
g_value_set_string (value, window->title); g_value_set_string (value, window->title);
break; break;
case PROP_ALLOW_SHRINK:
g_value_set_boolean (value, window->allow_shrink);
break;
case PROP_ALLOW_GROW:
g_value_set_boolean (value, window->allow_grow);
break;
case PROP_RESIZABLE: case PROP_RESIZABLE:
g_value_set_boolean (value, window->allow_grow); g_value_set_boolean (value, window->resizable);
break; break;
case PROP_MODAL: case PROP_MODAL:
g_value_set_boolean (value, window->modal); g_value_set_boolean (value, window->modal);
@ -1777,24 +1728,6 @@ gtk_window_get_default_widget (GtkWindow *window)
return window->default_widget; return window->default_widget;
} }
static void
gtk_window_set_policy_internal (GtkWindow *window,
gboolean allow_shrink,
gboolean allow_grow,
gboolean auto_shrink)
{
window->allow_shrink = (allow_shrink != FALSE);
window->allow_grow = (allow_grow != FALSE);
g_object_freeze_notify (G_OBJECT (window));
g_object_notify (G_OBJECT (window), "allow-shrink");
g_object_notify (G_OBJECT (window), "allow-grow");
g_object_notify (G_OBJECT (window), "resizable");
g_object_thaw_notify (G_OBJECT (window));
gtk_widget_queue_resize_no_redraw (GTK_WIDGET (window));
}
static gboolean static gboolean
handle_keys_changed (gpointer data) handle_keys_changed (gpointer data)
{ {
@ -6701,7 +6634,7 @@ gtk_window_compute_hints (GtkWindow *window,
else else
new_geometry->min_height += extra_height; new_geometry->min_height += extra_height;
} }
else if (!window->allow_shrink) else
{ {
*new_flags |= GDK_HINT_MIN_SIZE; *new_flags |= GDK_HINT_MIN_SIZE;
@ -6721,7 +6654,7 @@ gtk_window_compute_hints (GtkWindow *window,
else else
new_geometry->max_height += extra_height; new_geometry->max_height += extra_height;
} }
else if (!window->allow_grow) else if (!window->resizable)
{ {
*new_flags |= GDK_HINT_MAX_SIZE; *new_flags |= GDK_HINT_MAX_SIZE;
@ -7364,7 +7297,11 @@ gtk_window_set_resizable (GtkWindow *window,
{ {
g_return_if_fail (GTK_IS_WINDOW (window)); g_return_if_fail (GTK_IS_WINDOW (window));
gtk_window_set_policy_internal (window, FALSE, resizable, FALSE); window->resizable = (resizable != FALSE);
g_object_notify (G_OBJECT (window), "resizable");
gtk_widget_queue_resize_no_redraw (GTK_WIDGET (window));
} }
/** /**
@ -7384,7 +7321,7 @@ gtk_window_get_resizable (GtkWindow *window)
* mean by "resizable" (and will be a reliable indicator if * mean by "resizable" (and will be a reliable indicator if
* set_policy() hasn't been called) * set_policy() hasn't been called)
*/ */
return window->allow_grow; return window->resizable;
} }
/** /**

View File

@ -71,7 +71,7 @@ struct _GtkWindow
guint16 GSEAL (configure_request_count); guint16 GSEAL (configure_request_count);
guint GSEAL (allow_shrink) : 1; guint GSEAL (allow_shrink) : 1;
guint GSEAL (allow_grow) : 1; guint GSEAL (resizable) : 1;
guint GSEAL (configure_notify_received) : 1; guint GSEAL (configure_notify_received) : 1;
/* The following flags are initially TRUE (before a window is mapped). /* The following flags are initially TRUE (before a window is mapped).
* They cause us to compute a configure request that involves * They cause us to compute a configure request that involves