mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
persist zoom level
This commit is contained in:
+1
-1
@@ -73,7 +73,7 @@ public class StatusBar extends JPanel implements IPlugIn {
|
|||||||
if (zoomBox == null) {
|
if (zoomBox == null) {
|
||||||
zoomBox = new JComboBox(new Double[] { 0.25d, 0.3333d, 0.5d, 0.6667d, 0.75d, 1d, 1.25d,
|
zoomBox = new JComboBox(new Double[] { 0.25d, 0.3333d, 0.5d, 0.6667d, 0.75d, 1d, 1.25d,
|
||||||
1.5d, 2d });
|
1.5d, 2d });
|
||||||
zoomBox.setSelectedItem(1d);
|
zoomBox.setSelectedItem(plugInPort.getZoomLevel());
|
||||||
zoomBox.setFocusable(false);
|
zoomBox.setFocusable(false);
|
||||||
zoomBox.setRenderer(new PercentageListCellRenderer());
|
zoomBox.setRenderer(new PercentageListCellRenderer());
|
||||||
zoomBox.addActionListener(new ActionListener() {
|
zoomBox.addActionListener(new ActionListener() {
|
||||||
|
|||||||
+3
-1
@@ -66,10 +66,11 @@ public class Presenter implements IPlugInPort {
|
|||||||
public static final VersionNumber CURRENT_VERSION = new VersionNumber(3, 0, 1);
|
public static final VersionNumber CURRENT_VERSION = new VersionNumber(3, 0, 1);
|
||||||
public static final String DEFAULTS_KEY_PREFIX = "default.";
|
public static final String DEFAULTS_KEY_PREFIX = "default.";
|
||||||
public static final String METRIC_KEY = "metric";
|
public static final String METRIC_KEY = "metric";
|
||||||
|
public static final String ZOOM_KEY = "zoom";
|
||||||
|
|
||||||
public static final int ICON_SIZE = 32;
|
public static final int ICON_SIZE = 32;
|
||||||
|
|
||||||
private double zoomLevel = 1;
|
private double zoomLevel = ConfigurationManager.getInstance().readDouble(ZOOM_KEY, 1d);
|
||||||
private Project currentProject;
|
private Project currentProject;
|
||||||
private String currentFileName = null;
|
private String currentFileName = null;
|
||||||
private boolean modified = false;
|
private boolean modified = false;
|
||||||
@@ -149,6 +150,7 @@ public class Presenter implements IPlugInPort {
|
|||||||
public void setZoomLevel(double zoomLevel) {
|
public void setZoomLevel(double zoomLevel) {
|
||||||
LOG.info(String.format("setZoomLevel(%s)", zoomLevel));
|
LOG.info(String.format("setZoomLevel(%s)", zoomLevel));
|
||||||
this.zoomLevel = zoomLevel;
|
this.zoomLevel = zoomLevel;
|
||||||
|
ConfigurationManager.getInstance().writeValue(ZOOM_KEY, zoomLevel);
|
||||||
messageDispatcher.dispatchMessage(EventType.ZOOM_CHANGED, zoomLevel);
|
messageDispatcher.dispatchMessage(EventType.ZOOM_CHANGED, zoomLevel);
|
||||||
messageDispatcher.dispatchMessage(EventType.REPAINT);
|
messageDispatcher.dispatchMessage(EventType.REPAINT);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user