From 21fda8a692cc674a02ce3207dd971336250ab9c5 Mon Sep 17 00:00:00 2001 From: Yeison Cardona Date: Mon, 20 Dec 2021 12:05:36 -0500 Subject: [PATCH] Fixed: RCC export file format incorrect #44 --- examples/exporter/exporter.py | 3 + examples/exporter/resources.rcc | 132 ++++++++++++++++---------------- qt_material/__init__.py | 9 ++- 3 files changed, 77 insertions(+), 67 deletions(-) diff --git a/examples/exporter/exporter.py b/examples/exporter/exporter.py index a2839e5..21c10cc 100644 --- a/examples/exporter/exporter.py +++ b/examples/exporter/exporter.py @@ -11,6 +11,9 @@ extra = { 'font_family': 'monoespace', 'font_size': '14px', 'line_height': '14px', + + # Density Scale + 'density_scale': '0', } diff --git a/examples/exporter/resources.rcc b/examples/exporter/resources.rcc index d5481da..85c5f96 100644 --- a/examples/exporter/resources.rcc +++ b/examples/exporter/resources.rcc @@ -1,77 +1,81 @@ - theme/disabled/float.svg - theme/disabled/base.svg - theme/disabled/close.svg - theme/disabled/checklist_indeterminate.svg - theme/disabled/downarrow.svg - theme/disabled/checklist_invert.svg - theme/disabled/uparrow2.svg - theme/disabled/vline.svg - theme/disabled/tab_close.svg - theme/disabled/branch-end.svg - theme/disabled/checkbox_indeterminate.svg - theme/disabled/rightarrow2.svg - theme/disabled/radiobutton_unchecked.svg - theme/disabled/branch-closed.svg - theme/disabled/splitter-horizontal.svg - theme/disabled/checklist_indeterminate_invert.svg - theme/disabled/toolbar-handle-horizontal.svg - theme/disabled/uparrow.svg - theme/disabled/splitter-vertical.svg - theme/disabled/checkbox_indeterminate_invert.svg theme/disabled/downarrow2.svg - theme/disabled/leftarrow.svg - theme/disabled/toolbar-handle-vertical.svg theme/disabled/checkbox_unchecked.svg - theme/disabled/radiobutton_checked.svg - theme/disabled/rightarrow.svg - theme/disabled/checkbox_checked.svg - theme/disabled/checkbox_checked_invert.svg - theme/disabled/sizegrip.svg - theme/disabled/branch-more.svg - theme/disabled/checklist.svg - theme/disabled/branch-open.svg theme/disabled/leftarrow2.svg - theme/disabled/checkbox_unchecked_invert.svg theme/disabled/slider.svg - theme/primary/float.svg - theme/primary/base.svg - theme/primary/close.svg - theme/primary/checklist_indeterminate.svg - theme/primary/downarrow.svg - theme/primary/checklist_invert.svg - theme/primary/uparrow2.svg - theme/primary/vline.svg - theme/primary/tab_close.svg - theme/primary/branch-end.svg - theme/primary/checkbox_indeterminate.svg - theme/primary/rightarrow2.svg - theme/primary/radiobutton_unchecked.svg - theme/primary/branch-closed.svg - theme/primary/splitter-horizontal.svg - theme/primary/checklist_indeterminate_invert.svg - theme/primary/toolbar-handle-horizontal.svg - theme/primary/uparrow.svg - theme/primary/splitter-vertical.svg - theme/primary/checkbox_indeterminate_invert.svg + theme/disabled/checkbox_indeterminate.svg + theme/disabled/branch-closed.svg + theme/disabled/base.svg + theme/disabled/branch-end.svg + theme/disabled/uparrow2.svg + theme/disabled/rightarrow.svg + theme/disabled/branch-open.svg + theme/disabled/splitter-horizontal.svg + theme/disabled/checkbox_checked.svg + theme/disabled/vline.svg + theme/disabled/leftarrow.svg + theme/disabled/branch-more.svg + theme/disabled/toolbar-handle-horizontal.svg + theme/disabled/tab_close.svg + theme/disabled/radiobutton_checked.svg + theme/disabled/float.svg + theme/disabled/radiobutton_unchecked.svg + theme/disabled/checkbox_checked_invert.svg + theme/disabled/close.svg + theme/disabled/downarrow.svg + theme/disabled/rightarrow2.svg + theme/disabled/splitter-vertical.svg + theme/disabled/uparrow.svg + theme/disabled/checklist_invert.svg + theme/disabled/checkbox_indeterminate_invert.svg + theme/disabled/radiobutton_unchecked_invert.svg + theme/disabled/toolbar-handle-vertical.svg + theme/disabled/checklist_indeterminate_invert.svg + theme/disabled/radiobutton_checked_invert.svg + theme/disabled/checklist_indeterminate.svg + theme/disabled/checkbox_unchecked_invert.svg + theme/disabled/checklist.svg + theme/disabled/sizegrip.svg theme/primary/downarrow2.svg - theme/primary/leftarrow.svg - theme/primary/toolbar-handle-vertical.svg theme/primary/checkbox_unchecked.svg - theme/primary/radiobutton_checked.svg - theme/primary/rightarrow.svg - theme/primary/checkbox_checked.svg - theme/primary/checkbox_checked_invert.svg - theme/primary/sizegrip.svg - theme/primary/branch-more.svg - theme/primary/checklist.svg - theme/primary/branch-open.svg theme/primary/leftarrow2.svg - theme/primary/checkbox_unchecked_invert.svg theme/primary/slider.svg - theme/primary/checkbox_indeterminate.svg + theme/primary/branch-closed.svg + theme/primary/base.svg + theme/primary/branch-end.svg + theme/primary/uparrow2.svg + theme/primary/rightarrow.svg + theme/primary/branch-open.svg + theme/primary/splitter-horizontal.svg + theme/primary/checkbox_checked.svg + theme/primary/vline.svg + theme/primary/leftarrow.svg + theme/primary/branch-more.svg + theme/primary/toolbar-handle-horizontal.svg + theme/primary/tab_close.svg + theme/primary/radiobutton_checked.svg + theme/primary/float.svg + theme/primary/radiobutton_unchecked.svg + theme/primary/checkbox_checked_invert.svg + theme/primary/close.svg + theme/primary/downarrow.svg + theme/primary/rightarrow2.svg + theme/primary/splitter-vertical.svg + theme/primary/uparrow.svg + theme/primary/checklist_invert.svg + theme/primary/checkbox_indeterminate_invert.svg + theme/primary/radiobutton_unchecked_invert.svg + theme/primary/toolbar-handle-vertical.svg + theme/primary/checklist_indeterminate_invert.svg + theme/primary/radiobutton_checked_invert.svg + theme/primary/checklist_indeterminate.svg + theme/primary/checkbox_unchecked_invert.svg + theme/primary/checklist.svg + theme/primary/sizegrip.svg + dark_teal.qss - diff --git a/qt_material/__init__.py b/qt_material/__init__.py index 4a3c3c8..ce85528 100644 --- a/qt_material/__init__.py +++ b/qt_material/__init__.py @@ -69,12 +69,12 @@ def export_theme(theme='', qss=None, rcc=None, invert_secondary=False, extra={}, file.write( f' {output}/{subfolder}/{filename}\n') - file.write(' \n') file.write(f' \n') if qss: file.write(f' {qss}\n') - file.write(' \n') file.write('\n') @@ -82,7 +82,10 @@ def export_theme(theme='', qss=None, rcc=None, invert_secondary=False, extra={}, # ---------------------------------------------------------------------- def build_stylesheet(theme='', invert_secondary=False, extra={}, parent='theme'): """""" - add_fonts() + try: + add_fonts() + except Exception as e: + logging.warning(e) theme = get_theme(theme, invert_secondary) if theme is None: