[glade3/glade-3-8] * gladeui/glade-palette.c: Add a label in a box to the palette items to avoid the evil ellipsiza
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade3/glade-3-8] * gladeui/glade-palette.c: Add a label in a box to the palette items to avoid the evil ellipsiza
- Date: Wed, 15 Dec 2010 18:13:17 +0000 (UTC)
commit 7b25280b75902b82de768ef48170ed32010da10f
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Thu Dec 16 03:18:55 2010 +0900
* gladeui/glade-palette.c: Add a label in a box to the palette items to avoid
the evil ellipsization.
ChangeLog | 3 +++
gladeui/glade-palette.c | 15 ++++++++++++---
2 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a687069..5636e60 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,9 @@
* plugins/gtk+/gtk+.xml.in: Ignore "resize-mode" property incase of crashes
(as reported in bug 622996).
+ * gladeui/glade-palette.c: Add a label in a box to the palette items to avoid
+ the evil ellipsization.
+
2010-12-14 Tristan Van Berkom <tristanvb openismus com>
* Reverted 3.0 commit, now targetting this branch to the final GTK+ 2.x chapter
diff --git a/gladeui/glade-palette.c b/gladeui/glade-palette.c
index 805f9ce..a5288ed 100644
--- a/gladeui/glade-palette.c
+++ b/gladeui/glade-palette.c
@@ -562,15 +562,22 @@ glade_palette_item_button_press (GtkWidget *button,
static GtkWidget*
glade_palette_new_item (GladePalette *palette, GladeWidgetAdaptor *adaptor)
{
- GtkWidget *item, *button;
+ GtkWidget *item, *button, *label, *box;
item = (GtkWidget *)gtk_toggle_tool_button_new ();
g_object_set_data (G_OBJECT (item), "glade-widget-adaptor", adaptor);
button = gtk_bin_get_child (GTK_BIN (item));
g_assert (GTK_IS_BUTTON (button));
-
- gtk_tool_button_set_label (GTK_TOOL_BUTTON (item), adaptor->title);
+
+ /* Add a box to avoid the ellipsize on the items */
+ box = gtk_hbox_new (FALSE, 0);
+ label = gtk_label_new (adaptor->title);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_widget_show (label);
+ gtk_widget_show (box);
+ gtk_container_add (GTK_CONTAINER (box), label);
+ gtk_tool_button_set_label_widget (GTK_TOOL_BUTTON (item), box);
glade_palette_item_refresh (item);
/* Update selection when the item is pushed */
@@ -760,6 +767,8 @@ glade_palette_init (GladePalette *palette)
gtk_widget_show (sw);
gtk_widget_show (priv->toolpalette);
+
+ glade_palette_update_appearance (palette);
gtk_widget_set_no_show_all (GTK_WIDGET (palette), TRUE);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]