D24524: Add a common widget config control library starting with ConfigIcon.qml

Chris Holland noreply at phabricator.kde.org
Wed Oct 9 19:56:51 BST 2019


Zren created this revision.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
Zren requested review of this revision.

REVISION SUMMARY
  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 <https://github.com/Zren/plasma-applet-tiledmenu/tree/master/package/contents/ui/lib> 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
  ===========
  
  F7558454: 2019-10-09___12-45-11.png <https://phabricator.kde.org/F7558454>
  F7558455: 2019-10-09___14-41-15.png <https://phabricator.kde.org/F7558455>
  
  Use Cases
  =========
  
  - Kicker, Kickoff
  - Present Windows T11776 <https://phabricator.kde.org/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

TEST PLAN
  Not yet tested via `cmake` and importing, but the QML is tested in a widget.

REPOSITORY
  R242 Plasma Framework (Library)

REVISION DETAIL
  https://phabricator.kde.org/D24524

AFFECTED FILES
  src/declarativeimports/CMakeLists.txt
  src/declarativeimports/plasmaconfig/ConfigIcon.qml
  src/declarativeimports/plasmaconfig/qmldir

To: Zren
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20191009/24cc2e36/attachment.html>


More information about the Kde-frameworks-devel mailing list