The TableView in digital clock widget time zone configuration is replaced with ListView. Other UI didn't change.
Details
- Reviewers
ngraham - Group Reviewers
Plasma Plasma: Workspaces - Commits
- R120:b7b25010aa58: Migrate QQC1 to QQC2
Diff Detail
- Repository
- R120 Plasma Workspace
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 18155 Build 18173: arc lint + arc unit
++. The new table in the clock settings is much nicer anyway. :) See the following inline comments:
applets/digital-clock/package/contents/ui/configTimeZones.qml | ||
---|---|---|
22 | import QtQuick.Controls 2.5 as QQC2 | |
38–39 | While you're doing some porting, this entire thing can be replaced with a Kirigami.InlineMessage which will drastically reduce the amount of code here, and you can also remove the PlasmaComponents import (PlasmaCore is still needed for units, unless you want to also port things to use Kirigami.Units instead) | |
73 | units.largeSpacing is preferable to hardcoded spacing values | |
83 | This is pretty hard to follow. I would recommend expanding it to a conventional if/else block for clarity. | |
applets/digital-clock/plugin/timezonesi18n.cpp | ||
463 | Seems unrelated; probably best done in another patch | |
applets/systemmonitor/common/contents/ui/ConfigGeneral.qml | ||
20 | import QtQuick.Controls 2.5 as QQC2 | |
126 | Add editable: true and an appropriate valueFromText converter | |
sddm-theme/BreezeMenuStyle.qml | ||
6 | import QtQuick.Controls 2.5 as QQC2 | |
sddm-theme/KeyboardButton.qml | ||
6 | import QtQuick.Controls 2.5 as QQC2 | |
sddm-theme/Main.qml | ||
23 | import QtQuick.Controls 2.5 as QQC2 | |
sddm-theme/SessionButton.qml | ||
25 | import QtQuick.Controls 2.8 as QQC2 | |
wallpapers/image/imagepackage/platformcontents/phone/ui/config.qml | ||
25 | import QtQuick.Controls 2.5 as QQC2 | |
wallpapers/image/imagepackage/platformcontents/phone/ui/customwallpaper.qml | ||
25 | import QtQuick.Controls 2.5 as QQC2 |
That new time zone view lacks any form of keyboard navigation. I cannot use arrow keys to navigate it and neither can I hit space to toggle a checkbox. It also lacks a frame around its content area like the text field has.
Thanks. Still needs fixes for the timezone list:
- No frame around list
- Scrolling using touchpad or mouse wheel does not work
- Scrollview bounds are too large
- Item highlight is weird and nonstandard
- Keyboard navigation/selection does not work
QQC2 really shouldn't make it this hard to build a halfway decent list view...
Maybe the border of ScrollView is missing in breeze theme. I checked some other widgets, like network manager:
It also miss the border in the connection list.
Enable keyboard navigation and proper highlight
The key point is to enable focus properly:
- focus: true to both ListView and its delegate item. They are not focusable by default.
- activeFocusOnTab: true to ListView. So when you press Tab, it get focused.
- Call forceActiveFocus() function when clicking delegate item, so the ListView get focused.
Basically QML ListView doesn't response to any focus things by default. You have to enable them one by one. Then keyboard navigation will work.
Arrow key for navigation, Space for toggling checkbox. Enter will quit the window?
QQC2 Dekstop Style ScrollView does something really wonky with its background, where it only creates one if it was not set, instead of just having a background that can be overridden. In addition, that background is hidden by default. To enable it, you will need to add Component.onCompleted: background.visible = true to your scrollview.
Thanks for the tip. It seems added the border, but when scrolling, the top border or bottom border disappear. It cannot show full border at all sides.
I also tried to not use ScrollView but enable ListView's scrollbar:
ListView { // add scrollbar, background and border clip: true flickableDirection: Flickable.VerticalFlick boundsBehavior: Flickable.StopAtBounds QQC2.ScrollBar.vertical: QQC2.ScrollBar { } }
But it has no border or background. And the scrolling speed is crazily fast when using touch pad... However, all Qt examples on the internet say it is the way to add scrollbar to Flickables. But it is really buggy. https://bugreports.qt.io/browse/QTBUG-56075
applets/digital-clock/package/contents/ui/configTimeZones.qml | ||
---|---|---|
22–23 | Next plasma release can only depend on Qt 5.12 Please can you change accordingly | |
applets/systemmonitor/common/contents/ui/ConfigGeneral.qml | ||
134 | Please keep this the same as before i18ncp("Suffix for spinbox (seconds)", "second", "%1 secconds", seconds.toFixed(1)); |
This change prevents the SDDM theme from loading. See https://bugs.kde.org/show_bug.cgi?id=414252. The change to QQC2 in the import in Main.qml causes it, it seems.