Skip to content

Theming - #640

Open
19wintersp wants to merge 19 commits into
VATSIM-UK:mainfrom
19wintersp:theming
Open

19wintersp wants to merge 19 commits into
VATSIM-UK:mainfrom
19wintersp:theming

Conversation

@19wintersp

@19wintersp 19wintersp commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Fixes #536, #570

Supersedes #621

There's a lot of repetition in the rendering code at the moment unfortunately, which is mostly down to the way the existing code was written; I've tried to avoid changing too much so that has been retained. In the future this code will be rewritten when implementing the design changes. Potentially the Gdiplus::Graphics wrapper could be modified to accept PaletteKeys as well as raw GDI+ objects, which would also clean things up somewhat.

Still to do, in rough order:

  • Fix tests – I haven't touched these at all, so they're totally broken; wouldn't be opposed to just pointing an LLM at them since a lot of them are really redundant
  • Add new tests to cover new code
  • Fix "StandardButtons" – the "constructors" taking Gdiplus::Colors should be changed to take PaletteKeys instead, since they aren't used; the code here is really awful anyway, and should probably be rewritten
  • Check colour palettes for contrast, since some of the timer colours aren't very readable currently
  • Clang format

When merging, please squash merge!

19wintersp and others added 19 commits June 25, 2026 04:07
commit 6e2fb60
Author: Kristián Kunc <kristian.kunc@gmail.com>
Date:   Sat May 30 13:55:49 2026 +0000

    fix sonarqube duplication

commit 4dfe8f5
Author: Kristián Kunc <kristian.kunc@gmail.com>
Date:   Sat May 30 13:48:45 2026 +0000

    sonarqube fixes

commit b5be768
Author: Kristián Kunc <kristian.kunc@gmail.com>
Date:   Thu May 28 20:53:54 2026 +0000

    test fixes + copilot code review

commit 1ef3587
Author: Kristián Kunc <kristian.kunc@gmail.com>
Date:   Thu May 28 18:03:28 2026 +0000

    fix tests and clang run

commit b7d63cb
Author: Kristián Kunc <kristian.kunc@gmail.com>
Date:   Thu May 28 15:42:29 2026 +0000

    fix tests

commit 0e45813
Author: Kristián Kunc <kristian.kunc@gmail.com>
Date:   Thu May 28 15:02:49 2026 +0000

    feat: Add theming support

    refactor brushes, use standard theming burshes for all rendering

commit 080caaf
Author: Kristián Kunc <kristian.kunc@gmail.com>
Date:   Mon Jan 26 16:15:45 2026 +0100

    clang format

commit fe5d144
Author: William Hinshaw <61280994+Hinshee@users.noreply.github.com>
Date:   Mon Oct 20 20:58:24 2025 +0100

    Added: Standard Menu Buttons match selected theme

commit aeaeb64
Author: William Hinshaw <61280994+Hinshee@users.noreply.github.com>
Date:   Thu Aug 7 00:36:07 2025 +0100

    (WIP) Add Background to Departure Requests

    Initial work on this (WIP)

commit 42cf69a
Author: William Hinshaw <61280994+Hinshee@users.noreply.github.com>
Date:   Mon Jun 30 11:37:24 2025 +0100

    Implement Persistent Colours

commit 4af6c91
Author: William Hinshaw <61280994+Hinshee@users.noreply.github.com>
Date:   Mon Jun 16 18:41:05 2025 +0100

    Fix: Approach Seq. Title Bar Height

commit 1115dbe
Author: William Hinshaw <61280994+Hinshee@users.noreply.github.com>
Date:   Mon Jun 16 18:38:13 2025 +0100

    Added: Component Colour / Dimensions Changes

commit 1d9cbf6
Author: William Hinshaw <61280994+Hinshee@users.noreply.github.com>
Date:   Mon Jun 16 02:36:45 2025 +0100

    Configure Save/Load Settings

commit b7c8c5d
Author: William Hinshaw <61280994+Hinshee@users.noreply.github.com>
Date:   Sun Jun 15 19:32:46 2025 +0100

    Add General Definitions and Foundations

commit 184a065
Author: William Hinshaw <61280994+Hinshee@users.noreply.github.com>
Date:   Sun Jun 15 01:34:00 2025 +0100

    Add Settings Handler for Colour Palette

commit 34db6e5
Author: William Hinshaw <61280994+Hinshee@users.noreply.github.com>
Date:   Sun Jun 15 01:30:31 2025 +0100

    Added Colour Palette Dropdown

Co-authored-by: William Hinshaw <61280994+Hinshee@users.noreply.github.com>
Co-authored-by: Kristián Kunc <kristian.kunc@gmail.com>
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
8 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@19wintersp

Copy link
Copy Markdown
Contributor Author

More or less finished now; I've tried to remove all of the abortive changes from previous attempts at this feature, but there may still be a few lingering files changed. The code has been formatted with clang-format-18; I don't know why the Action seems to be using a different version (20?) to that specified in the Dockerfile. Sonar's recommended changes are irrelevant: the changes to "resource.h" and "TestEnvironment.cpp" are not possible due to external API constraints (Windows and gMock, respectively); the commented-out code will be removed when that functionality is re-introduced with a rewrite of the UI; to_underlying cannot be used because we use C++20, not C++23; and the declarations in "Palette.cpp" are deliberately formatted as such.

The "TestEnvironment.cpp" files are unfortunate, but I think the duplication is necessary due to the unique shutdown code required for the plugin tests alone; I'd appreciate a better way of doing it if one exists. I'm open to suggestions as to a better name/location for these files, but since they effectively act as an entrypoint to the testing binaries, I think having them in the root is justifiable.

Two regressions are visible to the user: the titlebar of the departure coordination list does not flash, as a temporary measure until this functionality is refactored into the common titlebar code; and the "OP" button is now a different colour by default, depending on the theme.

@19wintersp
19wintersp marked this pull request as ready for review September 10, 2026 15:15
@kristiankunc

Copy link
Copy Markdown
Contributor

I've built this locally and am satisfied. Not much to say about the code, other than that there's lots of it unfortunately but all looks satisfactory at first glance

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.

Colour Schemes + Dark Mode

2 participants