def test_custom_theme(self): for theme in ThemedStyle.pixmap_themes: window = tk.Tk() style = ThemedStyle(window) style.set_theme_advanced(theme, brightness=0.2, saturation=1.3, hue=1.4) window.destroy() return
def test_themed_style_themes(self): style = ThemedStyle(self.window) themes = ["blue", "plastik", "keramik", "aquativo", "clearlooks", "elegance", "kroc", "radiance", "winxpblue", "keramik_alt", "black", "arc"] for item in themes: style.theme_use(item) self.assertTrue(item in style.themes) self.assertEqual(style.theme_use(), item)
def get_ttk_style(): '''Use ttkthemes if module is installed ''' global __style if __style is None: try: from ttkthemes.themed_style import ThemedStyle __style = ThemedStyle() except: __style = ttk.Style() return __style
def main(): root = tk.Tk() root.title('Archive assistant 0.3') # Background color manually set because themed style doesn't for some reason root.configure(background='#F0F0F0') # Make window unresizable root.resizable(width=0, height=0) app = Application(master=root) style = ThemedStyle(root) # About possible themes: # The themes plastik, clearlooks and elegance are recommended to make your UI look nicer # on all platforms when using Tkinter and the ttk extensions in Python. # When you are targeting Ubuntu, consider using the great radiance theme. style.theme_use("plastik") app.mainloop()
def test_themed_style_init(self): ThemedStyle(self.window)