mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-03-15 05:34:17 -04:00
Added cycling both ways for switch_proportion_preset
Now switch_proportion_preset requires an argument "prev" or "next" to determine cycle direction
This commit is contained in:
parent
b1875f4663
commit
6438edc2b7
3 changed files with 24 additions and 8 deletions
|
|
@ -1057,13 +1057,28 @@ int32_t switch_proportion_preset(const Arg *arg) {
|
|||
for (int32_t i = 0; i < config.scroller_proportion_preset_count; i++) {
|
||||
if (config.scroller_proportion_preset[i] ==
|
||||
tc->scroller_proportion) {
|
||||
if (i == config.scroller_proportion_preset_count - 1) {
|
||||
target_proportion = config.scroller_proportion_preset[0];
|
||||
break;
|
||||
|
||||
if (arg->i == NEXT) {
|
||||
if (i == config.scroller_proportion_preset_count - 1) {
|
||||
target_proportion =
|
||||
config.scroller_proportion_preset[0];
|
||||
break;
|
||||
} else {
|
||||
target_proportion =
|
||||
config.scroller_proportion_preset[i + 1];
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
target_proportion =
|
||||
config.scroller_proportion_preset[i + 1];
|
||||
break;
|
||||
if (i == 0) {
|
||||
target_proportion =
|
||||
config.scroller_proportion_preset
|
||||
[config.scroller_proportion_preset_count - 1];
|
||||
break;
|
||||
} else {
|
||||
target_proportion =
|
||||
config.scroller_proportion_preset[i - 1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1848,4 +1863,4 @@ int32_t scroller_stack(const Arg *arg) {
|
|||
|
||||
arrange(selmon, false, false);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue