Skip to content

Commit

Permalink
Altered configure.py to prevent crashes while trying to alias if dark…
Browse files Browse the repository at this point in the history
…-blue or light-blue themes not to be built. Merged changes to themes to include extension specific lines
  • Loading branch information
= committed Sep 8, 2024
1 parent f7f4966 commit f5e882b
Show file tree
Hide file tree
Showing 16 changed files with 12,512 additions and 234,559 deletions.
16 changes: 10 additions & 6 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def parse_args(argv=None):
parser.add_argument(
'--styles',
help='comma-separate list of styles to configure. pass `all` to build all themes',
default='light,dark',
default='light-blue,dark-blue',
)
parser.add_argument(
'--extensions',
Expand Down Expand Up @@ -335,7 +335,10 @@ def write_qrc(config, qt_dist):
for style in config['themes'].keys():
files = os.listdir(f'{qt_dist}/{style}')
resources += [f'{style}/{i}' for i in files]
resources += ['dark-blue/stylesheet.qss', 'light-blue/stylesheet.qss']
if 'dark-blue' in config['themes'].keys():
resources.append('dark/stylesheet.qss')
if 'light-blue' in config['themes'].keys():
resources.append('light/stylesheet.qss')

qrc_path = config['resource']
if not os.path.isabs(qrc_path):
Expand Down Expand Up @@ -412,11 +415,12 @@ def configure(args):
for style in config['themes']:
configure_style(config, style, str(args.output_dir))

# create aliases for our light and dark styles to light-blue and dark-blue
# FIXME: Invert the order: light should be an alias of light-blue, etc.
for theme in ('dark', 'light'):
# Create aliases for our light-blue and dark-blue styles to light and dark.
# Only create aliases if light-blue and/or dark-blue are to be built.
themes = [theme for theme in args.styles if theme == 'dark-blue' or theme == 'light-blue']
for theme in themes:
source = args.output_dir / theme / 'stylesheet.qss'
destination = args.output_dir / f'{theme}-blue' / 'stylesheet.qss'
destination = args.output_dir / theme.split('-')[0] / 'stylesheet.qss'
destination.parent.mkdir(exist_ok=True)
shutil.copy2(source, destination)

Expand Down
2 changes: 2 additions & 0 deletions dist/breeze.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
<file>dark-blue/vmovetoolbar.svg</file>
<file>dark-blue/vseptoolbar.svg</file>
<file>dark-blue/window_close.svg</file>
<file>dark/stylesheet.qss</file>
<file>light-blue/branch_closed.svg</file>
<file>light-blue/branch_closed_hover.svg</file>
<file>light-blue/branch_end.svg</file>
Expand Down Expand Up @@ -174,5 +175,6 @@
<file>light-blue/vmovetoolbar.svg</file>
<file>light-blue/vseptoolbar.svg</file>
<file>light-blue/window_close.svg</file>
<file>light/stylesheet.qss</file>
</qresource>
</RCC>
64,438 changes: 2,731 additions & 61,707 deletions resources/breeze_pyqt5.py

Large diffs are not rendered by default.

61,104 changes: 3,487 additions & 57,617 deletions resources/breeze_pyqt6.py

Large diffs are not rendered by default.

Loading

0 comments on commit f5e882b

Please sign in to comment.