diff options
author | Will McKinnon <[email protected]> | 2022-11-30 20:22:39 -0500 |
---|---|---|
committer | Will McKinnon <[email protected]> | 2022-11-30 20:22:39 -0500 |
commit | e82e4de37f5c6fe184da62f228329a37517ccd55 (patch) | |
tree | 0a247dd8dd1a20876125449bf4cf5c3fa1d5d75d /sway/commands/corner_radius.c | |
parent | af282928ab3123a573d9562bb24f5c471e3b4704 (diff) |
fix: titlebars on containers with smart_gaps on and a large corner_radius now render as expected
Diffstat (limited to 'sway/commands/corner_radius.c')
-rw-r--r-- | sway/commands/corner_radius.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sway/commands/corner_radius.c b/sway/commands/corner_radius.c index ce1eff88..ab216f6e 100644 --- a/sway/commands/corner_radius.c +++ b/sway/commands/corner_radius.c @@ -1,6 +1,7 @@ #include <string.h> #include "sway/commands.h" #include "sway/config.h" +#include "sway/tree/container.h" #include "log.h" struct cmd_results *cmd_corner_radius(int argc, char **argv) { @@ -17,7 +18,16 @@ struct cmd_results *cmd_corner_radius(int argc, char **argv) { config->corner_radius = value; - // TODO: rerender windows (see opacity cmd) + /* + titlebar padding depends on corner_radius to + ensure that titlebars are rendered nicely + */ + if (value > config->titlebar_h_padding) { + config->titlebar_h_padding = value; + } + if (value > (int)container_titlebar_height()) { + config->titlebar_v_padding = (value - config->font_height) / 2; + } return cmd_results_new(CMD_SUCCESS, NULL); } |