Skip to content

Conversation

@lucabonamini
Copy link
Contributor

Summary

Fixed an issue where newly created subplots (via split view) did not inherit the current legend settings from existing plots, causing them to always display the default legend configuration (right-aligned, visible) instead of matching the user's current preferences.

Motivation

When users configure their legend settings (left/right alignment, hidden/visible) and then split a view to create additional subplots, they expect the new subplot to maintain the same visual configuration as the existing plots. However, the new subplots were always created with default settings:

  • Legend always positioned on the right side
  • Legend always visible (even if user had hidden it)
  • Pressing legend buttons would advance through modes instead of matching current state

This inconsistent behavior disrupted the user's workflow and required manual reconfiguration of each new subplot to match their preferences.

Solution

Enhanced the onPlotAdded method in mainwindow.cpp to inherit legend settings from the application's current state:

  • New subplots now inherit legend visibility from _labels_status (hidden/visible)
  • New subplots now inherit legend alignment from _labels_status (left/right positioning)
  • Legend configuration is applied immediately when the subplot is created

The fix ensures that split views maintain visual consistency across all subplots, matching user expectations and improving the overall user experience.

@lucabonamini
Copy link
Contributor Author

Related to #1207

@facontidavide
Copy link
Owner

careful, I think you included changes from #1259 (CSV)

@lucabonamini lucabonamini reopened this Jan 10, 2026
@lucabonamini
Copy link
Contributor Author

Apologies for the mistake, I had accidentally included files from a different PR. This has now been fixed.

@facontidavide facontidavide merged commit a236edc into facontidavide:main Jan 13, 2026
16 of 17 checks passed
@facontidavide
Copy link
Owner

thanks a lot!

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