[Xfce4-commits] xfce4-datetime-plugin:master Set widgets orientation according to the panel orientation.
Updating branch refs/heads/master to 34b77702471d93f2d8f19e736d616ea0b01f4664 (commit) from e55a418bd9d8c284774d7b8ac33aff0356a5a4ab (commit) commit 34b77702471d93f2d8f19e736d616ea0b01f4664 Author: Harald Judt h.j...@gmx.at Date: Mon May 21 10:54:00 2012 +0200 Set widgets orientation according to the panel orientation. This makes the plugin rotate its widgets in vertical mode and introduces support for panel-4.10 features, like the new deskbar mode. Signed-off-by: Landry Breuil lan...@xfce.org panel-plugin/datetime.c | 82 ++ panel-plugin/datetime.h |2 +- 2 files changed, 68 insertions(+), 16 deletions(-) diff --git a/panel-plugin/datetime.c b/panel-plugin/datetime.c index 3350c3a..559020e 100644 --- a/panel-plugin/datetime.c +++ b/panel-plugin/datetime.c @@ -38,6 +38,13 @@ #define DATETIME_MAX_STRLEN 256 +/* check for new Xfce 4.10 panel features */ +#ifdef LIBXFCE4PANEL_CHECK_VERSION +#if LIBXFCE4PANEL_CHECK_VERSION (4,9,0) +#define HAS_PANEL_49 +#endif +#endif + /** * Convert a GTimeVal to milliseconds. * Fractions of a millisecond are truncated. @@ -440,13 +447,13 @@ void datetime_apply_layout(t_datetime *datetime, t_layout layout) switch(datetime-layout) { case LAYOUT_TIME_DATE: - gtk_box_reorder_child(GTK_BOX(datetime-vbox), datetime-time_label, 0); - gtk_box_reorder_child(GTK_BOX(datetime-vbox), datetime-date_label, 1); + gtk_box_reorder_child(GTK_BOX(datetime-box), datetime-time_label, 0); + gtk_box_reorder_child(GTK_BOX(datetime-box), datetime-date_label, 1); break; default: - gtk_box_reorder_child(GTK_BOX(datetime-vbox), datetime-time_label, 1); - gtk_box_reorder_child(GTK_BOX(datetime-vbox), datetime-date_label, 0); + gtk_box_reorder_child(GTK_BOX(datetime-box), datetime-time_label, 1); + gtk_box_reorder_child(GTK_BOX(datetime-box), datetime-date_label, 0); } datetime_set_update_interval(datetime); @@ -585,18 +592,53 @@ void datetime_write_rc_file(XfcePanelPlugin *plugin, t_datetime *dt) } /* + * change widgets orientation when the panel orientation changes + */ +#ifdef HAS_PANEL_49 +static void datetime_set_mode(XfcePanelPlugin *plugin, XfcePanelPluginMode mode, t_datetime *datetime) +{ + GtkOrientation panel_orientation = xfce_panel_plugin_get_orientation (plugin); + GtkOrientation orientation = (mode == XFCE_PANEL_PLUGIN_MODE_VERTICAL) ? +GTK_ORIENTATION_VERTICAL : GTK_ORIENTATION_HORIZONTAL; +#else +static void datetime_set_orientation(XfcePanelPlugin *plugin, GtkOrientation orientation, t_datetime *datetime) +{ +#endif + if (orientation == GTK_ORIENTATION_VERTICAL) + { +xfce_hvbox_set_orientation(XFCE_HVBOX(datetime-box), GTK_ORIENTATION_HORIZONTAL); +gtk_label_set_angle(GTK_LABEL(datetime-time_label), -90); +gtk_label_set_angle(GTK_LABEL(datetime-date_label), -90); +gtk_box_reorder_child(GTK_BOX(datetime-box), datetime-time_label, 0); +gtk_box_reorder_child(GTK_BOX(datetime-box), datetime-date_label, 1); + } + else + { +xfce_hvbox_set_orientation(XFCE_HVBOX(datetime-box), GTK_ORIENTATION_VERTICAL); +gtk_label_set_angle(GTK_LABEL(datetime-time_label), 0); +gtk_label_set_angle(GTK_LABEL(datetime-date_label), 0); +gtk_box_reorder_child(GTK_BOX(datetime-box), datetime-date_label, 0); +gtk_box_reorder_child(GTK_BOX(datetime-box), datetime-time_label, 1); + } +} + +/* * create the gtk-part of the datetime plugin */ static void datetime_create_widget(t_datetime * datetime) { + GtkOrientation orientation; + orientation = xfce_panel_plugin_get_orientation(datetime-plugin); + /* create button */ datetime-button = xfce_create_panel_toggle_button(); gtk_widget_show(datetime-button); - /* create vertical box */ - datetime-vbox = gtk_vbox_new(TRUE, 0); - gtk_widget_show(datetime-vbox); - gtk_container_add(GTK_CONTAINER(datetime-button), datetime-vbox); + /* create a box which can be easily adapted to the panel orientation */ + datetime-box = xfce_hvbox_new(GTK_ORIENTATION_VERTICAL, TRUE, 0); + + gtk_widget_show(datetime-box); + gtk_container_add(GTK_CONTAINER(datetime-button), datetime-box); /* create time and date lines */ datetime-time_label = gtk_label_new(); @@ -604,17 +646,22 @@ static void datetime_create_widget(t_datetime * datetime) gtk_label_set_justify(GTK_LABEL(datetime-time_label), GTK_JUSTIFY_CENTER); gtk_label_set_justify(GTK_LABEL(datetime-date_label), GTK_JUSTIFY_CENTER); - /* add time and date lines to the vbox */ - gtk_box_pack_start(GTK_BOX(datetime-vbox), + /* add time and date lines to the box */ + gtk_box_pack_start(GTK_BOX(datetime-box), datetime-time_label, FALSE, FALSE, 0); - gtk_box_pack_start(GTK_BOX(datetime-vbox), + gtk_box_pack_start(GTK_BOX(datetime-box), datetime-date_label, FALSE, FALSE, 0); - gtk_box_reorder_child(GTK_BOX(datetime-vbox), datetime-time_label,
[Xfce4-commits] xfce4-datetime-plugin:master Remove the #ifdef machinery checking if GtkTooltip is available
Updating branch refs/heads/master to 1bd3d679d4591dd6689f0f7008e69d5fe8fe177e (commit) from 34b77702471d93f2d8f19e736d616ea0b01f4664 (commit) commit 1bd3d679d4591dd6689f0f7008e69d5fe8fe177e Author: Landry Breuil lan...@xfce.org Date: Thu Feb 14 21:30:41 2013 +0100 Remove the #ifdef machinery checking if GtkTooltip is available Gtk 2.15.4 was released 4 years ago and GtkTooltip is here since 2.12... panel-plugin/datetime-dialog.c | 23 --- panel-plugin/datetime.c|4 panel-plugin/datetime.h|8 3 files changed, 0 insertions(+), 35 deletions(-) diff --git a/panel-plugin/datetime-dialog.c b/panel-plugin/datetime-dialog.c index 4ef3ab8..ede858f 100644 --- a/panel-plugin/datetime-dialog.c +++ b/panel-plugin/datetime-dialog.c @@ -170,7 +170,6 @@ datetime_layout_changed(GtkComboBox *cbox, t_datetime *dt) /* read layout */ layout = gtk_combo_box_get_active(cbox); -#if USE_GTK_TOOLTIP_API switch(layout) { case LAYOUT_DATE: @@ -196,24 +195,6 @@ datetime_layout_changed(GtkComboBox *cbox, t_datetime *dt) gtk_widget_show(dt-time_font_hbox); gtk_widget_hide(dt-time_tooltip_label); } -#else - switch(layout) - { -case LAYOUT_DATE: - gtk_widget_set_sensitive(dt-date_frame, TRUE); - gtk_widget_set_sensitive(dt-time_frame, FALSE); - break; - -case LAYOUT_TIME: - gtk_widget_set_sensitive(dt-date_frame, FALSE); - gtk_widget_set_sensitive(dt-time_frame, TRUE); - break; - -default: - gtk_widget_set_sensitive(dt-date_frame, TRUE); - gtk_widget_set_sensitive(dt-time_frame, TRUE); - } -#endif datetime_apply_layout(dt, layout); datetime_update(dt); @@ -431,7 +412,6 @@ datetime_properties_dialog(XfcePanelPlugin *plugin, t_datetime * datetime) vbox = gtk_vbox_new(FALSE, 8); gtk_container_add(GTK_CONTAINER(bin),vbox); -#if USE_GTK_TOOLTIP_API /* tooltip label */ str = g_markup_printf_escaped(span style=\italic\%s/span, _(The date will appear in a tooltip.)); @@ -440,7 +420,6 @@ datetime_properties_dialog(XfcePanelPlugin *plugin, t_datetime * datetime) gtk_label_set_use_markup(GTK_LABEL(datetime-date_tooltip_label), TRUE); gtk_misc_set_alignment(GTK_MISC(datetime-date_tooltip_label), 0.0f, 0.0f); gtk_box_pack_start(GTK_BOX(vbox), datetime-date_tooltip_label, FALSE, FALSE, 0); -#endif /* hbox */ datetime-date_font_hbox = gtk_hbox_new(FALSE, 2); @@ -534,7 +513,6 @@ datetime_properties_dialog(XfcePanelPlugin *plugin, t_datetime * datetime) vbox = gtk_vbox_new(FALSE, 8); gtk_container_add(GTK_CONTAINER(bin),vbox); -#if USE_GTK_TOOLTIP_API /* tooltip label */ str = g_markup_printf_escaped(span style=\italic\%s/span, _(The time will appear in a tooltip.)); @@ -543,7 +521,6 @@ datetime_properties_dialog(XfcePanelPlugin *plugin, t_datetime * datetime) gtk_label_set_use_markup(GTK_LABEL(datetime-time_tooltip_label), TRUE); gtk_misc_set_alignment(GTK_MISC(datetime-time_tooltip_label), 0.0f, 0.0f); gtk_box_pack_start(GTK_BOX(vbox), datetime-time_tooltip_label, FALSE, FALSE, 0); -#endif /* hbox */ datetime-time_font_hbox = gtk_hbox_new(FALSE, 2); diff --git a/panel-plugin/datetime.c b/panel-plugin/datetime.c index 559020e..181c273 100644 --- a/panel-plugin/datetime.c +++ b/panel-plugin/datetime.c @@ -177,7 +177,6 @@ gboolean datetime_update(t_datetime *datetime) return TRUE; } -#if USE_GTK_TOOLTIP_API static gboolean datetime_tooltip_timer(t_datetime *datetime) { DBG(wake); @@ -244,7 +243,6 @@ static gboolean datetime_query_tooltip(GtkWidget *widget, return TRUE; } -#endif static void on_calendar_realized(GtkWidget *widget, t_datetime *datetime) { @@ -420,7 +418,6 @@ void datetime_apply_layout(t_datetime *datetime, t_layout layout) break; } -#if USE_GTK_TOOLTIP_API /* update tooltip handler */ if (datetime-tooltip_handler_id) { @@ -441,7 +438,6 @@ void datetime_apply_layout(t_datetime *datetime, t_layout layout) default: gtk_widget_set_has_tooltip(GTK_WIDGET(datetime-button), FALSE); } -#endif /* set order based on layout-selection */ switch(datetime-layout) diff --git a/panel-plugin/datetime.h b/panel-plugin/datetime.h index 73aa4ed..5f09f83 100644 --- a/panel-plugin/datetime.h +++ b/panel-plugin/datetime.h @@ -22,8 +22,6 @@ #ifndef DATETIME_H #define DATETIME_H -#define USE_GTK_TOOLTIP_API GTK_CHECK_VERSION(2,15,4) - /* enums */ enum { DATE = 0, @@ -48,10 +46,8 @@ typedef struct { GtkWidget *time_label; guint update_interval; /* time between updates in milliseconds */ guint timeout_id; -#if USE_GTK_TOOLTIP_API guint tooltip_timeout_id; gulong tooltip_handler_id; -#endif /* settings */ gchar *date_font; @@ -62,17 +58,13 @@ typedef struct { /* option widgets */ GtkWidget *date_frame; -#if USE_GTK_TOOLTIP_API GtkWidget
[Xfce4-commits] xfce4-datetime-plugin:master Updates for release 0.6.2.
Updating branch refs/heads/master to dd789c65229ae2ee452227619ea95c93381b8604 (commit) from 1bd3d679d4591dd6689f0f7008e69d5fe8fe177e (commit) commit dd789c65229ae2ee452227619ea95c93381b8604 Author: Landry Breuil lan...@xfce.org Date: Thu Feb 14 22:02:44 2013 +0100 Updates for release 0.6.2. Reset maintainer to goodies-dev.. NEWS|8 configure.ac.in |9 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 0afc635..787db3d 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +2013-02-14 + +xfce4-datetime-plugin v0.6.2 released + +* port to libxfce4ui (bug #8064) +* set text orientation according to panel mode/orientation (bug #8926) +* update toolchain/makefiles + 2008-11-19 xfce4-datetime-plugin v0.6.1 released diff --git a/configure.ac.in b/configure.ac.in index cdb3536..9113f98 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -1,13 +1,14 @@ dnl Version information m4_define([datetime_version_major], [0]) m4_define([datetime_version_minor], [6]) -m4_define([datetime_version_micro], [1]) +m4_define([datetime_version_micro], [2]) m4_define([datetime_version], [datetime_version_major().datetime_version_minor().datetime_version_micro()]) dnl Initialize autoconf -AC_COPYRIGHT([Copyright (c) 2006 -Remco den Breeje re...@sx.mine.nu]) -AC_INIT([xfce4-datetime-plugin], [datetime_version], [ongar...@gmail.com]) +AC_COPYRIGHT([Copyright (c) 2006-2009 +Remco den Breeje re...@sx.mine.nu +Diego Ongaro ongar...@gmail.com]) +AC_INIT([xfce4-datetime-plugin], [datetime_version], [goodies-...@xfce.org]) dnl Initialize automake AM_INIT_AUTOMAKE([AC_PACKAGE_TARNAME()], [AC_PACKAGE_VERSION()]) ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] xfce4-datetime-plugin|datetime-0.6.2 Creating annotated tag datetime-0.6.2
Updating annotated tag refs/tags/datetime-0.6.2 as new annotated tag to 985e825ec4db00ddd0cfe604f5061140e3b4d99c (tag) succeeds datetime-0.6.1-103-g1bd3d67 tagged by Landry Breuil lan...@xfce.org on 2013-02-14 22:04 +0100 Landry Breuil (1): Updates for release 0.6.2. ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits
[Xfce4-commits] midori:master Rename menu _Window to _Tabs
Updating branch refs/heads/master to 95eb63e32edfea1cf19dce4776e48cf937d58a3a (commit) from 25f94c69f1b12748a510cf311bf6134830964229 (commit) commit 95eb63e32edfea1cf19dce4776e48cf937d58a3a Author: Cuzzie Lee kelwin@gmail.com Date: Fri Feb 15 00:54:15 2013 +0100 Rename menu _Window to _Tabs Fixes: https://bugs.launchpad.net/midori/+bug/738474 midori/midori-browser.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 1412df6..6580533 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -6094,7 +6094,7 @@ midori_browser_init (MidoriBrowser* browser) action = g_object_new (KATZE_TYPE_ARRAY_ACTION, name, Window, -label, _(_Window), +label, _(_Tabs), stock-id, GTK_STOCK_INDEX, tooltip, _(Show a list of all open tabs), array, browser-proxy_array, ___ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits