Skip to content

Commit

Permalink
Pull dark mode setting out of SessionViewModel into ViewController to…
Browse files Browse the repository at this point in the history
… get it out of session files
  • Loading branch information
nathanielsherry committed Jan 8, 2024
1 parent a510f7a commit 0f8ef68
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public void setFittingParameters(int scanSize, float min, float max)
fittingModel.selections.getFittingParameters().setCalibration(min, max, scanSize);
fittingModel.proposals.getFittingParameters().setCalibration(min, max, scanSize);

//TODO: Why is this here? Are we just resetting it to be sure they stay in sync?
//Keep the other settings in sync
fittingModel.selections.getFittingParameters().setDetectorMaterial(getDetectorMaterial());
fittingModel.proposals.getFittingParameters().setDetectorMaterial(getDetectorMaterial());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public class SessionViewModel {
public float zoom;
public boolean logTransform;
public boolean showTitle;
public boolean darkMode;

public SessionViewModel() {

Expand All @@ -23,7 +22,6 @@ public SessionViewModel() {
zoom = 1.0f;
logTransform = true;
showTitle = false;
darkMode = false;

}

Expand Down Expand Up @@ -61,7 +59,6 @@ public void copy(SessionViewModel view) {
this.zoom = view.zoom;
this.logTransform = view.logTransform;
this.showTitle = view.showTitle;
this.darkMode = view.darkMode;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public class ViewController extends EventfulBeacon {

private SessionViewModel viewModel;
private PlotController plot;
// Don't save dark mode in the session view model or else it'll end up in the session files.
private boolean darkMode = false;

private static final String SETTING_MONOCHROME = "org.peakaboo.controller.plotter.view.monochrome";
private static final String SETTING_CONSTSCALE = "org.peakaboo.controller.plotter.view.constantscale";
Expand Down Expand Up @@ -190,11 +192,11 @@ public void setShowTitle(boolean showTitle) {


public boolean getDarkMode() {
return viewModel.darkMode;
return this.darkMode;
}

public void setDarkMode(boolean dark) {
viewModel.darkMode = dark;
this.darkMode = dark;
updateListeners();
}

Expand Down

0 comments on commit 0f8ef68

Please sign in to comment.