Commit 6bd779d2 authored by Benoît Minisini's avatar Benoît Minisini

Make component compile with GTK+ < 3.20.

[GB.GTK3]
* BUG: Make component compile with GTK+ < 3.20.
parent 7b75f31e
......@@ -347,7 +347,7 @@ gButton::gButton(gContainer *par, Type typ) : gControl(par)
_no_background = true;
rendtxt = gtk_cell_renderer_text_new();
border = gtk_toggle_button_new();
gtk_button_set_focus_on_click(GTK_BUTTON(border), false);
gt_set_focus_on_click(border, false);
break;
default:
......
......@@ -440,13 +440,14 @@ void gTabStripPage::updateButton()
if (v && !_button)
{
_button = gtk_button_new();
#ifdef GTK3
gtk_widget_set_focus_on_click(_button, false);
gt_set_focus_on_click(_button, false);
#if GTK3
gtk_button_set_relief(GTK_BUTTON(_button), GTK_RELIEF_NONE);
#else
gtk_button_set_focus_on_click(GTK_BUTTON(_button), false);
g_signal_connect(G_OBJECT(_button), "expose-event", G_CALLBACK(cb_button_fix), (gpointer)this);
#endif
//g_signal_connect_after(G_OBJECT(_button), "expose-event", G_CALLBACK(cb_button_expose), (gpointer)parent);
ON_DRAW(_button, parent, cb_button_expose, cb_button_draw);
g_signal_connect(G_OBJECT(_button), "clicked", G_CALLBACK(cb_button_clicked), (gpointer)parent);
......
......@@ -217,4 +217,10 @@ void gt_widget_reparent(GtkWidget *widget, GtkWidget *new_parent);
#define gt_widget_reparent gtk_widget_reparent
#endif
#if GTK_CHECK_VERSION(3, 20, 0)
#define gt_set_focus_on_click(_widget, _flag) gtk_widget_set_focus_on_click(GTK_WIDGET(_widget), (_flag))
#else
#define gt_set_focus_on_click(_widget, _flag) gtk_button_set_focus_on_click(GTK_BUTTON(_widget), (_flag))
#endif
#endif
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