mirror of
https://github.com/swaywm/sway.git
synced 2025-10-29 05:40:18 -04:00
Implement bar gaps
Adds the bar subcommand `gaps <amount>|<horizontal> <vertical>|<top> <right> <bottom> <left>` to set gaps for swaybar. Due to restrictions on margins for a layer_surface, only the sides that are anchored to an edge of the screen can have gaps. Since there is support for per-side outer gaps for workspaces, those should be able to be used instead for the last side.
This commit is contained in:
parent
5341e034df
commit
1bd8463481
11 changed files with 141 additions and 1 deletions
|
|
@ -506,6 +506,11 @@ void render_frame(struct swaybar_output *output) {
|
|||
if (height != output->height || output->width == 0) {
|
||||
// Reconfigure surface
|
||||
zwlr_layer_surface_v1_set_size(output->layer_surface, 0, height);
|
||||
zwlr_layer_surface_v1_set_margin(output->layer_surface,
|
||||
output->bar->config->gaps.top,
|
||||
output->bar->config->gaps.right,
|
||||
output->bar->config->gaps.bottom,
|
||||
output->bar->config->gaps.left);
|
||||
if (strcmp(output->bar->config->mode, "dock") == 0) {
|
||||
zwlr_layer_surface_v1_set_exclusive_zone(output->layer_surface, height);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue