Start of the accessibility KCM
AbandonedPublic

Authored by tcanabrava on Sep 25 2019, 2:43 PM.

Details

Summary

This is a 1 - 1 translation of the QWidgets version of the Accessibility
KCM - Most of the functionality is there, and the layout is the same
with minor edits. We do need a better layout, this one does not behave
correctly in Qml (the tabs are too many and if a tab gets out of the
window, there's no way to click in it without resizing the whole window)

Depends on D23835

Diff Detail

Repository
R119 Plasma Desktop
Branch
kcm_acess
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 18915
Build 18933: arc lint + arc unit
tcanabrava created this revision.Sep 25 2019, 2:43 PM
Restricted Application added a project: Plasma. · View Herald TranscriptSep 25 2019, 2:43 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
tcanabrava requested review of this revision.Sep 25 2019, 2:43 PM
tcanabrava updated this revision to Diff 66834.Sep 25 2019, 3:13 PM
  • Make buttons work

Thanks for taking this on Tomaz, Just throwing some ideas out but if it would help to have less tabs it might be useful to put all the keyboard features on one tab called Keyboard instead of the 3 it has now (Modifier Keys, Keyboard Filters and Activation Gestures) The top groupbox of Activation Gestures items could be moved to their respective groupboxes also so there are less groupboxes on the Keyboard tab than before on these 3 tabs.

Thanks for taking this on Tomaz, Just throwing some ideas out but if it would help to have less tabs it might be useful to put all the keyboard features on one tab called Keyboard instead of the 3 it has now (Modifier Keys, Keyboard Filters and Activation Gestures) The top groupbox of Activation Gestures items could be moved to their respective groupboxes also so there are less groupboxes on the Keyboard tab than before on these 3 tabs.

I'll try - I don't like the amount of tabs, but maybe joining three tabs together is too much.
The Orca tab has only one option, there's configure notifications buttons twice. we need a bit of love there.

Don't change kcm_access to kcmaccess

mart added a subscriber: mart.Sep 26 2019, 3:07 PM

Visually, it looks exactly like the old one, but in qml.. which gives it several layouting problems
Since is tabbed (vdg should be contacted tough to see if they don't have a different option other than tabbed) it should use https://phabricator.kde.org/D23835 (which then would depend from)

all the things inside the tabs should then use a Kirigami.FormLayout

kcms/access/CMakeLists.txt
6

kcm_access for compatibility with the other kcms

mart added inline comments.Sep 26 2019, 3:12 PM
kcms/access/package/contents/ui/Bell.qml
28

Shouldn't use groupboxes at all, but just FormLayouts with sections

Kirigami.FormLayout {
  Item{
      Kirigami.formData.title: i18n("Audible Bell")
      Kirigami.formData.isSection: true
  }
  QQC2.CheckBox { ....

....
  Item{
      Kirigami.formData.title: i18n("Visual Bell")
      Kirigami.formData.isSection: true
  }
  QQC2.CheckBox { ....
  
}
tcanabrava updated this revision to Diff 67571.Oct 9 2019, 5:14 PM
  • Use Plasma KCM
  • Adapt to FormLayout
  • Fix label
  • Space every tab equally
  • Form layout port
  • FormLayout
  • Simplify Qml
  • Port to Form Layout

this now depends on https://phabricator.kde.org/D23835 - There's an issue with saving (the save is not activated for some reason, I need to investigate.

ngraham edited the summary of this revision. (Show Details)Oct 9 2019, 5:18 PM
ngraham added a dependency: D23835: Add TabKCM.
ngraham requested changes to this revision.Oct 9 2019, 6:39 PM

Why is kcms/colors/CMakeLists.txt being changed? Looks unrelated.

As a general UI principle, whenever you have a group of controls that's mostly checkboxes, don't use formal section headers; instead, give the first checkbox a label by moving your Kirigami.FormData.label into it rather than putting it inside a separate Item or Separator.

Also often it's better to use whitespace instead of formal separator lines. It looks cleaner. Not always, but often.

So you would wind up with something that looks more like this:

.
(those labels are way too long, which is another matter)

In terms of a general UI design, I don't think tabs work here. There are too many tabs and they get cut off and look terrible with the default window size:


I imagine this is even worse with wordier languages like German or Brazilian Portuguese.

Instead, I think a better UI would be to have the tab chooser be a vertical list, like in the Notifications KCM:

This revision now requires changes to proceed.Oct 9 2019, 6:39 PM
bport added inline comments.
kcms/access/kcmaccess.h
37–72

Using KConfigXT will remove lots of boilerplate code (tons of property declaration + associated methods and easiest, load, save and defaults method).
And with the work done by @ervin on KConfigXT and KQuickAddons::ConfigModule you will have benefits (defaults, reset, apply button state for example will be handled automatically)

Can you please follow KDE Frameworks coding style

Can you please follow KDE Frameworks coding style

Sorry, it was by mistake. I'll fix the style.

tcanabrava added inline comments.Oct 11 2019, 12:27 PM
kcms/access/kcmaccess.h
37–72

Will look at it.

tcanabrava updated this revision to Diff 68019.Oct 16 2019, 7:14 AM
  • Use Plasma KCM
  • Adapt to FormLayout
  • Fix label
  • Space every tab equally
  • Form layout port
  • FormLayout
  • Simplify Qml
  • Port to Form Layout
  • A much much better layout than tabs
  • Beginning of KConfigXt Port
  • Add KConfigXt stubs
  • Fix install
  • Fix wrong values accessed
  • s/visibleBell/visualBell
  • Fix Many issues with the KConfigXT port
  • Fixes
  • Fix all the KConfigXT noiseances


Now it uses a Vertical List, providing a better navigation mode, The Settings where also rewritten using KConfigXT so I don't need to deal with all the possible properties. This actually hit a hard limit in the KConfigXT framework and I had to split in multiple files. aparently KConfigXT can't handle more than 32 settings at the moment.

bport requested changes to this revision.Oct 16 2019, 8:00 AM
bport added inline comments.
kcms/access/kcmaccess.cpp
177

new MouseSettings(this)

in order to avoid memory leak (same for other settings)

185

@ervin is working on fixing that (on KQuickAddons::ConfigModule) but unfortunatelly for now we need to connect all settings parameters to need save. When @ervin patch will be done we can remove that.
So I guess now if you are changing only one key the apply button is not updated to the good state

kcms/colors/CMakeLists.txt
26

Not sure why we have this change in this code review, seems unrelated

This revision now requires changes to proceed.Oct 16 2019, 8:00 AM

Lists such as these always need frames and backgrounds, like how it looks in the Notifications KCM. Just copy that.

tcanabrava updated this revision to Diff 69650.Nov 12 2019, 7:08 PM
  • Use Plasma KCM
  • Adapt to FormLayout
  • Fix label
  • Space every tab equally
  • Form layout port
  • FormLayout
  • Simplify Qml
  • Port to Form Layout
  • A much much better layout than tabs
  • Beginning of KConfigXt Port
  • Add KConfigXt stubs
  • Fix install
  • Fix wrong values accessed
  • s/visibleBell/visualBell
  • Fix Many issues with the KConfigXT port
  • Fixes
  • Fix all the KConfigXT noiseances
  • Add background to the List
  • Add single-connects
tcanabrava updated this revision to Diff 69651.Nov 12 2019, 7:12 PM
  • Fix Layout

kcms/colors/CMakeLists.txt
26

completely unrelated, thanks for spotting.

It doesn't compile:

/home/nate/kde/usr/include/KF5/KNewStuff3/KNS3/DownloadDialog:1:10: fatal error: kns3/downloaddialog.h: No such file or directory
    1 | #include "kns3/downloaddialog.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~

Also we should be using the new QML-based GHNS dialog where possible, now that it's a first-class citizen.

ervin requested changes to this revision.Nov 18 2019, 7:50 AM

A few changes still needed.

Also, in all the QML code we need to handle immutability of the settings (unfortunately that part can't be easily made magic like for the widgets). This would require for each control to have something like:
enabled: kcm.fooSettings.isImmutable("mySetting")

kcms/access/kcmaccess.cpp
177

What @bport said, pass the parent to the ctor (will require adjusting the kcfgc files to get the corresponding ctors generated though).
Also it's generally better to do this kind of member initialization in the ctor member initializers list.

213–214

I think this override can completely go away.

221

I don't think those calls to save are still needed. For sure you need to call the super class save() implementation though.

kcms/access/kcmaccessibilitymouse.kcfg
35

Wouldn't an Enum be more suited here?

kcms/colors/CMakeLists.txt
28

Why is there still changes in colors?

This revision now requires changes to proceed.Nov 18 2019, 7:50 AM

It doesn't compile:

/home/nate/kde/usr/include/KF5/KNewStuff3/KNS3/DownloadDialog:1:10: fatal error: kns3/downloaddialog.h: No such file or directory
    1 | #include "kns3/downloaddialog.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~

Also we should be using the new QML-based GHNS dialog where possible, now that it's a first-class citizen.

There's no KNS3 on Accessibility

So... fix it? :)

tcanabrava updated this revision to Diff 69945.Nov 18 2019, 6:15 PM
  • Use Plasma KCM
  • Adapt to FormLayout
  • Fix label
  • Space every tab equally
  • Form layout port
  • FormLayout
  • Simplify Qml
  • Port to Form Layout
  • A much much better layout than tabs
  • Beginning of KConfigXt Port
  • Add KConfigXt stubs
  • Fix install
  • Fix wrong values accessed
  • s/visibleBell/visualBell
  • Fix Many issues with the KConfigXT port
  • Fixes
  • Fix all the KConfigXT noiseances
  • Add background to the List
  • Add single-connects
  • Fix Layout
  • Adapt to new ManagedConfig
  • Re-add X11Info

After squashing the commits to remove the broken history, arc diff opened a new revision.
https://phabricator.kde.org/D25375

kcms/access/kcmaccessibilitymouse.kcfg
35

This i a spinBox with a range from 0 to 1000 in the original code, so I dont think an enum will be better there.

tcanabrava abandoned this revision.Nov 18 2019, 6:34 PM