summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/BarConfig.qml1
-rw-r--r--modules/bar/popouts/ActiveWindow.qml25
-rw-r--r--modules/bar/popouts/Content.qml5
3 files changed, 25 insertions, 6 deletions
diff --git a/config/BarConfig.qml b/config/BarConfig.qml
index 5afbdb3..9ffcabf 100644
--- a/config/BarConfig.qml
+++ b/config/BarConfig.qml
@@ -11,6 +11,7 @@ Singleton {
component Sizes: QtObject {
property int innerHeight: 30
+ property int windowPreviewSize: 400
}
component Workspaces: QtObject {
diff --git a/modules/bar/popouts/ActiveWindow.qml b/modules/bar/popouts/ActiveWindow.qml
index 06ad52c..d9e9b9e 100644
--- a/modules/bar/popouts/ActiveWindow.qml
+++ b/modules/bar/popouts/ActiveWindow.qml
@@ -1,9 +1,8 @@
-
-
import "root:/widgets"
import "root:/services"
import "root:/utils"
import "root:/config"
+import Quickshell.Widgets
import Quickshell.Wayland
import QtQuick
@@ -17,17 +16,35 @@ Item {
id: child
anchors.centerIn: parent
+ spacing: Appearance.spacing.normal
StyledText {
text: Hyprland.activeClient?.title ?? ""
+
+ elide: Text.ElideRight
+ width: preview.implicitWidth
}
StyledText {
text: Hyprland.activeClient?.wmClass ?? ""
+
+ elide: Text.ElideRight
+ width: preview.implicitWidth
}
- ScreencopyView {
-
+ ClippingWrapperRectangle {
+ color: "transparent"
+ radius: Appearance.rounding.small
+
+ ScreencopyView {
+ id: preview
+
+ captureSource: ToplevelManager.toplevels.values.find(t => t.title === Hyprland.activeClient?.title) ?? null
+ live: true
+
+ constraintSize.width: BarConfig.sizes.windowPreviewSize
+ constraintSize.height: BarConfig.sizes.windowPreviewSize
+ }
}
}
}
diff --git a/modules/bar/popouts/Content.qml b/modules/bar/popouts/Content.qml
index be45eac..c10348c 100644
--- a/modules/bar/popouts/Content.qml
+++ b/modules/bar/popouts/Content.qml
@@ -1,7 +1,6 @@
import "root:/services"
import "root:/config"
import Quickshell
-import Quickshell.Widgets
import QtQuick
Item {
@@ -13,7 +12,6 @@ Item {
implicitWidth: Popouts.hasCurrent ? content.children.find(c => c.shouldBeActive).implicitWidth + Appearance.padding.large * 2 : 0
implicitHeight: Popouts.hasCurrent ? content.children.find(c => c.shouldBeActive).implicitHeight + Appearance.padding.large * 2 : 0
- clip: true
Item {
id: content
@@ -47,6 +45,9 @@ Item {
required property string name
property bool shouldBeActive: Popouts.currentName === name
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.right: parent.right
+
active: shouldBeActive
asynchronous: true