statusbar: remove width_user
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
adf732dd9f
commit
2fa76f9237
10
statusbar.c
10
statusbar.c
|
@ -358,7 +358,7 @@ statusbar_position_update(statusbar_t *statusbar)
|
||||||
switch(statusbar->position)
|
switch(statusbar->position)
|
||||||
{
|
{
|
||||||
case Right:
|
case Right:
|
||||||
if(statusbar->width_user)
|
if(statusbar->width > 0)
|
||||||
wingeometry.height = statusbar->width;
|
wingeometry.height = statusbar->width;
|
||||||
else
|
else
|
||||||
wingeometry.height = area.height;
|
wingeometry.height = area.height;
|
||||||
|
@ -380,7 +380,7 @@ statusbar_position_update(statusbar_t *statusbar)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Left:
|
case Left:
|
||||||
if(statusbar->width_user)
|
if(statusbar->width > 0)
|
||||||
wingeometry.height = statusbar->width;
|
wingeometry.height = statusbar->width;
|
||||||
else
|
else
|
||||||
wingeometry.height = area.height;
|
wingeometry.height = area.height;
|
||||||
|
@ -401,7 +401,7 @@ statusbar_position_update(statusbar_t *statusbar)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Bottom:
|
case Bottom:
|
||||||
if(statusbar->width_user)
|
if(statusbar->width > 0)
|
||||||
wingeometry.width = statusbar->width;
|
wingeometry.width = statusbar->width;
|
||||||
else
|
else
|
||||||
wingeometry.width = area.width;
|
wingeometry.width = area.width;
|
||||||
|
@ -423,7 +423,7 @@ statusbar_position_update(statusbar_t *statusbar)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if(statusbar->width_user)
|
if(statusbar->width > 0)
|
||||||
wingeometry.width = statusbar->width;
|
wingeometry.width = statusbar->width;
|
||||||
else
|
else
|
||||||
wingeometry.width = area.width;
|
wingeometry.width = area.width;
|
||||||
|
@ -549,8 +549,6 @@ luaA_statusbar_new(lua_State *L)
|
||||||
sb->align = draw_align_fromstr(buf, len);
|
sb->align = draw_align_fromstr(buf, len);
|
||||||
|
|
||||||
sb->width = luaA_getopt_number(L, 2, "width", 0);
|
sb->width = luaA_getopt_number(L, 2, "width", 0);
|
||||||
if(sb->width > 0)
|
|
||||||
sb->width_user = true;
|
|
||||||
sb->height = luaA_getopt_number(L, 2, "height", 0);
|
sb->height = luaA_getopt_number(L, 2, "height", 0);
|
||||||
if(sb->height <= 0)
|
if(sb->height <= 0)
|
||||||
/* 1.5 as default factor, it fits nice but no one knows why */
|
/* 1.5 as default factor, it fits nice but no one knows why */
|
||||||
|
|
|
@ -226,8 +226,6 @@ struct statusbar_t
|
||||||
int width;
|
int width;
|
||||||
/** Bar height */
|
/** Bar height */
|
||||||
int height;
|
int height;
|
||||||
/** True if user specified width */
|
|
||||||
bool width_user;
|
|
||||||
/** Bar position */
|
/** Bar position */
|
||||||
position_t position;
|
position_t position;
|
||||||
/** Alignment */
|
/** Alignment */
|
||||||
|
|
Loading…
Reference in New Issue