I'm submitting this to start discussion on creating a common config control library.
I've started with a more common use case, an Icon control, to start us off.
- This is based on the kickoff icon control. https://github.com/KDE/plasma-desktop/blob/master/applets/kickoff/package/contents/ui/ConfigGeneral.qml
- I added:
- The preview size and padding can be changed
- The default icon that used when "cleared" can be changed.
- A TextField (Would be easier for power users, but I understand not adding it)
- A dedicated browse button (I'm not against removing)
- Preset values in the dropdown (I don't really need it)
- No idea if creating a new module is best. Nor if the name is okay. "configuration" is already in use.
- contents/config/config.qml has ConfigModel and ConfigCategory under a org.kde.plasma.configuration module, however it is declared using C++ classes. https://github.com/KDE/plasma-framework/blob/acdaefa221cc3e4b60542b4805e53ed966ea23b7/autotests/configmodeltest.cpp#L40
- I'm not sure why MenuSeparator { visible: false } leaves leftover whitespace.
I currently have a QQC1 library that assigns directly to plasmoid.configuration[configKey] without the user needing to click "Apply" (Like on Gnome). I'm not expecting "auto-serialize" to get merged to KDE however, which is unfortunate. ConfigIcon { configKey: 'icon' } is very nice and compact, and clicking Apply feels pointless.
Screenshots
Use Cases
- Kicker, Kickoff
- Present Windows T11776
- I use a modified version of this in Tiled Menu. I make the ColumnLayout the default property so I can optionally add a checkbox below the TextField. There's no need for this feature if we remove the TextField though. https://github.com/Zren/plasma-applet-tiledmenu/blob/master/package/contents/ui/lib/ConfigIcon.qml https://github.com/Zren/plasma-applet-tiledmenu/blob/master/package/contents/ui/config/ConfigGeneral.qml#L73-L81
RowLayout IconPreview ColumnLayout RowLayout TextField Button CheckBox