mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix Tab Labels
The tab labels do not keep to the width specified in the preferences, use set_width_chars instead of set_max_width_chars.
This commit is contained in:
parent
78f28887a6
commit
4de57ba982
@ -2853,7 +2853,7 @@ gnc_main_window_open_page (GncMainWindow *window,
|
|||||||
GncMainWindowPrivate *priv;
|
GncMainWindowPrivate *priv;
|
||||||
GtkWidget *tab_hbox;
|
GtkWidget *tab_hbox;
|
||||||
GtkWidget *label, *entry;
|
GtkWidget *label, *entry;
|
||||||
const gchar *icon, *text, *color_string;
|
const gchar *icon, *text, *color_string, *lab_text;
|
||||||
GtkWidget *image;
|
GtkWidget *image;
|
||||||
GList *tmp;
|
GList *tmp;
|
||||||
gint width;
|
gint width;
|
||||||
@ -2903,11 +2903,17 @@ gnc_main_window_open_page (GncMainWindow *window,
|
|||||||
*/
|
*/
|
||||||
width = gnc_prefs_get_float(GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_WIDTH);
|
width = gnc_prefs_get_float(GNC_PREFS_GROUP_GENERAL, GNC_PREF_TAB_WIDTH);
|
||||||
icon = GNC_PLUGIN_PAGE_GET_CLASS(page)->tab_icon;
|
icon = GNC_PLUGIN_PAGE_GET_CLASS(page)->tab_icon;
|
||||||
label = gtk_label_new (gnc_plugin_page_get_page_name(page));
|
lab_text = gnc_plugin_page_get_page_name(page);
|
||||||
|
label = gtk_label_new (lab_text);
|
||||||
|
|
||||||
if (width != 0)
|
if (width != 0)
|
||||||
{
|
{
|
||||||
|
if (g_utf8_strlen (lab_text, -1) < width)
|
||||||
|
gtk_label_set_width_chars (GTK_LABEL(label), strlen (lab_text));
|
||||||
|
else
|
||||||
|
gtk_label_set_width_chars (GTK_LABEL(label), width);
|
||||||
|
|
||||||
gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_MIDDLE);
|
gtk_label_set_ellipsize(GTK_LABEL(label), PANGO_ELLIPSIZE_MIDDLE);
|
||||||
gtk_label_set_max_width_chars(GTK_LABEL(label), width);
|
|
||||||
}
|
}
|
||||||
gtk_widget_show (label);
|
gtk_widget_show (label);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user