[Xfce4-commits] <xfce4-panel:xfce-4.8> Systray: Control the thinkness of the frame (bug #7593).
Nick Schermer
noreply at xfce.org
Sun Sep 11 20:22:01 CEST 2011
Updating branch refs/heads/xfce-4.8
to 1f6ca87ff2e965a345094870889c1b1e63124498 (commit)
from e49e4f43da6a4d3ad45c2388e440d69add0f107d (commit)
commit 1f6ca87ff2e965a345094870889c1b1e63124498
Author: Nick Schermer <nick at xfce.org>
Date: Sun Sep 11 14:19:42 2011 +0200
Systray: Control the thinkness of the frame (bug #7593).
Control the thickness in a better way and completely unset it
when the frame is disabled.
(cherry picked from commit 70d376e5485c7208012adb2aa2bc1b3f74f274d2)
(cherry picked from commit 3bb8fea830be758a8af556427ef81f41782ef39c)
(cherry picked from commit 00aea5208c00deb7e1f982815971b8cb15679f6e)
plugins/systray/systray-box.c | 5 +++--
plugins/systray/systray.c | 17 +++++++++++++++--
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/plugins/systray/systray-box.c b/plugins/systray/systray-box.c
index aca2def..06f0b46 100644
--- a/plugins/systray/systray-box.c
+++ b/plugins/systray/systray-box.c
@@ -399,11 +399,12 @@ systray_box_size_allocate (GtkWidget *widget,
border = GTK_CONTAINER (widget)->border_width;
alloc_size = box->horizontal ? allocation->height : allocation->width;
+
systray_box_size_get_max_child_size (box, alloc_size, &rows, &row_size, &offset);
- panel_debug_filtered (PANEL_DEBUG_SYSTRAY, "allocate rows=%d, row_size=%d, w=%d, h=%d, horiz=%s",
+ panel_debug_filtered (PANEL_DEBUG_SYSTRAY, "allocate rows=%d, row_size=%d, w=%d, h=%d, horiz=%s, border=%d",
rows, row_size, allocation->width, allocation->height,
- PANEL_DEBUG_BOOL (box->horizontal));
+ PANEL_DEBUG_BOOL (box->horizontal), border);
/* get allocation bounds */
x_start = allocation->x + border;
diff --git a/plugins/systray/systray.c b/plugins/systray/systray.c
index 69a7d3e..154bc03 100644
--- a/plugins/systray/systray.c
+++ b/plugins/systray/systray.c
@@ -211,6 +211,8 @@ systray_plugin_class_init (SystrayPluginClass *klass)
static void
systray_plugin_init (SystrayPlugin *plugin)
{
+ GtkRcStyle *style;
+
plugin->manager = NULL;
plugin->show_frame = TRUE;
plugin->idle_startup = 0;
@@ -221,6 +223,11 @@ systray_plugin_init (SystrayPlugin *plugin)
gtk_frame_set_shadow_type (GTK_FRAME (plugin->frame), GTK_SHADOW_ETCHED_IN);
gtk_widget_show (plugin->frame);
+ style = gtk_rc_style_new ();
+ style->xthickness = style->ythickness = 1;
+ gtk_widget_modify_style (plugin->frame, style);
+ g_object_unref (G_OBJECT (style));
+
plugin->hvbox = xfce_hvbox_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 2);
gtk_container_add (GTK_CONTAINER (plugin->frame), plugin->hvbox);
gtk_widget_show (plugin->hvbox);
@@ -298,6 +305,7 @@ systray_plugin_set_property (GObject *object,
const GValue *tmp;
gchar *name;
guint i;
+ GtkRcStyle *style;
switch (prop_id)
{
@@ -314,8 +322,13 @@ systray_plugin_set_property (GObject *object,
gtk_frame_set_shadow_type (GTK_FRAME (plugin->frame),
show_frame ? GTK_SHADOW_ETCHED_IN : GTK_SHADOW_NONE);
- gtk_container_set_border_width (GTK_CONTAINER (plugin->box),
- plugin->show_frame ? FRAME_SPACING : 0);
+ style = gtk_rc_style_new ();
+ style->xthickness = style->ythickness = show_frame ? 1 : 0;
+ gtk_widget_modify_style (plugin->frame, style);
+ g_object_unref (G_OBJECT (style));
+
+ systray_plugin_size_changed (XFCE_PANEL_PLUGIN (plugin),
+ xfce_panel_plugin_get_size (XFCE_PANEL_PLUGIN (plugin)));
}
break;
More information about the Xfce4-commits
mailing list