-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
52 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 27 additions & 8 deletions
35
src/main/java/org/jabref/preferences/AppearancePreferences.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,58 @@ | ||
package org.jabref.preferences; | ||
|
||
import org.jabref.gui.util.Theme; | ||
import javafx.beans.property.ObjectProperty; | ||
import javafx.beans.property.SimpleObjectProperty; | ||
import javafx.beans.property.BooleanProperty; | ||
import javafx.beans.property.IntegerProperty; | ||
import javafx.beans.property.ObjectProperty; | ||
import javafx.beans.property.SimpleBooleanProperty; | ||
import javafx.beans.property.SimpleIntegerProperty; | ||
import javafx.beans.property.SimpleObjectProperty; | ||
|
||
import org.jabref.gui.util.Theme; | ||
|
||
public class AppearancePreferences { | ||
private final BooleanProperty shouldOverrideDefaultFontSize; | ||
private final IntegerProperty mainFontSize; | ||
private final ObjectProperty<Theme> theme; | ||
|
||
public AppearancePreferences(boolean shouldOverrideDefaultFontSize, int mainFontSize, Theme theme) { | ||
this.shouldOverrideDefaultFontSize = new BooleanProperty(shouldOverrideDefaultFontSize); | ||
this.mainFontSize = new IntegerProperty(mainFontSize); | ||
this.theme = new SimpleObjectProperty(theme); | ||
this.shouldOverrideDefaultFontSize = new SimpleBooleanProperty(shouldOverrideDefaultFontSize); | ||
this.mainFontSize = new SimpleIntegerProperty(mainFontSize); | ||
this.theme = new SimpleObjectProperty<>(theme); | ||
} | ||
|
||
public boolean shouldOverrideDefaultFontSize() { | ||
return shouldOverrideDefaultFontSize.get(); | ||
} | ||
|
||
public boolean setShouldOverrideDefaultFontSize(boolean newValue) { | ||
return shouldOverrideDefaultFontSize.set(newValue); | ||
public void setShouldOverrideDefaultFontSize(boolean newValue) { | ||
shouldOverrideDefaultFontSize.set(newValue); | ||
} | ||
|
||
public BooleanProperty shouldOverrideDefaultFontSizeProperty() { | ||
return shouldOverrideDefaultFontSize; | ||
} | ||
|
||
public int getMainFontSize() { | ||
return mainFontSize.get(); | ||
} | ||
|
||
public void setMainFontSize(int mainFontSize) { | ||
this.mainFontSize.set(mainFontSize); | ||
} | ||
|
||
public IntegerProperty mainFontSizeProperty() { | ||
return mainFontSize; | ||
} | ||
|
||
public Theme getTheme() { | ||
return theme.get(); | ||
} | ||
|
||
public void setTheme(Theme theme) { | ||
this.theme.set(theme); | ||
} | ||
|
||
public ObjectProperty<Theme> themeProperty() { | ||
return theme; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters