From f0d5beba912d7a4c8736be13913bc6e4ace4ea3c Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 3 Nov 2024 15:18:05 +0700 Subject: [PATCH] SecurityPriceChartPane: Save sash position in preference store Similar to how other sash positions are already saved by the app. --- .../portfolio/ui/views/panes/SecurityPriceChartPane.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/panes/SecurityPriceChartPane.java b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/panes/SecurityPriceChartPane.java index 1dfdfb29e9..89f0e35f29 100644 --- a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/panes/SecurityPriceChartPane.java +++ b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/panes/SecurityPriceChartPane.java @@ -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; }