bar: add preview to activewindow popout
This commit is contained in:
parent
2054708406
commit
4f816e0abf
3 changed files with 25 additions and 6 deletions
|
|
@ -11,6 +11,7 @@ Singleton {
|
||||||
|
|
||||||
component Sizes: QtObject {
|
component Sizes: QtObject {
|
||||||
property int innerHeight: 30
|
property int innerHeight: 30
|
||||||
|
property int windowPreviewSize: 400
|
||||||
}
|
}
|
||||||
|
|
||||||
component Workspaces: QtObject {
|
component Workspaces: QtObject {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
|
|
||||||
|
|
||||||
import "root:/widgets"
|
import "root:/widgets"
|
||||||
import "root:/services"
|
import "root:/services"
|
||||||
import "root:/utils"
|
import "root:/utils"
|
||||||
import "root:/config"
|
import "root:/config"
|
||||||
|
import Quickshell.Widgets
|
||||||
import Quickshell.Wayland
|
import Quickshell.Wayland
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
|
|
@ -17,17 +16,35 @@ Item {
|
||||||
id: child
|
id: child
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
spacing: Appearance.spacing.normal
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: Hyprland.activeClient?.title ?? ""
|
text: Hyprland.activeClient?.title ?? ""
|
||||||
|
|
||||||
|
elide: Text.ElideRight
|
||||||
|
width: preview.implicitWidth
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: Hyprland.activeClient?.wmClass ?? ""
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import "root:/services"
|
import "root:/services"
|
||||||
import "root:/config"
|
import "root:/config"
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Widgets
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
@ -13,7 +12,6 @@ Item {
|
||||||
|
|
||||||
implicitWidth: Popouts.hasCurrent ? content.children.find(c => c.shouldBeActive).implicitWidth + Appearance.padding.large * 2 : 0
|
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
|
implicitHeight: Popouts.hasCurrent ? content.children.find(c => c.shouldBeActive).implicitHeight + Appearance.padding.large * 2 : 0
|
||||||
clip: true
|
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: content
|
id: content
|
||||||
|
|
@ -47,6 +45,9 @@ Item {
|
||||||
required property string name
|
required property string name
|
||||||
property bool shouldBeActive: Popouts.currentName === name
|
property bool shouldBeActive: Popouts.currentName === name
|
||||||
|
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
anchors.right: parent.right
|
||||||
|
|
||||||
active: shouldBeActive
|
active: shouldBeActive
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue