summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorAxel Spoerl <axel.spoerl@qt.io>2022-12-19 08:45:59 +0100
committerAxel Spoerl <axel.spoerl@qt.io>2022-12-28 09:04:21 +0100
commit7b64eb71c0fe68540d97eb22492b4d0b0a647e9f (patch)
tree644036c61afa7c8295c9a2497ac5b7ab1044e633 /src/widgets
parent988c7bfcae5f69f7918f4dacf74e8b1ad2bee9c2 (diff)
Detect appearance by colors unless GTK theme name contains "dark"
QGtk3Theme detects the appearance property by theme name: If the name contains the keyword "dark", the theme is considered to be dark and otherwise light. This detection logic fails, when the GTK theme is dark without containing the "dark" keyword, e.g. the dark theme "Adapta-Nokto". While QGtk3Theme imports the right colors in that case, it wrongly identifies a light theme. This patch adapts the detection logic: If the theme name contains the "dark" keyword, it is considered a dark theme without further checks. If it doesn't, the current GTK3 theme's default background and foreground colors will be read. If the foreground is lighter than the background, the theme is considered dark. If the background is lighter than the foreground, the theme is considered light. If both colors are identical, the appearance will be Qt::Appearance::Unknown. Task-number: QTBUG-93955 Pick-to: 6.5 Change-Id: I0e0f4870a1397b6a7918331a852284bb1c91199e Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Diffstat (limited to 'src/widgets')
0 files changed, 0 insertions, 0 deletions