summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2025-07-14 22:03:18 +0800
committerlittleblack111 <littleblack11111@gmail.com>2025-07-14 23:06:58 +0800
commita61860ea8ad4c91a0a25faf8b0a0e869236f8c07 (patch)
treec381d9505d033ee4e1d0e65b82b2671d7eac8c65
parentef9bdbf1538014bb05f9584cef3a2433307686e5 (diff)
Revert "activewindow: properly use loader"
This reverts commit a79f63360e3e20f35ae36611ed66a9bd3421f3c3.
-rw-r--r--bar/ActiveWindow.qml63
-rw-r--r--bar/Bar.qml8
2 files changed, 35 insertions, 36 deletions
diff --git a/bar/ActiveWindow.qml b/bar/ActiveWindow.qml
index e0b917d..4bc3f09 100644
--- a/bar/ActiveWindow.qml
+++ b/bar/ActiveWindow.qml
@@ -7,46 +7,39 @@ import Quickshell.Widgets
import qs.components
import qs.config
-Loader {
- id: activeWindowLoader
- anchors.centerIn: parent
- active: ToplevelManager.activeToplevel?.activated ? 1 : 0
- sourceComponent: Component {
- Rectangle {
- id: root
- property var toplevel: Hyprland.activeToplevel
- property var icon: Quickshell.iconPath(AppSearch.guessIcon(toplevel?.wayland?.appId), "image-missing")
+Rectangle {
+ id: root
+ property var toplevel: Hyprland.activeToplevel
+ property var icon: Quickshell.iconPath(AppSearch.guessIcon(toplevel?.wayland?.appId), "image-missing")
- // use IRect
- implicitWidth: rowLayout.implicitWidth + General.rectMargin * 4
- implicitHeight: rowLayout.implicitHeight + General.rectMargin * 2
- anchors.centerIn: parent
+ // use IRect
+ implicitWidth: rowLayout.implicitWidth + General.rectMargin * 4
+ implicitHeight: rowLayout.implicitHeight + General.rectMargin * 2
+ anchors.centerIn: parent
- color: Colors.alt
- // according to docs, null could happen but doesn't seem to happen in practice so..
- // hypr toplevel.activated is always true and doesn't change either so..
- // opacity: ToplevelManager.activeToplevel?.activated ? 1 : 0
+ color: Colors.alt
+ // according to docs, null could happen but doesn't seem to happen in practice so..
+ // hypr toplevel.activated is always true and doesn't change either so..
+ opacity: ToplevelManager.activeToplevel?.activated ? 1 : 0
- radius: Style.rounding.smaller
+ radius: Style.rounding.smaller
- RowLayout {
- id: rowLayout
- anchors.centerIn: parent
- spacing: Bar.resourceIconTextSpacing
+ RowLayout {
+ id: rowLayout
+ anchors.centerIn: parent
+ spacing: Bar.resourceIconTextSpacing
- IconImage {
- source: root.icon
- implicitWidth: Bar.appIconSize
- implicitHeight: Bar.appIconSize
- Layout.fillHeight: true
- Layout.fillWidth: false
- Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
- }
- IText {
- font.pixelSize: General.fontSize
- text: root?.toplevel?.wayland?.title || ""
- }
- }
+ IconImage {
+ source: root.icon
+ implicitWidth: Bar.appIconSize
+ implicitHeight: Bar.appIconSize
+ Layout.fillHeight: true
+ Layout.fillWidth: false
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
+ }
+ IText {
+ font.pixelSize: General.fontSize
+ text: root?.toplevel?.wayland?.title || ""
}
}
}
diff --git a/bar/Bar.qml b/bar/Bar.qml
index 1146c8d..4f523ea 100644
--- a/bar/Bar.qml
+++ b/bar/Bar.qml
@@ -76,7 +76,13 @@ Scope {
id: centerRow
anchors.centerIn: parent
- ActiveWindow {}
+ Loader {
+ active: activeWindow.opacity === 1
+
+ ActiveWindow {
+ id: activeWindow
+ }
+ }
}
Rectangle {