diff --git a/lib/extension/window.js b/lib/extension/window.js index 0509dcc..56e9c7c 100644 --- a/lib/extension/window.js +++ b/lib/extension/window.js @@ -154,6 +154,7 @@ export class WindowManager extends GObject.Object { if (floatingExempt) { this.removeFloatOverride(metaWindow, withWmId); + this.windowProps = this.ext.configMgr.windowProps; if (!this.isActiveWindowWorkspaceTiled(metaWindow)) { nodeWindow.mode = WINDOW_MODES.FLOAT; } else { @@ -161,6 +162,7 @@ export class WindowManager extends GObject.Object { } } else { this.addFloatOverride(metaWindow, withWmId); + this.windowProps = this.ext.configMgr.windowProps; nodeWindow.mode = WINDOW_MODES.FLOAT; } } diff --git a/lib/prefs/appearance.js b/lib/prefs/appearance.js index 5a048cf..51d4d47 100644 --- a/lib/prefs/appearance.js +++ b/lib/prefs/appearance.js @@ -67,6 +67,50 @@ export class AppearancePage extends PreferencesPage { }), ], }); + const borderRadiusSelectors = [ + ".window-tiled-border", + ".window-split-border", + ".window-stacked-border", + ".window-tabbed-border", + ".window-floated-border", + ".window-tilepreview-tiled", + ".window-tilepreview-stacked", + ".window-tilepreview-swap", + ".window-tilepreview-tabbed", + ]; + + const currentRadius = parseInt( + this.themeMgr.removePx( + this.themeMgr.getCssProperty(".window-tiled-border", "border-radius").value ?? "14px" + ) + ); + + const borderRadiusRow = new SpinButtonRow({ + title: _("Border radius"), + subtitle: _("Set to 0 for square corners"), + range: [0, 28, 1], + init: currentRadius, + onChange: (value) => { + const px = this.themeMgr.addPx(value); + for (const selector of borderRadiusSelectors) { + this.themeMgr.setCssProperty(selector, "border-radius", px); + } + }, + }); + + borderRadiusRow.add_suffix( + new ResetButton({ + onReset: () => { + const defaultRadius = 14; + const px = this.themeMgr.addPx(defaultRadius); + for (const selector of borderRadiusSelectors) { + this.themeMgr.setCssProperty(selector, "border-radius", px); + } + borderRadiusRow.activatable_widget.value = defaultRadius; + }, + }) + ); + this.add_group({ title: _("Style"), description: _("Change how the shell looks"), @@ -97,6 +141,7 @@ export class AppearancePage extends PreferencesPage { settings, bind: "quick-settings-enabled", }), + borderRadiusRow, ], }); this.add_group({