mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 05:31:07 +00:00
Stop assuming that priv->label_widget will be a GtkLabel.
https://bugzilla.gnome.org/show_bug.cgi?id=623603
This commit is contained in:
parent
76267f9d06
commit
963e1ec033
@ -423,26 +423,29 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
|
||||
gtk_widget_show (label);
|
||||
}
|
||||
|
||||
gtk_label_set_ellipsize (GTK_LABEL (label),
|
||||
gtk_tool_item_get_ellipsize_mode (GTK_TOOL_ITEM (button)));
|
||||
text_orientation = gtk_tool_item_get_text_orientation (GTK_TOOL_ITEM (button));
|
||||
if (text_orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
{
|
||||
gtk_label_set_angle (GTK_LABEL (label), 0);
|
||||
gtk_misc_set_alignment (GTK_MISC (label),
|
||||
gtk_tool_item_get_text_alignment (GTK_TOOL_ITEM (button)),
|
||||
0.5);
|
||||
}
|
||||
else
|
||||
if (GTK_IS_LABEL (label))
|
||||
{
|
||||
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_NONE);
|
||||
if (gtk_widget_get_direction (GTK_WIDGET (tool_item)) == GTK_TEXT_DIR_RTL)
|
||||
gtk_label_set_angle (GTK_LABEL (label), -90);
|
||||
else
|
||||
gtk_label_set_angle (GTK_LABEL (label), 90);
|
||||
gtk_misc_set_alignment (GTK_MISC (label),
|
||||
0.5,
|
||||
1 - gtk_tool_item_get_text_alignment (GTK_TOOL_ITEM (button)));
|
||||
gtk_label_set_ellipsize (GTK_LABEL (label),
|
||||
gtk_tool_item_get_ellipsize_mode (GTK_TOOL_ITEM (button)));
|
||||
text_orientation = gtk_tool_item_get_text_orientation (GTK_TOOL_ITEM (button));
|
||||
if (text_orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
{
|
||||
gtk_label_set_angle (GTK_LABEL (label), 0);
|
||||
gtk_misc_set_alignment (GTK_MISC (label),
|
||||
gtk_tool_item_get_text_alignment (GTK_TOOL_ITEM (button)),
|
||||
0.5);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_NONE);
|
||||
if (gtk_widget_get_direction (GTK_WIDGET (tool_item)) == GTK_TEXT_DIR_RTL)
|
||||
gtk_label_set_angle (GTK_LABEL (label), -90);
|
||||
else
|
||||
gtk_label_set_angle (GTK_LABEL (label), 90);
|
||||
gtk_misc_set_alignment (GTK_MISC (label),
|
||||
0.5,
|
||||
1 - gtk_tool_item_get_text_alignment (GTK_TOOL_ITEM (button)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user