feat: add dispatch increase_proportion
This commit is contained in:
@@ -4,6 +4,7 @@ void toggle_scratchpad(const Arg *arg);
|
|||||||
void focusdir(const Arg *arg);
|
void focusdir(const Arg *arg);
|
||||||
void toggleoverview(const Arg *arg);
|
void toggleoverview(const Arg *arg);
|
||||||
void set_proportion(const Arg *arg);
|
void set_proportion(const Arg *arg);
|
||||||
|
void increase_proportion(const Arg *arg);
|
||||||
void switch_proportion_preset(const Arg *arg);
|
void switch_proportion_preset(const Arg *arg);
|
||||||
void zoom(const Arg *arg);
|
void zoom(const Arg *arg);
|
||||||
void tagtoleft(const Arg *arg);
|
void tagtoleft(const Arg *arg);
|
||||||
|
|||||||
10
maomao.c
10
maomao.c
@@ -5746,6 +5746,16 @@ void set_proportion(const Arg *arg) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void increase_proportion(const Arg *arg) {
|
||||||
|
if (selmon->sel) {
|
||||||
|
unsigned int max_client_width =
|
||||||
|
selmon->w.width - 2 * scroller_structs - gappih;
|
||||||
|
selmon->sel->scroller_proportion = MIN(MAX(arg->f + selmon->sel->scroller_proportion,0.1),1.0);
|
||||||
|
selmon->sel->geom.width = max_client_width * arg->f;
|
||||||
|
arrange(selmon, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 显示所有tag 或 跳转到聚焦窗口的tag
|
// 显示所有tag 或 跳转到聚焦窗口的tag
|
||||||
void toggleoverview(const Arg *arg) {
|
void toggleoverview(const Arg *arg) {
|
||||||
|
|
||||||
|
|||||||
@@ -402,6 +402,9 @@ FuncType parse_func_name(char *func_name, Arg *arg, char *arg_value) {
|
|||||||
} else if (strcmp(func_name, "set_proportion") == 0) {
|
} else if (strcmp(func_name, "set_proportion") == 0) {
|
||||||
func = set_proportion;
|
func = set_proportion;
|
||||||
(*arg).f = atof(arg_value);
|
(*arg).f = atof(arg_value);
|
||||||
|
} else if (strcmp(func_name, "increase_proportion") == 0) {
|
||||||
|
func = increase_proportion;
|
||||||
|
(*arg).f = atof(arg_value);
|
||||||
} else if (strcmp(func_name, "switch_proportion_preset") == 0) {
|
} else if (strcmp(func_name, "switch_proportion_preset") == 0) {
|
||||||
func = switch_proportion_preset;
|
func = switch_proportion_preset;
|
||||||
} else if (strcmp(func_name, "viewtoleft") == 0) {
|
} else if (strcmp(func_name, "viewtoleft") == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user