forked from Shinonome/dots-hyprland
overview: indicate xwayland with italics and tooltip instead of icon
This commit is contained in:
@@ -176,8 +176,8 @@ Item {
|
|||||||
id: dragArea
|
id: dragArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onEntered: hovered = true
|
onEntered: hovered = true // For hover color change
|
||||||
onExited: hovered = false
|
onExited: hovered = false // For hover color change
|
||||||
acceptedButtons: Qt.LeftButton | Qt.MiddleButton
|
acceptedButtons: Qt.LeftButton | Qt.MiddleButton
|
||||||
drag.target: parent
|
drag.target: parent
|
||||||
onPressed: {
|
onPressed: {
|
||||||
@@ -212,6 +212,12 @@ Item {
|
|||||||
event.accepted = true
|
event.accepted = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StyledToolTip {
|
||||||
|
extraVisibleCondition: false
|
||||||
|
alternativeVisibleCondition: dragArea.containsMouse && !window.Drag.active
|
||||||
|
content: `${windowData.title}\n[${windowData.class}] ${windowData.xwayland ? "[XWayland] " : ""}\n`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import Quickshell.Hyprland
|
|||||||
|
|
||||||
Rectangle { // Window
|
Rectangle { // Window
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property var windowData
|
property var windowData
|
||||||
property var monitorData
|
property var monitorData
|
||||||
property var scale
|
property var scale
|
||||||
@@ -35,6 +34,8 @@ Rectangle { // Window
|
|||||||
property var iconPath: Quickshell.iconPath(AppSearch.guessIcon(windowData?.class), "image-missing")
|
property var iconPath: Quickshell.iconPath(AppSearch.guessIcon(windowData?.class), "image-missing")
|
||||||
property bool compactMode: Appearance.font.pixelSize.smaller * 4 > targetWindowHeight || Appearance.font.pixelSize.smaller * 4 > targetWindowWidth
|
property bool compactMode: Appearance.font.pixelSize.smaller * 4 > targetWindowHeight || Appearance.font.pixelSize.smaller * 4 > targetWindowWidth
|
||||||
|
|
||||||
|
property bool indicateXWayland: (ConfigOptions.overview.showXwaylandIndicator && windowData?.xwayland) ?? false
|
||||||
|
|
||||||
x: initX
|
x: initX
|
||||||
y: initY
|
y: initY
|
||||||
width: Math.min(windowData?.size[0] * root.scale, (restrictToWorkspace ? windowData?.size[0] : availableWorkspaceWidth - x + xOffset))
|
width: Math.min(windowData?.size[0] * root.scale, (restrictToWorkspace ? windowData?.size[0] : availableWorkspaceWidth - x + xOffset))
|
||||||
@@ -74,15 +75,6 @@ Rectangle { // Window
|
|||||||
Behavior on implicitSize {
|
Behavior on implicitSize {
|
||||||
animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this)
|
animation: Appearance.animation.elementMoveEnter.numberAnimation.createObject(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
IconImage {
|
|
||||||
id: xwaylandIndicator
|
|
||||||
visible: (ConfigOptions.overview.showXwaylandIndicator && windowData?.xwayland) ?? false
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
source: Quickshell.iconPath("xorg")
|
|
||||||
implicitSize: windowIcon.implicitSize * xwaylandIndicatorToIconRatio
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
@@ -93,8 +85,8 @@ Rectangle { // Window
|
|||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
font.pixelSize: Appearance.font.pixelSize.smaller
|
font.pixelSize: Appearance.font.pixelSize.smaller
|
||||||
|
font.italic: indicateXWayland ? true : false
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
// wrapMode: Text.Wrap
|
|
||||||
text: windowData?.title ?? ""
|
text: windowData?.title ?? ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user