Skip to content

Make updateStylesXML() results seamless#17298

Closed
pryrt wants to merge 2 commits intonotepad-plus-plus:masterfrom
pryrt:seamlessFromModel
Closed

Make updateStylesXML() results seamless#17298
pryrt wants to merge 2 commits intonotepad-plus-plus:masterfrom
pryrt:seamlessFromModel

Conversation

@pryrt
Copy link
Contributor

@pryrt pryrt commented Dec 12, 2025

  • First, implement @ozone10 improvements so the WidgetStyles can get their defaults from other existing WidgetStyles, rather than inheriting the model colors
  • Second, implement if(stylers.xml) { use colors from stylers.model.xml } else { use default colors for the active theme }

resolves #17289

verification notes

  • verified that the split-off NppParameters::addDefaultStyles() gets correctly used to populate the colors when those specific WidgetStyle elements were missing
  • verified that when updating stylers.xml, it inherits the full colors of new styles from stylers.model.xml
  • verified that when updating other themes, it adds all the new WidgetStyle or WordsStyle elements from the model, but uses the default FG/BG colors from the active theme
  • tested this by starting with the each of the 22 v8.0 themes, which were created before the Bookmark margin and Change History margin styles were added, so it will be very obvious if it wasn't using the new rules. I tried each of the themes, and they all had seamless margins, rather than the glaring light-gray margins that users complained about in the announcement discussion
  • also had a PowerShell script loaded in one of the views as I toggled between the 22 themes: they all look "seamless", rather than having the glaring white background for certain words in the code (as was seen in the original powershell complaint there as well as in my followup examples)

- First, implement ozone10 improvements so the WidgetStyles can get their defaults from other existing WidgetStyles, rather than inheriting the model colors
- Second, implement `if(stylers.xml) { use colors from stylers.model.xml } else { use default colors for the active theme }`
@pryrt
Copy link
Contributor Author

pryrt commented Dec 12, 2025

more verification: I used the code from this PR to create the new versions of the themes submitted in #17299 , and they all look reasonable to me, which is another step of verification for this PR.

@donho donho self-assigned this Dec 13, 2025
@chcg chcg added enhancement Proposed enhancements of existing features theme theming related issues labels Dec 14, 2025
Copy link
Member

@donho donho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the coding style of project:

const std::wstring& styleID = L"0") -> int
int result = 0;
const Style* pStyle = _widgetStyleArray.findByName(name);
if (pStyle == nullptr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use if (!pStyle) instead.

pryrt added a commit to pryrt/notepad-plus-plus that referenced this pull request Dec 15, 2025
- fix the brace locations
- fix the yoda conditionals
- remove unneeded stringToLower calls
- change ==nullptr and !=nullptr to the truthy equivalents
@pryrt
Copy link
Contributor Author

pryrt commented Dec 15, 2025

Okay, most recent commit to this PR should contain all your code-fix requests.

@donho donho added the accepted label Dec 15, 2025
@donho donho closed this in 415a787 Dec 15, 2025
@pryrt pryrt deleted the seamlessFromModel branch December 15, 2025 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted enhancement Proposed enhancements of existing features theme theming related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature request] Make the stylers/themes updater more "seamless"

3 participants