Skip to content

A gorgeous theme for Tkinter/ttk, based on the Sun Valley visual style ✨

License

Notifications You must be signed in to change notification settings

Valer100/Sun-Valley-ttk-theme

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sun Valley ttk theme

Make your Tkinter application look better than ever with just two lines of code! Now with accent color support and dark mode titlebars (only on Windows)!

Screenshot of Sun Valley ttk theme Screenshot of Sun Valley ttk theme

Warning

This branch is just an experiment! It isn't intended for production use. Your app may start a bit slower, because the spritesheets will be colorized with your accent color at runtime. Also, the controls may not be colorized with your accent color completly. Use this version at your own risk.

Installation PyPi downloads

Clone this repository. After that open the sv_ttk folder in your terminal (Command Prompt) run the following command:

pip install -r requirements.txt

This command will install all the necesary dependencies.

Finally, copy the sv_ttk folder to your project. You don't have to do any changes to your code.

Usage Documentation

Note

The theme will only be applied to themable (tkinter.ttk) widgets, and not with the regular Tkinter widgets, they only benefit from the colorscheme.

For detailed documentation, visit the wiki page.

import tkinter
from tkinter import ttk

import sv_ttk

root = tkinter.Tk()

button = ttk.Button(root, text="Click me!")
button.pack()

# This is where the magic happens
sv_ttk.set_theme("dark")

root.mainloop()

Tips and tricks

Our intention is to keep the sv-ttk package as simple as possible, while making it easy to integrate with other libraries.

Set the theme to the system theme

You can use the darkdetect package to detect the system color scheme. Here's an example:

import darkdetect

sv_ttk.set_theme(darkdetect.theme())

It's only a matter of an extra import and passing the result of darkdetect.theme() to sv_ttk.set_theme(). It's that easy!

Dark mode title bar on Windows

Already there.

About

A gorgeous theme for Tkinter/ttk, based on the Sun Valley visual style ✨

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Tcl 76.0%
  • Python 21.2%
  • JavaScript 2.8%