Add theme selector
Some checks failed
Run Tests / run-tests (push) Failing after 39s

This commit is contained in:
2026-04-30 21:31:19 +02:00
parent 8ae8bc7a24
commit a88d1b4e79
11 changed files with 143 additions and 38 deletions

View File

@@ -1,17 +1,27 @@
import streamlit as st
from pandas.core.ops.docstrings import key
from pandas.io.formats.style import Styler
import queries.crud as crud
import themes as th
is_login_enabled = hasattr(st, 'user') and hasattr(st.user, 'is_logged_in')
is_logged_in = is_login_enabled and st.user.is_logged_in
st.title("Settings")
if hasattr(st.session_state, 'user_name'):
st.markdown(f"Currently logged in as **{st.session_state.user_name}**")
st.header("Theme")
themes = st.session_state.themes
with st.container(horizontal=True, width="stretch"):
for theme in ["light", "dark"]:
if st.button(label=themes[theme]["button_face_label"],
icon = themes[theme]["button_face_icon"],
disabled = (theme == st.session_state.current_theme),
width = "stretch"):
th.change_theme(theme)
st.rerun()
st.header("Colors")
with st.container(key="settings-color-selector"):
palettes = crud.get_color_palettes()