feat: add global option scroller_ignore_proportion_single
This commit is contained in:
@@ -193,6 +193,7 @@ typedef struct {
|
||||
int scroller_structs;
|
||||
float scroller_default_proportion;
|
||||
float scroller_default_proportion_single;
|
||||
int scroller_ignore_proportion_single;
|
||||
int scroller_focus_center;
|
||||
int scroller_prefer_center;
|
||||
int edge_scroller_pointer_focus;
|
||||
@@ -1210,6 +1211,8 @@ void parse_option(Config *config, char *key, char *value) {
|
||||
config->scroller_default_proportion = atof(value);
|
||||
} else if (strcmp(key, "scroller_default_proportion_single") == 0) {
|
||||
config->scroller_default_proportion_single = atof(value);
|
||||
} else if (strcmp(key, "scroller_ignore_proportion_single") == 0) {
|
||||
config->scroller_ignore_proportion_single = atoi(value);
|
||||
} else if (strcmp(key, "scroller_focus_center") == 0) {
|
||||
config->scroller_focus_center = atoi(value);
|
||||
} else if (strcmp(key, "scroller_prefer_center") == 0) {
|
||||
@@ -2665,6 +2668,8 @@ void override_config(void) {
|
||||
CLAMP_FLOAT(config.scroller_default_proportion, 0.1f, 1.0f);
|
||||
scroller_default_proportion_single =
|
||||
CLAMP_FLOAT(config.scroller_default_proportion_single, 0.1f, 1.0f);
|
||||
scroller_ignore_proportion_single =
|
||||
CLAMP_INT(config.scroller_ignore_proportion_single, 0, 1);
|
||||
scroller_focus_center = CLAMP_INT(config.scroller_focus_center, 0, 1);
|
||||
scroller_prefer_center = CLAMP_INT(config.scroller_prefer_center, 0, 1);
|
||||
edge_scroller_pointer_focus =
|
||||
@@ -2852,6 +2857,8 @@ void set_value_default() {
|
||||
config.scroller_default_proportion = scroller_default_proportion;
|
||||
config.scroller_default_proportion_single =
|
||||
scroller_default_proportion_single;
|
||||
config.scroller_ignore_proportion_single =
|
||||
scroller_ignore_proportion_single;
|
||||
config.scroller_focus_center = scroller_focus_center;
|
||||
config.scroller_prefer_center = scroller_prefer_center;
|
||||
config.edge_scroller_pointer_focus = edge_scroller_pointer_focus;
|
||||
|
||||
@@ -60,6 +60,7 @@ float scratchpad_height_ratio = 0.9;
|
||||
int scroller_structs = 20;
|
||||
float scroller_default_proportion = 0.9;
|
||||
float scroller_default_proportion_single = 1.0;
|
||||
int scroller_ignore_proportion_single = 0;
|
||||
int scroller_focus_center = 0;
|
||||
int scroller_prefer_center = 0;
|
||||
int focus_cross_monitor = 0;
|
||||
|
||||
@@ -231,7 +231,7 @@ void scroller(Monitor *m) {
|
||||
}
|
||||
}
|
||||
|
||||
if (n == 1) {
|
||||
if (n == 1 && !scroller_ignore_proportion_single) {
|
||||
c = tempClients[0];
|
||||
target_geom.height = m->w.height - 2 * cur_gappov;
|
||||
target_geom.width =
|
||||
@@ -274,6 +274,10 @@ void scroller(Monitor *m) {
|
||||
}
|
||||
}
|
||||
|
||||
if (n == 1 && scroller_ignore_proportion_single) {
|
||||
need_scroller = true;
|
||||
}
|
||||
|
||||
if (start_drag_window)
|
||||
need_scroller = false;
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ void vertical_scroller(Monitor *m) {
|
||||
}
|
||||
}
|
||||
|
||||
if (n == 1) {
|
||||
if (n == 1 && !scroller_ignore_proportion_single) {
|
||||
c = tempClients[0];
|
||||
target_geom.width = m->w.width - 2 * cur_gappoh;
|
||||
target_geom.height =
|
||||
@@ -235,6 +235,13 @@ void vertical_scroller(Monitor *m) {
|
||||
}
|
||||
}
|
||||
|
||||
if (n == 1 && scroller_ignore_proportion_single) {
|
||||
need_scroller = true;
|
||||
}
|
||||
|
||||
if (start_drag_window)
|
||||
need_scroller = false;
|
||||
|
||||
target_geom.width = m->w.width - 2 * cur_gappoh;
|
||||
target_geom.height = max_client_height * c->scroller_proportion;
|
||||
target_geom.x = m->w.x + (m->w.width - target_geom.width) / 2;
|
||||
|
||||
Reference in New Issue
Block a user