mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-28 07:58:00 -04:00
config: csd.border_width now always reflects the full/total width
This commit is contained in:
parent
9df537a110
commit
521bd84a99
3 changed files with 13 additions and 5 deletions
6
config.c
6
config.c
|
|
@ -32,6 +32,8 @@
|
||||||
static const uint32_t default_foreground = 0xdcdccc;
|
static const uint32_t default_foreground = 0xdcdccc;
|
||||||
static const uint32_t default_background = 0x111111;
|
static const uint32_t default_background = 0x111111;
|
||||||
|
|
||||||
|
static const size_t min_csd_border_width = 5;
|
||||||
|
|
||||||
#define cube6(r, g) \
|
#define cube6(r, g) \
|
||||||
r|g|0x00, r|g|0x5f, r|g|0x87, r|g|0xaf, r|g|0xd7, r|g|0xff
|
r|g|0x00, r|g|0x5f, r|g|0x87, r|g|0xaf, r|g|0xd7, r|g|0xff
|
||||||
|
|
||||||
|
|
@ -2802,6 +2804,7 @@ config_load(struct config *conf, const char *conf_path,
|
||||||
.font = {0},
|
.font = {0},
|
||||||
.title_height = 26,
|
.title_height = 26,
|
||||||
.border_width = 5,
|
.border_width = 5,
|
||||||
|
.border_width_visible = 0,
|
||||||
.button_width = 26,
|
.button_width = 26,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -3009,6 +3012,9 @@ config_override_apply(struct config *conf, config_override_t *overrides,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
conf->csd.border_width = max(
|
||||||
|
min_csd_border_width, conf->csd.border_width_visible);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
4
main.c
4
main.c
|
|
@ -429,7 +429,9 @@ main(int argc, char *const *argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct config conf = {NULL};
|
struct config conf = {NULL};
|
||||||
bool conf_successful = config_load(&conf, conf_path, &user_notifications, &overrides, check_config);
|
bool conf_successful = config_load(
|
||||||
|
&conf, conf_path, &user_notifications, &overrides, check_config);
|
||||||
|
|
||||||
tll_free(overrides);
|
tll_free(overrides);
|
||||||
if (!conf_successful) {
|
if (!conf_successful) {
|
||||||
config_free(conf);
|
config_free(conf);
|
||||||
|
|
|
||||||
8
render.c
8
render.c
|
|
@ -1528,8 +1528,7 @@ get_csd_data(const struct terminal *term, enum csd_surface surf_idx)
|
||||||
|
|
||||||
/* Only title bar is rendered in maximized mode */
|
/* Only title bar is rendered in maximized mode */
|
||||||
const int border_width = !term->window->is_maximized
|
const int border_width = !term->window->is_maximized
|
||||||
? max(term->conf->csd.border_width,
|
? term->conf->csd.border_width * term->scale : 0;
|
||||||
term->conf->csd.border_width_visible) * term->scale : 0;
|
|
||||||
|
|
||||||
const int title_height = term->window->is_fullscreen
|
const int title_height = term->window->is_fullscreen
|
||||||
? 0
|
? 0
|
||||||
|
|
@ -1756,10 +1755,11 @@ render_csd_border(struct terminal *term, enum csd_surface surf_idx,
|
||||||
* The “visible” border.
|
* The “visible” border.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int bwidth = max(term->conf->csd.border_width,
|
int bwidth = term->conf->csd.border_width;
|
||||||
term->conf->csd.border_width_visible); /* Full border size */
|
|
||||||
int vwidth = term->conf->csd.border_width_visible; /* Visibls size */
|
int vwidth = term->conf->csd.border_width_visible; /* Visibls size */
|
||||||
|
|
||||||
|
xassert(bwidth >= vwidth);
|
||||||
|
|
||||||
if (vwidth > 0) {
|
if (vwidth > 0) {
|
||||||
|
|
||||||
const struct config *conf = term->conf;
|
const struct config *conf = term->conf;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue