Skip to content
Draft
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
17 changes: 10 additions & 7 deletions deeplabcut/gui/launch_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@

"""

import logging
import sys

import PySide6.QtWidgets as QtWidgets
import qdarkstyle
from PySide6.QtCore import Qt

from deeplabcut.gui import BASE_DIR
from deeplabcut.gui.gui_assets import icon_from_resource, pixmap_from_resource
from deeplabcut.gui.gui_assets import get_style_qss, icon_from_resource, pixmap_from_resource

logger = logging.getLogger(__name__)


def launch_dlc():
Expand All @@ -37,11 +39,12 @@ def launch_dlc():
splash = QtWidgets.QSplashScreen(pixmap)
splash.show()

stylefile = BASE_DIR / "style.qss"
with stylefile.open() as f:
app.setStyleSheet(f.read())

dark_stylesheet = qdarkstyle.load_stylesheet_pyside2()
app.setStyleSheet(get_style_qss()) # this gets overridden immediately?
try:
dark_stylesheet = qdarkstyle.load_stylesheet_pyside6()
except Exception as e:
logger.warning(f"Could not load qdarkstyle stylesheet for PySide6: {e}. Falling back to PySide2 stylesheet.")
dark_stylesheet = qdarkstyle.load_stylesheet_pyside2()
app.setStyleSheet(dark_stylesheet)

# Set up a logger and add an stdout handler.
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ gui = [
"pyside6; platform_system!='Linux' or platform_machine!='x86_64'",
# Avoid 6.10.0 only on Linux x86_64 (fails for older glib versions)
"pyside6<6.10; platform_system=='Linux' and platform_machine=='x86_64'",
"qdarkstyle==3.1",
"qdarkstyle==3.1; platform_system=='Linux' and platform_machine=='x86_64'",
"qdarkstyle>=3.1; platform_system!='Linux' or platform_machine!='x86_64'",
]
openvino = [ "openvino-dev==2022.1" ]
docs = [
Expand Down
Loading