Skip to content

Commit

Permalink
SecurityPriceChartPane: Save sash position in preference store
Browse files Browse the repository at this point in the history
Similar to how other sash positions are already saved by the app.
  • Loading branch information
pfalcon authored and buchen committed Nov 9, 2024
1 parent 564454b commit f0d5beb
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,14 @@ public Control createViewControl(Composite parent)
stylingEngine.style(chart);

details = new SecurityDetailsViewer(sash, SWT.NONE, client, true);
details.getControl().setLayoutData(new SashLayoutData(SWTHelper.getPackedWidth(details.getControl())));

final String sashIdentifier = getClass().getSimpleName() + "-newsash"; //$NON-NLS-1$
int size = preferences.getInt(sashIdentifier);
if (size == 0)
size = SWTHelper.getPackedWidth(details.getControl());
details.getControl().setLayoutData(new SashLayoutData(size));
sash.addDisposeListener(e -> preferences.setValue(sashIdentifier,
((SashLayoutData) details.getControl().getLayoutData()).getSize()));

return sash;
}
Expand Down

0 comments on commit f0d5beb

Please sign in to comment.