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

TK to TTK Overhaul #2116

Open
Rixxan opened this issue Dec 24, 2023 · 3 comments · May be fixed by #2241
Open

TK to TTK Overhaul #2116

Rixxan opened this issue Dec 24, 2023 · 3 comments · May be fixed by #2241
Milestone

Comments

@Rixxan
Copy link
Contributor

Rixxan commented Dec 24, 2023

A number of locations in the code eschew the TTK library and continue to use the original "tk" library. This holds us back from supporting custom themes as well as breaks a few things. That, and TK in general is just... awful to work with.

We should migrate as much of the styling code as possible from tk to ttk.

And redo theme.py while we're at it.

@ElSaico
Copy link
Contributor

ElSaico commented May 15, 2024

As said on Discord, I propose the use of CustomTkinter as a semi-drop-in replacement. My arguments:

  • It's extremely light on dependencies (darkdetect is self-explanatory and packaging is used for version detection logic; neither depends on anything else)
  • The API avoids deviating from standard Tk as much as possible
  • Well-maintained
  • Reasonably popular (~10k stars, supported by many other libraries)
  • Modernized widgets - while still supporting the original Tkinter ones
  • Automatic HiDPI scaling - though the factor can be overridden if so desired
  • Perhaps the most important of all: a painless theming support (fully configurable via .json files)

@ElSaico
Copy link
Contributor

ElSaico commented May 23, 2024

Option B: https://ttkbootstrap.readthedocs.io/en/latest/
Less popular but still nothing to scoff at with ~1.7k stars - and the documentation is much nicer.

The only dependency is Pillow, which is already on develop anyway.

EDIT: the latest release does not work with Pillow 10.x - which means no Python 3.12 either; although it's fixed on master (see: israel-dryer/ttkbootstrap#490), the dev has been AWOL for a while.

@ElSaico
Copy link
Contributor

ElSaico commented May 23, 2024

CTk's scaling code stumbles upon an ancient Tk bug in some locales: TomSchimansky/CustomTkinter#571

Although there's a fix on the comments, facing such an issue from the outset - after both libraries gave me hope to start tackling our UI nightmare - just makes me want to yeet anything Tkinter-based into an active volcano.

@ElSaico ElSaico linked a pull request May 27, 2024 that will close this issue
@Rixxan Rixxan linked a pull request Jun 9, 2024 that will close this issue
@Rixxan Rixxan modified the milestones: 6.0, 5.12 Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Pending
Development

Successfully merging a pull request may close this issue.

2 participants