mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-20 15:24:14 +02:00
800ddfbcbe
189 of QET's 266 fixed-size icons are black line art with no dark variant, so on a dark palette they were black on a dark toolbar, and Fusion's disabled rendering lightened them into something more readable than the enabled state (GitHub #466, #870; bugtracker 335 for the element panels, which keep their own fix). The theme "qet-dark" holds light-ink copies of the line-art icons in ico/themes/qet-dark, generated by misc/make_icon_themes.py. Colored icons are not copied; the theme inherits them from "qet". An icon counts as line art when fewer than 20% of its visible pixels are saturated. The copies keep hue and alpha and invert lightness, scaled so each icon's darkest ink becomes (220,220,220), the dark palette's text color. The eight SVG icons get their color replaced the same way. QETApp::applyIconTheme() picks "qet-dark" for a dark palette and "qet" otherwise. It runs from initIconTheme(), again from initStyle() once the palette is final, and on the OS color scheme switch. Icons created with QIcon::fromTheme() re-resolve on their next paint, so nothing else changes. With light-ink files, Fusion's own disabled rendering comes out dimmer than enabled with no extra code. tests/qttest/tst_qeticons: every name resolves in both themes, every dark file has light ink, and a Fusion tool button shows its icon at 3:1 in both themes with disabled weaker than enabled.