mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
new feature: uicb_setlayout can no go backward ; binding Button3 click on layout symbol statusbar for reverse layout switching
This commit is contained in:
parent
17ec922077
commit
4c4fb83e81
2 changed files with 16 additions and 15 deletions
4
event.c
4
event.c
|
@ -175,7 +175,9 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf)
|
|||
}
|
||||
}
|
||||
if((ev->x < x + awesomeconf[screen].statusbar.width) && ev->button == Button1)
|
||||
uicb_setlayout(e->xany.display, &dc[screen], &awesomeconf[screen], NULL);
|
||||
uicb_setlayout(e->xany.display, &dc[screen], &awesomeconf[screen], "+1");
|
||||
else if((ev->x < x + awesomeconf[screen].statusbar.width) && ev->button == Button3)
|
||||
uicb_setlayout(e->xany.display, &dc[screen], &awesomeconf[screen], "-1");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
23
layout.c
23
layout.c
|
@ -163,21 +163,20 @@ uicb_setlayout(Display *disp,
|
|||
awesome_config * awesomeconf,
|
||||
const char *arg)
|
||||
{
|
||||
int i, j;
|
||||
int i;
|
||||
Client *c;
|
||||
|
||||
for(i = 0; i < awesomeconf->nlayouts && &awesomeconf->layouts[i] != awesomeconf->current_layout; i++);
|
||||
|
||||
if(!arg)
|
||||
{
|
||||
if(!(++awesomeconf->current_layout)->symbol)
|
||||
awesomeconf->current_layout = awesomeconf->layouts;
|
||||
}
|
||||
i++;
|
||||
else
|
||||
{
|
||||
i = strtol(arg, NULL, 10);
|
||||
i = compute_new_value_from_arg(arg, (double) i);
|
||||
|
||||
if(i < 0 || i >= awesomeconf->nlayouts)
|
||||
return;
|
||||
i = 0;
|
||||
|
||||
awesomeconf->current_layout = &awesomeconf->layouts[i];
|
||||
}
|
||||
|
||||
for(c = clients; c; c = c->next)
|
||||
c->ftview = True;
|
||||
|
@ -189,9 +188,9 @@ uicb_setlayout(Display *disp,
|
|||
|
||||
saveawesomeprops(disp, awesomeconf);
|
||||
|
||||
for(j = 0; j < awesomeconf->ntags; j++)
|
||||
if (awesomeconf->tags[j].selected)
|
||||
awesomeconf->tags[j].layout = awesomeconf->current_layout;
|
||||
for(i = 0; i < awesomeconf->ntags; i++)
|
||||
if (awesomeconf->tags[i].selected)
|
||||
awesomeconf->tags[i].layout = awesomeconf->current_layout;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue