Commit efc8dc63 authored by Matthias Clasen's avatar Matthias Clasen

tooltip: Use an element name

This will allow us to drop hardcoded type names in the theme.
parent 1760ada1
......@@ -36,6 +36,8 @@
#include "gtkstylecontext.h"
#include "gtkwindowprivate.h"
#include "gtkaccessible.h"
#include "gtkcssnodeprivate.h"
#include "gtkwidgetprivate.h"
......@@ -57,7 +59,7 @@
* When you need a tooltip with a little more fancy contents, like adding an
* image, or you want the tooltip to have different contents per #GtkTreeView
* row or cell, you will have to do a little more work:
* - Set the #GtkWidget:has-tooltip property to %TRUE, this will make GTK+
* monitor the widget for motion and related events which are needed to
* determine when and where to show a tooltip.
......@@ -76,7 +78,7 @@
* In the probably rare case where you want to have even more control over the
* tooltip that is about to be shown, you can set your own #GtkWindow which
* will be used as tooltip window. This works as follows:
* - Set #GtkWidget:has-tooltip and connect to #GtkWidget::query-tooltip as before.
* Use gtk_widget_set_tooltip_window() to set a #GtkWindow created by you as
* tooltip window.
......@@ -85,6 +87,10 @@
* gtk_widget_get_tooltip_window() and manipulate as you wish. The semantics of
* the return value are exactly as before, return %TRUE to show the window,
* %FALSE to not show it.
* # CSS nodes
* The toplevel used for tooltips has a single CSS node with name tooltip.
......@@ -169,12 +175,12 @@ gtk_tooltip_class_init (GtkTooltipClass *klass)
static void
gtk_tooltip_init (GtkTooltip *tooltip)
GtkStyleContext *context;
GtkWidget *window;
GtkWidget *box;
GtkWidget *image;
GtkWidget *label;
AtkObject *atk_obj;
GtkCssNode *cssnode;
tooltip->timeout_id = 0;
tooltip->browse_mode_timeout_id = 0;
......@@ -197,8 +203,8 @@ gtk_tooltip_init (GtkTooltip *tooltip)
G_CALLBACK (gtk_tooltip_window_hide), tooltip);
_gtk_window_request_csd (GTK_WINDOW (window));
context = gtk_widget_get_style_context (window);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_TOOLTIP);
cssnode = gtk_widget_get_css_node (window);
gtk_css_node_set_name (cssnode, I_("tooltip"));
atk_obj = gtk_widget_get_accessible (window);
if (GTK_IS_ACCESSIBLE (atk_obj))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment