forked from AuroraMiddleware/gtk
GtkHeaderBar: Use defines for style classes
This commit is contained in:
parent
8328cfac92
commit
9d527c83aa
@ -151,7 +151,7 @@ init_sizing_box (GtkHeaderBar *bar)
|
||||
w = gtk_label_new (NULL);
|
||||
gtk_widget_show (w);
|
||||
context = gtk_widget_get_style_context (w);
|
||||
gtk_style_context_add_class (context, "title");
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_TITLE);
|
||||
gtk_box_pack_start (GTK_BOX (priv->label_sizing_box), w, FALSE, FALSE, 0);
|
||||
gtk_label_set_line_wrap (GTK_LABEL (w), FALSE);
|
||||
gtk_label_set_single_line_mode (GTK_LABEL (w), TRUE);
|
||||
@ -160,8 +160,7 @@ init_sizing_box (GtkHeaderBar *bar)
|
||||
|
||||
w = gtk_label_new (NULL);
|
||||
context = gtk_widget_get_style_context (w);
|
||||
gtk_style_context_add_class (context, "subtitle");
|
||||
gtk_style_context_add_class (context, "dim-label");
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SUBTITLE);
|
||||
gtk_box_pack_start (GTK_BOX (priv->label_sizing_box), w, FALSE, FALSE, 0);
|
||||
gtk_label_set_line_wrap (GTK_LABEL (w), FALSE);
|
||||
gtk_label_set_single_line_mode (GTK_LABEL (w), TRUE);
|
||||
@ -187,7 +186,7 @@ create_title_box (const char *title,
|
||||
|
||||
title_label = gtk_label_new (title);
|
||||
context = gtk_widget_get_style_context (title_label);
|
||||
gtk_style_context_add_class (context, "title");
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_TITLE);
|
||||
gtk_label_set_line_wrap (GTK_LABEL (title_label), FALSE);
|
||||
gtk_label_set_single_line_mode (GTK_LABEL (title_label), TRUE);
|
||||
gtk_label_set_ellipsize (GTK_LABEL (title_label), PANGO_ELLIPSIZE_END);
|
||||
@ -197,8 +196,7 @@ create_title_box (const char *title,
|
||||
|
||||
subtitle_label = gtk_label_new (subtitle);
|
||||
context = gtk_widget_get_style_context (subtitle_label);
|
||||
gtk_style_context_add_class (context, "subtitle");
|
||||
gtk_style_context_add_class (context, "dim-label");
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SUBTITLE);
|
||||
gtk_label_set_line_wrap (GTK_LABEL (subtitle_label), FALSE);
|
||||
gtk_label_set_single_line_mode (GTK_LABEL (subtitle_label), TRUE);
|
||||
gtk_label_set_ellipsize (GTK_LABEL (subtitle_label), PANGO_ELLIPSIZE_END);
|
||||
@ -464,9 +462,9 @@ _gtk_header_bar_update_window_buttons (GtkHeaderBar *bar)
|
||||
|
||||
if ((direction == GTK_TEXT_DIR_LTR && i == 0) ||
|
||||
(direction == GTK_TEXT_DIR_RTL && i == 1))
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (box), "left");
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (box), GTK_STYLE_CLASS_LEFT);
|
||||
else
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (box), "right");
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (box), GTK_STYLE_CLASS_RIGHT);
|
||||
|
||||
if (i == 0)
|
||||
priv->titlebar_start_box = box;
|
||||
|
Loading…
Reference in New Issue
Block a user