lawsie / guizero

A Python 3 library to allow learners to quickly and easily create GUIs.
https://lawsie.github.io/guizero
BSD 3-Clause "New" or "Revised" License
402 stars 81 forks source link

Theme Support #497

Open lmtreser opened 9 months ago

lmtreser commented 9 months ago

Hello, is there currently support for themes to change the appearance of the GUIs? For example, something similar to ttkbootstrap. If the answer is no, how could I help you start implementing it? Greetings!

PythonRPG010 commented 7 months ago

Hello! well, in the docs you can found an idea for it, but i made something like it and will share:

from guizero import *

theme = 'white'

colors = ['black', 'white']

def updatetheme():
    global theme
    app.bg = themeCombo.value
    theme = app.bg
    if theme == "white":
        app.text_color = "black"

    elif theme == "black":
        app.text_color = "white"
        color = "white"

app = App(title="Something",)

themeCombo = Combo(app, align='top', options=colors, selected=app.bg, command=updatetheme)

app.display()