Ticket #3711 (closed enhancement: fixed)
|Reported by:||egmont||Owned by:||andrew_b|
|Branch state:||merged||Votes for changeset:||committed-master|
Skins (and especially a set of skins that are similar to each other) are really cumbersome to create for a variety of reasons.
One of them is that the most prominent colors of a skin have to appear multiple times in the file. Sometimes it's the very same color pair repeated, but more often it's either the same background combined with a different foreground, or the other way around. Also, some of the main colors of a skin might appear at both positions (see e.g. highlighted text, or the badly named "reverse" keyword).
Skin definitions really cry for something like the #define preprocessor directive (but we're doomed with this since there's no convention for this in .ini files and we're using parser methods that don't support these) or an explicit section where aliases can be defined (this is what I implemented).
So e.g. instead of this:
[core] _default_ = white;blue selected = yellow;blue marked = white;cyan markselect = yellow;cyan
from now on you can write:
[aliases] bgmain = blue bghilite = cyan fgmain = white fgselect = yellow [core] _default_ = fgmain;bgmain selected = fgselect;bgmain marked = fgmain;bghilite markselect = fgselect;bghilite
Advantages of the new approach:
- You only modify the actual color at one single place.
- No search-and-replace madness with e.g. unwanted sub-word matches, or replacing only from the cursor location and not in the entire file.
- If two different roles accidentally happen to have the same color but you do not necessarily want it this way, you can define two different aliases, and changing just one of them won't change the other one as a search-and-replace would do.
- It's way easier to diff two variants of a skin, or two versions as you develop one presumably in some VCS.
Patch attached that implements this feature, and modifies the two "gray-*" skins.
Run "diff -u gray-green-purple256.ini gray-orange-blue256.ini" before applying the patch, and run it after applying it. It's quite self-explanatory. After applying the patch, the only difference between the two files is the two alias definitions.
Please comment, review etc... thanks!
comment:12 Changed 3 months ago by andrew_b
- Status changed from new to accepted
- Owner set to andrew_b
- Votes for changeset set to andrew_b
- Branch state changed from no branch to on review
- Milestone changed from Future Releases to 4.8.19
comment:14 Changed 3 months ago by andrew_b
- Status changed from accepted to testing
- Votes for changeset changed from andrew_b to committed-master
- Resolution set to fixed
- Branch state changed from approved to merged