Updating branch refs/heads/master to 51766e062740efc416ef3d37aa95008713d59ec3 (commit) from 9410825062964577e5e3c7620371be8bfb4bfcb0 (commit)
commit 51766e062740efc416ef3d37aa95008713d59ec3 Author: Andrzej <ndrwr...@gmail.com> Date: Thu Jan 26 22:56:41 2012 +0900 Tpa: Make the plugin fit a single row of the panel. NEWS | 4 ++++ plugins/thunar-tpa/thunar-tpa.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 0 deletions(-) diff --git a/NEWS b/NEWS index 3d0bf5a..beb07e3 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +1.3.x +===== +- Support small property for trash panel applet (bug #8391). + 1.3.1 ===== - Fix crash when trying to thumbnail a file with unknown content type. diff --git a/plugins/thunar-tpa/thunar-tpa.c b/plugins/thunar-tpa/thunar-tpa.c index 12b8d73..3af9472 100644 --- a/plugins/thunar-tpa/thunar-tpa.c +++ b/plugins/thunar-tpa/thunar-tpa.c @@ -55,6 +55,12 @@ GType thunar_tpa_get_type (void); void thunar_tpa_register_type (XfcePanelTypeModule *type_module); static void thunar_tpa_finalize (GObject *object); static void thunar_tpa_construct (XfcePanelPlugin *panel_plugin); + +#if defined (LIBXFCE4PANEL_CHECK_VERSION) && LIBXFCE4PANEL_CHECK_VERSION (4,9,0) +static gboolean thunar_tpa_size_changed (XfcePanelPlugin *panel_plugin, + gint size); +#endif + static void thunar_tpa_error (ThunarTpa *plugin, GError *error); static void thunar_tpa_state (ThunarTpa *plugin, @@ -147,6 +153,12 @@ thunar_tpa_class_init (ThunarTpaClass *klass) plugin_class = XFCE_PANEL_PLUGIN_CLASS (klass); plugin_class->construct = thunar_tpa_construct; + +#ifdef LIBXFCE4PANEL_CHECK_VERSION +#if LIBXFCE4PANEL_CHECK_VERSION (4, 9, 0) + plugin_class->size_changed = thunar_tpa_size_changed; +#endif +#endif } @@ -232,6 +244,13 @@ thunar_tpa_construct (XfcePanelPlugin *panel_plugin) { ThunarTpa *plugin = THUNAR_TPA (panel_plugin); +#ifdef LIBXFCE4PANEL_CHECK_VERSION +#if LIBXFCE4PANEL_CHECK_VERSION (4, 9, 0) + /* make the plugin fit a single row */ + xfce_panel_plugin_set_small (panel_plugin, TRUE); +#endif +#endif + /* add the "Empty Trash" menu item */ xfce_panel_plugin_menu_insert_item (panel_plugin, GTK_MENU_ITEM (plugin->mi)); @@ -241,6 +260,25 @@ thunar_tpa_construct (XfcePanelPlugin *panel_plugin) +#ifdef LIBXFCE4PANEL_CHECK_VERSION +#if LIBXFCE4PANEL_CHECK_VERSION (4, 9, 0) +static gboolean +thunar_tpa_size_changed (XfcePanelPlugin *panel_plugin, + gint size) +{ + g_return_val_if_fail (panel_plugin != NULL, FALSE); + + /* make the plugin fit a single row */ + size /= xfce_panel_plugin_get_nrows (panel_plugin); + gtk_widget_set_size_request (GTK_WIDGET (panel_plugin), size, size); + + return TRUE; +} +#endif +#endif + + + static void thunar_tpa_error (ThunarTpa *plugin, GError *error) _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org https://mail.xfce.org/mailman/listinfo/xfce4-commits