From 61ca42cd2c37b49d124be50802f035e7c52faa49 Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Sun, 7 Apr 2024 12:31:33 -0600 Subject: [PATCH] Round all the things consistently Now that we have Kirigami.Units.cornerRadius, there's a central source of truth for corner radius so don't have to use random numbers for these anymore. Part of https://invent.kde.org/teams/vdg/issues/-/issues/45. --- src/kcms/decoration/ui/Buttons.qml | 12 ++++++------ .../plastik/package/contents/ui/PlastikButton.qml | 4 ++++ src/plugins/overview/qml/DesktopBar.qml | 2 +- src/plugins/overview/qml/main.qml | 4 ++-- src/plugins/private/qml/WindowHeapDelegate.qml | 4 ++-- src/plugins/tileseditor/qml/ResizeCorner.qml | 4 ++-- src/plugins/tileseditor/qml/ResizeHandle.qml | 4 ++-- src/plugins/tileseditor/qml/TileDelegate.qml | 6 +++--- src/qml/frames/plasma/frame_unstyled.qml | 4 ++-- 9 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/kcms/decoration/ui/Buttons.qml b/src/kcms/decoration/ui/Buttons.qml index 148e4eb9da..c22165a7f6 100644 --- a/src/kcms/decoration/ui/Buttons.qml +++ b/src/kcms/decoration/ui/Buttons.qml @@ -9,7 +9,7 @@ import QtQuick.Layouts import QtQuick.Controls as QQC2 import org.kde.kcmutils as KCM -import org.kde.kirigami 2.20 as Kirigami +import org.kde.kirigami as Kirigami import org.kde.kwin.private.kdecoration as KDecoration // Fake Window @@ -22,7 +22,7 @@ Rectangle { readonly property bool hideDragHint: draggingTitlebarButtons || availableButtonsGrid.dragActive color: palette.base - radius: Kirigami.Units.smallSpacing + radius: Kirigami.Units.cornerRadius KDecoration.Bridge { id: bridgeItem @@ -40,7 +40,7 @@ Rectangle { Rectangle { Layout.fillWidth: true implicitHeight: buttonPreviewRow.implicitHeight + 2 * baseLayout.titleBarSpacing - radius: Kirigami.Units.smallSpacing + radius: Kirigami.Units.cornerRadius gradient: Gradient { GradientStop { position: 0.0; color: palette.midlight } GradientStop { position: 1.0; color: palette.window } @@ -68,7 +68,7 @@ Rectangle { color: "transparent" border.color: Kirigami.Theme.neutralTextColor border.width: 1 - radius: Kirigami.Units.smallSpacing + radius: Kirigami.Units.cornerRadius } KCM.SettingStateBinding { @@ -97,7 +97,7 @@ Rectangle { color: "transparent" border.color: Kirigami.Theme.neutralTextColor border.width: 1 - radius: Kirigami.Units.smallSpacing + radius: Kirigami.Units.cornerRadius } KCM.SettingStateBinding { @@ -190,7 +190,7 @@ Rectangle { Rectangle { Layout.alignment: Qt.AlignHCenter color: palette.window - radius: Kirigami.Units.smallSpacing + radius: Kirigami.Units.cornerRadius implicitWidth: baseLayout.buttonIconSize + Kirigami.Units.largeSpacing implicitHeight: baseLayout.buttonIconSize + Kirigami.Units.largeSpacing diff --git a/src/plugins/kdecorations/aurorae/themes/plastik/package/contents/ui/PlastikButton.qml b/src/plugins/kdecorations/aurorae/themes/plastik/package/contents/ui/PlastikButton.qml index 4f11871514..f224b1f935 100644 --- a/src/plugins/kdecorations/aurorae/themes/plastik/package/contents/ui/PlastikButton.qml +++ b/src/plugins/kdecorations/aurorae/themes/plastik/package/contents/ui/PlastikButton.qml @@ -65,6 +65,8 @@ DecorationButton { width: size height: size Rectangle { + // Intentionally not using Kirigami.Units.cornerRadius to mimic a + // particular style radius: 2 smooth: true anchors.fill: parent @@ -79,6 +81,8 @@ DecorationButton { } } Rectangle { + // Intentionally not using Kirigami.Units.cornerRadius to mimic a + // particular style radius: 2 smooth: true anchors { diff --git a/src/plugins/overview/qml/DesktopBar.qml b/src/plugins/overview/qml/DesktopBar.qml index 0cb730ce71..74da9a6393 100644 --- a/src/plugins/overview/qml/DesktopBar.qml +++ b/src/plugins/overview/qml/DesktopBar.qml @@ -139,7 +139,7 @@ Item { Rectangle { readonly property bool active: (delegate.activeFocus || dropArea.containsDrag || mouseArea.containsPress || bar.selectedDesktop === delegate.desktop) anchors.fill: parent - radius: width / 20 + radius: Kirigami.Units.cornerRadius color: "transparent" border.width: active ? 2 : 1 border.color: active ? Kirigami.Theme.highlightColor : Kirigami.Theme.textColor diff --git a/src/plugins/overview/qml/main.qml b/src/plugins/overview/qml/main.qml index a798827fa1..604d4ccf96 100644 --- a/src/plugins/overview/qml/main.qml +++ b/src/plugins/overview/qml/main.qml @@ -9,7 +9,7 @@ import QtQuick import Qt5Compat.GraphicalEffects import QtQuick.Layouts -import org.kde.kirigami 2.20 as Kirigami +import org.kde.kirigami as Kirigami import org.kde.kwin as KWinComponents import org.kde.kwin.private.effects import org.kde.milou as Milou @@ -527,7 +527,7 @@ FocusScope { color: "transparent" source: desktopElement - radius: Kirigami.Units.largeSpacing * 2 * (overviewVal + gridVal * 2) + radius: Kirigami.Units.cornerRadius * (overviewVal + gridVal * 2) shadow { size: Kirigami.Units.gridUnit * 2 diff --git a/src/plugins/private/qml/WindowHeapDelegate.qml b/src/plugins/private/qml/WindowHeapDelegate.qml index 77d6ba92ad..b1b2620efd 100644 --- a/src/plugins/private/qml/WindowHeapDelegate.qml +++ b/src/plugins/private/qml/WindowHeapDelegate.qml @@ -8,7 +8,7 @@ import QtQuick import QtQuick.Window import Qt5Compat.GraphicalEffects -import org.kde.kirigami 2.20 as Kirigami +import org.kde.kirigami as Kirigami import org.kde.kwin as KWinComponents import org.kde.kwin.private.effects import org.kde.plasma.components 3.0 as PC3 @@ -136,7 +136,7 @@ Item { border.color: Kirigami.Theme.highlightColor anchors.fill: parent anchors.margins: -border.width - radius: border.width + radius: Kirigami.Units.cornerRadius color: "transparent" visible: !thumb.windowHeap.dragActive && (hoverHandler.hovered || (thumb.selected && Window.window.activeFocusItem)) && windowHeap.effectiveOrganized } diff --git a/src/plugins/tileseditor/qml/ResizeCorner.qml b/src/plugins/tileseditor/qml/ResizeCorner.qml index b65a33e81e..f2d7e9efa7 100644 --- a/src/plugins/tileseditor/qml/ResizeCorner.qml +++ b/src/plugins/tileseditor/qml/ResizeCorner.qml @@ -9,7 +9,7 @@ import Qt5Compat.GraphicalEffects import QtQuick.Layouts import org.kde.kwin as KWinComponents import org.kde.kwin.private.effects -import org.kde.kirigami 2.20 as Kirigami +import org.kde.kirigami as Kirigami Rectangle { id: handle @@ -23,7 +23,7 @@ Rectangle { implicitWidth: Kirigami.Units.gridUnit implicitHeight: Kirigami.Units.gridUnit - radius: 3 + radius: Kirigami.Units.cornerRadius color: Kirigami.Theme.highlightColor opacity: hoverHandler.hovered || dragHandler.active ? 0.4 : 0 visible: tile && diff --git a/src/plugins/tileseditor/qml/ResizeHandle.qml b/src/plugins/tileseditor/qml/ResizeHandle.qml index 98c5b0d735..199bbdd1d1 100644 --- a/src/plugins/tileseditor/qml/ResizeHandle.qml +++ b/src/plugins/tileseditor/qml/ResizeHandle.qml @@ -7,7 +7,7 @@ import QtQuick import org.kde.kwin as KWinComponents import org.kde.kwin.private.effects -import org.kde.kirigami 2.20 as Kirigami +import org.kde.kirigami as Kirigami Rectangle { id: handle @@ -25,7 +25,7 @@ Rectangle { implicitWidth: Kirigami.Units.smallSpacing * 2 implicitHeight: Kirigami.Units.smallSpacing * 2 - radius: 3 + radius: Kirigami.Units.cornerRadius color: Kirigami.Theme.highlightColor opacity: hoverHandler.hovered || dragHandler.active ? 0.4 : 0 visible: valid && (tile.layoutDirection === KWinComponents.Tile.Floating || tile.positionInLayout > 0) diff --git a/src/plugins/tileseditor/qml/TileDelegate.qml b/src/plugins/tileseditor/qml/TileDelegate.qml index f5b029802e..01452bf519 100644 --- a/src/plugins/tileseditor/qml/TileDelegate.qml +++ b/src/plugins/tileseditor/qml/TileDelegate.qml @@ -8,7 +8,7 @@ import QtQuick import QtQuick.Layouts import org.kde.kwin as KWinComponents import org.kde.kwin.private.effects -import org.kde.kirigami 2.20 as Kirigami +import org.kde.kirigami as Kirigami import org.kde.plasma.components 3.0 as PlasmaComponents Item { @@ -110,7 +110,7 @@ Item { margins: Kirigami.Units.smallSpacing } visible: tile.tiles.length === 0 - radius: 3 + radius: Kirigami.Units.cornerRadius opacity: tile.layoutDirection === KWinComponents.Tile.Floating ? 0.6 : 0.3 color: tile.layoutDirection === KWinComponents.Tile.Floating ? Kirigami.Theme.backgroundColor : "transparent" border.color: Kirigami.Theme.textColor @@ -119,7 +119,7 @@ Item { fill: parent margins: 1 } - radius: 3 + radius: Kirigami.Units.cornerRadius color: "transparent" border.color: Kirigami.Theme.backgroundColor } diff --git a/src/qml/frames/plasma/frame_unstyled.qml b/src/qml/frames/plasma/frame_unstyled.qml index c817f09054..132675084d 100644 --- a/src/qml/frames/plasma/frame_unstyled.qml +++ b/src/qml/frames/plasma/frame_unstyled.qml @@ -9,7 +9,7 @@ import QtQuick import QtQuick.Layouts import QtQuick.Controls as QQC2 -import org.kde.kirigami 2.12 as Kirigami +import org.kde.kirigami as Kirigami Rectangle { id: root @@ -20,7 +20,7 @@ Rectangle { implicitHeight: layout.implicitHeight + 2 * layout.anchors.margins color: Qt.rgba(0, 0, 0, effectFrame.frameOpacity) - radius: layout.anchors.margins + radius: Kirigami.Units.cornerRadius RowLayout { id: layout