[*.c] Add x option for bar buttons position
This commit is contained in:
parent
c1906cd63e
commit
8b37136652
2
config.c
2
config.c
@ -140,6 +140,7 @@ init_conf(void) {
|
||||
CFG_SEC("mouse", mouse_button_opts, CFGF_MULTI),
|
||||
CFG_INT("fg_color", 0x000000, CFGF_NONE),
|
||||
CFG_INT("bg_color", 0xFFFFFF, CFGF_NONE),
|
||||
CFG_INT("x", 0, CFGF_NONE),
|
||||
CFG_END()
|
||||
};
|
||||
|
||||
@ -253,6 +254,7 @@ init_conf(void) {
|
||||
conf.barbutton[i].text = strdup(cfg_getstr(cfgtmp2, "text"));
|
||||
conf.barbutton[i].fg_color = cfg_getint(cfgtmp2, "fg_color");
|
||||
conf.barbutton[i].bg_color = cfg_getint(cfgtmp2, "bg_color");
|
||||
conf.barbutton[i].x = cfg_getint(cfgtmp2, "x");
|
||||
}
|
||||
cfg_free(cfg);
|
||||
}
|
||||
|
||||
17
wmfs.c
17
wmfs.c
@ -542,7 +542,7 @@ keymovex(char *cmd) {
|
||||
&& !ishide(sel)
|
||||
&& !sel->max)
|
||||
{
|
||||
if((layout[seltag] == Tile && !sel->hint) || layout[seltag] == Max)
|
||||
if(layout[seltag] == Tile && !sel->hint)
|
||||
return;
|
||||
int tmp;
|
||||
tmp = sel->x + atoi(cmd);
|
||||
@ -558,7 +558,7 @@ keymovey(char *cmd) {
|
||||
&& !ishide(sel)
|
||||
&& !sel->max)
|
||||
{
|
||||
if((layout[seltag] == Tile && !sel->hint) || layout[seltag] == Max)
|
||||
if(layout[seltag] == Tile && !sel->hint)
|
||||
return;
|
||||
int tmp;
|
||||
tmp = sel->y + atoi(cmd);
|
||||
@ -590,8 +590,7 @@ void
|
||||
keyresize(char *cmd) {
|
||||
if(sel && !ishide(sel)
|
||||
&& !sel->max
|
||||
&& layout[seltag] != Tile
|
||||
&& layout[seltag] != Max)
|
||||
&& layout[seltag] != Tile)
|
||||
{
|
||||
int temph = 0, tempw = 0, modh = 0, modw = 0, tmp = 0;
|
||||
|
||||
@ -1141,10 +1140,12 @@ updatebutton(Bool c) {
|
||||
|
||||
for(i = 0; i < conf.nbutton; ++i) {
|
||||
p = strlen(conf.barbutton[i].text);
|
||||
|
||||
if(i)
|
||||
pm += strlen(conf.barbutton[i-1].text) * fonty;
|
||||
x = (!i) ? j : j + pm;
|
||||
if(!conf.barbutton[i].x) {
|
||||
if(i)
|
||||
pm += strlen(conf.barbutton[i-1].text) * fonty;
|
||||
x = (!i) ? j : j + pm;
|
||||
} else
|
||||
x = conf.barbutton[i].x;
|
||||
|
||||
if(!c) {
|
||||
conf.barbutton[i].win = XCreateWindow(dpy, root, x, 0, p*fonty+2, barheight,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user