strut_policy=minimum possible even if autohide disabled
git-svn-id: http://tint2.googlecode.com/svn/trunk@489 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
parent
237b19c5c9
commit
771d0bf4ea
2 changed files with 14 additions and 15 deletions
|
@ -283,10 +283,10 @@ void add_entry (char *key, char *value)
|
||||||
else if (strcmp (key, "panel_layer") == 0) {
|
else if (strcmp (key, "panel_layer") == 0) {
|
||||||
if (strcmp(value, "bottom") == 0)
|
if (strcmp(value, "bottom") == 0)
|
||||||
panel_layer = BOTTOM_LAYER;
|
panel_layer = BOTTOM_LAYER;
|
||||||
else if (strcmp(value, "normal") == 0)
|
|
||||||
panel_layer = NORMAL_LAYER;
|
|
||||||
else if (strcmp(value, "top") == 0)
|
else if (strcmp(value, "top") == 0)
|
||||||
panel_layer = TOP_LAYER;
|
panel_layer = TOP_LAYER;
|
||||||
|
else
|
||||||
|
panel_layer = NORMAL_LAYER;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Battery */
|
/* Battery */
|
||||||
|
|
25
src/panel.c
25
src/panel.c
|
@ -88,7 +88,7 @@ void default_panel()
|
||||||
panel_autohide_show_timeout = 0;
|
panel_autohide_show_timeout = 0;
|
||||||
panel_autohide_hide_timeout = 0;
|
panel_autohide_hide_timeout = 0;
|
||||||
panel_autohide_height = 5; // for vertical panels this is of course the width
|
panel_autohide_height = 5; // for vertical panels this is of course the width
|
||||||
panel_strut_policy = STRUT_MINIMUM;
|
panel_strut_policy = STRUT_FOLLOW_SIZE;
|
||||||
panel_dock = 0; // default not in the dock
|
panel_dock = 0; // default not in the dock
|
||||||
panel_layer = BOTTOM_LAYER; // default is bottom layer
|
panel_layer = BOTTOM_LAYER; // default is bottom layer
|
||||||
wm_menu = 0;
|
wm_menu = 0;
|
||||||
|
@ -284,16 +284,15 @@ void init_panel_size_and_position(Panel *panel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (panel_autohide) {
|
// autohide or strut_policy=minimum
|
||||||
int diff = (panel_horizontal ? panel->area.height : panel->area.width) - panel_autohide_height;
|
int diff = (panel_horizontal ? panel->area.height : panel->area.width) - panel_autohide_height;
|
||||||
if (panel_horizontal) {
|
if (panel_horizontal) {
|
||||||
panel->hidden_width = panel->area.width;
|
panel->hidden_width = panel->area.width;
|
||||||
panel->hidden_height = panel->area.height - diff;
|
panel->hidden_height = panel->area.height - diff;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
panel->hidden_width = panel->area.width - diff;
|
panel->hidden_width = panel->area.width - diff;
|
||||||
panel->hidden_height = panel->area.height;
|
panel->hidden_height = panel->area.height;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// printf("panel : posx %d, posy %d, width %d, height %d\n", panel->posx, panel->posy, panel->area.width, panel->area.height);
|
// printf("panel : posx %d, posy %d, width %d, height %d\n", panel->posx, panel->posy, panel->area.width, panel->area.height);
|
||||||
}
|
}
|
||||||
|
@ -417,7 +416,7 @@ void update_strut(Panel* p)
|
||||||
long struts [12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
long struts [12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||||
if (panel_horizontal) {
|
if (panel_horizontal) {
|
||||||
int height = p->area.height + p->marginy;
|
int height = p->area.height + p->marginy;
|
||||||
if (panel_autohide && (panel_strut_policy == STRUT_MINIMUM || (panel_strut_policy == STRUT_FOLLOW_SIZE && p->is_hidden)) )
|
if (panel_strut_policy == STRUT_MINIMUM || (panel_strut_policy == STRUT_FOLLOW_SIZE && p->is_hidden))
|
||||||
height = p->hidden_height;
|
height = p->hidden_height;
|
||||||
if (panel_position & TOP) {
|
if (panel_position & TOP) {
|
||||||
struts[2] = height + monitor.y;
|
struts[2] = height + monitor.y;
|
||||||
|
@ -434,7 +433,7 @@ void update_strut(Panel* p)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int width = p->area.width + p->marginx;
|
int width = p->area.width + p->marginx;
|
||||||
if (panel_autohide && (panel_strut_policy == STRUT_MINIMUM || (panel_strut_policy == STRUT_FOLLOW_SIZE && p->is_hidden)) )
|
if (panel_strut_policy == STRUT_MINIMUM || (panel_strut_policy == STRUT_FOLLOW_SIZE && p->is_hidden))
|
||||||
width = p->hidden_width;
|
width = p->hidden_width;
|
||||||
if (panel_position & LEFT) {
|
if (panel_position & LEFT) {
|
||||||
struts[0] = width + monitor.x;
|
struts[0] = width + monitor.x;
|
||||||
|
|
Loading…
Reference in a new issue