Use KQuickAddons.IconDialog to choose a custom icon for the applet instead of just a plain old open file dialog with extension filter. This makes it possible to choose from actual icons like in KickOff which IMO is the most common use-case and is more user-friendly than having to find actual icon files in the filesystem (and which then get incorrectly scaled in the panel).
Details
- Reviewers
hein - Group Reviewers
Plasma - Commits
- R119:b46cd1ed167c: Use icon chooser in Kicker and Dashboard configuration to select custom icon
Diff Detail
- Repository
- R119 Plasma Desktop
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
applets/kicker/package/contents/ui/ConfigGeneral.qml | ||
---|---|---|
26 | this shouldn't be used in a config module. Use QtQuick.Controls 1.x instead |
applets/kicker/package/contents/ui/ConfigGeneral.qml | ||
---|---|---|
26 | That's fine. Fwict this code is from Kickoff and there we have a QQC Button for the icon which inside has a Plasma panel SVG background and IconItem on top, so you get a "live preview" of how it looks with your current Plasma theme. We do not end up with white icon on white background. |
This was done intentionally in the past to allow people to pick random images and get the proper kind of URL back to feed into the Image (which isn't used anymore). Can you verify this workflow still works?
@hein Tested that, you can still choose an arbitrary image file in the filesystem through the dialog and the image is used correctly
@davidedmundson As Kai Uwe said, this is basically just copy-pasted from KickOff configuration code - do you still want me to change it to 1.x control?
Can you also check the following case:
- Use the old UI to
applets/kicker/package/contents/ui/ConfigGeneral.qml | ||
---|---|---|
123 | This isn't OK - it needs to revert to the actual config default. Some distros change it to their branded icon and are very keen on wanting to override specifically the default rather than pre-setting a deviation. That's one reason why the old config format had cfg_icon and otherwise used cfg_useCustomButtonImage (while your approach here is to migrate everyone to cfg_icon by setting cfg_useCustomButtonImage to false when the UI is used). |
@davidedmundson As Kai Uwe said, this is basically just copy-pasted from KickOff configuration code - do you still want me to change it to 1.x control?
No, if Kai says something is fine, it's probably fine.
BTW this change will also accidentally fix your blurry icon issue you showed me at Akademy.
applets/kicker/package/contents/ui/ConfigGeneral.qml | ||
---|---|---|
123 | we could add a Q_INVOKABLE QVariant defaultValue() to KDeclarative ConfigPropertyMap so we could query this, like we already have an bool isImmutable() |
BTW this change will also accidentally fix your blurry icon issue you showed me at Akademy.
This change is a fix for the blurry icon which accidentally improves the config UI ;-)
This change *is* a fix for the blurry icon which accidentally improves the config UI ;-)
Well not really, for absolute paths you're just avoding a bug in IconItem. See https://bugs.kde.org/show_bug.cgi?id=383513