Skip to content

Main: Use KConfig.WindowStateSaver to handle window geometry

Currently, Kontrast does not handle window geometry at all, and will always open with a default geometry. This MR moves Kontrast to use the KConfig.WindowStateSaver, which will handle remembering window geometry and state. Note that remembering the window maximized state depends on a recent commit to KConfig.

It does not look like Kontrast currently sets a minimum window geometry (minimumWidth, minimumHeight in QML). Likewise it does not set a default geometry (width, height in QML). This could be set in this MR or in a follow-up, if there is a preferred size. I am not sure what sensible settings would be for these, but the KDE Human Interface Guidelines recommend using Kirigami gridUnits.

Right now, the default size that Kontrast uses is good, so a default size is probably not necessery (using WindowStateSaver doesn't affect the default size if there is no previously saved size it seems like), but the minimum size should be set as it can get very small.

image.png

I am happy to do this work, in this MR or in a follow-up, if some recommended sizes can be given.


All feedback is welcome on this. Thanks!

Merge request reports