Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Add-ons
Commits
1c4a4322
Verified
Commit
1c4a4322
authored
May 13, 2022
by
ivan tkachenko
Browse files
[applets/userswitcher] Port away from plasmoid context property
parent
5a9dc844
Changes
1
Hide whitespace changes
Inline
Side-by-side
applets/userswitcher/package/contents/ui/main.qml
View file @
1c4a4322
...
...
@@ -21,17 +21,17 @@ import org.kde.plasma.private.sessions 2.0 as Sessions
Item
{
id
:
root
readonly
property
bool
isVertical
:
p
lasmoid
.
formFactor
===
PlasmaCore
.
Types
.
Vertical
readonly
property
bool
isVertical
:
P
lasmoid
.
formFactor
===
PlasmaCore
.
Types
.
Vertical
readonly
property
string
displayedName
:
showFullName
?
kuser
.
fullName
:
kuser
.
loginName
readonly
property
bool
showFace
:
p
lasmoid
.
configuration
.
showFace
readonly
property
bool
showName
:
p
lasmoid
.
configuration
.
showName
readonly
property
bool
showFace
:
P
lasmoid
.
configuration
.
showFace
readonly
property
bool
showName
:
P
lasmoid
.
configuration
.
showName
readonly
property
bool
showFullName
:
p
lasmoid
.
configuration
.
showFullName
readonly
property
bool
showFullName
:
P
lasmoid
.
configuration
.
showFullName
// TTY number and X display
readonly
property
bool
showTechnicalInfo
:
p
lasmoid
.
configuration
.
showTechnicalInfo
readonly
property
bool
showTechnicalInfo
:
P
lasmoid
.
configuration
.
showTechnicalInfo
Plasmoid.switchWidth
:
PlasmaCore
.
Units
.
gridUnit
*
10
Plasmoid.switchHeight
:
PlasmaCore
.
Units
.
gridUnit
*
12
...
...
@@ -40,10 +40,10 @@ Item {
Plasmoid.toolTipSubText
:
i18n
(
"
You are logged in as <b>%1</b>
"
,
displayedName
)
Binding
{
target
:
p
lasmoid
target
:
P
lasmoid
.
self
property
:
"
icon
"
value
:
kuser
.
faceIconUrl
// revert to the
p
lasmoid icon if no face given
// revert to the
P
lasmoid icon if no face given
when
:
kuser
.
faceIconUrl
.
toString
()
!==
""
}
...
...
@@ -55,7 +55,7 @@ Item {
id
:
compactRoot
// Taken from DigitalClock to ensure uniform sizing when next to each other
readonly
property
bool
tooSmall
:
p
lasmoid
.
formFactor
===
PlasmaCore
.
Types
.
Horizontal
&&
Math
.
round
(
2
*
(
compactRoot
.
height
/
5
))
<=
PlasmaCore
.
Theme
.
smallestFont
.
pixelSize
readonly
property
bool
tooSmall
:
P
lasmoid
.
formFactor
===
PlasmaCore
.
Types
.
Horizontal
&&
Math
.
round
(
2
*
(
compactRoot
.
height
/
5
))
<=
PlasmaCore
.
Theme
.
smallestFont
.
pixelSize
Layout.minimumWidth
:
isVertical
?
0
:
compactRow
.
implicitWidth
Layout.maximumWidth
:
isVertical
?
Infinity
:
Layout
.
minimumWidth
...
...
@@ -65,7 +65,7 @@ Item {
Layout.maximumHeight
:
isVertical
?
Layout
.
minimumHeight
:
Infinity
Layout.preferredHeight
:
isVertical
?
Layout
.
minimumHeight
:
PlasmaCore
.
Theme
.
mSize
(
PlasmaCore
.
Theme
.
defaultFont
).
height
*
2
onClicked
:
p
lasmoid
.
expanded
=
!
p
lasmoid
.
expanded
onClicked
:
P
lasmoid
.
expanded
=
!
P
lasmoid
.
expanded
Row
{
id
:
compactRow
...
...
@@ -229,12 +229,13 @@ Item {
}
}
Component.onCompleted
:
{
plasmoid
.
expandedChanged
.
connect
(
function
(
expanded
)
{
if
(
expanded
)
{
Connections
{
target
:
Plasmoid
.
self
function
onExpandedChanged
()
{
if
(
Plasmoid
.
expanded
)
{
sessionsModel
.
reload
();
}
}
);
}
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment