[faces clock] bare-bones switching mechanism
During the Plasma sprint, we talked about that we're still not quite happy about code duplication in the clocks available for Plasma, and the complexity of the digital clocks code, which makes it very hard to get the rendering juuuuuuuust perfect, because it still isn't in many cases. So, new approach we came up with: - Clock faces are different representations (done in QML) with a shared underlying mechanism. This resembles a little bit what we did with libplasmaclock during 4.x times, where we shared complex code for timezone handling, etc. in a shared library. This approach is different in that the clock actually gets its own (non-binary) plugins in the form of easy to write clock faces that are geared and perfected towards a specific scenario. The idea is to use a Loader and load a clock face dynamically during run-time, instead of loading the "fixed" DigitalClock.qml directly. - Move DigitalClock.qml under faces/ directory - Create a really simple alternative face - Allow switching from the config ui Rough, first prototype, in particular: - rendering of the previews is somewhat very broken - the exposed api is pretty much main.qml - zero polish Further steps: - flesh out API to present to clock faces, perhaps as a base QtQuick class to implement the clock faces, expose API in a less ad-hoc way than right now - design mechanisms to avoid the complexity requird by the vast matrix of rendering / constraint scenarios, perhaps splitting up the faces further into Horizontal.qml or Vertical.qml All needs a lot more fleshing out, here are some ideas where to take this branch: - Use packages for the clock faces, allow installing third party clocks, hello store.kde.org - Not just digital clock faces, but also analog; Kai has a prototype to change just the theme of the clock, take ideas from that - Perhaps start easy with just a bunch of different pre-defined faces, and allow 3rd party faces later on, this way we can get it into the hands of users a bit earlier on and learn about mistakes through feedback early on - Plasma is still all about clocks. I'll hack a bit further on this, but since notmart asked during our meeting this morning, I thought why not share at this early point, perhaps others find it interesting as well. Personal Note: I worked on the very first digital clock in Plasma, way before 4.0. The plan was to simplify a very artistic experimental train clock done by Ruphy into a basic digital clock, which we ended shipping with 4.0. I wanted to use a 2 hour train ride (ironically) from Cologne to Nijmegen to get that work done. That was in 2007. It'll be ten years this year that I make the mistake of starting to hack on our clocks' code. CCMAIL:plasma-devel@kde.org CCMAIL:ruphy@kde.org CCMAIL:mklapetek@kde.org
parent
0c217799
Please register or sign in to comment