make tag_view_prev and next to by cycling
This commit is contained in:
parent
4d117da0ec
commit
4ee9cdcd67
22
tag.c
22
tag.c
|
@ -334,13 +334,15 @@ uicb_tag_prev_selected(int screen, char *arg __attribute__ ((unused)))
|
||||||
void
|
void
|
||||||
uicb_tag_viewnext(int screen, char *arg __attribute__ ((unused)))
|
uicb_tag_viewnext(int screen, char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
Tag **curtags = get_current_tags(screen);
|
Tag *tag, **curtags = get_current_tags(screen);
|
||||||
|
|
||||||
if(!curtags[0]->next)
|
if(curtags[0]->next)
|
||||||
return;
|
tag = curtags[0]->next;
|
||||||
|
else
|
||||||
|
tag = globalconf.screens[screen].tags;
|
||||||
|
|
||||||
curtags[0]->selected = False;
|
curtags[0]->selected = False;
|
||||||
curtags[0]->next->selected = True;
|
tag->selected = True;
|
||||||
|
|
||||||
p_delete(&curtags);
|
p_delete(&curtags);
|
||||||
|
|
||||||
|
@ -360,16 +362,14 @@ uicb_tag_viewprev(int screen, char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
Tag *tag, **curtags = get_current_tags(screen);
|
Tag *tag, **curtags = get_current_tags(screen);
|
||||||
|
|
||||||
for(tag = globalconf.screens[screen].tags; tag && tag->next != curtags[0]; tag = tag->next);
|
tag = tag_list_prev_cycle(&globalconf.screens[screen].tags, curtags[0]);
|
||||||
if(tag)
|
|
||||||
{
|
|
||||||
tag->selected = True;
|
|
||||||
curtags[0]->selected = False;
|
curtags[0]->selected = False;
|
||||||
saveawesomeprops(screen);
|
tag->selected = True;
|
||||||
arrange(screen);
|
|
||||||
}
|
|
||||||
p_delete(&curtags);
|
p_delete(&curtags);
|
||||||
saveawesomeprops(screen);
|
saveawesomeprops(screen);
|
||||||
|
arrange(screen);
|
||||||
ewmh_update_net_current_desktop(get_phys_screen(screen));
|
ewmh_update_net_current_desktop(get_phys_screen(screen));
|
||||||
widget_invalidate_cache(screen, WIDGET_CACHE_TAGS);
|
widget_invalidate_cache(screen, WIDGET_CACHE_TAGS);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue