summaryrefslogtreecommitdiff
path: root/charpick
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-11-22 17:47:06 +0300
committermonsta <[email protected]>2016-11-22 17:47:06 +0300
commitf7acf55db3ab4b97d60faae24555a07b6b08d43c (patch)
tree6feb99e63f801161642669b01c9ce0c217e60d0b /charpick
parent45354a60352e05eba7e66e24a171e713876d71e9 (diff)
downloadmate-applets-f7acf55db3ab4b97d60faae24555a07b6b08d43c.tar.bz2
mate-applets-f7acf55db3ab4b97d60faae24555a07b6b08d43c.tar.xz
move to GTK+3 (>= 3.14), drop GTK+2 code and --with-gtk build option
and require mate-panel >= 1.17 WARNING: use GTK+3 build of libmateweather for this build. that lib is not migrated to GTK+3 only as we will possibly use libgweather instead of it.
Diffstat (limited to 'charpick')
-rw-r--r--charpick/charpick.c65
-rw-r--r--charpick/properties.c23
2 files changed, 17 insertions, 71 deletions
diff --git a/charpick/charpick.c b/charpick/charpick.c
index d06b98e3..97d07a06 100644
--- a/charpick/charpick.c
+++ b/charpick/charpick.c
@@ -11,11 +11,6 @@
#endif
#include "charpick.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
-
/* The comment for each char list has the html entity names of the chars */
/* All gunicar codes should end in 0 */
@@ -319,7 +314,6 @@ populate_menu (charpick_data *curr_data)
}
build_table(curr_data);
-#if GTK_CHECK_VERSION (3, 0, 0)
/*Set up custom theme and transparency support*/
GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (menu));
/* Fix any failures of compiz/other wm's to communicate with gtk for transparency */
@@ -331,7 +325,6 @@ populate_menu (charpick_data *curr_data)
context = gtk_widget_get_style_context (GTK_WIDGET(toplevel));
gtk_style_context_add_class(context,"gnome-panel-menu-bar");
gtk_style_context_add_class(context,"mate-panel-menu-bar");
-#endif
}
static void
@@ -342,17 +335,10 @@ get_menu_pos (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer data)
gint tempx, tempy, width, height;
gint screen_width, screen_height;
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL, &reqmenu);
-#else
- gtk_widget_size_request (GTK_WIDGET (menu), &reqmenu);
-#endif
gdk_window_get_origin (GDK_WINDOW (gtk_widget_get_window(curr_data->applet)), &tempx, &tempy);
gdk_window_get_geometry (GDK_WINDOW (gtk_widget_get_window(curr_data->applet)), NULL, NULL,
&width, &height
-#if !GTK_CHECK_VERSION (3, 0, 0)
- , NULL
-#endif
);
switch (mate_panel_applet_get_orient (MATE_PANEL_APPLET (curr_data->applet))) {
@@ -395,7 +381,6 @@ chooser_button_clicked (GtkButton *button, charpick_data *curr_data)
static inline void force_no_focus_padding (GtkWidget *widget)
{
-#if GTK_CHECK_VERSION (3, 0, 0)
gboolean first_time = TRUE;
GtkCssProvider *provider;
@@ -417,22 +402,6 @@ static inline void force_no_focus_padding (GtkWidget *widget)
first_time = FALSE;
}
-#else
- gboolean first_time=TRUE;
-
- if (first_time) {
- gtk_rc_parse_string ("\n"
- " style \"charpick-applet-button-style\"\n"
- " {\n"
- " GtkWidget::focus-line-width=0\n"
- " GtkWidget::focus-padding=0\n"
- " }\n"
- "\n"
- " widget \"*.charpick-applet-button\" style \"charpick-applet-button-style\"\n"
- "\n");
- first_time = FALSE;
- }
-#endif
gtk_widget_set_name (widget, "charpick-applet-button");
}
@@ -457,9 +426,9 @@ build_table(charpick_data *p_curr_data)
gtk_widget_destroy(p_curr_data->box);
if (p_curr_data->panel_vertical)
- box = gtk_vbox_new (FALSE, 0);
+ box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
else
- box = gtk_hbox_new (FALSE, 0);
+ box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_show (box);
p_curr_data->box = box;
@@ -470,7 +439,6 @@ build_table(charpick_data *p_curr_data)
switch (mate_panel_applet_get_orient (MATE_PANEL_APPLET (p_curr_data->applet))) {
case MATE_PANEL_APPLET_ORIENT_DOWN:
-#if GTK_CHECK_VERSION (3, 0, 0)
arrow = gtk_image_new_from_icon_name ("pan-down-symbolic", GTK_ICON_SIZE_MENU);
break;
case MATE_PANEL_APPLET_ORIENT_UP:
@@ -481,18 +449,6 @@ build_table(charpick_data *p_curr_data)
break;
case MATE_PANEL_APPLET_ORIENT_RIGHT:
arrow = gtk_image_new_from_icon_name ("pan-end-symbolic", GTK_ICON_SIZE_MENU);
-#else
- arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_OUT);
- break;
- case MATE_PANEL_APPLET_ORIENT_UP:
- arrow = gtk_arrow_new (GTK_ARROW_UP, GTK_SHADOW_OUT);
- break;
- case MATE_PANEL_APPLET_ORIENT_LEFT:
- arrow = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_OUT);
- break;
- case MATE_PANEL_APPLET_ORIENT_RIGHT:
- arrow = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_OUT);
-#endif
break;
default:
g_assert_not_reached ();
@@ -543,11 +499,7 @@ build_table(charpick_data *p_curr_data)
gtk_widget_set_tooltip_text (toggle_button[i], name);
g_free (name);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_get_preferred_size (toggle_button[i], NULL, &req);
-#else
- gtk_widget_size_request (toggle_button[i], &req);
-#endif
max_width = MAX (max_width, req.width);
max_height = MAX (max_height, req.height-2);
@@ -563,22 +515,21 @@ build_table(charpick_data *p_curr_data)
if (p_curr_data->panel_vertical) {
size_ratio = p_curr_data->panel_size / max_width;
- button_box = gtk_hbox_new (TRUE, 0);
+ button_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
} else {
size_ratio = p_curr_data->panel_size / max_height;
- button_box = gtk_vbox_new (TRUE, 0);
+ button_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
}
+ gtk_box_set_homogeneous (GTK_BOX (button_box), TRUE);
gtk_box_pack_start (GTK_BOX (box), button_box, TRUE, TRUE, 0);
size_ratio = MAX (size_ratio, 1);
row_box = g_new0 (GtkWidget *, size_ratio);
for (i=0; i < size_ratio; i++) {
- if (!p_curr_data->panel_vertical) row_box[i] = gtk_hbox_new (TRUE, 0);
- else row_box[i] = gtk_vbox_new (TRUE, 0);
-#if GTK_CHECK_VERSION (3, 0, 0)
- gtk_box_set_homogeneous (GTK_BOX (button_box), TRUE);
-#endif
+ if (!p_curr_data->panel_vertical) row_box[i] = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ else row_box[i] = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+ gtk_box_set_homogeneous (GTK_BOX (row_box[i]), TRUE);
gtk_box_pack_start (GTK_BOX (button_box), row_box[i], TRUE, TRUE, 0);
}
diff --git a/charpick/properties.c b/charpick/properties.c
index ac41ebd9..bf1dfd5a 100644
--- a/charpick/properties.c
+++ b/charpick/properties.c
@@ -15,11 +15,6 @@
#define CHARPICK_STOCK_EDIT "charpick-stock-edit"
-#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
-
void
register_stock_for_edit (void)
{
@@ -111,11 +106,11 @@ add_edit_dialog_create (charpick_data *curr_data, gchar *string, gchar *title)
dbox = gtk_dialog_get_content_area(GTK_DIALOG (dialog));
- vbox = gtk_vbox_new (FALSE, 12);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_box_pack_start (GTK_BOX (dbox), vbox, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
- hbox = gtk_hbox_new (FALSE, 12);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
label = gtk_label_new_with_mnemonic (_("_Palette:"));
@@ -415,7 +410,7 @@ create_hig_catagory (GtkWidget *main_box, gchar *title)
GtkWidget *label;
gchar *tmp;
- vbox = gtk_vbox_new (FALSE, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (main_box), vbox, TRUE, TRUE, 0);
tmp = g_strdup_printf ("<b>%s</b>", title);
@@ -429,13 +424,13 @@ create_hig_catagory (GtkWidget *main_box, gchar *title)
g_free (tmp);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
- hbox = gtk_hbox_new (FALSE, 0);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
label = gtk_label_new (" ");
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
- vbox2 = gtk_vbox_new (FALSE, 6);
+ vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (hbox), vbox2, TRUE, TRUE, 0);
return vbox2;
@@ -453,13 +448,13 @@ static void default_chars_frame_create(charpick_data *curr_data)
dbox = gtk_dialog_get_content_area(GTK_DIALOG (dialog));
- vbox = gtk_vbox_new (FALSE, 18);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 18);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
gtk_box_pack_start (GTK_BOX (dbox), vbox, TRUE, TRUE, 0);
vbox1 = create_hig_catagory (vbox, _("Character Palette"));
- vbox3 = gtk_vbox_new (FALSE, 6);
+ vbox3 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (vbox1), vbox3, TRUE, TRUE, 0);
label = gtk_label_new_with_mnemonic(_("_Palettes:"));
@@ -471,12 +466,12 @@ static void default_chars_frame_create(charpick_data *curr_data)
#endif
gtk_widget_show(label);
- hbox = gtk_hbox_new (FALSE, 12);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (vbox3), hbox, TRUE, TRUE, 0);
scrolled = create_palettes_tree (curr_data, label);
gtk_box_pack_start (GTK_BOX (hbox), scrolled, TRUE, TRUE, 0);
- vbox2 = gtk_vbox_new (FALSE, 6);
+ vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (hbox), vbox2, FALSE, FALSE, 0);
button = gtk_button_new_from_stock (GTK_STOCK_ADD);
gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);