GtkButton: Deprecated setters and getters as well

gtk_button_set/get_alignment should be deprecated together
with the properties they are setters/getters for.
This commit is contained in:
Matthias Clasen 2014-05-13 22:19:30 -04:00
parent 38445e6326
commit f6af96723c
3 changed files with 14 additions and 2 deletions

View File

@ -802,10 +802,14 @@ gtk_button_set_property (GObject *object,
gtk_button_set_focus_on_click (button, g_value_get_boolean (value));
break;
case PROP_XALIGN:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_button_set_alignment (button, g_value_get_float (value), priv->yalign);
G_GNUC_END_IGNORE_DEPRECATIONS
break;
case PROP_YALIGN:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_button_set_alignment (button, priv->xalign, g_value_get_float (value));
G_GNUC_END_IGNORE_DEPRECATIONS
break;
case PROP_IMAGE_POSITION:
gtk_button_set_image_position (button, g_value_get_enum (value));
@ -2481,6 +2485,9 @@ gtk_button_get_focus_on_click (GtkButton *button)
* the child is a #GtkMisc or a #GtkAlignment.
*
* Since: 2.4
*
* Deprecated: 3.14: Access the child widget directly if you need to control
* its alignment.
*/
void
gtk_button_set_alignment (GtkButton *button,
@ -2514,6 +2521,9 @@ gtk_button_set_alignment (GtkButton *button,
* Gets the alignment of the child in the button.
*
* Since: 2.4
*
* Deprecated: 3.14: Access the child widget directly if you need to control
* its alignment.
*/
void
gtk_button_get_alignment (GtkButton *button,

View File

@ -139,11 +139,11 @@ void gtk_button_set_focus_on_click (GtkButton *button,
gboolean focus_on_click);
GDK_AVAILABLE_IN_ALL
gboolean gtk_button_get_focus_on_click (GtkButton *button);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
void gtk_button_set_alignment (GtkButton *button,
gfloat xalign,
gfloat yalign);
GDK_AVAILABLE_IN_ALL
GDK_DEPRECATED_IN_3_14
void gtk_button_get_alignment (GtkButton *button,
gfloat *xalign,
gfloat *yalign);

View File

@ -130,10 +130,12 @@ draw_indicator_changed (GObject *object,
{
GtkButton *button = GTK_BUTTON (object);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (gtk_toggle_button_get_mode (GTK_TOGGLE_BUTTON (button)))
gtk_button_set_alignment (button, 0.0, 0.5);
else
gtk_button_set_alignment (button, 0.5, 0.5);
G_GNUC_END_IGNORE_DEPRECATIONS
}
static void