Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch/theme logo switch #83

Merged
merged 3 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions massdash/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import click
import logging
import streamlit as st
from streamlit_javascript import st_javascript
from PIL import Image

# Server
Expand Down Expand Up @@ -39,8 +40,12 @@ def main(verbose, perf, perf_output):
st.set_page_config(page_title='MassDash', page_icon=MASSDASH_ICON, layout='wide')

dirname = os.path.dirname(__file__)

MASSDASH_LOGO = os.path.join(dirname, 'assets/img/MassDash_Logo_Dark.png')

st_theme = st_javascript("""window.getComputedStyle(window.parent.document.getElementsByClassName("stApp")[0]).getPropertyValue("color-scheme")""")
if st_theme == "dark":
MASSDASH_LOGO = os.path.join(dirname, 'assets/img/MassDash_Logo_Light.png')
else:
MASSDASH_LOGO = os.path.join(dirname, 'assets/img/MassDash_Logo_Dark.png')
OPENMS_LOGO = os.path.join(dirname, 'assets/img/OpenMS.png')

###########################
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ requires = [
"psutil",
"pyopenms",
"scipy",
"streamlit",
"streamlit>=1.30.0",
"streamlit-javascript",
"tqdm",
"upsetplot",
]
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ psutil
pyopenms
scipy
streamlit>=1.30.0
streamlit-javascript
tqdm
upsetplot
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ install_requires =
pyopenms
scipy
streamlit>=1.30.0
streamlit-javascript
tqdm
upsetplot

Expand Down