mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-06-19 14:33:16 -04:00
feat: add tab_bar_enable to toggle monocle tab bar
This commit is contained in:
parent
727b9fe77e
commit
f9e03240eb
3 changed files with 16 additions and 5 deletions
|
|
@ -69,6 +69,7 @@ You can also color-code windows based on their state:
|
||||||
### Tab Bar For Monocle Layout
|
### Tab Bar For Monocle Layout
|
||||||
| Setting | Default | Description |
|
| Setting | Default | Description |
|
||||||
| :--- | :--- | :--- |
|
| :--- | :--- | :--- |
|
||||||
|
| `tab_bar_enable` | `1` | Set to `0` to disable the monocle tab bar. |
|
||||||
| `tab_bar_height` | `50` | Height of the tab bar for monocle layout. |
|
| `tab_bar_height` | `50` | Height of the tab bar for monocle layout. |
|
||||||
| `tab_bar_decorate_fg_color` | `0xc4939dff` | text color.
|
| `tab_bar_decorate_fg_color` | `0xc4939dff` | text color.
|
||||||
| `tab_bar_decorate_bg_color` | `0x201b14ff` | background color.|
|
| `tab_bar_decorate_bg_color` | `0x201b14ff` | background color.|
|
||||||
|
|
|
||||||
|
|
@ -332,6 +332,7 @@ typedef struct {
|
||||||
uint32_t gappoh;
|
uint32_t gappoh;
|
||||||
uint32_t gappov;
|
uint32_t gappov;
|
||||||
uint32_t borderpx;
|
uint32_t borderpx;
|
||||||
|
uint32_t tab_bar_enable;
|
||||||
uint32_t tab_bar_height;
|
uint32_t tab_bar_height;
|
||||||
float scratchpad_width_ratio;
|
float scratchpad_width_ratio;
|
||||||
float scratchpad_height_ratio;
|
float scratchpad_height_ratio;
|
||||||
|
|
@ -1953,6 +1954,8 @@ bool parse_option(Config *config, char *key, char *value) {
|
||||||
config->borderpx = atoi(value);
|
config->borderpx = atoi(value);
|
||||||
} else if (strcmp(key, "tab_bar_height") == 0) {
|
} else if (strcmp(key, "tab_bar_height") == 0) {
|
||||||
config->tab_bar_height = atoi(value);
|
config->tab_bar_height = atoi(value);
|
||||||
|
} else if (strcmp(key, "tab_bar_enable") == 0) {
|
||||||
|
config->tab_bar_enable = atoi(value);
|
||||||
} else if (strcmp(key, "rootcolor") == 0) {
|
} else if (strcmp(key, "rootcolor") == 0) {
|
||||||
int64_t color = parse_color(value);
|
int64_t color = parse_color(value);
|
||||||
if (color == -1) {
|
if (color == -1) {
|
||||||
|
|
@ -3569,6 +3572,7 @@ void override_config(void) {
|
||||||
config.scratchpad_height_ratio =
|
config.scratchpad_height_ratio =
|
||||||
CLAMP_FLOAT(config.scratchpad_height_ratio, 0.1f, 1.0f);
|
CLAMP_FLOAT(config.scratchpad_height_ratio, 0.1f, 1.0f);
|
||||||
config.borderpx = CLAMP_INT(config.borderpx, 0, 200);
|
config.borderpx = CLAMP_INT(config.borderpx, 0, 200);
|
||||||
|
config.tab_bar_enable = CLAMP_INT(config.tab_bar_enable, 0, 1);
|
||||||
config.tab_bar_height = CLAMP_INT(config.tab_bar_height, 5, 500);
|
config.tab_bar_height = CLAMP_INT(config.tab_bar_height, 5, 500);
|
||||||
config.smartgaps = CLAMP_INT(config.smartgaps, 0, 1);
|
config.smartgaps = CLAMP_INT(config.smartgaps, 0, 1);
|
||||||
config.blur = CLAMP_INT(config.blur, 0, 1);
|
config.blur = CLAMP_INT(config.blur, 0, 1);
|
||||||
|
|
@ -3701,6 +3705,7 @@ void set_value_default() {
|
||||||
config.idleinhibit_ignore_visible = 0;
|
config.idleinhibit_ignore_visible = 0;
|
||||||
|
|
||||||
config.borderpx = 4;
|
config.borderpx = 4;
|
||||||
|
config.tab_bar_enable = 1;
|
||||||
config.tab_bar_height = 50;
|
config.tab_bar_height = 50;
|
||||||
config.overviewgappi = 5;
|
config.overviewgappi = 5;
|
||||||
config.overviewgappo = 30;
|
config.overviewgappo = 30;
|
||||||
|
|
|
||||||
|
|
@ -546,7 +546,7 @@ void deck(Monitor *m) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void monocle(Monitor *m) {
|
void monocle(Monitor *m) {
|
||||||
Client *c, *fc;
|
Client *c, *fc = NULL;
|
||||||
struct wlr_box geom;
|
struct wlr_box geom;
|
||||||
int32_t cur_gappov = enablegaps ? m->gappov : 0;
|
int32_t cur_gappov = enablegaps ? m->gappov : 0;
|
||||||
int32_t cur_gappoh = enablegaps ? m->gappoh : 0;
|
int32_t cur_gappoh = enablegaps ? m->gappoh : 0;
|
||||||
|
|
@ -570,13 +570,18 @@ void monocle(Monitor *m) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n == 1) {
|
if (n == 1 || !config.tab_bar_enable) {
|
||||||
geom.x = m->w.x + cur_gappoh;
|
geom.x = m->w.x + cur_gappoh;
|
||||||
geom.y = m->w.y + cur_gappov;
|
geom.y = m->w.y + cur_gappov;
|
||||||
geom.width = m->w.width - 2 * cur_gappoh;
|
geom.width = m->w.width - 2 * cur_gappoh;
|
||||||
geom.height = m->w.height - 2 * cur_gappov;
|
geom.height = m->w.height - 2 * cur_gappov;
|
||||||
client_tile_resize(fc, geom, 0);
|
|
||||||
monocle_set_focus(fc, true);
|
wl_list_for_each(c, &clients, link) {
|
||||||
|
if (!VISIBLEON(c, m) || !ISFAKETILED(c))
|
||||||
|
continue;
|
||||||
|
client_tile_resize(fc, geom, 0);
|
||||||
|
monocle_set_focus(fc, true);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue