Visitar URL original
Fix PySide6 stylesheet usage by C-Achard · Pull Request #3371 · DeepLabCut/DeepLabCut · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3b8c44a
fix path resolution on network drives. Replace Path(..).resolve() wi…
deruyter92 May 29, 2026
fddcbaa
Add safe_resolve helper for path resolution
deruyter92 May 29, 2026
65f8dfb
fix redundant resolution of resolved path in memory_replay.py
deruyter92 May 29, 2026
6bbe26d
fix open -> os.stat
deruyter92 May 29, 2026
3f93a76
replace os.stat -> open for files, listdir for dirs.
deruyter92 May 29, 2026
87cd6aa
fix TestReadConfigProjectPath
deruyter92 May 29, 2026
8be1c26
Update deeplabcut/utils/auxiliaryfunctions.py
deruyter92 May 29, 2026
5ec1023
Merge remote-tracking branch 'upstream/main' into jaap/safe_resolve_p…
deruyter92 Jun 26, 2026
f422dcc
Merge branch 'main' into jaap/safe_resolve_paths
C-Achard Jun 29, 2026
9d2732b
Adjust config path tests for Path objects
C-Achard Jun 29, 2026
bb23a34
address remaining `.resolve()` cases: prefer `.absolute()`, or otherw…
deruyter92 Jul 6, 2026
831cb1d
update `safe_resolve`: add logging, use os.stat (more efficient)
deruyter92 Jul 6, 2026
77bf7f0
update test safe_resolve: allow fallback and test open/closing instead
deruyter92 Jul 6, 2026
ca63582
Merge remote-tracking branch 'upstream/main' into jaap/safe_resolve_p…
deruyter92 Jul 6, 2026
205b550
fix remaining Path.resolve()
deruyter92 Jul 7, 2026
8c6c722
Add GUI asset helper utilities
C-Achard Jun 15, 2026
32c12e7
Use gui_assets for icons and pixmaps
C-Achard Jun 15, 2026
a7f2643
Use get_style_qss and update qdarkstyle deps
C-Achard Jun 15, 2026
2a59325
Update uv.lock
C-Achard Jun 15, 2026
4dec33a
Fallback to PySide2 qdarkstyle stylesheet
C-Achard Jun 15, 2026
5275139
Remove unused imports and tidy spacing
C-Achard Jul 16, 2026
e6aab6a
Remove outdated comments
C-Achard Jul 17, 2026
b5c2c91
Merge remote-tracking branch 'upstream/main' into cy/fix-pyside6-theme
deruyter92 Jul 17, 2026
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
14 changes: 6 additions & 8 deletions deeplabcut/create_project/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@
# Licensed under GNU Lesser General Public License v3.0
#

import os
import shutil
from pathlib import Path

from deeplabcut.generate_training_dataset import frame_extraction
from deeplabcut.utils import auxiliaryfunctions
from deeplabcut.utils.auxfun_videos import VideoReader


def add_new_videos(
config: str | Path,
Expand Down Expand Up @@ -59,14 +65,6 @@ def add_new_videos(
coords=[[0, 100, 0, 200], [0, 100, 0, 250]],
)
"""
import os
import shutil
from pathlib import Path

from ..generate_training_dataset import frame_extraction
from ..utils import auxiliaryfunctions
from ..utils.auxfun_videos import VideoReader

config = Path(config).absolute()

# Read the config file
Expand Down
1 change: 0 additions & 1 deletion deeplabcut/gui/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,6 @@ def _create_message_box(text, info_text):

msg.setWindowTitle("Info")
msg.setMinimumWidth(900)
# logo = Path("logo.png").resolve().parent / "assets" / "logo.png"
icon = icon_from_resource("logo.png")
msg.setWindowIcon(icon)
msg.setStandardButtons(QtWidgets.QMessageBox.Ok)
Expand Down
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: 1 addition & 2 deletions deeplabcut/gui/tabs/modelzoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#
# Licensed under GNU Lesser General Public License v3.0
#
import os
import webbrowser
from functools import partial
from pathlib import Path
Expand Down Expand Up @@ -388,7 +387,7 @@ def _adapt_checkbox_status_changed(self, state: int) -> None:

def select_folder(self):
dirname = QtWidgets.QFileDialog.getExistingDirectory(
self, "Please select a folder", os.fspath(self.root.project_folder)
self, "Please select a folder", str(self.root.project_folder)
)
if not dirname:
return
Expand Down
1 change: 0 additions & 1 deletion deeplabcut/gui/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,6 @@ def window_set(self):
palette.setColor(QtGui.QPalette.Window, QtGui.QColor("#ffffff"))
self.setPalette(palette)

# icon = str(BASE_DIR / "assets" / "logo.png")
self.setWindowIcon(icon_from_resource("logo.png"))

# Set default window size and allow resizing
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,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
3 changes: 2 additions & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading