Force Plasma style for QQC2 in applets
ClosedPublic

Authored by mart on Jul 28 2017, 2:22 PM.

Details

Summary

using the qml url interceptor, rewrite imports in order
to load always the plasma styled qqc2 controls in plasmoids
and plasma views. As is per-engine, is possible to load
controls with qstyle theme in configuration dialogs
and plasma style in plasmoids.

Note: this replaces just the style org.kde.desktop
to Plasma and not every style (so with Material
set as QT_QUICK_CONTROLS_STYLE environment variable
plasma would load controls with material style) because
we can control both org.kde.desktop and Plasma styles:
they must have the same subdirectories as unlike files,
their existence is checked before the rewrite (in our case,
"private"), so in order to work they must exist in both
styles

Test Plan

a qqc2 button in a plasmoid has the plasma style, in
a config dialog has the qwidget style. rewrite works
only from org.kde.desktop to Plasma and not from other
styles, due to the existence of the "private" subdirectory

Diff Detail

Repository
R242 Plasma Framework (Library)
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mart created this revision.Jul 28 2017, 2:22 PM
Restricted Application added projects: Plasma, Frameworks. · View Herald TranscriptJul 28 2017, 2:22 PM
Restricted Application added subscribers: Frameworks, plasma-devel. · View Herald Transcript
mart updated this revision to Diff 17325.Jul 28 2017, 2:22 PM

comment useless debug

‎[13:51] ‎<‎notmart‎>‎ hmm, still random failures in loading components
‎[13:58] ‎<‎notmart‎>‎ gaah, import of a subdirectory still breaks

Is this fixed?

Also we'll need to maybe look at changing how kirigami does its theme stuff so we can make that work.

mart added a comment.Jul 28 2017, 3:17 PM

‎[13:51] ‎<‎notmart‎>‎ hmm, still random failures in loading components
‎[13:58] ‎<‎notmart‎>‎ gaah, import of a subdirectory still breaks

Is this fixed?

no, that's the problem of having to have a "private" subfolder in both themes i mentioned in the commit message, will need to look deeper in qml parsing to figure out what's going wrong and maybe patching qt, if both the style that we replace and the new one are controlled by us, that's workable around (as they happen to have the same directory structure) fragile but works

Also we'll need to maybe look at changing how kirigami does its theme stuff so we can make that work.

kirigami does it exactly as qqc2 does, so should work as well. also in that case, we should make sure that both kirigami themes which we both control have the same directory structure

mart updated this revision to Diff 17703.Aug 4 2017, 11:25 AM

ignore resizes to empty sizes

on multiscreen, it happens that notification windows areresized to 0,0
by somebody else (not dialog code, perhaps kwin, perhaps notification applet

this makes the notification main item lose track of its natural geometry
causing bug 382340
ignore those events as spurious (and resizing a window to 0x0 doesn't
make sense anyways)

with this, notifications on multi monitor systems with primary on the right are ok

BUG:382340

mart updated this revision to Diff 17706.Aug 4 2017, 11:42 AM

remove unrelated changes

davidedmundson accepted this revision.Aug 25 2017, 9:28 AM
This revision is now accepted and ready to land.Aug 25 2017, 9:28 AM
This revision was automatically updated to reflect the committed changes.