[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r118156: * gtkutil.c (create_dialog): Don't use gtk_
From: |
Jan D. |
Subject: |
[Emacs-diffs] trunk r118156: * gtkutil.c (create_dialog): Don't use gtk_dialog_get_action_area on |
Date: |
Sun, 19 Oct 2014 16:28:53 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 118156
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/18674
committer: Jan D. <address@hidden>
branch nick: trunk
timestamp: Sun 2014-10-19 18:28:49 +0200
message:
* gtkutil.c (create_dialog): Don't use gtk_dialog_get_action_area on
Gt+ >= 3.12, or gtk_misc_set_alignment on Gtk+ >= 3.14.
(make_widget_for_menu_item): Don't use gtk_misc_set_alignment on
Gtk+ >= 3.14 (Bug#18674).
(update_frame_tool_bar): Don't use gtk_misc_set_padding on
Gtk+ >= 3.14 (Bug#18674).
modified:
src/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1438
src/gtkutil.c gtkutil.c-20091113204419-o5vbwnq5f7feedwu-2527
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2014-10-18 19:07:17 +0000
+++ b/src/ChangeLog 2014-10-19 16:28:49 +0000
@@ -1,3 +1,12 @@
+2014-10-19 Jan Djärv <address@hidden>
+
+ * gtkutil.c (create_dialog): Don't use gtk_dialog_get_action_area on
+ Gt+ >= 3.12, or gtk_misc_set_alignment on Gtk+ >= 3.14 (Bug#18674).
+ (make_widget_for_menu_item): Don't use gtk_misc_set_alignment on
+ Gtk+ >= 3.14 (Bug#18674).
+ (update_frame_tool_bar): Don't use gtk_misc_set_padding on
+ Gtk+ >= 3.14 (Bug#18674).
+
2014-10-18 Paul Eggert <address@hidden>
* gtkutil.c: Remove no-longer-used code.
=== modified file 'src/gtkutil.c'
--- a/src/gtkutil.c 2014-10-18 19:07:17 +0000
+++ b/src/gtkutil.c 2014-10-19 16:28:49 +0000
@@ -1489,7 +1489,6 @@
int button_spacing = 10;
GtkWidget *wdialog = gtk_dialog_new ();
GtkDialog *wd = GTK_DIALOG (wdialog);
- GtkBox *cur_box = GTK_BOX (gtk_dialog_get_action_area (wd));
widget_value *item;
GtkWidget *whbox_down;
@@ -1497,6 +1496,17 @@
instead. This looks better. */
bool make_two_rows = total_buttons > 4;
+#if GTK_CHECK_VERSION (3, 12, 0)
+ GtkBuilder *gbld = gtk_builder_new ();
+ GObject *go = gtk_buildable_get_internal_child (GTK_BUILDABLE (wd),
+ gbld,
+ "action_area");
+ GtkBox *cur_box = GTK_BOX (go);
+ g_object_unref (G_OBJECT (gbld));
+#else
+ GtkBox *cur_box = GTK_BOX (gtk_dialog_get_action_area (wd));
+#endif
+
if (right_buttons == 0) right_buttons = total_buttons/2;
left_buttons = total_buttons - right_buttons;
@@ -1542,8 +1552,12 @@
w = gtk_label_new (utf8_label);
gtk_box_pack_start (wvbox, gtk_label_new (""), FALSE, FALSE, 0);
gtk_box_pack_start (wvbox, w, TRUE, TRUE, 0);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (w, GTK_ALIGN_START);
+ gtk_widget_set_valign (w, GTK_ALIGN_CENTER);
+#else
gtk_misc_set_alignment (GTK_MISC (w), 0.1, 0.5);
-
+#endif
/* Try to make dialog look better. Must realize first so
the widget can calculate the size it needs. */
gtk_widget_realize (w);
@@ -2293,9 +2307,15 @@
wlbl = gtk_label_new (utf8_label);
wkey = gtk_label_new (utf8_key);
+#if GTK_CHECK_VERSION (3, 14, 0)
+ gtk_widget_set_halign (wlbl, GTK_ALIGN_START);
+ gtk_widget_set_valign (wlbl, GTK_ALIGN_CENTER);
+ gtk_widget_set_halign (wkey, GTK_ALIGN_START);
+ gtk_widget_set_valign (wkey, GTK_ALIGN_CENTER);
+#else
gtk_misc_set_alignment (GTK_MISC (wlbl), 0.0, 0.5);
gtk_misc_set_alignment (GTK_MISC (wkey), 0.0, 0.5);
-
+#endif
gtk_box_pack_start (GTK_BOX (wbox), wlbl, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (wbox), wkey, FALSE, FALSE, 0);
@@ -4761,7 +4781,17 @@
(gpointer)img->pixmap);
}
+#if GTK_CHECK_VERSION (3, 14, 0)
+ if (w)
+ {
+ gtk_widget_set_margin_start (w, hmargin);
+ gtk_widget_set_margin_end (w, hmargin);
+ gtk_widget_set_margin_top (w, vmargin);
+ gtk_widget_set_margin_bottom (w, vmargin);
+ }
+#else
if (w) gtk_misc_set_padding (GTK_MISC (w), hmargin, vmargin);
+#endif
ti = xg_make_tool_item (f, w, &wbutton, label, i, horiz, text_image);
gtk_toolbar_insert (GTK_TOOLBAR (wtoolbar), ti, j);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r118156: * gtkutil.c (create_dialog): Don't use gtk_dialog_get_action_area on,
Jan D. <=