diff --git a/contents/ui/ConfigGeneral.qml b/contents/ui/ConfigGeneral.qml index 434b0a2..4f9f877 100644 --- a/contents/ui/ConfigGeneral.qml +++ b/contents/ui/ConfigGeneral.qml @@ -212,6 +212,7 @@ Kirigami.FormLayout { onCurrentIndexChanged: { if (currentIndex == 2) { floating.enabled = false + floating.checked = true } else { floating.enabled = true } diff --git a/contents/ui/FloatingAvatar.qml b/contents/ui/FloatingAvatar.qml index be5b727..1480605 100644 --- a/contents/ui/FloatingAvatar.qml +++ b/contents/ui/FloatingAvatar.qml @@ -27,12 +27,13 @@ PlasmaCore.Dialog { //cosmic background noise is less random than the placement property int avatarWidth property bool isTop: false + flags: Qt.WindowStaysOnTopHint type: "Notification" x: root.x + root.width / 2 - width / 2 - y: isTop ? root.y + root.height - width / 2 : root.y - width / 2 - + y: root.y - width / 2 //you can't even add 1 without everything breaking wtf + mainItem: Item { onParentChanged: { diff --git a/contents/ui/MainView.qml b/contents/ui/MainView.qml index 2bdf813..2f68e20 100644 --- a/contents/ui/MainView.qml +++ b/contents/ui/MainView.qml @@ -66,10 +66,10 @@ Item { width: main.width height: isTop ? main.height - 200 * PlasmaCore.Units.devicePixelRatio : main.height - y color: plasmoid.configuration.theming == 0 ? "#131314" : plasmoid.configuration.theming == 1 ? "#ECEDEE" : PlasmaCore.Theme.backgroundColor - radius: plasmoid.configuration.floating ? 10 : 0 + radius: 10 Rectangle { id: topCorner - visible: plasmoid.configuration.floating & !isTop + visible: true anchors.top: backdrop.top color: backdrop.color width: backdrop.width @@ -77,7 +77,7 @@ Item { } Rectangle { id: bottomCorner - visible: plasmoid.configuration.floating & isTop + visible: !plasmoid.configuration.floating anchors.bottom: backdrop.bottom color: backdrop.color width: backdrop.width @@ -94,7 +94,7 @@ Item { visualParent: root isTop: main.isTop avatarWidth: 125 * PlasmaCore.Units.devicePixelRatio - visible: root.visible + visible: root.visible && !isTop ? true : root.visible && plasmoid.configuration.floating ? true : false } } //Power & Settings @@ -111,7 +111,7 @@ Item { PlasmaComponents.Label { id: nameLabel x: main.width / 2 - width / 2 //This centeres the Text - y: isTop ? main.height - height - 80 * PlasmaCore.Units.devicePixelRatio : 80 * PlasmaCore.Units.devicePixelRatio + y: isTop ? main.height - height - 125 * PlasmaCore.Units.devicePixelRatio : 80 * PlasmaCore.Units.devicePixelRatio text: plasmoid.configuration.enableGreeting && plasmoid.configuration.customGreeting ? plasmoid.configuration.customGreeting : plasmoid.configuration.enableGreeting ? 'Hi, ' + kuser.fullName : i18n("%1@%2", kuser.loginName, kuser.host) color: textColor font.family: textFont @@ -122,7 +122,7 @@ Item { Item { Rectangle { x: 25 * PlasmaCore.Units.devicePixelRatio - y: isTop ? main.height - height - 125 * PlasmaCore.Units.devicePixelRatio : 125 * PlasmaCore.Units.devicePixelRatio + y: isTop ? main.height - height - 55 : 125 * PlasmaCore.Units.devicePixelRatio width: main.width - 2 * x height: 45 * PlasmaCore.Units.devicePixelRatio radius: 6 @@ -311,7 +311,7 @@ Item { width: main.width height: 40 * PlasmaCore.Units.devicePixelRatio anchors.bottom: backdrop.bottom - radius: !isTop ? backdrop.radius : 0 + radius: !bottomCorner.visible ? backdrop.radius : 0 gradient: Gradient { GradientStop { position: 0.0; color: "transparent" } GradientStop { position: 1.0; color: Qt.darker(backdrop.color, 1.5)} diff --git a/contents/ui/MenuRepresentation.qml b/contents/ui/MenuRepresentation.qml index 3ebdc66..fff4da3 100644 --- a/contents/ui/MenuRepresentation.qml +++ b/contents/ui/MenuRepresentation.qml @@ -75,7 +75,7 @@ PlasmaCore.Dialog { screenAvail.width, screenAvail.height);*/ - var offset = plasmoid.configuration.floating ? parent.height : 0; + var offset = plasmoid.configuration.floating ? parent.height * 0.75 : 0; // Fall back to bottom-left of screen area when the applet is on the desktop or floating. var x = offset; var y = screen.height - height - offset; @@ -89,9 +89,9 @@ PlasmaCore.Dialog { } else { x = (appletTopLeft.x < horizMidPoint) ? screen.x : (screen.x + screen.width) - width; if (plasmoid.configuration.floating) { - if (appletTopLeft.x < horizMidPoint & plasmoid.location != PlasmaCore.Types.TopEdge) { + if (appletTopLeft.x < horizMidPoint) { x += offset - } else if (appletTopLeft.x + width > horizMidPoint & plasmoid.location != PlasmaCore.Types.TopEdge){ + } else if (appletTopLeft.x + width > horizMidPoint){ x -= offset } } @@ -101,7 +101,7 @@ PlasmaCore.Dialog { if (plasmoid.location == PlasmaCore.Types.TopEdge) { if (plasmoid.configuration.floating) { /*this is floatingAvatar.width*/ - offset = (125 * PlasmaCore.Units.devicePixelRatio) / 2 - parent.height + offset = (125 * PlasmaCore.Units.devicePixelRatio) / 2 + parent.height * 0.125 } y = parent.height + panelSvg.margins.bottom + offset; } else {