I want to use the Sun Valley Dark theme
sv_ttk.set_theme("dark")
However, I want to change the fonts, possibly by using a style
@staticmethod
def getStdFont():
return Font(family="Courier", size=16)
stdFont = getStdFont()
s = ttk.Style()
s.theme_create( "MyStyle", parent="alt", settings=
{
"TNotebook": {"configure": {"padding": [2, 2], "font": (stdFont) } },
"TNotebook.Tab": {"configure": {"padding": [2, 2], "font": (stdFont) } },
"TLabel": {"configure": {"font": (stdFont) } },
"TButton": {"configure": {"font": (stdFont) } }
})
s.theme_use("MyStyle")
It seems as if each are overwriting each other rather than combining the two.
I tried to add the sv_ttk
theme to myStyle
but couldn't figure out how.
I tried to change the font size of the sv_ttk
theme but couldn't figure out how
I don't care which way it's done, I just want the dark theme with different font sizes.
Looking at the source code for sv_ttk I see that it defines its own font objects, which you can modify to be whatever size you want.
For example, this function might be one way to make all of the fonts bigger:
Or, if you want to be able to make the font bigger or smaller multiple times, here's a function that lets you pass in a positive number to make the font bigger, and a negative number to make ti smaller:
Note that negative font sizes represent font sizes in pixels, and a positive size represents a size in printers points. In the source code the package uses negative values to represent font sizes in pixels.