Browse Source

Systray: Control the thinkness of the frame (bug #7593).

Instead of the previous commits, control the brightness in
a better way.
upstream/xfce4-panel-4.10.1
Nick Schermer 11 years ago
parent
commit
00aea5208c
  1. 2
      plugins/systray/systray-box.c
  2. 20
      plugins/systray/systray.c

2
plugins/systray/systray-box.c

@ -399,7 +399,7 @@ systray_box_size_allocate (GtkWidget *widget,
border = GTK_CONTAINER (widget)->border_width;
alloc_size = box->horizontal ? allocation->height : allocation->width;
alloc_size -= 2 * border;
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, border=%d",

20
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;
@ -525,8 +538,7 @@ systray_plugin_size_changed (XfcePanelPlugin *panel_plugin,
* behind the allocated size when resizing and during startup, we
* correct the maximum size set by the user with the size the panel
* will most likely allocated */
if (plugin->show_frame)
border += MAX (frame->style->xthickness, frame->style->ythickness);
border += MAX (frame->style->xthickness, frame->style->ythickness);
systray_box_set_size_alloc (XFCE_SYSTRAY_BOX (plugin->box), size - 2 * border);
return TRUE;

Loading…
Cancel
Save