Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Plasma Add-ons
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Plasma
Plasma Add-ons
Commits
37b8c9cc
Commit
37b8c9cc
authored
Jan 11, 2018
by
Friedrich W. H. Kossebau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[weather] Treat Details & Notices views the same WRT content & visibility
parent
0c87abc2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
+18
-6
applets/weather/package/contents/ui/FullRepresentation.qml
applets/weather/package/contents/ui/FullRepresentation.qml
+16
-6
applets/weather/package/contents/ui/WeatherListView.qml
applets/weather/package/contents/ui/WeatherListView.qml
+2
-0
No files found.
applets/weather/package/contents/ui/FullRepresentation.qml
View file @
37b8c9cc
...
...
@@ -55,7 +55,15 @@ Item {
horizontalCenter
:
parent
.
horizontalCenter
}
visible
:
detailsView
.
model
.
length
>
0
visible
:
detailsView
.
hasContent
||
noticesView
.
hasContent
function
fallBackToFiveDaysIfInvisble
(
tabButton
)
{
// PlasmaComponents.TabBar does not handle this (yet), so let's do it ourselves
if
(
!
tabButton
.
visible
&&
(
currentTab
==
tabButton
))
{
currentTab
=
fiveDaysTabButton
;
mainTabGroup
.
currentTab
=
fiveDaysTabButton
.
tab
;
}
}
PlasmaComponents.TabButton
{
id
:
fiveDaysTabButton
...
...
@@ -64,8 +72,14 @@ Item {
tab
:
fiveDaysView
}
PlasmaComponents.TabButton
{
id
:
detailsTabButton
text
:
i18n
(
"
Details
"
)
visible
:
detailsView
.
hasContent
tab
:
detailsView
onVisibleChanged
:
{
tabBar
.
fallBackToFiveDaysIfInvisble
(
detailsTabButton
);
}
}
PlasmaComponents.TabButton
{
id
:
noticesTabButton
...
...
@@ -74,11 +88,7 @@ Item {
visible
:
noticesView
.
hasContent
tab
:
noticesView
onVisibleChanged
:
{
// PlasmaComponents.TabBar does not handle this, so let's do it ourselves
if
(
!
visible
&&
(
tabBar
.
currentTab
==
noticesTabButton
))
{
tabBar
.
currentTab
=
fiveDaysTabButton
;
mainTabGroup
.
currentTab
=
fiveDaysTabButton
.
tab
;
}
tabBar
.
fallBackToFiveDaysIfInvisble
(
noticesTabButton
);
}
}
}
...
...
applets/weather/package/contents/ui/WeatherListView.qml
View file @
37b8c9cc
...
...
@@ -26,6 +26,8 @@ Column {
// ensure text fits in rectangle, relies on delegates only using labels with theme.defaultFont
property
int
rowHeight
:
theme
.
mSize
(
theme
.
defaultFont
).
height
readonly
property
bool
hasContent
:
model
&&
model
.
length
>
0
spacing
:
(
root
.
height
-
(
repeater
.
count
*
rowHeight
))
/
(
repeater
.
count
-
1
)
Repeater
{
...
...
Write
Preview
Markdown
is supported
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