From bb8ae47a66fb13f2b3693ec3431dc9e9dbec4e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Fri, 12 Feb 2021 12:19:43 +0100 Subject: [PATCH] Enforce rounded corners only on Adwaita theme Adwaita does not have rounded corners yet, but will have soon. Enforce rounded corners in the app only for Adwaita to avoid bumping min required GTK version. --- css/styles.css | 12 ++++++++++++ src/appBase.js | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/css/styles.css b/css/styles.css index 6819a49c..7f0af224 100644 --- a/css/styles.css +++ b/css/styles.css @@ -18,6 +18,18 @@ radio { .gtk402 .osd trough highlight { border-color: inherit; } +.adwrounded.csd { + border-radius: 8px; +} +.adwrounded.fullscreen, +.adwrounded.maximized, +.adwrounded.tiled, +.adwrounded.tiled-top, +.adwrounded.tiled-left, +.adwrounded.tiled-right, +.adwrounded.tiled-bottom { + border-radius: 0px; +} .tvmode popover box { text-shadow: none; diff --git a/src/appBase.js b/src/appBase.js index bfd4fc39..4f8981c1 100644 --- a/src/appBase.js +++ b/src/appBase.js @@ -95,6 +95,12 @@ class ClapperAppBase extends Gtk.Application const theme = gtkSettings.gtk_theme_name; debug(`user selected theme: ${theme}`); + if( + theme.startsWith('Adwaita') + && !this.active_window.has_css_class('adwrounded') + ) + this.active_window.add_css_class('adwrounded'); + if(!theme.endsWith('-dark')) return;