mirror of
https://github.com/swaywm/sway.git
synced 2026-04-18 06:46:56 -04:00
added hide_titlebar option
This commit is contained in:
parent
1a3cfc50c1
commit
1cfa217168
4 changed files with 18 additions and 8 deletions
|
|
@ -508,6 +508,7 @@ struct sway_config {
|
|||
int font_height;
|
||||
int font_baseline;
|
||||
bool pango_markup;
|
||||
bool hide_titlebar;
|
||||
int titlebar_border_thickness;
|
||||
int titlebar_h_padding;
|
||||
int titlebar_v_padding;
|
||||
|
|
|
|||
|
|
@ -249,6 +249,7 @@ static void config_defaults(struct sway_config *config) {
|
|||
config->popup_during_fullscreen = POPUP_SMART;
|
||||
config->xwayland = XWAYLAND_MODE_LAZY;
|
||||
|
||||
config->hide_titlebar = false;
|
||||
config->titlebar_border_thickness = 1;
|
||||
config->titlebar_h_padding = 5;
|
||||
config->titlebar_v_padding = 4;
|
||||
|
|
|
|||
|
|
@ -716,7 +716,7 @@ static void render_containers_linear(struct render_context *ctx, struct parent_d
|
|||
marks_texture = child->marks_unfocused;
|
||||
}
|
||||
|
||||
if (state->border == B_NORMAL) {
|
||||
if (state->border == B_NORMAL && !config->hide_titlebar) {
|
||||
render_titlebar(ctx, child, floor(state->x),
|
||||
floor(state->y), state->width, colors,
|
||||
title_texture, marks_texture);
|
||||
|
|
@ -789,9 +789,11 @@ static void render_containers_tabbed(struct render_context *ctx, struct parent_d
|
|||
if (i == parent->children->length - 1) {
|
||||
tab_width = parent->box.width - tab_width * i;
|
||||
}
|
||||
|
||||
render_titlebar(ctx, child, x, parent->box.y, tab_width,
|
||||
colors, title_texture, marks_texture);
|
||||
|
||||
if (!config->hide_titlebar) {
|
||||
render_titlebar(ctx, child, x, parent->box.y, tab_width,
|
||||
colors, title_texture, marks_texture);
|
||||
}
|
||||
|
||||
if (child == current) {
|
||||
current_colors = colors;
|
||||
|
|
@ -851,9 +853,11 @@ static void render_containers_stacked(struct render_context *ctx, struct parent_
|
|||
marks_texture = child->marks_unfocused;
|
||||
}
|
||||
|
||||
int y = parent->box.y + titlebar_height * i;
|
||||
render_titlebar(ctx, child, parent->box.x, y,
|
||||
parent->box.width, colors, title_texture, marks_texture);
|
||||
if (!config->hide_titlebar) {
|
||||
int y = parent->box.y + titlebar_height * i;
|
||||
render_titlebar(ctx, child, parent->box.x, y,
|
||||
parent->box.width, colors, title_texture, marks_texture);
|
||||
}
|
||||
|
||||
if (child == current) {
|
||||
current_colors = colors;
|
||||
|
|
@ -949,7 +953,7 @@ static void render_floating_container(struct render_context *ctx,
|
|||
marks_texture = con->marks_unfocused;
|
||||
}
|
||||
|
||||
if (con->current.border == B_NORMAL) {
|
||||
if (con->current.border == B_NORMAL && !config->hide_titlebar) {
|
||||
render_titlebar(ctx, con, floor(con->current.x),
|
||||
floor(con->current.y), con->current.width, colors,
|
||||
title_texture, marks_texture);
|
||||
|
|
|
|||
|
|
@ -670,6 +670,10 @@ void container_update_representation(struct sway_container *con) {
|
|||
}
|
||||
|
||||
size_t container_titlebar_height(void) {
|
||||
if(config->hide_titlebar) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return config->font_height + config->titlebar_v_padding * 2;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue