This is an automated email from the git hooks/post-receive script. a n d r z e j r p u s h e d a c o m m i t t o b r a n c h m a s t e r in repository panel-plugins/xfce4-indicator-plugin.
commit 311efa7951487e5d5652541543509ae2ed8e7dcf Author: Viktor Odintsev <[email protected]> Date: Sun Jul 9 00:03:07 2017 +0300 Bump GTK version to 3.18, remove deprecations --- configure.ac.in | 2 +- panel-plugin/indicator-button-box.c | 6 ++++-- panel-plugin/indicator-button.c | 20 ++++++++++++++------ panel-plugin/indicator-dialog.glade | 28 ++++++++++++++++++---------- 4 files changed, 37 insertions(+), 19 deletions(-) diff --git a/configure.ac.in b/configure.ac.in index 150d480..066d7b6 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -77,7 +77,7 @@ LIBXFCE4PANEL_VERSION_API=libxfce4panel_version_api() AC_DEFINE([LIBXFCE4PANEL_VERSION_API], "libxfce4panel_version_api()", [libxfce4panel api version]) AC_SUBST([LIBXFCE4PANEL_VERSION_API]) -XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.6.0]) +XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [3.18.0]) dnl XDT_CHECK_PACKAGE([EXO], [exo-1], [0.6.0]) XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.9.0]) XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.11.0]) diff --git a/panel-plugin/indicator-button-box.c b/panel-plugin/indicator-button-box.c index 5a8c97f..d59449a 100644 --- a/panel-plugin/indicator-button-box.c +++ b/panel-plugin/indicator-button-box.c @@ -358,12 +358,14 @@ indicator_button_box_is_small (IndicatorButtonBox *box) indicator_config_get_align_left (box->config)) { box->orientation = GTK_ORIENTATION_HORIZONTAL; - gtk_misc_set_alignment (GTK_MISC (box->label), 0.0, 0.5); + gtk_label_set_xalign (GTK_LABEL (box->label), 0.0); + gtk_label_set_yalign (GTK_LABEL (box->label), 0.5); gtk_label_set_ellipsize (GTK_LABEL (box->label), PANGO_ELLIPSIZE_END); } else { - gtk_misc_set_alignment (GTK_MISC (box->label), 0.5, 0.5); + gtk_label_set_xalign (GTK_LABEL (box->label), 0.5); + gtk_label_set_yalign (GTK_LABEL (box->label), 0.5); gtk_label_set_ellipsize (GTK_LABEL (box->label), PANGO_ELLIPSIZE_NONE); } gtk_label_set_angle (GTK_LABEL (box->label), diff --git a/panel-plugin/indicator-button.c b/panel-plugin/indicator-button.c index ce5f6e7..c6aedbd 100644 --- a/panel-plugin/indicator-button.c +++ b/panel-plugin/indicator-button.c @@ -70,7 +70,6 @@ struct _XfceIndicatorButton XfcePanelPlugin *plugin; IndicatorConfig *config; - GtkWidget *align_box; GtkWidget *box; gulong deactivate_id; }; @@ -108,12 +107,17 @@ xfce_indicator_button_init (XfceIndicatorButton *button) gtk_widget_set_can_default (GTK_WIDGET (button), FALSE); gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); gtk_button_set_use_underline (GTK_BUTTON (button),TRUE); +#if GTK_CHECK_VERSION (3, 20, 0) + gtk_widget_set_focus_on_click (GTK_WIDGET (button), FALSE); +#else gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE); +#endif gtk_widget_set_name (GTK_WIDGET (button), "indicator-button"); css_provider = gtk_css_provider_new (); gtk_css_provider_load_from_data (css_provider, "#indicator-button { -GtkWidget-focus-padding: 0; -GtkWidget-focus-line-width: 0; -GtkButton-default-border: 0; -GtkButton-inner-border: 0; padding: 1px; border-width: 1px;}", -1, NULL); gtk_style_context_add_provider (GTK_STYLE_CONTEXT (gtk_widget_get_style_context (GTK_WIDGET (button))), GTK_STYLE_PROVIDER (css_provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + g_object_unref (css_provider); gtk_widget_add_events (GTK_WIDGET (button), GDK_SCROLL_MASK); @@ -124,9 +128,8 @@ xfce_indicator_button_init (XfceIndicatorButton *button) button->menu = NULL; button->deactivate_id = 0; - button->align_box = gtk_alignment_new (0.5, 0.5, 1.0, 1.0); - gtk_container_add (GTK_CONTAINER (button), button->align_box); - gtk_widget_show (button->align_box); + gtk_widget_set_halign (GTK_WIDGET (button), GTK_ALIGN_FILL); + gtk_widget_set_valign (GTK_WIDGET (button), GTK_ALIGN_FILL); } @@ -278,8 +281,7 @@ xfce_indicator_button_new (IndicatorObject *io, button->config = config; button->box = indicator_button_box_new (button->config); - //gtk_container_add (GTK_CONTAINER (button), button->box); - gtk_container_add (GTK_CONTAINER (button->align_box), button->box); + gtk_container_add (GTK_CONTAINER (button), button->box); gtk_widget_show (button->box); g_object_set (G_OBJECT (button), "has-tooltip", TRUE, NULL); @@ -319,9 +321,15 @@ xfce_indicator_button_button_press (GtkWidget *widget, (G_OBJECT (button->menu), "deactivate", G_CALLBACK (xfce_indicator_button_menu_deactivate), button); gtk_menu_reposition (GTK_MENU (button->menu)); +#if GTK_CHECK_VERSION (3, 22, 0) + gtk_menu_popup_at_widget (button->menu, widget, + GDK_GRAVITY_NORTH_WEST, GDK_GRAVITY_NORTH_WEST, + (GdkEvent *)event); +#else gtk_menu_popup (button->menu, NULL, NULL, xfce_panel_plugin_position_menu, button->plugin, event->button, event->time); +#endif return TRUE; } diff --git a/panel-plugin/indicator-dialog.glade b/panel-plugin/indicator-dialog.glade index a7f6b0c..d93a5f9 100644 --- a/panel-plugin/indicator-dialog.glade +++ b/panel-plugin/indicator-dialog.glade @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <interface> - <requires lib="gtk+" version="2.14"/> - <!-- interface-requires libxfce4ui 0.0 --> + <requires lib="gtk+" version="3.18"/> + <!-- interface-requires libxfce4ui-2.0 --> <!-- interface-naming-policy toplevel-contextual --> <object class="XfceTitledDialog" id="dialog"> <property name="can_focus">False</property> @@ -11,14 +11,16 @@ <property name="icon_name">gtk-properties</property> <property name="type_hint">normal</property> <child internal-child="vbox"> - <object class="GtkVBox" id="dialog-vbox2"> + <object class="GtkBox" id="dialog-vbox2"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="orientation">vertical</property> <property name="spacing">2</property> <child internal-child="action_area"> - <object class="GtkHButtonBox" id="dialog-action_area2"> + <object class="GtkButtonBox" id="dialog-action_area2"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="orientation">horizontal</property> <property name="layout_style">end</property> <child> <object class="GtkButton" id="close-button"> @@ -60,10 +62,11 @@ </packing> </child> <child> - <object class="GtkVBox" id="vbox1"> + <object class="GtkBox" id="vbox1"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="border_width">6</property> + <property name="orientation">vertical</property> <property name="spacing">6</property> <child> <object class="GtkFrame" id="frame3"> @@ -77,10 +80,11 @@ <property name="can_focus">False</property> <property name="left_padding">12</property> <child> - <object class="GtkVBox" id="vbox2"> + <object class="GtkBox" id="vbox2"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="border_width">6</property> + <property name="orientation">vertical</property> <property name="spacing">6</property> <child> <object class="GtkCheckButton" id="checkbutton-single-row"> @@ -163,10 +167,11 @@ <property name="can_focus">False</property> <property name="left_padding">12</property> <child> - <object class="GtkVBox" id="vbox3"> + <object class="GtkBox" id="vbox3"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="border_width">6</property> + <property name="orientation">vertical</property> <property name="spacing">6</property> <child> <object class="GtkCheckButton" id="checkbutton-whitelist"> @@ -185,9 +190,10 @@ </packing> </child> <child> - <object class="GtkHBox" id="hbox2"> + <object class="GtkBox" id="hbox2"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="orientation">horizontal</property> <property name="spacing">6</property> <child> <object class="GtkScrolledWindow" id="scrolledwindow1"> @@ -259,9 +265,10 @@ </packing> </child> <child> - <object class="GtkVBox" id="vbox4"> + <object class="GtkBox" id="vbox4"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="orientation">vertical</property> <property name="spacing">6</property> <child> <object class="GtkButton" id="item-up"> @@ -337,9 +344,10 @@ </packing> </child> <child> - <object class="GtkHButtonBox" id="hbuttonbox1"> + <object class="GtkButtonBox" id="hbuttonbox1"> <property name="visible">True</property> <property name="can_focus">False</property> + <property name="orientation">horizontal</property> <property name="layout_style">start</property> <child> <object class="GtkButton" id="indicators-clear"> -- To stop receiving notification emails like this one, please contact the administrator of this repository. _______________________________________________ Xfce4-commits mailing list [email protected] https://mail.xfce.org/mailman/listinfo/xfce4-commits
