Skip to content

ttk theming for Dialogs library #5381

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

d-biehl
Copy link
Contributor

@d-biehl d-biehl commented Mar 24, 2025

Had to play around a bit today to distract myself from the other important things I should actually be doing, just to clear my head a bit… 😉

Regarding issue #5334 and today’s Slack discussion, I remembered reading that Tkinter can be themed. So I experimented a little, refreshed my TCL skills (with a bit of help from Claude 😉), and made the Dialogs library themeable.

What we have now:

  • A first version of the Dialogs library supporting Dark and Light modes
  • Automatically follows the system theme (Dark/Light) on Windows/Mac/Linux (Gnome/GTK)
  • A touch of turquoise for that Robot Framework vibe
  • A theme file to adjust all aspects of Tkinter dialogs/controls without changing the code

What’s still missing:

  • Option to set the default theme
  • Support for custom themes

Take a look — maybe it’ll be useful; if not, at least I procrastinated 😄

image image image image

@pekkaklarck
Copy link
Member

pekkaklarck commented Mar 28, 2025

I tested this locally. Comments based on that and otherwise:

  • On the Slack poll the clear majority preferred using the system default colors. I'm thus not sure does it make sense to change them. I'm also not sure do people recognize "Robot colors" if they are used only with buttons.
  • Using light/dark theme depending on user preference is nice, but I'm not sure is it worth all the extra code. I also tested the current code on an OSX laptop with a dark theme today, and dialogs were black. Could it be that OSes can handle the theme automatically? In that case I think it's best we don't touch colors too much.
  • I don't like the reduced padding or smaller font size compared to the current styles. I increased them on purpose as part of Dialogs: Enhance look and feel #5334 earlier.
  • List selection widget is broken on Linux at least on Linux. I'll attach a screenshot.

broken_list

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.

2 participants