aboutsummaryrefslogtreecommitdiff
path: root/mate-applet
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2016-08-06 20:03:11 +0200
committerJavier <dev.git@javispedro.com>2016-08-06 20:03:11 +0200
commit8e366dc6d198d4942a036f42df5074f97a6d206b (patch)
treeb088bf331799218615d94b4b8138e7ef4f123e69 /mate-applet
parent7173bc9994c591eeae092446c83e428d9f554767 (diff)
downloadtopmenu-gtk-8e366dc6d198d4942a036f42df5074f97a6d206b.tar.gz
topmenu-gtk-8e366dc6d198d4942a036f42df5074f97a6d206b.zip
build mate panel applet with gtk3 too
Diffstat (limited to 'mate-applet')
-rw-r--r--mate-applet/topmenu-mate-panel-applet.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/mate-applet/topmenu-mate-panel-applet.c b/mate-applet/topmenu-mate-panel-applet.c
index eb133bb..fbbad59 100644
--- a/mate-applet/topmenu-mate-panel-applet.c
+++ b/mate-applet/topmenu-mate-panel-applet.c
@@ -60,6 +60,23 @@ static void topmenu_mate_panel_applet_size_allocate(GtkWidget *widget, GtkAlloca
GTK_WIDGET_CLASS(topmenu_mate_panel_applet_parent_class)->size_allocate(widget, allocation);
}
+#if GTK_MAJOR_VERSION == 3
+static void topmenu_mate_panel_get_preferred_width(GtkWidget *widget, gint *minimal_width, gint *natural_width)
+{
+ TopMenuMatePanelApplet *self = TOPMENU_MATE_PANEL_APPLET(widget);
+ if (self->menu_widget) {
+ gtk_widget_get_preferred_width(GTK_WIDGET(self->menu_widget), minimal_width, natural_width);
+ }
+}
+
+static void topmenu_mate_panel_get_preferred_height(GtkWidget *widget, gint *minimal_height, gint *natural_height)
+{
+ TopMenuMatePanelApplet *self = TOPMENU_MATE_PANEL_APPLET(widget);
+ if (self->menu_widget) {
+ gtk_widget_get_preferred_height(GTK_WIDGET(self->menu_widget), minimal_height, natural_height);
+ }
+}
+#elif GTK_MAJOR_VERSION == 2
static void topmenu_mate_panel_applet_size_request(GtkWidget *widget, GtkRequisition *requisition)
{
TopMenuMatePanelApplet *self = TOPMENU_MATE_PANEL_APPLET(widget);
@@ -67,12 +84,18 @@ static void topmenu_mate_panel_applet_size_request(GtkWidget *widget, GtkRequisi
gtk_widget_size_request(GTK_WIDGET(self->menu_widget), requisition);
}
}
+#endif
static void topmenu_mate_panel_applet_class_init(TopMenuMatePanelAppletClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
widget_class->size_allocate = topmenu_mate_panel_applet_size_allocate;
+#if GTK_MAJOR_VERSION == 3
+ widget_class->get_preferred_width = topmenu_mate_panel_get_preferred_width;
+ widget_class->get_preferred_height = topmenu_mate_panel_get_preferred_height;
+#elif GTK_MAJOR_VERSION == 2
widget_class->size_request = topmenu_mate_panel_applet_size_request;
+#endif
}
static void topmenu_mate_panel_applet_init(TopMenuMatePanelApplet *self)