Skip to content
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

Style fixes #643

Merged
merged 2 commits into from
Dec 12, 2023
Merged

Style fixes #643

merged 2 commits into from
Dec 12, 2023

Conversation

sstendahl
Copy link
Owner

@sstendahl sstendahl commented Dec 12, 2023

Fixes some issues with the styles:

  • Stops connecting style preview buttons to window.edit_style after the initial time. This prevents multiple calls to the same functions which lead to performance issues, and "critical" errors in the terminal output about the view already being present in the stack.

  • Reorders a bit with regard to the behaviour on style changes/edits. Allows to edit the current style, and then keep this style selecting (and applying changes) when backing out.

  • New styles now use the currently active style as template by default, instead of the top style.

I've also looked into why the scroll window has such an incredibly long list of whitespace. The cause of this is that it reserves whitespace for when the window is resized to fewer columns. So the reserved amount of space is equal to the amount of space that is needed for the case when there's only one column present per row. Not completely sure if it's fixable.

src/styles.py Outdated
Comment on lines 617 to 629
style_manager = self._style_manager
style_model = style_manager.props.style_model
file = self.style.get_file()
for index, style in enumerate(style_model):
if style is not None:
file2 = style.get_file()
if file2 is not None and file.equal(file2):
stylename = style.get_name()
style_model.remove(index)
style_manager._stylenames.remove(stylename)
style_manager.props.use_custom_style = False
style_manager.props.custom_style = \
style_manager._system_style_name
Copy link
Collaborator

Choose a reason for hiding this comment

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

This logic is making a few calls, that should rather be in the stylemanager itself imo.

@cmkohnen cmkohnen merged commit 3ea915b into main Dec 12, 2023
6 checks passed
@sstendahl sstendahl deleted the Styles-fixes branch December 14, 2023 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants