Commit 51766e06 authored by Andrzej's avatar Andrzej Committed by Nick Schermer

Tpa: Make the plugin fit a single row of the panel.

parent 94108250
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.
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment