This is an automated email from the git hooks/post-receive script. b l u e s a b r e 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-weather-plugin.
commit 35570e5a37255f0e5dfb69f0ab7f38542413f1c9 Author: Sean Davis <[email protected]> Date: Sun Sep 9 15:56:02 2018 -0400 Initial port to GTK 3. It runs... but not well --- configure.ac.in | 7 +- panel-plugin/weather-config.c | 11 ++- panel-plugin/weather-config.ui | 158 +++++++++++++++++++-------------------- panel-plugin/weather-scrollbox.c | 62 +++++++++++---- panel-plugin/weather-search.c | 12 +-- panel-plugin/weather-summary.c | 32 ++++---- panel-plugin/weather.c | 18 ++--- panel-plugin/weather.desktop.in | 1 + 8 files changed, 165 insertions(+), 136 deletions(-) diff --git a/configure.ac.in b/configure.ac.in index c670c77..3a4b039 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -58,12 +58,11 @@ XDT_I18N([@LINGUAS@]) dnl *********************************** dnl *** Check for required packages *** dnl *********************************** -XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.14.0]) +XDT_CHECK_PACKAGE([GTK], [gtk+-3.0], [2.14.0]) XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.20.0]) XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.20.0]) -XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.7.0]) -XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-1], [4.7.0]) -XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.7.0]) +XDT_CHECK_PACKAGE([LIBXFCE4UI], [libxfce4ui-2], [4.12.0]) +XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-2.0], [4.12.0]) XDT_CHECK_PACKAGE([LIBXML], [libxml-2.0], [2.4.0]) XDT_CHECK_PACKAGE([SOUP], [libsoup-2.4], [2.32.0]) XDT_CHECK_OPTIONAL_PACKAGE([UPOWER_GLIB], [upower-glib], [0.9.0], [upower], diff --git a/panel-plugin/weather-config.c b/panel-plugin/weather-config.c index e0b0f51..1fee481 100644 --- a/panel-plugin/weather-config.c +++ b/panel-plugin/weather-config.c @@ -1146,19 +1146,18 @@ button_scrollbox_font_clicked(GtkWidget *button, gpointer user_data) { xfceweather_dialog *dialog = (xfceweather_dialog *) user_data; - GtkFontSelectionDialog *fsd; + GtkFontChooserDialog *fsd; gchar *fontname; gint result; - fsd = GTK_FONT_SELECTION_DIALOG - (gtk_font_selection_dialog_new(_("Select font"))); + fsd = GTK_FONT_CHOOSER_DIALOG + (gtk_font_chooser_dialog_new(_("Select font"), dialog->dialog)); if (dialog->pd->scrollbox_font) - gtk_font_selection_dialog_set_font_name(fsd, - dialog->pd->scrollbox_font); + gtk_font_chooser_set_font (GTK_FONT_CHOOSER (fsd), dialog->pd->scrollbox_font); result = gtk_dialog_run(GTK_DIALOG(fsd)); if (result == GTK_RESPONSE_OK || result == GTK_RESPONSE_ACCEPT) { - fontname = gtk_font_selection_dialog_get_font_name(fsd); + fontname = gtk_font_chooser_get_font (GTK_FONT_CHOOSER (fsd)); if (fontname != NULL) { gtk_button_set_label(GTK_BUTTON(button), fontname); g_free(dialog->pd->scrollbox_font); diff --git a/panel-plugin/weather-config.ui b/panel-plugin/weather-config.ui index 39a87cb..529c570 100644 --- a/panel-plugin/weather-config.ui +++ b/panel-plugin/weather-config.ui @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- Generated with glade 3.22.1 --> <interface> - <requires lib="gtk+" version="2.24"/> + <requires lib="gtk+" version="3.20"/> + <requires lib="libxfce4ui-2" version="4.12"/> <object class="GtkAdjustment" id="adjustment1"> <property name="lower">1</property> <property name="upper">10</property> @@ -71,9 +72,8 @@ <property name="destroy_with_parent">True</property> <property name="icon_name">xfce4-weather</property> <property name="type_hint">dialog</property> - <property name="subtitle" translatable="yes">Preferences</property> <child internal-child="vbox"> - <object class="GtkVBox" id="box1"> + <object class="GtkBox" id="box1"> <property name="can_focus">False</property> <property name="orientation">vertical</property> <property name="spacing">2</property> @@ -128,8 +128,8 @@ <property name="can_focus">False</property> <property name="valign">start</property> <property name="border_width">12</property> - <property name="row_spacing">6</property> <property name="column_spacing">12</property> + <property name="row_spacing">6</property> <child> <object class="GtkLabel" id="label1"> <property name="visible">True</property> @@ -139,10 +139,6 @@ <property name="mnemonic_widget">text_loc_name</property> <property name="xalign">0</property> </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - </packing> </child> <child> <object class="GtkLabel" id="label2"> @@ -154,7 +150,6 @@ <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">1</property> </packing> </child> @@ -168,7 +163,6 @@ <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">2</property> </packing> </child> @@ -182,7 +176,6 @@ <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">3</property> </packing> </child> @@ -196,7 +189,6 @@ <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">4</property> </packing> </child> @@ -208,9 +200,7 @@ <property name="margin_bottom">6</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">5</property> - <property name="width">3</property> </packing> </child> <child> @@ -225,9 +215,7 @@ </attributes> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">6</property> - <property name="width">3</property> </packing> </child> <child> @@ -239,10 +227,15 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">0</property> </packing> </child> <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> <object class="GtkButton" id="button_loc_change"> <property name="label" translatable="yes">Change...</property> <property name="visible">True</property> @@ -253,10 +246,27 @@ </object> <packing> <property name="left_attach">2</property> - <property name="top_attach">0</property> </packing> </child> <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> <object class="GtkHBox" id="box2"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -292,7 +302,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">1</property> - <property name="width">2</property> </packing> </child> <child> @@ -331,7 +340,6 @@ <packing> <property name="left_attach">1</property> <property name="top_attach">2</property> - <property name="width">2</property> </packing> </child> <child> @@ -373,7 +381,6 @@ Altitude is given in meters above sea level, or alternatively in feet by changin <packing> <property name="left_attach">1</property> <property name="top_attach">3</property> - <property name="width">2</property> </packing> </child> <child> @@ -386,7 +393,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <packing> <property name="left_attach">1</property> <property name="top_attach">4</property> - <property name="width">2</property> </packing> </child> <child> @@ -395,11 +401,15 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="no_show_all">True</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">7</property> - <property name="width">3</property> </packing> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> </child> <child type="tab"> @@ -419,8 +429,8 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="can_focus">False</property> <property name="valign">start</property> <property name="border_width">12</property> - <property name="row_spacing">6</property> <property name="column_spacing">12</property> + <property name="row_spacing">6</property> <child> <object class="GtkLabel" id="label10"> <property name="visible">True</property> @@ -430,10 +440,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="mnemonic_widget">combo_unit_temperature</property> <property name="xalign">0</property> </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - </packing> </child> <child> <object class="GtkLabel" id="label11"> @@ -445,7 +451,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">1</property> </packing> </child> @@ -459,7 +464,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">2</property> </packing> </child> @@ -473,7 +477,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">3</property> </packing> </child> @@ -487,7 +490,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">4</property> </packing> </child> @@ -499,9 +501,7 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="margin_bottom">6</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">5</property> - <property name="width">2</property> </packing> </child> <child> @@ -513,7 +513,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="mnemonic_widget">combo_apparent_temperature</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">6</property> </packing> </child> @@ -529,10 +528,12 @@ Leave this field empty to use the timezone set by your system. Invalid entries w </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">0</property> </packing> </child> <child> + <placeholder/> + </child> + <child> <object class="GtkComboBoxText" id="combo_unit_pressure"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -631,8 +632,8 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="visible">True</property> <property name="can_focus">False</property> <property name="border_width">12</property> - <property name="row_spacing">6</property> <property name="column_spacing">12</property> + <property name="row_spacing">6</property> <child> <object class="GtkLabel" id="label17"> <property name="visible">True</property> @@ -643,10 +644,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="mnemonic_widget">combo_icon_theme</property> <property name="xalign">0</property> </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - </packing> </child> <child> <object class="GtkHBox" id="box5"> @@ -682,7 +679,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">0</property> </packing> </child> <child> @@ -696,12 +692,13 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="draw_indicator">True</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">1</property> - <property name="width">2</property> </packing> </child> <child> + <placeholder/> + </child> + <child> <object class="GtkHSeparator" id="separator3"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -709,12 +706,13 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="margin_bottom">6</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">2</property> - <property name="width">2</property> </packing> </child> <child> + <placeholder/> + </child> + <child> <object class="GtkLabel" id="label18"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -724,7 +722,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">3</property> </packing> </child> @@ -751,12 +748,13 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="margin_bottom">6</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">4</property> - <property name="width">2</property> </packing> </child> <child> + <placeholder/> + </child> + <child> <object class="GtkLabel" id="label20"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -766,7 +764,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">5</property> </packing> </child> @@ -794,7 +791,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">6</property> </packing> </child> @@ -820,12 +816,13 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="margin_bottom">6</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">7</property> - <property name="width">2</property> </packing> </child> <child> + <placeholder/> + </child> + <child> <object class="GtkCheckButton" id="check_round_values"> <property name="label" translatable="yes">_Round values</property> <property name="visible">True</property> @@ -835,11 +832,12 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="draw_indicator">True</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">8</property> - <property name="width">2</property> </packing> </child> + <child> + <placeholder/> + </child> </object> <packing> <property name="position">2</property> @@ -862,8 +860,8 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="visible">True</property> <property name="can_focus">False</property> <property name="border_width">12</property> - <property name="row_spacing">6</property> <property name="column_spacing">12</property> + <property name="row_spacing">6</property> <child> <object class="GtkCheckButton" id="check_scrollbox_show"> <property name="label" translatable="yes">Show scroll_box</property> @@ -874,10 +872,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="use_underline">True</property> <property name="draw_indicator">True</property> </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - </packing> </child> <child> <object class="GtkLabel" id="label23"> @@ -891,7 +885,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">0</property> </packing> </child> <child> @@ -906,7 +899,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w </object> <packing> <property name="left_attach">2</property> - <property name="top_attach">0</property> </packing> </child> <child> @@ -917,7 +909,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="xalign">0</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">1</property> </packing> </child> @@ -941,19 +932,23 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="margin_bottom">6</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">2</property> - <property name="width">3</property> </packing> </child> <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> <object class="GtkTable" id="grid5"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="row_spacing">6</property> <property name="column_spacing">6</property> + <property name="row_spacing">6</property> <child> <object class="GtkComboBoxText" id="options_datatypes"> <property name="visible">True</property> @@ -977,10 +972,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <item id="17" translatable="yes">Precipitation (R)</item> </items> </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - </packing> </child> <child> <object class="GtkScrolledWindow" id="scrollwindow1"> @@ -1000,7 +991,7 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="tooltip_text" translatable="yes">These are the values that will be shown in the scrollbox. Select a single value here and click the appropriate button to remove it or move it up and down in the list.</property> <property name="model">liststore1</property> <child internal-child="selection"> - <object class="GtkTreeSelection" id="selection1" /> + <object class="GtkTreeSelection" id="selection1"/> </child> </object> </child> @@ -1008,7 +999,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w </child> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">1</property> </packing> </child> @@ -1016,7 +1006,6 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <object class="GtkVBox" id="box6"> <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="button_add"> @@ -1099,18 +1088,23 @@ Leave this field empty to use the timezone set by your system. Invalid entries w </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">0</property> - <property name="height">2</property> </packing> </child> + <child> + <placeholder/> + </child> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">3</property> - <property name="width">3</property> </packing> </child> <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> <object class="GtkCheckButton" id="check_scrollbox_animate"> <property name="label" translatable="yes">Animate _transitions between labels</property> <property name="visible">True</property> @@ -1121,12 +1115,16 @@ Leave this field empty to use the timezone set by your system. Invalid entries w <property name="draw_indicator">True</property> </object> <packing> - <property name="left_attach">0</property> <property name="top_attach">4</property> - <property name="width">3</property> </packing> </child> <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> <object class="GtkButton" id="button_scrollbox_font"> <property name="label" translatable="yes">Select _font</property> <property name="visible">True</property> diff --git a/panel-plugin/weather-scrollbox.c b/panel-plugin/weather-scrollbox.c index 48f94e0..3ac21f9 100644 --- a/panel-plugin/weather-scrollbox.c +++ b/panel-plugin/weather-scrollbox.c @@ -35,11 +35,16 @@ static void gtk_scrollbox_finalize(GObject *object); -static void gtk_scrollbox_size_request(GtkWidget *widget, - GtkRequisition *requisition); +static void gtk_scrollbox_get_preferred_height (GtkWidget *widget, + gint *minimal_height, + gint *natural_height); -static gboolean gtk_scrollbox_expose_event(GtkWidget *widget, - GdkEventExpose *event); +static void gtk_scrollbox_get_preferred_width (GtkWidget *widget, + gint *minimal_width, + gint *natural_width); + +static gboolean gtk_scrollbox_draw_event(GtkWidget *widget, + cairo_t *cr); static gboolean gtk_scrollbox_control_loop(gpointer user_data); @@ -56,8 +61,9 @@ gtk_scrollbox_class_init(GtkScrollboxClass *klass) gobject_class->finalize = gtk_scrollbox_finalize; widget_class = GTK_WIDGET_CLASS(klass); - widget_class->size_request = gtk_scrollbox_size_request; - widget_class->expose_event = gtk_scrollbox_expose_event; + widget_class->get_preferred_width = gtk_scrollbox_get_preferred_width; + widget_class->get_preferred_height = gtk_scrollbox_get_preferred_height; + widget_class->draw = gtk_scrollbox_draw_event; } @@ -170,9 +176,35 @@ gtk_scrollbox_size_request(GtkWidget *widget, } +static void +gtk_scrollbox_get_preferred_height (GtkWidget *widget, + gint *minimal_height, + gint *natural_height) +{ + GtkRequisition requisition; + + gtk_scrollbox_size_request (widget, &requisition); + + *minimal_height = *natural_height = requisition.height; +} + + +static void +gtk_scrollbox_get_preferred_width (GtkWidget *widget, + gint *minimal_width, + gint *natural_width) +{ + GtkRequisition requisition; + + gtk_scrollbox_size_request (widget, &requisition); + + *minimal_width = *natural_width = requisition.width; +} + + static gboolean -gtk_scrollbox_expose_event(GtkWidget *widget, - GdkEventExpose *event) +gtk_scrollbox_draw_event(GtkWidget *widget, + cairo_t *cr) { GtkScrollbox *self = GTK_SCROLLBOX(widget); PangoLayout *layout; @@ -182,9 +214,9 @@ gtk_scrollbox_expose_event(GtkWidget *widget, PangoMatrix matrix = PANGO_MATRIX_INIT; GtkAllocation allocation; - if (GTK_WIDGET_CLASS(gtk_scrollbox_parent_class)->expose_event != NULL) + if (GTK_WIDGET_CLASS(gtk_scrollbox_parent_class)->draw != NULL) result = GTK_WIDGET_CLASS - (gtk_scrollbox_parent_class)->expose_event(widget, event); + (gtk_scrollbox_parent_class)->draw(widget, cr); if (self->active != NULL) { layout = PANGO_LAYOUT(self->active->data); @@ -216,11 +248,11 @@ gtk_scrollbox_expose_event(GtkWidget *widget, - PANGO_PIXELS(logical_rect.width)) / 2; } - gtk_paint_layout(gtk_widget_get_style (GTK_WIDGET (widget)), - gtk_widget_get_window (GTK_WIDGET (widget)), - gtk_widget_get_state(widget), TRUE, - &event->area, widget, - "GtkScrollbox", width, height, layout); + gtk_render_layout (gtk_widget_get_style_context (GTK_WIDGET (widget)), + cr, + width, + height, + layout); } return result; } diff --git a/panel-plugin/weather-search.c b/panel-plugin/weather-search.c index c6c7bf6..b934151 100644 --- a/panel-plugin/weather-search.c +++ b/panel-plugin/weather-search.c @@ -202,18 +202,18 @@ create_search_dialog(GtkWindow *parent, parent, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_STOCK_CANCEL, + _("Cancel"), GTK_RESPONSE_REJECT, - GTK_STOCK_OK, + _("OK"), GTK_RESPONSE_ACCEPT, NULL); gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog->dialog), GTK_RESPONSE_ACCEPT, FALSE); - gtk_window_set_icon_name(GTK_WINDOW(dialog->dialog), GTK_STOCK_FIND); + gtk_window_set_icon_name(GTK_WINDOW(dialog->dialog), "edit-find"); dialog_vbox = gtk_dialog_get_content_area(GTK_DIALOG(dialog->dialog)); - vbox = gtk_vbox_new(FALSE, BORDER); + vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, BORDER); gtk_container_set_border_width(GTK_CONTAINER(vbox), 6); gtk_box_pack_start(GTK_BOX(dialog_vbox), vbox, TRUE, TRUE, 0); @@ -221,7 +221,7 @@ create_search_dialog(GtkWindow *parent, xfce_titled_dialog_set_subtitle(XFCE_TITLED_DIALOG(dialog->dialog), _("Enter a city name or address")); - hbox = gtk_hbox_new(FALSE, BORDER); + hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, BORDER); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); dialog->search_entry = gtk_entry_new(); @@ -230,7 +230,7 @@ create_search_dialog(GtkWindow *parent, g_signal_connect(G_OBJECT(dialog->search_entry), "activate", G_CALLBACK(search_cb), dialog); - dialog->find_button = gtk_button_new_from_stock(GTK_STOCK_FIND); + dialog->find_button = gtk_button_new_from_stock("edit-find"); gtk_box_pack_start(GTK_BOX(hbox), dialog->find_button, TRUE, TRUE, 0); g_signal_connect(G_OBJECT(dialog->find_button), "clicked", G_CALLBACK(search_cb), dialog); diff --git a/panel-plugin/weather-summary.c b/panel-plugin/weather-summary.c index fe3a821..ada3ad8 100644 --- a/panel-plugin/weather-summary.c +++ b/panel-plugin/weather-summary.c @@ -90,12 +90,12 @@ lnk_clicked(GtkTextTag *tag, #define ATTACH_DAYTIME_HEADER(title, pos) \ if (data->forecast_layout == FC_LAYOUT_CALENDAR) \ gtk_table_attach_defaults \ - (GTK_TABLE(table), \ + (table, \ add_forecast_header(title, 90.0, &darkbg), \ 0, 1, pos, pos+1); \ else \ gtk_table_attach_defaults \ - (GTK_TABLE(table), \ + (table, \ add_forecast_header(title, 0.0, &darkbg), \ pos, pos+1, 0, 1); \ @@ -840,7 +840,7 @@ add_forecast_cell(plugin_data *data, gchar *wind_speed, *wind_direction, *value, *rawvalue; xml_time *fcdata; - box = gtk_vbox_new(FALSE, 0); + box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); fcdata = make_forecast_data(data->weatherdata, daydata, day, daytime); if (fcdata == NULL) @@ -930,12 +930,12 @@ make_forecast(plugin_data *data) else table = gtk_table_new(data->forecast_days + 1, 5, FALSE); - gtk_table_set_row_spacings(GTK_TABLE(table), 0); - gtk_table_set_col_spacings(GTK_TABLE(table), 0); + gtk_table_set_row_spacings(table, 0); + gtk_table_set_col_spacings(table, 0); /* empty upper left corner */ - box = gtk_vbox_new(FALSE, 0); - gtk_table_attach_defaults(GTK_TABLE(table), + box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); + gtk_table_attach_defaults(table, wrap_forecast_cell(box, &darkbg), 0, 1, 0, 1); @@ -960,10 +960,10 @@ make_forecast(plugin_data *data) gtk_widget_set_tooltip_markup(GTK_WIDGET(ebox), text); if (data->forecast_layout == FC_LAYOUT_CALENDAR) - gtk_table_attach_defaults(GTK_TABLE(table), GTK_WIDGET(ebox), + gtk_table_attach_defaults(table, GTK_WIDGET(ebox), i+1, i+2, 0, 1); else - gtk_table_attach_defaults(GTK_TABLE(table), GTK_WIDGET(ebox), + gtk_table_attach_defaults(table, GTK_WIDGET(ebox), 0, 1, i+1, i+2); /* to speed up things, first get forecast data for all daytimes */ @@ -981,11 +981,11 @@ make_forecast(plugin_data *data) ebox = wrap_forecast_cell(align, &lightbg); if (data->forecast_layout == FC_LAYOUT_CALENDAR) - gtk_table_attach_defaults(GTK_TABLE(table), + gtk_table_attach_defaults(table, GTK_WIDGET(ebox), i+1, i+2, 1+daytime, 2+daytime); else - gtk_table_attach_defaults(GTK_TABLE(table), + gtk_table_attach_defaults(table, GTK_WIDGET(ebox), 1+daytime, 2+daytime, i+1, i+2); } @@ -1043,7 +1043,7 @@ create_forecast_tab(plugin_data *data) return align; } else { /* contents too big, scroll window needed */ - hbox = gtk_hbox_new(FALSE, 0); + hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start(GTK_BOX(hbox), table, TRUE, FALSE, 0); gtk_container_add(GTK_CONTAINER(align), GTK_WIDGET(hbox)); @@ -1150,15 +1150,15 @@ create_summary_window(plugin_data *data) conditions = get_current_conditions(data->weatherdata); window = xfce_titled_dialog_new_with_buttons(_("Weather Report"), NULL, - GTK_DIALOG_NO_SEPARATOR, - GTK_STOCK_CLOSE, + GTK_DIALOG_DESTROY_WITH_PARENT, + _("Close"), GTK_RESPONSE_ACCEPT, NULL); if (G_LIKELY(data->location_name != NULL)) { title = g_strdup_printf("%s\n", data->location_name); xfce_titled_dialog_set_subtitle(XFCE_TITLED_DIALOG(window), title); g_free(title); } - vbox = gtk_vbox_new(FALSE, 0); + vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area (GTK_DIALOG(window))), vbox, TRUE, TRUE, 0); symbol = get_data(conditions, data->units, SYMBOL, @@ -1173,7 +1173,7 @@ create_summary_window(plugin_data *data) if (data->location_name == NULL || data->weatherdata == NULL || data->weatherdata->current_conditions == NULL) { - hbox = gtk_hbox_new(FALSE, 0); + hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); if (data->location_name == NULL) label = gtk_label_new(_("Please set a location in the plugin settings.")); else diff --git a/panel-plugin/weather.c b/panel-plugin/weather.c index 338020b..d28b761 100644 --- a/panel-plugin/weather.c +++ b/panel-plugin/weather.c @@ -1897,11 +1897,11 @@ xfceweather_create_control(XfcePanelPlugin *plugin) /* create alignment box that can be easily adapted to the panel orientation */ - data->alignbox = xfce_hvbox_new(GTK_ORIENTATION_HORIZONTAL, FALSE, 0); + data->alignbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_container_add(GTK_CONTAINER(data->button), data->alignbox); /* add widgets to alignment box */ - data->vbox_center_scrollbox = gtk_vbox_new(FALSE, 0); + data->vbox_center_scrollbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); gtk_misc_set_alignment(GTK_MISC(data->iconimage), 1, 0.5); gtk_box_pack_start(GTK_BOX(data->alignbox), data->iconimage, TRUE, FALSE, 0); @@ -1925,10 +1925,10 @@ xfceweather_create_control(XfcePanelPlugin *plugin) /* add refresh button to right click menu, for people who missed the middle mouse click feature */ - refresh = gtk_image_menu_item_new_with_mnemonic(_("Re_fresh")); - refresh_icon = gtk_image_new_from_stock(GTK_STOCK_REFRESH, + refresh = gtk_menu_item_new_with_mnemonic(_("Re_fresh")); + refresh_icon = gtk_image_new_from_icon_name("view-refresh", GTK_ICON_SIZE_MENU); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(refresh), refresh_icon); + //gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(refresh), refresh_icon); gtk_widget_show(refresh); g_signal_connect(G_OBJECT(refresh), "activate", G_CALLBACK(mi_click), data); @@ -2038,11 +2038,11 @@ xfceweather_set_mode(XfcePanelPlugin *panel, if (data->panel_orientation == XFCE_PANEL_PLUGIN_MODE_HORIZONTAL || (data->panel_orientation == XFCE_PANEL_PLUGIN_MODE_DESKBAR && data->single_row)) { - xfce_hvbox_set_orientation(XFCE_HVBOX(data->alignbox), + gtk_orientable_set_orientation(data->alignbox, GTK_ORIENTATION_HORIZONTAL); gtk_misc_set_alignment(GTK_MISC(data->iconimage), 1, 0.5); } else { - xfce_hvbox_set_orientation(XFCE_HVBOX(data->alignbox), + gtk_orientable_set_orientation(data->alignbox, GTK_ORIENTATION_VERTICAL); gtk_misc_set_alignment(GTK_MISC(data->iconimage), 0.5, 1); } @@ -2077,11 +2077,11 @@ xfceweather_set_orientation(XfcePanelPlugin *panel, data->panel_orientation = orientation; if (data->panel_orientation == GTK_ORIENTATION_HORIZONTAL) { - xfce_hvbox_set_orientation(XFCE_HVBOX(data->alignbox), + gtk_orientable_set_orientation(data->alignbox, GTK_ORIENTATION_HORIZONTAL); gtk_misc_set_alignment(GTK_MISC(data->iconimage), 1, 0.5); } else { - xfce_hvbox_set_orientation(XFCE_HVBOX(data->alignbox), + gtk_orientable_set_orientation(data->alignbox, GTK_ORIENTATION_VERTICAL); gtk_misc_set_alignment(GTK_MISC(data->iconimage), 0.5, 1); } diff --git a/panel-plugin/weather.desktop.in b/panel-plugin/weather.desktop.in index fa40e0a..d13d19a 100644 --- a/panel-plugin/weather.desktop.in +++ b/panel-plugin/weather.desktop.in @@ -5,3 +5,4 @@ _Comment=Show current weather conditions Icon=xfce4-weather X-XFCE-Internal=FALSE X-XFCE-Module=weather +X-XFCE-API=2.0 -- 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
