diff --git a/Bar/Modules/ActiveWindow.qml b/Bar/Modules/ActiveWindow.qml index cf05cfd8..a6cdae58 100644 --- a/Bar/Modules/ActiveWindow.qml +++ b/Bar/Modules/ActiveWindow.qml @@ -13,7 +13,7 @@ PanelWindow { anchors.left: true anchors.right: true margins.top: barHeight - visible: activeWindowWrapper.shouldShow + visible: !activeWindowWrapper.finallyHidden implicitHeight: activeWindowTitleContainer.height implicitWidth: activeWindowTitleContainer.x property int barHeight: 36 @@ -39,13 +39,24 @@ PanelWindow { width: parent.width property int fullHeight: activeWindowTitleContainer.height property bool shouldShow: false + property bool finallyHidden: false Timer { id: visibilityTimer - interval: 4000 + interval: 1200 running: false onTriggered: { activeWindowWrapper.shouldShow = false; + hideTimer.restart(); + } + } + + Timer { + id: hideTimer + interval: 300 + running: false + onTriggered: { + activeWindowWrapper.finallyHidden = true; } } @@ -54,9 +65,11 @@ PanelWindow { function onActiveToplevelChanged() { if (ToplevelManager.activeToplevel?.appId) { activeWindowWrapper.shouldShow = true; + activeWindowWrapper.finallyHidden = false; visibilityTimer.restart(); } else { activeWindowWrapper.shouldShow = false; + hideTimer.restart(); visibilityTimer.stop(); } } @@ -67,8 +80,6 @@ PanelWindow { opacity: shouldShow ? 1 : 0 clip: true - - Behavior on height { NumberAnimation { duration: 300 diff --git a/README.md b/README.md index c6d886f0..0f9dd443 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,14 @@ qs (If you want to autostart it, just add it to your niri configuration.) +It is recommended to set the following in your Niri configuration (hyprland equivalent): + +``` +window-rule { + geometry-corner-radius 20 + clip-to-geometry true +} +``` ### Settings: To make the weather widget, wallpaper manager and record button work you will have to open up the settings menu in to right panel (top right button to open panel) and edit said things accordingly. diff --git a/Services/WallpaperManager.qml b/Services/WallpaperManager.qml index 727b04cb..7f9a2812 100644 --- a/Services/WallpaperManager.qml +++ b/Services/WallpaperManager.qml @@ -30,9 +30,7 @@ Singleton { } function changeWallpaper(path) { - if (!Settings.randomWallpaper) { - setCurrentWallpaper(path); - } + setCurrentWallpaper(path); } function setCurrentWallpaper(path, isInitial) { diff --git a/Widgets/Sidebar/Config.qml b/Widgets/Sidebar/Config.qml deleted file mode 100644 index c36c89cd..00000000 --- a/Widgets/Sidebar/Config.qml +++ /dev/null @@ -1,515 +0,0 @@ -import QtQuick -import QtQuick.Layouts -import QtQuick.Controls -import QtQuick.Effects -import Qt5Compat.GraphicalEffects -import Quickshell -import Quickshell.Wayland -import qs.Settings - -Rectangle { - id: settingsModal - anchors.centerIn: parent - color: Theme.backgroundPrimary - radius: 20 - visible: false - z: 100 - - - // Local properties for editing (not saved until apply) - property string tempWeatherCity: Settings.weatherCity - property bool tempUseFahrenheit: false - property string tempProfileImage: Settings.profileImage - property string tempWallpaperFolder: Settings.wallpaperFolder - - ColumnLayout { - anchors.fill: parent - anchors.margins: 20 - spacing: 16 - - // Header - RowLayout { - Layout.fillWidth: true - spacing: 16 - - Text { - text: "settings" - font.family: "Material Symbols Outlined" - font.pixelSize: Theme.fontSizeHeader - color: Theme.accentPrimary - } - - Text { - text: "Settings" - font.family: Theme.fontFamily - font.pixelSize: Theme.fontSizeHeader - font.bold: true - color: Theme.textPrimary - Layout.fillWidth: true - } - - Rectangle { - width: 36 - height: 36 - radius: 18 - color: closeButtonArea.containsMouse ? Theme.accentPrimary : "transparent" - border.color: Theme.accentPrimary - border.width: 1 - - Text { - anchors.centerIn: parent - text: "close" - font.family: "Material Symbols Outlined" - font.pixelSize: Theme.fontSizeBody - color: closeButtonArea.containsMouse ? Theme.onAccent : Theme.accentPrimary - } - - MouseArea { - id: closeButtonArea - anchors.fill: parent - hoverEnabled: true - onClicked: settingsModal.closeSettings() - } - } - } - - // Weather Settings Card - Rectangle { - Layout.fillWidth: true - Layout.preferredHeight: 180 - color: Theme.surface - radius: 18 - - ColumnLayout { - anchors.fill: parent - anchors.margins: 18 - spacing: 12 - - // Weather Settings Header - RowLayout { - Layout.fillWidth: true - spacing: 12 - - Text { - text: "wb_sunny" - font.family: "Material Symbols Outlined" - font.pixelSize: Theme.fontSizeBody - color: Theme.accentPrimary - } - - Text { - text: "Weather Settings" - font.family: Theme.fontFamily - font.pixelSize: Theme.fontSizeBody - font.bold: true - color: Theme.textPrimary - Layout.fillWidth: true - } - } - - // Weather City Setting - ColumnLayout { - spacing: 8 - Layout.fillWidth: true - - Text { - text: "City" - font.family: Theme.fontFamily - font.pixelSize: Theme.fontSizeSmall - font.bold: true - color: Theme.textPrimary - } - - Rectangle { - Layout.fillWidth: true - Layout.preferredHeight: 40 - radius: 8 - color: Theme.surfaceVariant - border.color: cityInput.activeFocus ? Theme.accentPrimary : Theme.outline - border.width: 1 - - TextInput { - id: cityInput - anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.leftMargin: 12 - anchors.rightMargin: 12 - anchors.topMargin: 6 - anchors.bottomMargin: 6 - text: tempWeatherCity - font.family: Theme.fontFamily - font.pixelSize: Theme.fontSizeSmall - color: Theme.textPrimary - verticalAlignment: TextInput.AlignVCenter - clip: true - focus: true - selectByMouse: true - activeFocusOnTab: true - inputMethodHints: Qt.ImhNone - - onTextChanged: { - tempWeatherCity = text - } - - MouseArea { - anchors.fill: parent - onClicked: { - cityInput.forceActiveFocus() - } - } - } - } - } - - // Temperature Unit Setting - RowLayout { - spacing: 12 - Layout.fillWidth: true - - Text { - text: "Temperature Unit" - font.family: Theme.fontFamily - font.pixelSize: Theme.fontSizeSmall - font.bold: true - color: Theme.textPrimary - } - - Item { - Layout.fillWidth: true - } - - // Custom Material 3 Switch - Rectangle { - id: customSwitch - width: 52 - height: 32 - radius: 16 - color: Theme.accentPrimary - border.color: Theme.accentPrimary - border.width: 2 - - Rectangle { - id: thumb - width: 28 - height: 28 - radius: 14 - color: Theme.surface - border.color: Theme.outline - border.width: 1 - y: 2 - x: tempUseFahrenheit ? customSwitch.width - width - 2 : 2 - - Text { - anchors.centerIn: parent - text: tempUseFahrenheit ? "°F" : "°C" - font.family: Theme.fontFamily - font.pixelSize: Theme.fontSizeCaption - font.bold: true - color: Theme.textPrimary - } - - Behavior on x { - NumberAnimation { duration: 200; easing.type: Easing.OutCubic } - } - } - - MouseArea { - anchors.fill: parent - onClicked: { - tempUseFahrenheit = !tempUseFahrenheit - } - } - } - } - } - } - - // Profile Image Card - Rectangle { - Layout.fillWidth: true - Layout.preferredHeight: 140 - color: Theme.surface - radius: 18 - anchors.left: parent.left - anchors.right: parent.right - anchors.margins: 0 - border.color: "transparent" - border.width: 0 - Layout.bottomMargin: 16 - - ColumnLayout { - anchors.fill: parent - anchors.margins: 18 - spacing: 12 - - // Profile Image Header - RowLayout { - Layout.fillWidth: true - spacing: 12 - - Text { - text: "person" - font.family: "Material Symbols Outlined" - font.pixelSize: Theme.fontSizeBody - color: Theme.accentPrimary - } - - Text { - text: "Profile Image" - font.family: Theme.fontFamily - font.pixelSize: Theme.fontSizeBody - font.bold: true - color: Theme.textPrimary - Layout.fillWidth: true - } - } - - // Profile Image Input Row - RowLayout { - spacing: 8 - Layout.fillWidth: true - - Rectangle { - width: 36 - height: 36 - radius: 18 - color: Theme.surfaceVariant - border.color: profileImageInput.activeFocus ? Theme.accentPrimary : Theme.outline - border.width: 1 - - Image { - id: avatarImage - anchors.fill: parent - anchors.margins: 2 - source: tempProfileImage - fillMode: Image.PreserveAspectCrop - visible: false - asynchronous: true - } - OpacityMask { - anchors.fill: avatarImage - source: avatarImage - maskSource: Rectangle { - width: avatarImage.width - height: avatarImage.height - radius: avatarImage.width / 2 - visible: false - } - visible: tempProfileImage !== "" - } - - // Fallback icon - Text { - anchors.centerIn: parent - text: "person" - font.family: "Material Symbols Outlined" - font.pixelSize: Theme.fontSizeBody - color: Theme.accentPrimary - visible: tempProfileImage === "" - } - } - - // Text input styled exactly like weather city - Rectangle { - Layout.fillWidth: true - Layout.preferredHeight: 40 - radius: 8 - color: Theme.surfaceVariant - border.color: profileImageInput.activeFocus ? Theme.accentPrimary : Theme.outline - border.width: 1 - - TextInput { - id: profileImageInput - anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.leftMargin: 12 - anchors.rightMargin: 12 - anchors.topMargin: 6 - anchors.bottomMargin: 6 - text: tempProfileImage - font.family: Theme.fontFamily - font.pixelSize: Theme.fontSizeSmall - color: Theme.textPrimary - verticalAlignment: TextInput.AlignVCenter - clip: true - focus: true - selectByMouse: true - activeFocusOnTab: true - inputMethodHints: Qt.ImhNone - onTextChanged: { - tempProfileImage = text - } - MouseArea { - anchors.fill: parent - onClicked: { - profileImageInput.forceActiveFocus() - } - } - } - } - } - } - } - - // Wallpaper Folder Card - Rectangle { - Layout.fillWidth: true - Layout.preferredHeight: 100 - color: Theme.surface - radius: 18 - - ColumnLayout { - anchors.fill: parent - anchors.margins: 18 - spacing: 12 - - // Header - RowLayout { - Layout.fillWidth: true - spacing: 12 - Text { - text: "image" - font.family: "Material Symbols Outlined" - font.pixelSize: Theme.fontSizeBody - color: Theme.accentPrimary - } - Text { - text: "Wallpaper Folder" - font.family: Theme.fontFamily - font.pixelSize: Theme.fontSizeBody - font.bold: true - color: Theme.textPrimary - Layout.fillWidth: true - } - } - - // Folder Path Input - Rectangle { - Layout.fillWidth: true - Layout.preferredHeight: 40 - radius: 8 - color: Theme.surfaceVariant - border.color: wallpaperFolderInput.activeFocus ? Theme.accentPrimary : Theme.outline - border.width: 1 - - TextInput { - id: wallpaperFolderInput - anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.leftMargin: 12 - anchors.rightMargin: 12 - anchors.topMargin: 6 - anchors.bottomMargin: 6 - text: tempWallpaperFolder - font.family: Theme.fontFamily - font.pixelSize: Theme.fontSizeSmall - color: Theme.textPrimary - verticalAlignment: TextInput.AlignVCenter - clip: true - selectByMouse: true - activeFocusOnTab: true - inputMethodHints: Qt.ImhUrlCharactersOnly - onTextChanged: tempWallpaperFolder = text - MouseArea { - anchors.fill: parent - onClicked: wallpaperFolderInput.forceActiveFocus() - } - } - } - } - } - - // Spacer to push content to top - Item { - Layout.fillHeight: true - } - - // Apply Button - Rectangle { - Layout.fillWidth: true - Layout.preferredHeight: 44 - radius: 12 - color: applyButtonArea.containsMouse ? Theme.accentPrimary : Theme.accentPrimary - border.color: "transparent" - border.width: 0 - opacity: 1.0 - - Text { - anchors.centerIn: parent - text: "Apply Changes" - font.family: Theme.fontFamily - font.pixelSize: Theme.fontSizeSmall - font.bold: true - color: applyButtonArea.containsMouse ? Theme.onAccent : Theme.onAccent - } - - MouseArea { - id: applyButtonArea - anchors.fill: parent - hoverEnabled: true - onClicked: { - // Apply the changes - Settings.weatherCity = tempWeatherCity - Settings.useFahrenheit = tempUseFahrenheit - Settings.profileImage = tempProfileImage - Settings.wallpaperFolder = tempWallpaperFolder - // Force save settings - Settings.saveSettings() - // Refresh weather if available - if (typeof weather !== 'undefined' && weather) { - weather.fetchCityWeather() - } - // Close the modal - settingsModal.closeSettings() - } - } - } - } - - // Function to open the modal and initialize temp values - function openSettings() { - tempWeatherCity = Settings.weatherCity - tempUseFahrenheit = Settings.useFahrenheit - tempProfileImage = Settings.profileImage - tempWallpaperFolder = Settings.wallpaperFolder - visible = true - // Force focus on the text input after a short delay - focusTimer.start() - } - - // Function to close the modal and release focus - function closeSettings() { - visible = false - cityInput.focus = false - profileImageInput.focus = false - wallpaperFolderInput.focus = false - } - - Timer { - id: focusTimer - interval: 100 - repeat: false - onTriggered: { - if (visible) { - cityInput.forceActiveFocus() - // Optionally, also focus profileImageInput if you want both to get focus: - // profileImageInput.forceActiveFocus() - } - } - } - - // Release focus when modal becomes invisible - onVisibleChanged: { - if (!visible) { - cityInput.focus = false - profileImageInput.focus = false - wallpaperFolderInput.focus = false - } - } -} \ No newline at end of file diff --git a/Widgets/Sidebar/Config/ProfileSettings.qml b/Widgets/Sidebar/Config/ProfileSettings.qml index c8dd4368..98153fec 100644 --- a/Widgets/Sidebar/Config/ProfileSettings.qml +++ b/Widgets/Sidebar/Config/ProfileSettings.qml @@ -9,6 +9,7 @@ Rectangle { Layout.fillWidth: true Layout.preferredHeight: 340 color: Theme.surface + Layout.topMargin: 12 radius: 18 border.color: "transparent" border.width: 0 diff --git a/Widgets/Sidebar/Config/WallpaperSettings.qml b/Widgets/Sidebar/Config/WallpaperSettings.qml index 8c9a2106..71c8e75b 100644 --- a/Widgets/Sidebar/Config/WallpaperSettings.qml +++ b/Widgets/Sidebar/Config/WallpaperSettings.qml @@ -7,6 +7,7 @@ Rectangle { id: wallpaperSettingsCard Layout.fillWidth: true Layout.preferredHeight: 680 + Layout.topMargin: 12 color: Theme.surface radius: 18 diff --git a/Widgets/Sidebar/Config/WeatherSettings.qml b/Widgets/Sidebar/Config/WeatherSettings.qml index 46f785ed..dc535747 100644 --- a/Widgets/Sidebar/Config/WeatherSettings.qml +++ b/Widgets/Sidebar/Config/WeatherSettings.qml @@ -7,6 +7,7 @@ Rectangle { id: weatherSettingsCard Layout.fillWidth: true Layout.preferredHeight: 180 + Layout.topMargin: 12 color: Theme.surface radius: 18 diff --git a/Widgets/Sidebar/Panel/BluetoothPanel.qml b/Widgets/Sidebar/Panel/BluetoothPanel.qml index 4848e0cb..defd564d 100644 --- a/Widgets/Sidebar/Panel/BluetoothPanel.qml +++ b/Widgets/Sidebar/Panel/BluetoothPanel.qml @@ -79,7 +79,7 @@ Item { anchors.top: true anchors.right: true margins.right: 0 - margins.top: -24 + margins.top: 0 WlrLayershell.keyboardFocus: visible ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None onVisibleChanged: { diff --git a/Widgets/Sidebar/Panel/WifiPanel.qml b/Widgets/Sidebar/Panel/WifiPanel.qml index 7ddbc5d2..eeb5b8c7 100644 --- a/Widgets/Sidebar/Panel/WifiPanel.qml +++ b/Widgets/Sidebar/Panel/WifiPanel.qml @@ -341,7 +341,7 @@ Item { anchors.top: true anchors.right: true margins.right: 0 - margins.top: -24 + margins.top: 0 WlrLayershell.keyboardFocus: visible ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None Component.onCompleted: { wifiLogic.refreshNetworks()