Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Workspace
Commits
9397d3a2
Commit
9397d3a2
authored
Dec 26, 2020
by
Konrad Materka
Browse files
[applets/systemtray] Simplify rowCount
parent
be476538
Changes
2
Hide whitespace changes
Inline
Side-by-side
applets/systemtray/package/contents/ui/ExpandedRepresentation.qml
View file @
9397d3a2
...
...
@@ -74,7 +74,7 @@ Item {
PlasmaComponents.ToolButton
{
id
:
backButton
visible
:
systemTrayState
.
activeApplet
&&
systemTrayState
.
activeApplet
.
expanded
&&
(
hidden
ItemsView
.
itemCount
>
0
)
visible
:
systemTrayState
.
activeApplet
&&
systemTrayState
.
activeApplet
.
expanded
&&
(
hidden
Layout
.
itemCount
>
0
)
icon.name
:
LayoutMirroring
.
enabled
?
"
go-previous-symbolic-rtl
"
:
"
go-previous-symbolic
"
onClicked
:
systemTrayState
.
setActiveApplet
(
null
)
}
...
...
applets/systemtray/package/contents/ui/HiddenItemsView.qml
View file @
9397d3a2
...
...
@@ -31,7 +31,6 @@ MouseArea {
id
:
hiddenTasksView
property
alias
layout
:
hiddenTasks
readonly
property
alias
itemCount
:
hiddenTasks
.
itemCount
hoverEnabled
:
true
onExited
:
hiddenTasks
.
currentIndex
=
-
1
...
...
@@ -57,11 +56,7 @@ MouseArea {
highlight
:
PlasmaComponents.Highlight
{}
highlightMoveDuration
:
0
property
int
itemCount
:
model
.
rowCount
()
Component.onCompleted
:
{
itemCount
=
model
.
rowCount
()
}
readonly
property
int
itemCount
:
model
.
count
model
:
PlasmaCore.SortFilterModel
{
sourceModel
:
plasmoid
.
nativeInterface
.
systemTrayModel
...
...
@@ -73,14 +68,4 @@ MouseArea {
delegate
:
ItemLoader
{}
}
}
Connections
{
target
:
hiddenTasks
.
model
// hiddenTasks.count is not updated when ListView is hidden and is not rendered
// manually update itemCount so that expander arrow hides/shows itself correctly
function
onModelReset
()
{
hiddenTasks
.
itemCount
=
hiddenTasks
.
model
.
rowCount
()}
function
onRowsInserted
()
{
hiddenTasks
.
itemCount
=
hiddenTasks
.
model
.
rowCount
()}
function
onRowsRemoved
()
{
hiddenTasks
.
itemCount
=
hiddenTasks
.
model
.
rowCount
()}
function
onLayoutChanged
()
{
hiddenTasks
.
itemCount
=
hiddenTasks
.
model
.
rowCount
()}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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