popout positioning fixes
This commit is contained in:
+13
-21
@@ -3,10 +3,11 @@ import QtQuick.Layouts
|
||||
import Quickshell.Hyprland
|
||||
import qs.Helpers
|
||||
import qs.Config
|
||||
import qs.Components
|
||||
|
||||
Item {
|
||||
id: root
|
||||
property string currentTitle
|
||||
property string currentTitle: Hypr.activeName
|
||||
Layout.fillHeight: true
|
||||
Layout.preferredWidth: Math.max( titleText1.implicitWidth, titleText2.implicitWidth ) + 10
|
||||
clip: true
|
||||
@@ -14,15 +15,15 @@ Item {
|
||||
property bool showFirst: true
|
||||
property color textColor: Config.useDynamicColors ? DynamicColors.palette.m3primary : "white"
|
||||
|
||||
Component.onCompleted: {
|
||||
Hyprland.rawEvent.connect(( event ) => {
|
||||
if (event.name === "activewindow") {
|
||||
InitialTitle.getInitialTitle( function( initialTitle ) {
|
||||
root.currentTitle = initialTitle
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
// Component.onCompleted: {
|
||||
// Hyprland.rawEvent.connect(( event ) => {
|
||||
// if (event.name === "activewindow") {
|
||||
// InitialTitle.getInitialTitle( function( initialTitle ) {
|
||||
// root.currentTitle = initialTitle
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
onCurrentTitleChanged: {
|
||||
if (showFirst) {
|
||||
@@ -34,14 +35,13 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
CustomText {
|
||||
id: titleText1
|
||||
anchors.fill: parent
|
||||
anchors.margins: 5
|
||||
text: root.currentTitle
|
||||
color: root.textColor
|
||||
elide: Text.ElideRight
|
||||
font.family: "Rubik"
|
||||
font.pixelSize: 16
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
@@ -49,13 +49,9 @@ Item {
|
||||
Behavior on opacity {
|
||||
NumberAnimation { duration: 200; easing.type: Easing.InOutQuad }
|
||||
}
|
||||
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
CustomText {
|
||||
id: titleText2
|
||||
anchors.fill: parent
|
||||
anchors.margins: 5
|
||||
@@ -68,9 +64,5 @@ Item {
|
||||
Behavior on opacity {
|
||||
NumberAnimation { duration: 200; easing.type: Easing.InOutQuad }
|
||||
}
|
||||
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user