Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
SnoutBug authored Mar 5, 2022
1 parent 0210d0b commit 05c00f6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
1 change: 1 addition & 0 deletions contents/ui/ConfigGeneral.qml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ Kirigami.FormLayout {
onCurrentIndexChanged: {
if (currentIndex == 2) {
floating.enabled = false
floating.checked = true
} else {
floating.enabled = true
}
Expand Down
5 changes: 3 additions & 2 deletions contents/ui/FloatingAvatar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
14 changes: 7 additions & 7 deletions contents/ui/MainView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,18 @@ 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
height: 20
}
Rectangle {
id: bottomCorner
visible: plasmoid.configuration.floating & isTop
visible: !plasmoid.configuration.floating
anchors.bottom: backdrop.bottom
color: backdrop.color
width: backdrop.width
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)}
Expand Down
8 changes: 4 additions & 4 deletions contents/ui/MenuRepresentation.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
}
}
Expand All @@ -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 {
Expand Down

0 comments on commit 05c00f6

Please sign in to comment.