summaryrefslogtreecommitdiff
path: root/charpick
diff options
context:
space:
mode:
authormonsta <[email protected]>2018-02-02 16:25:31 +0300
committerraveit65 <[email protected]>2018-02-04 20:32:14 +0100
commitd1020226236576464be4ab47ec0098a588bef486 (patch)
treec79b616da32f8b684b964af8b8cf3fa96b98c4e6 /charpick
parente6d55cba85fc49b3dfac8150c397540bda369847 (diff)
downloadmate-applets-d1020226236576464be4ab47ec0098a588bef486.tar.bz2
mate-applets-d1020226236576464be4ab47ec0098a588bef486.tar.xz
require GTK+ 3.22 and GLib 2.50
Diffstat (limited to 'charpick')
-rw-r--r--charpick/charpick.c52
-rw-r--r--charpick/properties.c15
2 files changed, 6 insertions, 61 deletions
diff --git a/charpick/charpick.c b/charpick/charpick.c
index f896b6b3..97e076df 100644
--- a/charpick/charpick.c
+++ b/charpick/charpick.c
@@ -380,7 +380,6 @@ chooser_button_clicked (GtkButton *button, charpick_data *curr_data)
indication be drawn on the label itself when space is tight. Taken from the clock applet.
FIXME : This is an Evil Hack and should be fixed when the focus padding can be overridden at the gtk+ level */
-#if GTK_CHECK_VERSION (3, 20, 0)
static inline void force_no_button_padding (GtkWidget *widget)
{
GtkCssProvider *provider;
@@ -403,34 +402,6 @@ static inline void force_no_button_padding (GtkWidget *widget)
gtk_widget_set_name (widget, "charpick-applet-button");
}
-#else
-static inline void force_no_focus_padding (GtkWidget *widget)
-{
- static gboolean first_time = TRUE;
- GtkCssProvider *provider;
-
- if (first_time) {
- provider = gtk_css_provider_new ();
-
- gtk_css_provider_load_from_data (provider,
- "#charpick-applet-button {\n"
- "-GtkWidget-focus-line-width: 0px;\n"
- "-GtkWidget-focus-padding: 0px;\n"
- "}",
- -1,
- NULL);
- gtk_style_context_add_provider (gtk_widget_get_style_context (widget),
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-
- g_object_unref (provider);
-
- first_time = FALSE;
- }
-
- gtk_widget_set_name (widget, "charpick-applet-button");
-}
-#endif
/* creates table of buttons, sets up their callbacks, and packs the table in
the event box */
@@ -481,12 +452,10 @@ build_table(charpick_data *p_curr_data)
}
gtk_container_add (GTK_CONTAINER (button), arrow);
gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
- /* FIXME : evil hack (see force_no_focus_padding) */
-#if GTK_CHECK_VERSION (3, 20, 0)
+
+ /* FIXME : evil hack (see force_no_button_padding) */
force_no_button_padding (button);
-#else
- force_no_focus_padding (button);
-#endif
+
gtk_box_pack_start (GTK_BOX (box), button, TRUE, TRUE, 0);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (chooser_button_clicked),
@@ -524,12 +493,10 @@ build_table(charpick_data *p_curr_data)
g_free (atk_desc);
gtk_widget_show (toggle_button[i]);
gtk_button_set_relief(GTK_BUTTON(toggle_button[i]), GTK_RELIEF_NONE);
- /* FIXME : evil hack (see force_no_focus_padding) */
-#if GTK_CHECK_VERSION (3, 20, 0)
+
+ /* FIXME : evil hack (see force_no_button_padding) */
force_no_button_padding (toggle_button[i]);
-#else
- force_no_focus_padding (toggle_button[i]);
-#endif
+
gtk_widget_set_tooltip_text (toggle_button[i], name);
g_free (name);
@@ -660,17 +627,10 @@ help_cb (GtkAction *action,
{
GError *error = NULL;
-#if GTK_CHECK_VERSION (3, 22, 0)
gtk_show_uri_on_window (NULL,
"help:mate-char-palette",
gtk_get_current_event_time (),
&error);
-#else
- gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (curr_data->applet)),
- "help:mate-char-palette",
- gtk_get_current_event_time (),
- &error);
-#endif
if (error) { /* FIXME: the user needs to see this */
g_warning ("help error: %s\n", error->message);
diff --git a/charpick/properties.c b/charpick/properties.c
index 4842b478..4676968a 100644
--- a/charpick/properties.c
+++ b/charpick/properties.c
@@ -415,11 +415,7 @@ create_hig_catagory (GtkWidget *main_box, gchar *title)
tmp = g_strdup_printf ("<b>%s</b>", title);
label = gtk_label_new (NULL);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_label_set_markup (GTK_LABEL (label), tmp);
g_free (tmp);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
@@ -459,11 +455,7 @@ static void default_chars_frame_create(charpick_data *curr_data)
label = gtk_label_new_with_mnemonic(_("_Palettes:"));
gtk_box_pack_start(GTK_BOX(vbox3), label, FALSE, FALSE, 0);
-#if GTK_CHECK_VERSION (3, 16, 0)
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
-#else
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-#endif
gtk_widget_show(label);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
@@ -507,17 +499,10 @@ phelp_cb (GtkDialog *dialog, gint tab, gpointer data)
{
GError *error = NULL;
-#if GTK_CHECK_VERSION (3, 22, 0)
gtk_show_uri_on_window (GTK_WINDOW (dialog),
"help:mate-char-palette/charpick-prefs",
gtk_get_current_event_time (),
&error);
-#else
- gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (dialog)),
- "help:mate-char-palette/charpick-prefs",
- gtk_get_current_event_time (),
- &error);
-#endif
if (error) { /* FIXME: the user needs to see this */
g_warning ("help error: %s\n", error->message);