Skip to content

Commit

Permalink
Round corners of workspaces in multitasking view (#1734)
Browse files Browse the repository at this point in the history
  • Loading branch information
lenemter authored Dec 18, 2023
1 parent a4a3fa5 commit fa8ebfd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions data/gala.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
}

.workspace.decoration {
border-radius: 6px;
box-shadow:
0 0 0 1px alpha(#000, 0.2),
0 8px 10px 1px alpha(#000, 0.14),
Expand Down
10 changes: 9 additions & 1 deletion src/Background/BackgroundManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,22 @@ public class Gala.BackgroundManager : Meta.BackgroundGroup {
unowned var content = (Meta.BackgroundContent) background_actor.content;
content.background = background.background;

var monitor = display.get_monitor_geometry (monitor_index);
var rect = Graphene.Rect () {
origin = {monitor.x, monitor.y},
size = {monitor.width, monitor.height},
};

content.set_rounded_clip_bounds (rect);
content.rounded_clip_radius = Utils.scale_to_int (6, display.get_monitor_scale (monitor_index));

if (background_source.should_dim) {
content.vignette = true;
content.brightness = DIM_OPACITY;
}

insert_child_below (background_actor, null);

var monitor = display.get_monitor_geometry (monitor_index);
background_actor.set_size (monitor.width, monitor.height);

ulong changed_handler = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Widgets/WorkspaceClone.vala
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace Gala {
var ctx = cached_context;

ctx.set_source_rgba (255, 255, 255, 255);
ctx.rectangle (0, 0, (int) width, (int) height);
Drawing.Utilities.cairo_rounded_rectangle (ctx, 0, 0, width, height, 9);
ctx.set_operator (Cairo.Operator.SOURCE);
ctx.stroke ();
ctx.restore ();
Expand Down

0 comments on commit fa8ebfd

Please sign in to comment.