{"id":13793763,"url":"https://github.com/rdbende/Azure-ttk-theme","last_synced_at":"2025-05-12T20:31:13.251Z","repository":{"id":37722798,"uuid":"334097545","full_name":"rdbende/Azure-ttk-theme","owner":"rdbende","description":"A stunning modern theme for ttk inspired by Fluent Design 💠","archived":false,"fork":false,"pushed_at":"2023-10-30T16:39:23.000Z","size":8753,"stargazers_count":776,"open_issues_count":10,"forks_count":143,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-12T20:46:41.070Z","etag":null,"topics":["azure","azure-theme","dark","dark-mode","dark-theme","fluent-design","gorgeous","gui","modern","python","python-gui","stunning","tcl","theme","tk","tkinter","tkinter-gui","ttk"],"latest_commit_sha":null,"homepage":"","language":"Tcl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rdbende.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-29T09:32:06.000Z","updated_at":"2025-04-11T14:31:49.000Z","dependencies_parsed_at":"2024-08-03T23:02:22.067Z","dependency_job_id":null,"html_url":"https://github.com/rdbende/Azure-ttk-theme","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdbende%2FAzure-ttk-theme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdbende%2FAzure-ttk-theme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdbende%2FAzure-ttk-theme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rdbende%2FAzure-ttk-theme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rdbende","download_url":"https://codeload.github.com/rdbende/Azure-ttk-theme/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253816718,"owners_count":21968873,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","azure-theme","dark","dark-mode","dark-theme","fluent-design","gorgeous","gui","modern","python","python-gui","stunning","tcl","theme","tk","tkinter","tkinter-gui","ttk"],"created_at":"2024-08-03T23:00:30.950Z","updated_at":"2025-05-12T20:31:11.975Z","avatar_url":"https://github.com/rdbende.png","language":"Tcl","funding_links":[],"categories":["New style elements","Wanna see more?"],"sub_categories":["Tcl / tk","Dark mode title bar on Windows"],"readme":"# Azure theme for ttk\r\n\r\n![Screenshot of the Azure theme](screenshot.png)\r\n\r\n## How to use?\r\nJust like for my [Sun Valley](https://github.com/rdbende/Sun-Valley-ttk-theme) theme in version 2.0 I wanted to make usage of the theme very simple, so the theme setting is handled by a separate tcl script.\r\nThis way whether you want to use a dark or light theme, you need to import just a single file. The other thing that makes this a good solution is that normally switching between light and dark theme is not entirely perfect, and the colors are not correct.\r\n\r\n```python\r\n# Just simply import the azure.tcl file\r\nwidget.tk.call(\"source\", \"azure.tcl\")\r\n\r\n# Then set the theme you want with the set_theme procedure\r\nwidget.tk.call(\"set_theme\", \"light\")\r\n# or\r\nwidget.tk.call(\"set_theme\", \"dark\")\r\n```\r\n\r\n### Changing themes\r\nNormally changing between themes isn't that easy, because then the colors aren't correct. See this [Stackoverflow question](https://stackoverflow.com/questions/66576662/how-to-switch-between-dark-and-light-ttk-theme). However, with my current solution, you can change theme at any time, without any color issues.\r\n\r\n```python\r\nimport tkinter as tk\r\nfrom tkinter import ttk\r\n\r\nroot = tk.Tk()\r\n\r\n# Pack a big frame so, it behaves like the window background\r\nbig_frame = ttk.Frame(root)\r\nbig_frame.pack(fill=\"both\", expand=True)\r\n\r\n# Set the initial theme\r\nroot.tk.call(\"source\", \"azure.tcl\")\r\nroot.tk.call(\"set_theme\", \"light\")\r\n\r\ndef change_theme():\r\n    # NOTE: The theme's real name is azure-\u003cmode\u003e\r\n    if root.tk.call(\"ttk::style\", \"theme\", \"use\") == \"azure-dark\":\r\n        # Set light theme\r\n        root.tk.call(\"set_theme\", \"light\")\r\n    else:\r\n        # Set dark theme\r\n        root.tk.call(\"set_theme\", \"dark\")\r\n\r\n# Remember, you have to use ttk widgets\r\nbutton = ttk.Button(big_frame, text=\"Change theme!\", command=change_theme)\r\nbutton.pack()\r\n\r\nroot.mainloop()\r\n```\r\n\r\n## New style elements\r\nAzure theme has a style for every ttk widget, but there are some **new** widget styles, such as an accent button, toggle switch, toggle button, tickscale, and card. You can apply these with the style parameter.\r\n\r\nIf you need a highlighted button, use `Accent.TButton`:\r\n```python\r\naccent_button = ttk.Button(root, text='Accent button', style='Accent.TButton', command=callback)\r\n```\r\n\r\nTo create a toggle button you need a checkbutton, to which you can apply the `Toggle.TButton` style:\r\n```python\r\ntoggle_button = ttk.Checkbutton(root, text='Toggle button', style='Toggle.TButton', variable=var)\r\n```\r\n\r\nThe use of switches instead of checkboxes is becoming more common these days, so this theme has a `Switch.TCheckbutton` style, that can be applied to checkbuttons:\r\n```python\r\nswitch = ttk.Checkbutton(root, text='Switch', style='Switch.TCheckbutton', variable=var)\r\n```\r\n\r\nIf you don't like the big circle on the scale, you prefer something more solid, then use the `Tick.TScale` style:\r\n```python\r\ntick_scale = ttk.Scale(root, style='Tick.TScale', variable=var)\r\n```\r\n\r\nIf you only want a border around your widgets, not an entire LabelFrame then apply the `Card.TFrame` style to a Frame:\r\n```python\r\ncard = ttk.Frame(root, style='Card.TFrame', padding=(5, 6, 7, 8))\r\n```\r\n\r\n## Bugs\r\n- Tk isn't really good at displaying `png` images, so if your program is laggy with the theme, please check out the [gif-based branch!](https://github.com/rdbende/Azure-ttk-theme/tree/gif-based/)\r\n- If your app has a treeview widget, and you change the theme the window will expand horizontally. This is a quite strange bug that applies to all ttk themes. \r\n\r\nIf you scrolled down here, please check out my other themes!\r\n- [Sun Valley ttk theme](https://github.com/rdbende/Sun-Valley-ttk-theme) a theme that looks like Windows 11!\r\n- [Forest ttk theme](https://github.com/rdbende/Forest-ttk-theme) a theme inspired by Excel's look.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdbende%2FAzure-ttk-theme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frdbende%2FAzure-ttk-theme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frdbende%2FAzure-ttk-theme/lists"}