mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
Implement rounded window corners
This commit is contained in:
@@ -59,6 +59,9 @@ window-rule {
|
||||
// Same as focus-ring.
|
||||
}
|
||||
|
||||
geometry-corner-radius 12
|
||||
clip-to-geometry true
|
||||
|
||||
min-width 100
|
||||
max-width 200
|
||||
min-height 300
|
||||
@@ -378,6 +381,77 @@ window-rule {
|
||||
}
|
||||
```
|
||||
|
||||
#### `geometry-corner-radius`
|
||||
|
||||
<sup>Since: 0.1.6</sup>
|
||||
|
||||
Set the corner radius of the window.
|
||||
|
||||
On its own, this setting will only affect the border and the focus ring—they will round their corners to match the geometry corner radius.
|
||||
If you'd like to force-round the corners of the window itself, set `clip-to-geometry true` in addition to this setting.
|
||||
|
||||
```
|
||||
window-rule {
|
||||
geometry-corner-radius 12
|
||||
}
|
||||
```
|
||||
|
||||
The radius is set in logical pixels, and controls the radius of the window itself, that is, the inner radius of the border:
|
||||
|
||||

|
||||
|
||||
Instead of one radius, you can set four, for each corner.
|
||||
The order is the same as in CSS: top-left, top-right, bottom-right, bottom-left.
|
||||
|
||||
```
|
||||
window-rule {
|
||||
geometry-corner-radius 8 8 0 0
|
||||
}
|
||||
```
|
||||
|
||||
This way, you can match GTK 3 applications which have square bottom corners:
|
||||
|
||||

|
||||
|
||||
#### `clip-to-geometry`
|
||||
|
||||
<sup>Since: 0.1.6</sup>
|
||||
|
||||
Clips the window to its visual geometry.
|
||||
|
||||
This will cut out any client-side window shadows, and also round window corners according to `geometry-corner-radius`.
|
||||
|
||||

|
||||
|
||||
```
|
||||
window-rule {
|
||||
clip-to-geometry true
|
||||
}
|
||||
```
|
||||
|
||||
Enable border, set `geometry-corner-radius` and `clip-to-geometry`, and you've got a classic setup:
|
||||
|
||||

|
||||
|
||||
```
|
||||
prefer-no-csd
|
||||
|
||||
layout {
|
||||
focus-ring {
|
||||
off
|
||||
}
|
||||
|
||||
border {
|
||||
width 2
|
||||
}
|
||||
}
|
||||
|
||||
window-rule {
|
||||
geometry-corner-radius 12
|
||||
clip-to-geometry true
|
||||
}
|
||||
```
|
||||
|
||||
#### Size Overrides
|
||||
|
||||
You can amend the window's minimum and maximum size in logical pixels.
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6246413f95e5aa2d63db3fc8bc7726e45af3d20a95ea8f66614f4d62fa7a6624
|
||||
size 34239
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:88ca1517153755ee64b3fae4e67eced1f83873026ad1ad35c44b85f31fa8171d
|
||||
size 33591
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e420523fff7891335ef9af5410d946abdd468f1e1dad88e0c189a2b21c9bc7f3
|
||||
size 11099
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3ed3d553cae8948726ab03db3bf4ad9ef2dc9cf4593e24a96fad9d8820af949d
|
||||
size 25777
|
||||
Reference in New Issue
Block a user