From 2684bbae69a2b722f2b9f349da74afc5af24d549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hasan=20A=2E=20Tekeo=C4=9Flu?= <55619655+tekeoglan@users.noreply.github.com> Date: Wed, 2 Jul 2025 15:52:24 +0300 Subject: [PATCH] refactor(WeatherBar): put in `barRightSide` --- .config/quickshell/modules/bar/Bar.qml | 41 +++++++++---------- .../modules/bar/weather/WeatherBar.qml | 7 ++-- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.config/quickshell/modules/bar/Bar.qml b/.config/quickshell/modules/bar/Bar.qml index ce4a614ec..1785e3179 100644 --- a/.config/quickshell/modules/bar/Bar.qml +++ b/.config/quickshell/modules/bar/Bar.qml @@ -85,7 +85,7 @@ Scope { } } } - + // Background shadow Loader { active: showBarBackground && Config.options.bar.cornerStyle === 1 @@ -105,7 +105,7 @@ Scope { color: showBarBackground ? Appearance.colors.colLayer0 : "transparent" radius: Config.options.bar.cornerStyle === 1 ? Appearance.rounding.windowRounding : 0 } - + MouseArea { // Left side | scroll to change brightness id: barLeftSideMouseArea anchors.left: parent.left @@ -203,8 +203,7 @@ Scope { anchors.centerIn: parent width: 19.5 height: 19.5 - source: Config.options.bar.topLeftIcon == 'distro' ? - SystemInfo.distroIcon : "spark-symbolic" + source: Config.options.bar.topLeftIcon == 'distro' ? SystemInfo.distroIcon : "spark-symbolic" } ColorOverlay { @@ -246,7 +245,9 @@ Scope { } } - VerticalBarSeparator {visible: Config.options?.bar.borderless} + VerticalBarSeparator { + visible: Config.options?.bar.borderless + } BarGroup { id: middleCenterGroup @@ -271,7 +272,9 @@ Scope { } } - VerticalBarSeparator {visible: Config.options?.bar.borderless} + VerticalBarSeparator { + visible: Config.options?.bar.borderless + } MouseArea { id: rightCenterGroup @@ -307,20 +310,7 @@ Scope { } VerticalBarSeparator { - visible: Config.options.bar.borderless - } - } - - // Weather - Loader { - id: weatherLoader - active: Config.options.bar.weather.enable - anchors.left: middleSection.right - anchors.margins: 10 - sourceComponent: BarGroup { - implicitHeight: Appearance.sizes.baseBarHeight - height: Appearance.sizes.barHeight - WeatherBar {} + visible: Config.options.bar.borderless && Config.options.bar.weather.enable } } @@ -330,7 +320,7 @@ Scope { anchors.right: parent.right implicitHeight: Appearance.sizes.baseBarHeight height: Appearance.sizes.barHeight - width: barRoot.width - (barLeftSideMouseArea.width + middleSection.width + weatherLoader.width) + width: (barRoot.width - middleSection.width) / 2 property bool hovered: false property real lastScrollX: 0 @@ -493,6 +483,15 @@ Scope { Item { Layout.fillWidth: true Layout.fillHeight: true + + // Weather + Loader { + active: Config.options.bar.weather.enable + sourceComponent: BarGroup { + implicitHeight: Appearance.sizes.baseBarHeight + WeatherBar {} + } + } } } } diff --git a/.config/quickshell/modules/bar/weather/WeatherBar.qml b/.config/quickshell/modules/bar/weather/WeatherBar.qml index b879646ce..c0fda9641 100644 --- a/.config/quickshell/modules/bar/weather/WeatherBar.qml +++ b/.config/quickshell/modules/bar/weather/WeatherBar.qml @@ -9,8 +9,8 @@ import QtQuick.Layouts Item { id: root - property real margin: 5 - implicitHeight: 32 + property real margin: 10 + implicitHeight: mouseArea.implicitHeight implicitWidth: mouseArea.implicitWidth + margin * 2 MouseArea { @@ -30,12 +30,12 @@ Item { RowLayout { id: rowLayout - MaterialSymbol { fill: 0 text: WeatherIcons.codeToName[Weather.data.wCode] iconSize: Appearance.font.pixelSize.large color: Appearance.colors.colOnLayer1 + Layout.alignment: Qt.AlignVCenter } StyledText { @@ -43,6 +43,7 @@ Item { font.pixelSize: Appearance.font.pixelSize.large color: Appearance.colors.colOnLayer1 text: Weather.data.temp + Layout.alignment: Qt.AlignVCenter } } }