Port colord-kcm to Qml
I try to keep the change as small as possible. But due to the nature of the porting, the diff is still very large. From the C++ side, KCMColord.*
got re-written, since we need to port that from QWidget to KQuickAddons::ConfigModule. And that's where the old KCM's view control logic was. Description
was split into DeviceDescription
and ProfileDescription
, and view control logic all removed, they're now just data source. ProfileModel
and DeviceModel
got some additional method to make them available in Qml, besides that they remain unchanged. ProfileNamedColor
and ProfileMetadata
changed from QWidgets with in-place data to ListModel, the view is now in Qml.
For the CMake part, the old desktop file got converted to json, and relevant CMake commands also changed, and of course we no longer link to QWidget. KItemmodel and kirigami-addon runtime dependency added.
Of course, the Qml is written from the ground up. While the UI largely remain unchanged, there are some differences.
Remove profile button is moved from header to inside item. None removable profile don't have this button. (instead of showing a disabled button in the old KCM)
The color preview is now a background of list item, additionally, hex color code is also displayed.
import profile now a dialog instead of toolbutton, still not sure about the UI though.
remove profile from device button now also in-item
calibrate button is replaced by help message. The old KCM will launch gnome-color-manager for current device. 'displaycal' is way better than gnome-color-manager, but not support routing directly to device calibrate page. And according to @tysontan, it's unlikely for users who want to calibrate displays to enter from colord-kcm. And calibrating is a rarely used operation. We just need to tell user they can use displaycal to calibrate.