Commit 8d755863 authored by Sean Davis's avatar Sean Davis 🕶

Make systray recognize and respond to config updates (size max, square icons)

parent 9942c3ce
Pipeline #1074 passed with stages
in 4 minutes and 40 seconds
...@@ -317,6 +317,8 @@ sn_plugin_construct (XfcePanelPlugin *panel_plugin) ...@@ -317,6 +317,8 @@ sn_plugin_construct (XfcePanelPlugin *panel_plugin)
g_signal_connect_swapped (plugin->config, "configuration-changed", g_signal_connect_swapped (plugin->config, "configuration-changed",
G_CALLBACK (gtk_widget_queue_resize), plugin->systray_box); G_CALLBACK (gtk_widget_queue_resize), plugin->systray_box);
g_signal_connect (plugin->config, "configuration-changed",
G_CALLBACK (systray_plugin_configuration_changed), plugin);
plugin->backend = sn_backend_new (); plugin->backend = sn_backend_new ();
g_signal_connect_swapped (plugin->backend, "item-added", g_signal_connect_swapped (plugin->backend, "item-added",
......
...@@ -171,6 +171,20 @@ systray_free_array_element (gpointer data) ...@@ -171,6 +171,20 @@ systray_free_array_element (gpointer data)
g_free (value); g_free (value);
} }
void systray_plugin_configuration_changed (SnConfig *config,
SnPlugin *plugin)
{
gint icon_size = sn_config_get_icon_size (config);
gboolean square_icons = sn_config_get_square_icons (config);
systray_box_set_size_max (XFCE_SYSTRAY_BOX (plugin->systray_box),
icon_size);
systray_box_set_squared (XFCE_SYSTRAY_BOX (plugin->systray_box), square_icons);
systray_plugin_size_changed (XFCE_PANEL_PLUGIN (plugin),
xfce_panel_plugin_get_size (XFCE_PANEL_PLUGIN (plugin)));
}
static void static void
systray_plugin_get_property (GObject *object, systray_plugin_get_property (GObject *object,
guint prop_id, guint prop_id,
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <libxfce4panel/libxfce4panel.h> #include <libxfce4panel/libxfce4panel.h>
#include "sn-config.h"
#include "sn-plugin.h" #include "sn-plugin.h"
G_BEGIN_DECLS G_BEGIN_DECLS
...@@ -40,6 +41,8 @@ void systray_plugin_button_toggled (GtkWidget *button, ...@@ -40,6 +41,8 @@ void systray_plugin_button_toggled (GtkWidget *button,
void systray_plugin_screen_changed (GtkWidget *widget, void systray_plugin_screen_changed (GtkWidget *widget,
GdkScreen *previous_screen); GdkScreen *previous_screen);
void systray_plugin_composited_changed (GtkWidget *widget); void systray_plugin_composited_changed (GtkWidget *widget);
void systray_plugin_configuration_changed (SnConfig *config,
SnPlugin *plugin);
void systray_plugin_orientation_changed (XfcePanelPlugin *panel_plugin, void systray_plugin_orientation_changed (XfcePanelPlugin *panel_plugin,
GtkOrientation orientation); GtkOrientation orientation);
gboolean systray_plugin_size_changed (XfcePanelPlugin *panel_plugin, gboolean systray_plugin_size_changed (XfcePanelPlugin *panel_plugin,
......
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