diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2015-11-08 17:10:00 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2015-11-10 13:23:18 +0000 |
commit | 6f6e5365432050cde71550a09e3cce0f6a55c1d5 (patch) | |
tree | 30f34ce48086f07790d97f32413567964ee484a2 /gtk/gtktooltipwindow.c | |
parent | a846fd586db4256b748edcae149bf55fc2d9fbd2 (diff) | |
download | gtk+-6f6e5365432050cde71550a09e3cce0f6a55c1d5.tar.gz |
Use CSS node name for GtkTooltipWindow
Instead of a style class.
Diffstat (limited to 'gtk/gtktooltipwindow.c')
-rw-r--r-- | gtk/gtktooltipwindow.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gtk/gtktooltipwindow.c b/gtk/gtktooltipwindow.c index e0f8e9db16..ba71113c2a 100644 --- a/gtk/gtktooltipwindow.c +++ b/gtk/gtktooltipwindow.c @@ -27,6 +27,7 @@ #include "gtktooltipwindowprivate.h" #include "gtkprivate.h" +#include "gtkintl.h" #include "gtkaccessible.h" #include "gtkbox.h" @@ -35,8 +36,10 @@ #include "gtkmain.h" #include "gtksettings.h" #include "gtksizerequest.h" -#include "gtkstylecontext.h" #include "gtkwindowprivate.h" +#include "gtkwidgetprivate.h" + +#define MAX_TOOLTIP_LINE_WIDTH 70 struct _GtkTooltipWindow { @@ -60,6 +63,7 @@ gtk_tooltip_window_class_init (GtkTooltipWindowClass *klass) { GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + gtk_widget_class_set_css_name (widget_class, I_("tooltip")); gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_TOOL_TIP); } @@ -67,7 +71,6 @@ static void gtk_tooltip_window_init (GtkTooltipWindow *self) { GtkWindow *window = GTK_WINDOW (self); - GtkStyleContext *context; gtk_window_set_type_hint (window, GDK_WINDOW_TYPE_HINT_TOOLTIP); gtk_window_set_resizable (window, FALSE); @@ -75,9 +78,6 @@ gtk_tooltip_window_init (GtkTooltipWindow *self) _gtk_window_request_csd (window); - context = gtk_widget_get_style_context (GTK_WIDGET (self)); - gtk_style_context_add_class (context, GTK_STYLE_CLASS_TOOLTIP); - /* FIXME: don't hardcode the padding */ self->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); gtk_widget_set_margin_start (self->box, 6); @@ -92,7 +92,7 @@ gtk_tooltip_window_init (GtkTooltipWindow *self) self->label = gtk_label_new (""); gtk_label_set_line_wrap (GTK_LABEL (self->label), TRUE); - gtk_label_set_max_width_chars (GTK_LABEL (self->label), 70); + gtk_label_set_max_width_chars (GTK_LABEL (self->label), MAX_TOOLTIP_LINE_WIDTH); gtk_box_pack_start (GTK_BOX (self->box), self->label, FALSE, FALSE, 0); } |