Files
cnix/modules/home/services/quickshell/shell/modules/bar/popouts/ActiveWindow.qml
2025-06-30 17:19:24 +02:00

103 lines
2.8 KiB
QML

import "root:/widgets"
import "root:/services"
import "root:/utils"
import "root:/config"
import Quickshell.Widgets
import Quickshell.Wayland
import QtQuick
import QtQuick.Layouts
Item {
id: root
required property Item wrapper
implicitWidth: Hyprland.activeToplevel ? child.implicitWidth : -Appearance.padding.large * 2
implicitHeight: child.implicitHeight
Column {
id: child
anchors.centerIn: parent
spacing: Appearance.spacing.normal
RowLayout {
id: detailsRow
anchors.left: parent.left
anchors.right: parent.right
spacing: Appearance.spacing.normal
IconImage {
id: icon
Layout.alignment: Qt.AlignVCenter
implicitSize: details.implicitHeight
source: Icons.getAppIcon(Hyprland.activeToplevel?.lastIpcObject.class ?? "", "image-missing")
}
ColumnLayout {
id: details
spacing: 0
Layout.fillWidth: true
StyledText {
Layout.fillWidth: true
text: Hyprland.activeToplevel?.title ?? ""
font.pointSize: Appearance.font.size.normal
elide: Text.ElideRight
}
StyledText {
Layout.fillWidth: true
text: Hyprland.activeToplevel?.lastIpcObject.class ?? ""
color: Colours.palette.m3onSurfaceVariant
elide: Text.ElideRight
}
}
Item {
implicitWidth: expandIcon.implicitHeight + Appearance.padding.small * 2
implicitHeight: expandIcon.implicitHeight + Appearance.padding.small * 2
Layout.alignment: Qt.AlignVCenter
StateLayer {
radius: Appearance.rounding.normal
function onClicked(): void {
root.wrapper.detach("winfo");
}
}
MaterialIcon {
id: expandIcon
anchors.centerIn: parent
anchors.horizontalCenterOffset: font.pointSize * 0.05
text: "chevron_right"
font.pointSize: Appearance.font.size.large
}
}
}
ClippingWrapperRectangle {
color: "transparent"
radius: Appearance.rounding.small
ScreencopyView {
id: preview
captureSource: Hyprland.activeToplevel?.wayland ?? null
live: visible
constraintSize.width: Config.bar.sizes.windowPreviewSize
constraintSize.height: Config.bar.sizes.windowPreviewSize
}
}
}
}