From 72c3318a6f0e83530c9ce9e8275f724b541edd87 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Tue, 12 Jan 2016 03:25:58 +0100 Subject: [PATCH] Restore support for Gtk+ 2 --- src/applets/pager.c | 5 +++++ src/applets/tasks.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/src/applets/pager.c b/src/applets/pager.c index a1878ab..a99cc9c 100644 --- a/src/applets/pager.c +++ b/src/applets/pager.c @@ -119,8 +119,13 @@ static Pager * _pager_init(PanelAppletHelper * helper, GtkWidget ** widget) } pager->helper = helper; orientation = panel_window_get_orientation(helper->window); +#if GTK_CHECK_VERSION(3, 0, 0) pager->box = gtk_box_new(orientation, 0); gtk_box_set_homogeneous(GTK_BOX(pager->box), TRUE); +#else + pager->box = (orientation == GTK_ORIENTATION_VERTICAL) + ? gtk_vbox_new(TRUE, 0) : gtk_hbox_new(TRUE, 0); +#endif pager->source = g_signal_connect(pager->box, "screen-changed", G_CALLBACK(_pager_on_screen_changed), pager); pager->widgets = NULL; diff --git a/src/applets/tasks.c b/src/applets/tasks.c index 6cc0291..8a67d0d 100644 --- a/src/applets/tasks.c +++ b/src/applets/tasks.c @@ -190,7 +190,11 @@ static Task * _task_new(Tasks * tasks, gboolean label, gboolean reorder, task->image = gtk_image_new(); task->delete = FALSE; task->reorder = reorder; +#if GTK_CHECK_VERSION(3, 0, 0) hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); +#else + hbox = gtk_hbox_new(FALSE, 0); +#endif gtk_box_pack_start(GTK_BOX(hbox), task->image, FALSE, TRUE, 0); if(label) { @@ -312,7 +316,11 @@ static Tasks * _tasks_init(PanelAppletHelper * helper, GtkWidget ** widget) #else tasks->embedded = FALSE; #endif +#if GTK_CHECK_VERSION(3, 0, 0) tasks->hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); +#else + tasks->hbox = gtk_hbox_new(FALSE, 0); +#endif gtk_box_set_homogeneous(GTK_BOX(tasks->hbox), TRUE); tasks->source = g_signal_connect(tasks->hbox, "screen-changed", G_CALLBACK(_task_on_screen_changed), tasks);