Skip to content

Qualify the shell palette as Commons.Color for Qt 6.12 - #15

Open
eliasfaltin wants to merge 1 commit into
SLcode777:masterfrom
eliasfaltin:fix/qt612-qualify-color
Open

eliasfaltin wants to merge 1 commit into
SLcode777:masterfrom
eliasfaltin:fix/qt612-qualify-color

Conversation

@eliasfaltin

Copy link
Copy Markdown

Qt 6.12 adds a Color type to the QtQuick module. It shadows the shell's Color palette singleton from qs.Commons. Every unqualified Color.<prop> read now returns undefined, so the panel and the roaming pet render with no theme colors. The shell log shows lines like these:

Panel.qml[40]: TypeError: Cannot read property 'text' of undefined
RoamWindow.qml[606:5]: Unable to assign [undefined] to QColor

Fix

  • Add import qs.Commons as Commons to Panel.qml and RoamWindow.qml.
  • Change the 22 palette reads from Color.x to Commons.Color.x.
  • Keep the plain qs.Commons import, because Panel.qml still uses Style.

This matches Omarchy's own fix in omacom/omarchy#14553. The change also works on older Qt versions, because a qualified module import works on any Qt version.

Verification

  • grep finds no unqualified Color references left in the plugin's QML files.
  • qmllint 6.12.0 parses both files with no syntax errors.
  • I applied the same patch to my local plugin copy on Qt 6.12. The shell picked up the change, but it kept the old compiled components until a full restart. I have not yet confirmed the colors after a restart.

Qt 6.12 adds a Color type to QtQuick. It shadows the shell's Color
singleton from qs.Commons, so every unqualified Color.<prop> read
returns undefined and the panel and roaming pet lose their colors.

Import qs.Commons as Commons and read the palette as Commons.Color,
the same fix Omarchy applied in omacom/omarchy#14553. The plain
qs.Commons import stays for Style.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant