https://bugs.kde.org/show_bug.cgi?id=481216

ratijas <m...@ratijas.tk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|                            |https://invent.kde.org/plas
                   |                            |ma/plasma-thunderbolt/-/com
                   |                            |mit/3f8a85355d3ae43a31960ac
                   |                            |7cb170e7cb0c4c127
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from ratijas <m...@ratijas.tk> ---
Git commit 3f8a85355d3ae43a31960ac7cb170e7cb0c4c127 by ivan tkachenko.
Committed on 13/08/2024 at 20:03.
Pushed by ratijas into branch 'master'.

kcm: Fix usage of Kirigami.Theme colors

Kirigami.Theme attached property can not be meaningfully used form a
stateless JavaScript module without a context Item instance, because,
well, it is designed to be an attached property after all! It attaches
to an Item, and reads values based on a context and parent chain of it.

Instead, we have few options:

a) Turn the module into a stateful script. This is horrible for scripts
which are to be reused from more than one QML component, because they
rely on external imports from those QML files.

b) Pass the context Item to the function and rewrite the assignments to
query the attached properties from that Item. Sounds good and type-safe.

c) Return only names of the respective color properties, so that the
client code may query them on any number of any Items they like. This
is the least intrusive option, and does not fetch colors unnecessarily
for the DeviceView component which doesn't currently use it anyway.

M  +1    -1    src/kcm/ui/DeviceList.qml
M  +3    -3    src/kcm/ui/utils.js

https://invent.kde.org/plasma/plasma-thunderbolt/-/commit/3f8a85355d3ae43a31960ac7cb170e7cb0c4c127

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to