-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finished aliasing modifications & merged theme changes/ #111
Conversation
…for details of alternates.
…-blue or light-blue themes not to be built. Merged changes to themes to include extension specific lines
Related to #101. |
# 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 in ('dark-blue', 'light-blue')] | ||
for theme in themes: | ||
source = args.output_dir / theme / 'stylesheet.qss' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be improved to use a set but it's fine as-is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. When you say it could be improved using a set , do you mean as below? If so, what's the benefit to this over using a list comprehension with a tuple? I guess sets are slightly more efficient but is that the only difference in this context? Sorry, probably a noob question!
themes = {theme for theme in args.styles if theme in {'dark-blue', 'light-blue'}}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did something like this:
set(args.styles) & {'dark-blue', 'light-blue'}
It uses set intersection to grab the overlap between the two. Technically a bit slower but the performance really doesn't matter: it's very easy to read and can be extended pretty well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good info, thanks. I didn't know set intersection was available in Python so easily. Thanks
By the way, I implemented #113 to deal with the increasing bundle sizes caused by #110 and due to an increasing number of variants of each style. This compresses the total size by >=90% and more themes will lead to a higher compression ratio, so there;s no real concerns ever adding more and more themes. So if you have more good theme ideas, there's no real downside to adding them anymore, and thank you. |
#113 is a good idea. I may add some new colors when I have some time. I also thought about adding a flag to disable the aliasing if not required in order to reduce file size but I guess that's less of a priority now. May still add it though if you think it's worth it? |
Much less so, also you can manually provide individual styles so you can choose a subset if required. Those will also compress very nicely so I can't imagine they'd affect file size more than a few bytes. |
Ref #101
I had to modify configure.py as it would throw an exception when trying to build themes other than dark-blue and light-blue. The code for aliasing expected them to exist even if not requested. Now it'll only build the alias(es) if dark-blue and/or light-blue are in args.styles.
Changed -alt themes to
instead of
This produces the same result.
Using "passthrough" or "transparent" does the opposite of what was desired, see screenshots below.
Using "none" or "" (desired effect):
Using "transparent":
Using "passthrough":