Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ttk-based theming #2241

Draft
wants to merge 67 commits into
base: develop
Choose a base branch
from
Draft

Ttk-based theming #2241

wants to merge 67 commits into from

Conversation

ElSaico
Copy link
Contributor

@ElSaico ElSaico commented May 27, 2024

Description

This replaces Tk widgets with their Ttk equivalents and makes theme.apply() use actual Ttk themes, which are implemented as Tcl packages.
It also sets the colors for all non-Ttk widgets the correct way, via tk_setPalette, and eliminates the need for most of myNotebook (with the exception of EntryMenu, which has added functionality).

Plugins should be minimally affected, and can be encouraged to use Ttk from then on.

Type of Change

UI. As in, all of it.

How Tested

The application is being live tested with my plugin setup - those with interfaces (main screen and/or preferences) are:

  • Artemis Scanner Tracker
  • BioScan
  • EDMC-C14-SoundViewer
  • EDMC-Cannon
  • EDMC-Massacres
  • Hutton Helper
  • SpanshRouter

In addition, a comprehensive catalog of Ttk widgets was added as a core plugin (accessible only with the --ttk-catalog argument), to showcase them for plugin authors and help any future theme development.

Notes

Closes #2116

@ElSaico ElSaico mentioned this pull request May 28, 2024
@Rixxan Rixxan linked an issue Jun 9, 2024 that may be closed by this pull request
@ElSaico
Copy link
Contributor Author

ElSaico commented Jun 16, 2024

Problem: while yeeting the alternative title bar for the Windows native dark one would rid us of the former's gnarly minimize/restore handling, the Transparent theme doesn't work on the latter - as its background color needs to be the exact same as the rest of the window (and worse, it changes upon deselecting).

The only pre-Windows 11 way to change a title bar's color (at least without invoking a mountain of undocumented Win32 calls that'd defeat its purpose anyway) is through the Windows App SDK, a set of WinRT APIs that work all the way back to version 1809.
There are bindings thanks to PyWinRT, but it lacks a crucial piece: a Win32 interop API that converts HWNDs from existing windows to the SDK's native WindowId. I made a request (pywinrt/pywinrt#61) and the head maintainer is so prolific that it might not take much long to get it implemented, so there's still hope.

...also, this SDK might open the door for cleaner alternatives of our Win32 API sprawl in the future - even beyond the ongoing move to pywin32.

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.

TK to TTK Overhaul
2 participants