Skip to content

Commit

Permalink
Merge pull request #103 from Alexhuszagh/alias
Browse files Browse the repository at this point in the history
Create aliases for our dark and light to dark-blue and light-blue.
  • Loading branch information
Alexhuszagh authored Sep 7, 2024
2 parents 093f505 + f75dce4 commit 12bb954
Show file tree
Hide file tree
Showing 7 changed files with 13,048 additions and 6,575 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ By default, BreezeStyleSheets comes with the `dark` and `light` themes pre-built
frameworks=("pyqt5" "pyqt6" "pyside2" "pyside6")
for framework in "${frameworks[@]}"; do
python configure.py --styles=all --extensions=all --qt-framework "${framework}" \
--resource breeze.qrc --compiled-resource "resources/breeze_${framework}.py"
--resource breeze.qrc --compiled-resource "breeze_${framework}.py"
done
```

Expand Down
13 changes: 13 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,15 @@ def configure_qt(qt_dist, style_prefix):
def write_qrc(config, qt_dist):
'''Simple QRC writer.'''

# NOTE: We also want to create aliases for light-blue and dark-blue from our
# light and dark. See:
# https://github.com/Alexhuszagh/BreezeStyleSheets/pull/101#issuecomment-2336476041
resources = []
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']

qrc_path = config['resource']
if not os.path.isabs(qrc_path):
qrc_path = f'{qt_dist}/{qrc_path}'
Expand Down Expand Up @@ -407,6 +412,14 @@ 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'):
source = args.output_dir / theme / 'stylesheet.qss'
destination = args.output_dir / f'{theme}-blue' / 'stylesheet.qss'
destination.parent.mkdir(exist_ok=True)
shutil.copy2(source, destination)

# Create and compile our resource files.
if not args.no_qrc:
write_qrc(config, str(args.output_dir))
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ confidence = ["HIGH", "CONTROL_FLOW", "INFERENCE", "INFERENCE_FAILURE", "UNDEFIN
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use "--disable=all --enable=classes
# --disable=W".
disable = ["raw-checker-failed", "bad-inline-option", "locally-disabled", "file-ignored", "suppressed-message", "useless-suppression", "deprecated-pragma", "use-symbolic-message-instead", "use-implicit-booleaness-not-comparison-to-string", "use-implicit-booleaness-not-comparison-to-zero", "import-outside-toplevel", "broad-exception-caught", "too-few-public-methods", "global-statement", "c-extension-no-member", "too-many-instance-attributes", "invalid-name", "attribute-defined-outside-init", "unnecessary-lambda-assignment"]
disable = ["raw-checker-failed", "bad-inline-option", "locally-disabled", "file-ignored", "suppressed-message", "useless-suppression", "deprecated-pragma", "use-symbolic-message-instead", "use-implicit-booleaness-not-comparison-to-string", "use-implicit-booleaness-not-comparison-to-zero", "import-outside-toplevel", "broad-exception-caught", "too-few-public-methods", "global-statement", "c-extension-no-member", "too-many-instance-attributes", "invalid-name", "attribute-defined-outside-init", "unnecessary-lambda-assignment", "fixme"]

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
6,015 changes: 3,819 additions & 2,196 deletions resources/breeze_pyqt5.py

Large diffs are not rendered by default.

4,527 changes: 3,068 additions & 1,459 deletions resources/breeze_pyqt6.py

Large diffs are not rendered by default.

Loading

0 comments on commit 12bb954

Please sign in to comment.