diff --git a/Modules/SettingsPanel/Tabs/ColorSchemeTab.qml b/Modules/SettingsPanel/Tabs/ColorSchemeTab.qml index 1f8a528..15578af 100644 --- a/Modules/SettingsPanel/Tabs/ColorSchemeTab.qml +++ b/Modules/SettingsPanel/Tabs/ColorSchemeTab.qml @@ -348,7 +348,8 @@ ColumnLayout { font.pointSize: Style.fontSizeXXL * scaling font.weight: Style.fontWeightBold color: Color.mSecondary - Layout.bottomMargin: Style.marginS * scaling + // Match spacing with the section above (no extra bottom margin) + Layout.bottomMargin: 0 } NText { @@ -359,7 +360,7 @@ ColumnLayout { wrapMode: Text.WordWrap } - NToggle { + NCheckbox { label: "GTK 4 (libadwaita)" description: "Write ~/.config/gtk-4.0/gtk.css" checked: Settings.data.matugen.gtk4 @@ -370,7 +371,7 @@ ColumnLayout { } } - NToggle { + NCheckbox { label: "GTK 3" description: "Write ~/.config/gtk-3.0/gtk.css" checked: Settings.data.matugen.gtk3 @@ -381,7 +382,7 @@ ColumnLayout { } } - NToggle { + NCheckbox { label: "Qt6ct" description: "Write ~/.config/qt6ct/colors/noctalia.conf" checked: Settings.data.matugen.qt6 @@ -392,7 +393,7 @@ ColumnLayout { } } - NToggle { + NCheckbox { label: "Qt5ct" description: "Write ~/.config/qt5ct/colors/noctalia.conf" checked: Settings.data.matugen.qt5 @@ -403,7 +404,7 @@ ColumnLayout { } } - NToggle { + NCheckbox { label: "Kitty" description: "Write ~/.config/kitty/themes/noctalia.conf and reload" checked: Settings.data.matugen.kitty diff --git a/Modules/SettingsPanel/Tabs/DisplayTab.qml b/Modules/SettingsPanel/Tabs/DisplayTab.qml index 842da36..3236bcb 100644 --- a/Modules/SettingsPanel/Tabs/DisplayTab.qml +++ b/Modules/SettingsPanel/Tabs/DisplayTab.qml @@ -330,5 +330,6 @@ ColumnLayout { Layout.fillWidth: true Layout.topMargin: Style.marginXL * scaling Layout.bottomMargin: Style.marginXL * scaling + visible: Settings.data.nightLight.enabled } } diff --git a/Widgets/NCheckbox.qml b/Widgets/NCheckbox.qml new file mode 100644 index 0000000..8bb3552 --- /dev/null +++ b/Widgets/NCheckbox.qml @@ -0,0 +1,72 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import qs.Commons + +RowLayout { + id: root + + // Public API (mirrors NToggle but compact) + property string label: "" + property string description: "" + property bool checked: false + property bool hovering: false + // Smaller default footprint than NToggle + property int baseSize: Math.max(Style.baseWidgetSize * 0.8, 14) + + signal toggled(bool checked) + signal entered + signal exited + + Layout.fillWidth: true + + NLabel { + label: root.label + description: root.description + } + + Rectangle { + id: box + + implicitWidth: root.baseSize * scaling + implicitHeight: root.baseSize * scaling + radius: Math.max(2 * scaling, Style.radiusXS * scaling) + color: root.checked ? Color.mPrimary : Color.mSurface + border.color: root.checked ? Color.mPrimary : Color.mOutline + border.width: Math.max(1, Style.borderM * scaling) + + NIcon { + visible: root.checked + anchors.centerIn: parent + text: "check" + color: Color.mOnPrimary + font.pointSize: Math.max(Style.fontSizeS, root.baseSize * 0.7) * scaling + } + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + hoverEnabled: true + onEntered: { + hovering = true + root.entered() + } + onExited: { + hovering = false + root.exited() + } + onClicked: root.toggled(!root.checked) + } + + Behavior on color { + ColorAnimation { + duration: Style.animationFast + } + } + Behavior on border.color { + ColorAnimation { + duration: Style.animationFast + } + } + } +}