theming questions
Dirk Hohndel
dirk at hohndel.org
Thu Jan 14 12:36:52 GMT 2021
Hi Marco,
Yes, you are correct, this is for Subsurface-mobile.
We do in fact use mostly our own controls and simply style them directly, but
it is the odds and ends that we get from Kirigami that cause us problems, or
more correctly, inconsistencies.
E.g., I couldn't figure out a way to change the color used in the breadcrumbs
or in the drawer backgrounds or for the action button without patching Kirigami.
And both of your responses indicate an issue that Kirigami (as part of Plasma)
appears to primarily be targeting Linux system - the promise of QLM and Kirigami
for us of course was that we could use one framework for Linux, Windows, macOS,
Android, and iOS. We already use QLM for the maps across all of these OSs,
and we are just right now adding statistics that are used everywhere and consist
of a mixture of C++ and QLM.
As of this writing, Kirigami itself isn't used in the desktop app, only the mobile app,
so predominantly on Android and iOS, but if I can get some of the issues I am
fighting right now sorted out, my hope would be to change that and make it the
consistent element of our UI design
> On Jan 13, 2021, at 6:54 AM, Marco Martin <notmart at gmail.com> wrote:
>>
>> After spending some quality time with the documentation I could find (not a lot) and with the sample plugin that I was able to find (Noah’s qqc2-breeze-plugin) I’m not sure if I understand more or am more confused. :-)
>>
>> I was able to build the plugin (that requires a lot of KF5 infrastructure, but for figuring out how this all is supposed to work I’m not too worried about that) and load the plugin, but then what do I do with it? Or asked differently, what do I get from having it?
>
> that one is called a QtQuickControls style. Basically is a set of qml
> files that will be instantiated when you create basic components like
> Button{}, ComboBox{} and so on.
> If your application must have an uniform own style for those controls,
> implementing an own QtQuickControls style is the suggested way, rather
> having inside the application MyButton{} MyTextBox{} and so on.
So this really changes the way the basic building blocks of QML are put
together. That may be a bit more invasive (and a bit too hard to maintain
as Qt changes fairly rapidly) for us.
Which brings us back to "how I do the simpler thing"
> On Jan 13, 2021, at 6:26 AM, Marco Martin <notmart at gmail.com> wrote:
>
> there may be several ways to go about.
> As Nico says, the Theme cal actually load plugins which can make it
> arbitrarly customizable.
> I was thinking about ways to make apps use arbitrary own color schemes
> (mostly for mobile use case) didn't come to a good upstream solution
> yet (i guess will end up have something based upon plain text config
> files for different color themes).
That certainly would work and be fairly easy for us to do, but I understand
that that's not available, yet.
> you can do either a c++ theme specialization plugin, or if you use
> your own style, and have it as a subdirectory in styles/
> you can then provide your own Theme.qml that exposes the various color
> properties (just start from one existing)
Ahh, that's interesting. Can you say a little more how that would work?
Kirigami gets compiled into a plugin that contains all its resources. So
would this simply be an additional set of commits on top of Kirigami that
we would carry and modify things there?
> so then in there you can make those values conditional to your internal theme.
> there it should affect colors everywhere (handles included).
> I assume is for Subsurface, right? i see that it already has custom
> buttons and whatnot, if they are a QtQuickcontrols2 theme, just create
> a kirigami style with the same name and that should be used
No, they aren't a QQC2 theme - as you saw in the other email (in this
response I reverted the order of your emails) I never got that to really
work.
If I read both of your responses correctly, then my easiest path is to
create a Subsurface style directory in the Kirigami sources (src/styles)
and then somehow get my app to use that style at startup. And use
our attached property to populate all the Kirigami colors.
I'll play with that idea - but am of course happy for other suggestions
and ideas.
Thanks for the responses so far! This definitely gives me more to
explore.
/D
PS: I am surprised that the main example used for Kirigami in action
on https://develop.kde.org/frameworks/kirigami// <https://develop.kde.org/frameworks/kirigami//> is still Subsurface-mobile :-)
I hope that with our next version we can give some far more interesting
screen shots to update that site... what you have there is fairly old and
IMHO doesn't show how well a Kirigami app can look... but yeah, seeing
my own dives shown on that site was interesting :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20210114/d2d4497d/attachment.htm>
More information about the Plasma-devel
mailing list