Skip to content

Commit 62b0035

Browse files
committed
Flatten styling/theme_manager to theme_manager
The static token files now live under resources/, so the extra styling/ package layer no longer serves a purpose. Test folders and imports are updated to match the new location.
1 parent bd87c6e commit 62b0035

9 files changed

Lines changed: 20 additions & 19 deletions

File tree

src/ert/gui/styling/__init__.py

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from __future__ import annotations
2+
3+
from ert.gui.theme_manager.manager import ColorSchemeManager
4+
from ert.gui.theme_manager.theme import ColorScheme
5+
6+
__all__ = [
7+
"ColorScheme",
8+
"ColorSchemeManager",
9+
]

src/ert/gui/styling/theme_manager/manager.py renamed to src/ert/gui/theme_manager/manager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ def apply_stylesheet_from_qss(self) -> None:
9494
stylesheet = load_qss(self._current_color_scheme)
9595
except (OSError, UnicodeDecodeError):
9696
logger.exception(
97-
"Failed to load QSS for colour scheme '%s'; keeping previous styling.",
97+
"Failed to load QSS for colour scheme'%s';"
98+
" keeping the previously applied stylesheet.",
9899
self._current_color_scheme.value,
99100
)
100101
return
File renamed without changes.

tests/ert/unit_tests/gui/styling/__init__.py

Whitespace-only changes.
File renamed without changes.

tests/ert/unit_tests/gui/styling/test_qss_loading.py renamed to tests/ert/unit_tests/gui/theme_manager/test_qss_loading.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
import pytest
44

5-
from ert.gui.styling import ColorScheme
6-
from ert.gui.styling.theme_manager import theme as theme_module
7-
from ert.gui.styling.theme_manager.theme import load_qss
5+
from ert.gui.theme_manager import ColorScheme
6+
from ert.gui.theme_manager import theme as theme_module
7+
from ert.gui.theme_manager.theme import load_qss
88

99

1010
class _MissingResource:

tests/ert/unit_tests/gui/styling/test_theme_detection.py renamed to tests/ert/unit_tests/gui/theme_manager/test_theme_detection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
from PyQt6.QtCore import Qt
55
from PyQt6.QtGui import QColor, QGuiApplication, QPalette
66

7-
from ert.gui.styling import ColorScheme
8-
from ert.gui.styling.theme_manager import manager as manager_module
9-
from ert.gui.styling.theme_manager.manager import (
7+
from ert.gui.theme_manager import ColorScheme
8+
from ert.gui.theme_manager import manager as manager_module
9+
from ert.gui.theme_manager.manager import (
1010
_DARK_BASE_VALUE_THRESHOLD,
1111
detect_system_color_scheme,
1212
)

tests/ert/unit_tests/gui/styling/test_theme_manager.py renamed to tests/ert/unit_tests/gui/theme_manager/test_theme_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
from PyQt6.QtGui import QGuiApplication
88
from PyQt6.QtWidgets import QApplication
99

10-
from ert.gui.styling import ColorScheme, ColorSchemeManager
11-
from ert.gui.styling.theme_manager import manager as manager_module
12-
from ert.gui.styling.theme_manager.theme import load_qss
10+
from ert.gui.theme_manager import ColorScheme, ColorSchemeManager
11+
from ert.gui.theme_manager import manager as manager_module
12+
from ert.gui.theme_manager.theme import load_qss
1313

1414

1515
@pytest.fixture(autouse=True)

0 commit comments

Comments
 (0)