summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSorokin Alexei <[email protected]>2016-06-24 23:33:04 +0300
committerraveit65 <[email protected]>2016-06-29 18:42:12 +0200
commit882f8f4d9959b6b27f08d2ddb525c7347df1797c (patch)
treebadcf506263d22bd15f0c4a77c41b431e4e65f09
parent8acec6d1ae0e50f0eee68ce6153d04a3beb5d52a (diff)
downloadmate-panel-882f8f4d9959b6b27f08d2ddb525c7347df1797c.tar.bz2
mate-panel-882f8f4d9959b6b27f08d2ddb525c7347df1797c.tar.xz
use gtk_box_new instead of gtk_{h,v}box_new properly
-rw-r--r--applets/clock/calendar-window.c12
-rw-r--r--applets/clock/clock-location-tile.c12
-rw-r--r--applets/clock/clock-location.c5
-rw-r--r--applets/clock/clock.c12
-rw-r--r--applets/notification_area/na-tray.c5
-rw-r--r--applets/notification_area/testtray.c13
-rw-r--r--mate-panel/nothing.cP7
-rw-r--r--mate-panel/panel-addto.c13
-rw-r--r--mate-panel/panel-ditem-editor.c8
-rw-r--r--mate-panel/panel-force-quit.c8
10 files changed, 47 insertions, 48 deletions
diff --git a/applets/clock/calendar-window.c b/applets/clock/calendar-window.c
index e800f272..ceb3a38d 100644
--- a/applets/clock/calendar-window.c
+++ b/applets/clock/calendar-window.c
@@ -43,9 +43,9 @@
#define KEY_LOCATIONS_EXPANDED "expand-locations"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_vbox_new(X, Y) gtk_box_new(GTK_ORIENTATION_VERTICAL, Y)
-#define gtk_hbox_new(X, Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL, Y)
+#if !GTK_CHECK_VERSION (3, 0, 0)
+#define gtk_box_new(GTK_ORIENTATION_HORIZONTAL, b) gtk_hbox_new(FALSE, b)
+#define gtk_box_new(GTK_ORIENTATION_VERTICAL, b) gtk_vbox_new(FALSE, b)
#endif
enum {
@@ -166,14 +166,14 @@ create_hig_frame (CalendarWindow *calwin,
char *text;
GtkWidget *expander;
- vbox = gtk_vbox_new (FALSE, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
bold_title = g_strdup_printf ("<b>%s</b>", title);
expander = gtk_expander_new (bold_title);
g_free (bold_title);
gtk_expander_set_use_markup (GTK_EXPANDER (expander), TRUE);
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), expander, FALSE, FALSE, 0);
gtk_widget_show_all (vbox);
@@ -252,7 +252,7 @@ calendar_window_fill (CalendarWindow *calwin)
gtk_container_add (GTK_CONTAINER (calwin), frame);
gtk_widget_show (frame);
- vbox = gtk_vbox_new (FALSE, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_widget_show (vbox);
diff --git a/applets/clock/clock-location-tile.c b/applets/clock/clock-location-tile.c
index 48d57494..d34b8aba 100644
--- a/applets/clock/clock-location-tile.c
+++ b/applets/clock/clock-location-tile.c
@@ -17,14 +17,12 @@
#include "clock-marshallers.h"
#include "set-timezone.h"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y)
-#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y)
-#endif
#if GTK_CHECK_VERSION (3, 0, 0)
G_DEFINE_TYPE (ClockLocationTile, clock_location_tile, GTK_TYPE_BIN)
#else
+#define gtk_box_new(GTK_ORIENTATION_HORIZONTAL, b) gtk_hbox_new(FALSE, b)
+#define gtk_box_new(GTK_ORIENTATION_VERTICAL, b) gtk_vbox_new(FALSE, b)
G_DEFINE_TYPE (ClockLocationTile, clock_location_tile, GTK_TYPE_ALIGNMENT)
#endif
@@ -290,13 +288,13 @@ clock_location_tile_fill (ClockLocationTile *this)
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 3, 3, 3, 0);
#endif
- tile = gtk_hbox_new (FALSE, 6);
+ tile = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_set_margin_top (tile, 3);
gtk_widget_set_margin_bottom (tile, 3);
gtk_widget_set_margin_start (tile, 3);
#endif
- head_section = gtk_vbox_new (FALSE, 0);
+ head_section = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
priv->city_label = gtk_label_new (NULL);
#if GTK_CHECK_VERSION (3, 0, 0)
@@ -337,7 +335,7 @@ clock_location_tile_fill (ClockLocationTile *this)
gtk_container_add (GTK_CONTAINER (align), priv->weather_icon);
#endif
- box = gtk_hbox_new (FALSE, 0);
+ box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (head_section), box, FALSE, FALSE, 0);
#if GTK_CHECK_VERSION (3, 0, 0)
gtk_box_pack_start (GTK_BOX (box), priv->weather_icon, FALSE, FALSE, 0);
diff --git a/applets/clock/clock-location.c b/applets/clock/clock-location.c
index 13495587..e2317b0d 100644
--- a/applets/clock/clock-location.c
+++ b/applets/clock/clock-location.c
@@ -22,11 +22,6 @@
#include "set-timezone.h"
#include "system-timezone.h"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_vbox_new(X, Y) gtk_box_new(GTK_ORIENTATION_VERTICAL, Y)
-#define gtk_hbox_new(X, Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL, Y)
-#endif
-
G_DEFINE_TYPE (ClockLocation, clock_location, G_TYPE_OBJECT)
typedef struct {
diff --git a/applets/clock/clock.c b/applets/clock/clock.c
index 370bf9ac..8a40ad63 100644
--- a/applets/clock/clock.c
+++ b/applets/clock/clock.c
@@ -85,10 +85,6 @@
#define KEY_TEMPERATURE_UNIT "temperature-unit"
#define KEY_SPEED_UNIT "speed-unit"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_vbox_new(X, Y) gtk_box_new(GTK_ORIENTATION_VERTICAL, Y)
-#endif
-
enum {
COL_CITY_NAME = 0,
COL_CITY_TZ,
@@ -1019,7 +1015,11 @@ create_clock_window (ClockData *cd)
locations_box = calendar_window_get_locations_box (CALENDAR_WINDOW (cd->calendar_popup));
gtk_widget_show (locations_box);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ cd->clock_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+#else
cd->clock_vbox = gtk_vbox_new (FALSE, 6);
+#endif
gtk_container_add (GTK_CONTAINER (locations_box), cd->clock_vbox);
cd->clock_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
@@ -1168,7 +1168,11 @@ create_cities_section (ClockData *cd)
g_list_free (cd->location_tiles);
cd->location_tiles = NULL;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ cd->cities_section = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+#else
cd->cities_section = gtk_vbox_new (FALSE, 6);
+#endif
gtk_container_set_border_width (GTK_CONTAINER (cd->cities_section), 0);
cities = cd->locations;
diff --git a/applets/notification_area/na-tray.c b/applets/notification_area/na-tray.c
index 996bd693..b07376c2 100644
--- a/applets/notification_area/na-tray.c
+++ b/applets/notification_area/na-tray.c
@@ -34,11 +34,6 @@
#define ICON_SPACING 1
#define MIN_BOX_SIZE 3
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_vbox_new(X, Y) gtk_box_new(GTK_ORIENTATION_VERTICAL, Y)
-#define gtk_hbox_new(X, Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL, Y)
-#endif
-
typedef struct
{
NaTrayManager *tray_manager;
diff --git a/applets/notification_area/testtray.c b/applets/notification_area/testtray.c
index c541aaa2..0cb38e92 100644
--- a/applets/notification_area/testtray.c
+++ b/applets/notification_area/testtray.c
@@ -29,11 +29,6 @@
#define NOTIFICATION_AREA_ICON "mate-panel-notification-area"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y)
-#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y)
-#endif
-
static guint n_windows = 0;
typedef struct
@@ -155,14 +150,22 @@ create_tray_on_screen (GdkScreen *screen,
data->window = window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
g_object_weak_ref (G_OBJECT (window), (GWeakNotify) maybe_quit, NULL);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+#else
vbox = gtk_vbox_new (FALSE, 6);
+#endif
gtk_container_add (GTK_CONTAINER (window), vbox);
button = gtk_button_new_with_mnemonic ("_Add another tray");
g_signal_connect (button, "clicked", G_CALLBACK (add_tray_cb), data);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+#else
hbox = gtk_hbox_new (FALSE, 12);
+#endif
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
label = gtk_label_new_with_mnemonic ("_Orientation:");
#if GTK_CHECK_VERSION (3, 16, 0)
diff --git a/mate-panel/nothing.cP b/mate-panel/nothing.cP
index 71441287..e3f2b51e 100644
--- a/mate-panel/nothing.cP
+++ b/mate-panel/nothing.cP
@@ -6,9 +6,6 @@
#include <cairo.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_vbox_new(X, Y) gtk_box_new(GTK_ORIENTATION_VERTICAL, Y)
-#endif
#include <canberra-gtk.h>
#ifdef CA_CHECK_VERSION
@@ -1397,7 +1394,11 @@ start_geginv (void)
gtk_widget_set_double_buffered (GTK_WIDGET (geginv_canvas), FALSE);
gtk_widget_set_size_request (geginv_canvas, inv_width, inv_height);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+#else
vbox = gtk_vbox_new (FALSE, 0);
+#endif
gtk_container_add (GTK_CONTAINER (geginv), vbox);
gtk_box_pack_start (GTK_BOX (vbox), geginv_canvas, TRUE, TRUE, 0);
diff --git a/mate-panel/panel-addto.c b/mate-panel/panel-addto.c
index eac9be93..bd1f47c6 100644
--- a/mate-panel/panel-addto.c
+++ b/mate-panel/panel-addto.c
@@ -52,11 +52,6 @@
#include "panel-schemas.h"
#include "panel-stock-icons.h"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_vbox_new(X, Y) gtk_box_new(GTK_ORIENTATION_VERTICAL, Y)
-#define gtk_hbox_new(X, Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL, Y)
-#endif
-
typedef struct {
PanelWidget *panel_widget;
@@ -1253,10 +1248,18 @@ panel_addto_dialog_new (PanelWidget *panel_widget)
g_signal_connect (dialog->addto_dialog, "destroy",
G_CALLBACK (panel_addto_dialog_destroy), dialog);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ inner_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
+#else
inner_vbox = gtk_vbox_new (FALSE, 6);
+#endif
gtk_box_pack_start (GTK_BOX (dialog_vbox), inner_vbox, TRUE, TRUE, 0);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ find_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+#else
find_hbox = gtk_hbox_new (FALSE, 6);
+#endif
gtk_box_pack_start (GTK_BOX (inner_vbox), find_hbox, FALSE, FALSE, 0);
dialog->label = gtk_label_new_with_mnemonic ("");
diff --git a/mate-panel/panel-ditem-editor.c b/mate-panel/panel-ditem-editor.c
index c8bb3d76..5d18bfc6 100644
--- a/mate-panel/panel-ditem-editor.c
+++ b/mate-panel/panel-ditem-editor.c
@@ -40,10 +40,6 @@
#include "panel-util.h"
#include "panel-marshal.h"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_hbox_new(X, Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL, Y)
-#endif
-
struct _PanelDItemEditorPrivate
{
/* we keep a ditem around, since we can never have absolutely
@@ -650,7 +646,11 @@ panel_ditem_editor_make_ui (PanelDItemEditor *dialog)
/* Command */
priv->command_label = label_new_with_mnemonic ("");
+#if GTK_CHECK_VERSION (3, 0, 0)
+ priv->command_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
+#else
priv->command_hbox = gtk_hbox_new (FALSE, 12);
+#endif
gtk_widget_show (priv->command_hbox);
priv->command_entry = gtk_entry_new ();
diff --git a/mate-panel/panel-force-quit.c b/mate-panel/panel-force-quit.c
index ac7611a3..60a35323 100644
--- a/mate-panel/panel-force-quit.c
+++ b/mate-panel/panel-force-quit.c
@@ -37,10 +37,6 @@
#include "panel-icon-names.h"
#include "panel-stock-icons.h"
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_vbox_new(X, Y) gtk_box_new(GTK_ORIENTATION_VERTICAL, Y)
-#endif
-
static GdkFilterReturn popup_filter (GdkXEvent *gdk_xevent,
GdkEvent *event,
GtkWidget *popup);
@@ -69,7 +65,11 @@ display_popup_window (GdkScreen *screen)
gtk_container_add (GTK_CONTAINER (retval), frame);
gtk_widget_show (frame);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+#else
vbox = gtk_vbox_new (FALSE, 0);
+#endif
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
gtk_container_add (GTK_CONTAINER (frame), vbox);
gtk_widget_show (vbox);