menuitem: Deprecate gtk_menu_item_set_right_justified()

And the getter, too: gtk_menu_item_get_right_justified() and the
corresponding property. Also make the only caller use the private
structure (as it did before the recent patches).
This commit is contained in:
Benjamin Otte 2011-05-02 16:49:03 +02:00
parent e8c6dbfab1
commit 87ecd9ad59
3 changed files with 16 additions and 3 deletions

View File

@ -564,7 +564,7 @@ gtk_menu_bar_size_allocate (GtkWidget *widget,
remaining_space.width -= request->minimum_size;
if (i + 1 == requested_sizes->len && GTK_IS_MENU_ITEM (request->data) &&
gtk_menu_item_get_right_justified (request->data))
GTK_MENU_ITEM (request->data)->priv->right_justify)
ltr = !ltr;
if (ltr)
@ -618,7 +618,7 @@ gtk_menu_bar_size_allocate (GtkWidget *widget,
remaining_space.height -= request->minimum_size;
if (i + 1 == requested_sizes->len && GTK_IS_MENU_ITEM (request->data) &&
gtk_menu_item_get_right_justified (request->data))
GTK_MENU_ITEM (request->data)->priv->right_justify)
ttb = !ttb;
if (ttb)

View File

@ -189,6 +189,12 @@ static void gtk_menu_item_set_related_action (GtkMenuItem *menu
static void gtk_menu_item_set_use_action_appearance (GtkMenuItem *menu_item,
gboolean use_appearance);
/* Declare deprecated function that need a declaration */
#ifdef GTK_DISABLE_DEPRECATED
void gtk_menu_item_set_right_justified (GtkMenuItem *menu_item,
gboolean right_justified);
gboolean gtk_menu_item_get_right_justified (GtkMenuItem *menu_item);
#endif /* GTK_DISABLE_DEPRECATED */
static guint menu_item_signals[LAST_SIGNAL] = { 0 };
@ -327,7 +333,7 @@ gtk_menu_item_class_init (GtkMenuItemClass *klass)
P_("Right Justified"),
P_("Sets whether the menu item appears justified at the right side of a menu bar"),
FALSE,
GTK_PARAM_READWRITE));
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
/**
* GtkMenuItem:submenu:
@ -2289,6 +2295,9 @@ gtk_menu_item_position_menu (GtkMenu *menu,
* menu items, but is now considered a bad idea. (If the widget
* layout is reversed for a right-to-left language like Hebrew
* or Arabic, right-justified-menu-items appear at the left.)
*
* Deprecated: 3.2: If you insist on using it, use
* gtk_widget_set_hexpand() and gtk_widget_set_halign().
**/
void
gtk_menu_item_set_right_justified (GtkMenuItem *menu_item,
@ -2316,6 +2325,8 @@ gtk_menu_item_set_right_justified (GtkMenuItem *menu_item,
*
* Return value: %TRUE if the menu item will appear at the
* far right if added to a menu bar.
*
* Deprecated: 3.2: See gtk_menu_item_set_right_justified()
**/
gboolean
gtk_menu_item_get_right_justified (GtkMenuItem *menu_item)

View File

@ -104,9 +104,11 @@ void gtk_menu_item_toggle_size_request (GtkMenuItem *menu_item,
gint *requisition);
void gtk_menu_item_toggle_size_allocate (GtkMenuItem *menu_item,
gint allocation);
#ifndef GTK_DISABLE_DEPRECATED
void gtk_menu_item_set_right_justified (GtkMenuItem *menu_item,
gboolean right_justified);
gboolean gtk_menu_item_get_right_justified (GtkMenuItem *menu_item);
#endif /* GTK_DISABLE_DEPRECATED */
void gtk_menu_item_set_accel_path (GtkMenuItem *menu_item,
const gchar *accel_path);
G_CONST_RETURN gchar* gtk_menu_item_get_accel_path (GtkMenuItem *menu_item);