aerothemeplasma/plasma/plasmoids/io.gitgud.wackyideas.SevenStart/contents/ui/FloatingIcon.qml

105 lines
2.9 KiB
QML
Raw Normal View History

2023-08-24 22:32:11 +00:00
2024-08-09 01:20:25 +00:00
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Dialogs
import QtQuick.Window
2023-08-24 22:32:11 +00:00
2024-08-09 01:20:25 +00:00
import org.kde.plasma.plasmoid
import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.components as PlasmaComponents
import org.kde.plasma.extras as PlasmaExtras
2023-08-24 22:32:11 +00:00
2024-08-09 01:20:25 +00:00
import org.kde.plasma.private.kicker as Kicker
import org.kde.coreaddons as KCoreAddons // kuser
2023-08-24 22:32:11 +00:00
import org.kde.plasma.private.shell 2.0
import org.kde.kwindowsystem 1.0
import org.kde.kquickcontrolsaddons 2.0
import org.kde.plasma.private.quicklaunch 1.0
import org.kde.kirigami 2.13 as Kirigami
import org.kde.kquickcontrolsaddons 2.0 as KQuickAddons
2024-08-09 01:20:25 +00:00
import org.kde.kcmutils as KCM
2023-08-24 22:32:11 +00:00
import org.kde.kwindowsystem 1.0
Item {
id: iconContainer
//The frame displayed on top of the user icon
2024-08-09 01:20:25 +00:00
height: Kirigami.Units.iconSizes.huge
//Kirigami.Units.iconSizes.huge
2023-08-24 22:32:11 +00:00
width: height
anchors.horizontalCenter: parent.horizontalCenter
property alias iconSource: imgAuthorIcon.source
Image {
source: "../pics/user.png"
smooth: true
z: 1
opacity: imgAuthorIcon.source === ""
Behavior on opacity {
NumberAnimation { duration: 350 }
}
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
top: parent.top
}
}
2024-08-09 01:20:25 +00:00
Kirigami.Icon {
2023-08-24 22:32:11 +00:00
id: imgAuthorIcon
source: ""
height: parent.height
width: height
smooth: true
visible: true
2024-08-09 01:20:25 +00:00
//usesPlasmaTheme: false
2023-08-24 22:32:11 +00:00
z: 99
CrossFadeBehavior on source {
fadeDuration: 350
}
}
Image {
id: imgAuthor
anchors {
top: parent.top
left: parent.left
right: parent.right
bottom: parent.bottom
2024-08-09 01:20:25 +00:00
topMargin: Kirigami.Units.smallSpacing*2
leftMargin: Kirigami.Units.smallSpacing*2
rightMargin: Kirigami.Units.smallSpacing*2
bottomMargin: Kirigami.Units.smallSpacing*2
2023-08-24 22:32:11 +00:00
}
opacity: imgAuthorIcon.source === ""
Behavior on opacity {
NumberAnimation { duration: 350 }
}
source: kuser.faceIconUrl.toString()
smooth: true
mipmap: true
visible: true
}
/*OpacityMask {
anchors.fill: imgAuthor
source: (kuser.faceIconUrl.toString() === "") ? imgAuthorIcon : imgAuthor;
maskSource: Rectangle {
width: imgAuthorIcon.source === "" ? imgAuthor.width : 0
height: imgAuthor.height
visible: false
}
}*/
MouseArea{
anchors.fill: parent
acceptedButtons: Qt.LeftButton
onPressed: {
root.visible = false;
2024-08-09 01:20:25 +00:00
KCM.KCMLauncher.openSystemSettings("kcm_users")
2023-08-24 22:32:11 +00:00
}
cursorShape: Qt.PointingHandCursor
}
}