diff --git a/src/bigocrpdf/ui/image_ocr_window.py b/src/bigocrpdf/ui/image_ocr_window.py index e6bf042..fc71af0 100644 --- a/src/bigocrpdf/ui/image_ocr_window.py +++ b/src/bigocrpdf/ui/image_ocr_window.py @@ -77,6 +77,7 @@ def __init__( default_height=height, ) + self.add_css_class("bigocrimage") self.set_title("Big Image OCR") self.set_icon_name("bigocrimage") diff --git a/src/bigocrpdf/ui/pdf_editor/editor_window.py b/src/bigocrpdf/ui/pdf_editor/editor_window.py index d08e127..f7852ef 100644 --- a/src/bigocrpdf/ui/pdf_editor/editor_window.py +++ b/src/bigocrpdf/ui/pdf_editor/editor_window.py @@ -103,6 +103,7 @@ def __init__( standalone: If True, show Save As button instead of Apply """ super().__init__(application=application) + self.add_css_class("bigocrpdf-editor") self._help = EditorHelpController(self) self._tools = EditorToolsController(self) diff --git a/src/bigocrpdf/utils/config_manager.py b/src/bigocrpdf/utils/config_manager.py index 4c92021..79f3f69 100644 --- a/src/bigocrpdf/utils/config_manager.py +++ b/src/bigocrpdf/utils/config_manager.py @@ -40,7 +40,7 @@ DEFAULT_CONFIG: Final[dict[str, Any]] = { "version": 1, "window": { - "width": 820, + "width": 960, # Keep the sidebar expanded at the default text scale. "height": 600, }, "ocr": { diff --git a/src/bigocrpdf/window.py b/src/bigocrpdf/window.py index eaf49b2..4bbeff2 100644 --- a/src/bigocrpdf/window.py +++ b/src/bigocrpdf/window.py @@ -57,7 +57,9 @@ def __init__( default_height=height, ) - # The sidebar overlays the content below the 700 sp breakpoint, so the + self.add_css_class("bigocrpdf") + + # The sidebar overlays the content in compact mode, so the # minimum must describe the collapsed content instead of both panes. self.set_size_request(640, 400) diff --git a/tests/test_config_manager.py b/tests/test_config_manager.py index 7194714..9f33a2e 100644 --- a/tests/test_config_manager.py +++ b/tests/test_config_manager.py @@ -13,6 +13,14 @@ class TestConfigManager: + def test_default_window_width_and_saved_override(self, tmp_path): + manager = ConfigManager(str(tmp_path / "config.json")) + assert manager.get("window.width") == 960 + + manager.set("window.width", 820) + restored = ConfigManager(str(tmp_path / "config.json")) + assert restored.get("window.width") == 820 + def _make_manager(self, tmp_dir, initial=None): path = os.path.join(tmp_dir, "config.json") if initial: