Commit missing file gtk3-compat.c
The file was intended to be part of 52de7471
.
This commit is contained in:
parent
3b2d95c0e4
commit
7cb16405f8
1 changed files with 40 additions and 0 deletions
40
katze/gtk3-compat.c
Normal file
40
katze/gtk3-compat.c
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
#include "katze/gtk3-compat.h"
|
||||||
|
|
||||||
|
#if !GTK_CHECK_VERSION (2, 12, 0)
|
||||||
|
|
||||||
|
void
|
||||||
|
gtk_widget_set_has_tooltip (GtkWidget* widget,
|
||||||
|
gboolean has_tooltip)
|
||||||
|
{
|
||||||
|
/* Do nothing */
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gtk_widget_set_tooltip_text (GtkWidget* widget,
|
||||||
|
const gchar* text)
|
||||||
|
{
|
||||||
|
if (text && *text)
|
||||||
|
{
|
||||||
|
static GtkTooltips* tooltips = NULL;
|
||||||
|
if (G_UNLIKELY (!tooltips))
|
||||||
|
tooltips = gtk_tooltips_new ();
|
||||||
|
gtk_tooltips_set_tip (tooltips, widget, text, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gtk_tool_item_set_tooltip_text (GtkToolItem* toolitem,
|
||||||
|
const gchar* text)
|
||||||
|
{
|
||||||
|
if (text && *text)
|
||||||
|
{
|
||||||
|
static GtkTooltips* tooltips = NULL;
|
||||||
|
if (G_UNLIKELY (!tooltips))
|
||||||
|
tooltips = gtk_tooltips_new ();
|
||||||
|
|
||||||
|
gtk_tool_item_set_tooltip (toolitem, tooltips, text, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue