Skip to content

Commit

Permalink
Merge pull request openrocket#2261 from SiboVG/dark-theme
Browse files Browse the repository at this point in the history
[openrocket#1089] Add dark mode theme & custom UI font size
  • Loading branch information
SiboVG authored Aug 8, 2023
2 parents 6bc477f + 7a1711d commit e2993a6
Show file tree
Hide file tree
Showing 109 changed files with 1,233 additions and 346 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ OpenRocket needs help to become even better. Implementing features, writing docu
- Daniel Williams, pod support, maintainer
- Joe Pfeiffer (maintainer)
- Billy Olsen (maintainer)
- Sibo Van Gool (maintainer)
- Sibo Van Gool (RASAero file format, maintainer)
- Neil Weinstock (tester, icons, forum support)
- H. Craig Miller (tester)

Expand Down
12 changes: 8 additions & 4 deletions core/resources/l10n/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -380,15 +380,15 @@ pref.dlg.PrefBooleanSelector2 = Confirm
pref.dlg.Add = Add
pref.dlg.DescriptionArea.Adddirectories = Add directories, RASP motor files (*.eng), RockSim engine files (*.rse) or ZIP archives separated by a semicolon (;) to load external thrust curves. Changes will take effect the next time you start OpenRocket.

PreferencesDialog.lbl.language = Interface language:
PreferencesDialog.languages.default = System default
PreferencesDialog.lbl.languageEffect = The language will change the next time you start OpenRocket.
PreferencesDialog.CancelOperation.title = Discard Preference Changes
PreferencesDialog.CancelOperation.msg.discardChanges = <html>Are you sure you want to <b>discard the preference changes</b>?</html>

generalprefs.lbl.language = Interface language
generalprefs.languages.default = System default
generalprefs.lbl.languageEffect = The language will change the next time you start OpenRocket.
generalprefs.lbl.UITheme = UI Theme
generalprefs.lbl.FontSize = UI Font Size
generalprefs.lbl.themeRestartOR = You must restart OpenRocket for the UI changes to take effect.
generalprefs.ImportWarning.title = Reload OpenRocket
generalprefs.ImportWarning.msg = You may need to restart OpenRocket for some of the changes to take effect.

Expand All @@ -402,6 +402,10 @@ PreferencesOptionPanel.checkbox.userDirectories.ttip = If unchecked, user direct
PreferencesOptionPanel.checkbox.windowInfo = Export window information (position, size\u2026)
PreferencesOptionPanel.checkbox.windowInfo.ttip = If unchecked, window information (position, size\u2026) will not be exported.

! UI Themes
UITheme.Light = Light (Default)
UITheme.Dark = Dark

! Welcome dialog
welcome.dlg.title = Welcome to OpenRocket
welcome.dlg.lbl.thankYou = Thank you for downloading OpenRocket
Expand Down Expand Up @@ -2331,7 +2335,7 @@ ComponentPresetChooserDialog.menu.units = Units
ComponentPresetChooserDialog.checkbox.showLegacyCheckBox = Show Legacy Database
ComponentPresetChooserDialog.lbl.favorites = Check to add preset to the preset drop-down menu in the component edit dialog<br>Directly apply a preset by double-clicking it or by selecting it and closing this window.
ComponentPresetChooserDialog.checkbox.alwaysOpenPreset = Always open this dialog when creating a new %s
table.column.Favorite = Favorite
table.column.Favorite = \u2026 Favorite
table.column.Legacy = Legacy
table.column.Manufacturer = Manufacturer
table.column.PartNo = Part Number
Expand Down
3 changes: 0 additions & 3 deletions core/resources/l10n/messages_ar.properties
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,6 @@ pref.dlg.PrefBooleanSelector2 = تأكيد
pref.dlg.Add = أضف
pref.dlg.DescriptionArea.Adddirectories =.ملفات محرك روكسيم أو أرشيفات زيب مفصولة بفاصلة منقوطة لتحميل منحنيات الدفع الخارجية. ستدخل التغييرات حيز التنفيذ في المرة التالية التي تفتح فيها أوبنروكت (* .rse)أو RASP ملفات محرك (* .eng), أضف الدلائل

PreferencesDialog.lbl.language = :لغة الواجهة
PreferencesDialog.languages.default = النظام الافتراضي
PreferencesDialog.lbl.languageEffect = .ستتغير اللغة في المرة التالية التي تعيد تشغيل أوبنروكت
generalprefs.lbl.language = :لغة الواجهة
generalprefs.languages.default = النظام الافتراضي
generalprefs.lbl.languageEffect = .ستتغير اللغة في المرة التالية التي تعيد تشغيل أوبنروكت
Expand Down
6 changes: 3 additions & 3 deletions core/resources/l10n/messages_cs.properties
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ pref.dlg.PrefBooleanSelector2 = Potvrd
pref.dlg.Add = Pridej
pref.dlg.DescriptionArea.Adddirectories = Pridej adresáre, soubory RASP motor (*.eng), RockSim engine soubory (*.rse) nebo ZIP archiv oddelený oddelovacem (;) k nahrání externích výkonových prubehu. Zmeny se projeví po restaru programu OpenRocket.

PreferencesDialog.lbl.language = Jazyk rohranní:
PreferencesDialog.languages.default = Výchozí
PreferencesDialog.lbl.languageEffect = Jazyk se zmení pri dal\u0161ím spu\u0161tení programu OpenRocket.
generalprefs.lbl.language = Jazyk rohranní:
generalprefs.languages.default = Výchozí
generalprefs.lbl.languageEffect = Jazyk se zmení pri dal\u0161ím spu\u0161tení programu OpenRocket.

! Software update checker
update.dlg.error.title = Nemohu získat informace o aktualizacích
Expand Down
6 changes: 3 additions & 3 deletions core/resources/l10n/messages_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ pref.dlg.PrefBooleanSelector2 = Best
pref.dlg.Add = Hinzufügen
pref.dlg.DescriptionArea.Adddirectories = Um eigene Schubkurven zu laden, Verzeichnisse, RASP-Motordateien (*.eng), RockSim-Motordateien (*.rse) oder ZIP-Archive mit Semikolon getrennt eingeben. Änderungen werden beim nächsten Neustart von OpenRocket übernommen.

PreferencesDialog.lbl.language = Sprache:
PreferencesDialog.languages.default = Systemeinstellung
PreferencesDialog.lbl.languageEffect = Die Sprache wird beim nächsten Neustart von OpenRocket geändert.
generalprefs.lbl.language = Sprache:
generalprefs.languages.default = Systemeinstellung
generalprefs.lbl.languageEffect = Die Sprache wird beim nächsten Neustart von OpenRocket geändert.

! Software update checker
update.dlg.error.title = Es konnten keine Informationen über Programmaktualisierungen empfangen werden.
Expand Down
6 changes: 3 additions & 3 deletions core/resources/l10n/messages_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -733,9 +733,9 @@ PlotDialog.title.Flightdataplot = Representaci\u00f3n de los datos de vuelo

ComponentTreeRenderer.total = total

PreferencesDialog.languages.default = Idioma por defecto
PreferencesDialog.lbl.language = Idioma de la interfaz:
PreferencesDialog.lbl.languageEffect = El idioma cambiar\u00e1 la pr\u00f3xima vez que abra OpenRocket.
generalprefs.languages.default = Idioma por defecto
generalprefs.lbl.language = Idioma de la interfaz:
generalprefs.lbl.languageEffect = El idioma cambiar\u00e1 la pr\u00f3xima vez que abra OpenRocket.

PresetModel.lbl.custompreset = Personalizado
PresetModel.lbl.partsLib = Biblioteca de piezas
Expand Down
6 changes: 3 additions & 3 deletions core/resources/l10n/messages_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -725,9 +725,9 @@ PlotDialog.title.Flightdataplot = Trac\u00E9 du vol

ComponentTreeRenderer.total = total

PreferencesDialog.languages.default = Valeur syst\u00E8me par d\u00E9faut
PreferencesDialog.lbl.language = Langue du programme:
PreferencesDialog.lbl.languageEffect = La langue sera chang\u00E9e apr\u00E8s avoir red\u00E9marr\u00E9 OpenRocket.
generalprefs.languages.default = Valeur syst\u00E8me par d\u00E9faut
generalprefs.lbl.language = Langue du programme:
generalprefs.lbl.languageEffect = La langue sera chang\u00E9e apr\u00E8s avoir red\u00E9marr\u00E9 OpenRocket.

PresetModel.lbl.custompreset = Personnalisé
PresetModel.lbl.partsLib = Biblioth\u00E8que de pi\u00E8ces
Expand Down
6 changes: 3 additions & 3 deletions core/resources/l10n/messages_it.properties
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ pref.dlg.PrefBooleanSelector2 = Conferma
pref.dlg.Add = Aggiungi
pref.dlg.DescriptionArea.Adddirectories = Aggiungi cartelle, RASP motor files (*.eng), RockSim engine files (*.rse) or ZIP archives separate da puntoevirgola (;) per caricare curve di spinta esterne. I cambiamenti avranno effetto la prossima volta che avvierai OpenRocket.

PreferencesDialog.lbl.language = Lingua dell'interfaccia:
PreferencesDialog.languages.default = Predefinita di sistema
PreferencesDialog.lbl.languageEffect = La lingua sara' cambiata la prossima volta che avvierai OpenRocket.
generalprefs.lbl.language = Lingua dell'interfaccia:
generalprefs.languages.default = Predefinita di sistema
generalprefs.lbl.languageEffect = La lingua sara' cambiata la prossima volta che avvierai OpenRocket.

! Software update checker
update.dlg.error.title = Non sono in grado di recuperare informazioni sugli aggiornamenti
Expand Down
6 changes: 3 additions & 3 deletions core/resources/l10n/messages_ja.properties
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ pref.dlg.PrefBooleanSelector2 = \u78BA\u8A8D
pref.dlg.Add = \u8FFD\u52A0
pref.dlg.DescriptionArea.Adddirectories = \u30D5\u30A9\u30EB\u30C0, RASP motor files (*.eng), RockSim engine files (*.rse) \u3082\u3057\u304F\u306F ZIP archives \u3092\u30BB\u30DF\u30B3\u30ED\u30F3(;)\u306B\u3088\u3063\u3066\u5206\u3051\u3089\u308C\u305F\u5F62\u3067\u8FFD\u52A0\u306E\u63A8\u529B\u5C65\u6B74\u3068\u3057\u3066\u8FFD\u52A0\u3067\u304D\u307E\u3059\u3002\u3053\u306E\u5909\u66F4\u306FOpenRocket\u306E\u518D\u8D77\u52D5\u6642\u306B\u6709\u52B9\u306B\u306A\u308A\u307E\u3059

PreferencesDialog.lbl.language = \u8A00\u8A9E\uFF1A
PreferencesDialog.languages.default = \u30B7\u30B9\u30C6\u30E0\u8A00\u8A9E
PreferencesDialog.lbl.languageEffect = \u8A00\u8A9E\u306F\u518D\u8D77\u52D5\u6642\u306B\u5909\u66F4\u3055\u308C\u307E\u3059
generalprefs.lbl.language = \u8A00\u8A9E\uFF1A
generalprefs.languages.default = \u30B7\u30B9\u30C6\u30E0\u8A00\u8A9E
generalprefs.lbl.languageEffect = \u8A00\u8A9E\u306F\u518D\u8D77\u52D5\u6642\u306B\u5909\u66F4\u3055\u308C\u307E\u3059

! Software update checker
update.dlg.error.title = \u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u60C5\u5831\u306E\u8AAD\u307F\u51FA\u3057\u304C\u3067\u304D\u307E\u305B\u3093
Expand Down
4 changes: 0 additions & 4 deletions core/resources/l10n/messages_nl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,6 @@ pref.dlg.PrefBooleanSelector2 = Bevestig
pref.dlg.Add = Voeg toe
pref.dlg.DescriptionArea.Adddirectories = Voeg folders, RASP motorbestanden (*.eng), RockSim motorbestanden (*.rse) of ZIP-archieven gescheiden door een puntkomma (;) om externe stuwkrachtcurves te laden. Wijzigingen zullen van kracht gaan de volgende keer dat u OpenRocket start.

PreferencesDialog.lbl.language = Interface taal:
PreferencesDialog.languages.default = Systeemstandaard
PreferencesDialog.lbl.languageEffect = De taal zal veranderen de volgende keer dat u OpenRocket start.

generalprefs.lbl.language = Interface taal
generalprefs.languages.default = Systeemstandaard
generalprefs.lbl.languageEffect = De taal zal veranderen de volgende keer dat u OpenRocket start.
Expand Down
8 changes: 4 additions & 4 deletions core/resources/l10n/messages_pl.properties
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@
pref.dlg.PrefBooleanSelector2 = Potwierd\u017A
pref.dlg.Add = Dodaj
pref.dlg.DescriptionArea.Adddirectories = Dodaj katalogi, pliki silnikowe RASP (*.eng), Pliki silnikowe RockSim (*.rse) albo archiwa ZIP rozdzielone \u015Brednikiem (;) by za\u0142adowa\u0107 zewn\u0119trzne krzywe si\u0142y ci\u0105gu. Zmiany zostan\u0105 wprowadzone przy kolejnym uruchomieniu OpenRocket.
PreferencesDialog.lbl.language = J\u0119zyk programu:
PreferencesDialog.languages.default = Domy\u015Blny j\u0119zyk systemu
PreferencesDialog.lbl.languageEffect = Nowy j\u0119zyk zostanie ustawiony przy kolejnym uruchomieniu OpenRocket.

generalprefs.lbl.language = J\u0119zyk programu:
generalprefs.languages.default = Domy\u015Blny j\u0119zyk systemu
generalprefs.lbl.languageEffect = Nowy j\u0119zyk zostanie ustawiony przy kolejnym uruchomieniu OpenRocket.

! Software update checker
update.dlg.error.title = Nie mo\u017Cna uzyska\u0107 informacji o aktualizacji
Expand Down
6 changes: 3 additions & 3 deletions core/resources/l10n/messages_pt.properties
Original file line number Diff line number Diff line change
Expand Up @@ -709,9 +709,9 @@ PlotDialog.lbl.Chart = Clique e arraste para baixo+direita para am
# PlotDialog
PlotDialog.title.Flightdataplot = Plotagem dos dados de voo

PreferencesDialog.languages.default = Padr\u00e3o do sistema
PreferencesDialog.lbl.language = Idioma da interface:
PreferencesDialog.lbl.languageEffect = A linguagem vai mudar na pr\u00f3xima vez que voc\u00ea iniciar o OpenRocket.
generalprefs.languages.default = Padr\u00e3o do sistema
generalprefs.lbl.language = Idioma da interface:
generalprefs.lbl.languageEffect = A linguagem vai mudar na pr\u00f3xima vez que voc\u00ea iniciar o OpenRocket.

PresetModel.lbl.custompreset = Personalizado
PresetModel.lbl.partsLib = Biblioteca de pe\u00e7as
Expand Down
4 changes: 0 additions & 4 deletions core/resources/l10n/messages_ru.properties
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,6 @@ pref.dlg.PrefBooleanSelector2 = \u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434
pref.dlg.Add = \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C
pref.dlg.DescriptionArea.Adddirectories = \u0414\u043B\u044F \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0438 \u0434\u0430\u043D\u043D\u044B\u0445 \u0441\u0432\u043E\u0438\u0445 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043B\u0435\u0439 \u0434\u043E\u0431\u0430\u0432\u044C\u0442\u0435 \u043A\u0430\u0442\u0430\u043B\u043E\u0433\u0438, \u0444\u0430\u0439\u043B\u044B \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043B\u0435\u0439 RASP (*.eng), \u0444\u0430\u0439\u043B\u044B \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043B\u0435\u0439 RockSim (*.rse) \u0438\u043B\u0438 ZIP-\u0430\u0440\u0445\u0438\u0432\u044B, \u0440\u0430\u0437\u0434\u0435\u043B\u0435\u043D\u043D\u044B\u0435 \u0442\u043E\u0447\u043A\u043E\u0439 \u0441 \u0437\u0430\u043F\u044F\u0442\u043E\u0439 (;). \u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0432\u0441\u0442\u0443\u043F\u044F\u0442 \u0432 \u0441\u0438\u043B\u0443 \u043F\u0440\u0438 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C \u0437\u0430\u043F\u0443\u0441\u043A\u0435 OpenRocket.

PreferencesDialog.lbl.language = \u042F\u0437\u044B\u043A \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430:
PreferencesDialog.languages.default = \u0421\u0438\u0441\u0442\u0435\u043C\u043D\u044B\u0439
PreferencesDialog.lbl.languageEffect = \u042F\u0437\u044B\u043A \u0441\u043C\u0435\u043D\u0438\u0442\u0441\u044F \u043F\u0440\u0438 \u043F\u0435\u0440\u0435\u0437\u0430\u043F\u0443\u0441\u043A\u0435 OpenRocket.

generalprefs.lbl.language = \u042F\u0437\u044B\u043A \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430
generalprefs.languages.default = \u0421\u0438\u0441\u0442\u0435\u043C\u043D\u044B\u0439
generalprefs.lbl.languageEffect = \u042F\u0437\u044B\u043A \u0441\u043C\u0435\u043D\u0438\u0442\u0441\u044F \u043F\u0440\u0438 \u043F\u0435\u0440\u0435\u0437\u0430\u043F\u0443\u0441\u043A\u0435 OpenRocket.
Expand Down
6 changes: 3 additions & 3 deletions core/resources/l10n/messages_uk_UA.properties
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@ pref.dlg.PrefBooleanSelector2 = Confirm
pref.dlg.Add = Add
pref.dlg.DescriptionArea.Adddirectories = Add directories, RASP motor files (*.eng), RockSim engine files (*.rse) or ZIP archives separated by a semicolon (;) to load external thrust curves. Changes will take effect the next time you start OpenRocket.

PreferencesDialog.lbl.language = Interface language:
PreferencesDialog.languages.default = System default
PreferencesDialog.lbl.languageEffect = The language will change the next time you start OpenRocket.
generalprefs.lbl.language = Interface language:
generalprefs.languages.default = System default
generalprefs.lbl.languageEffect = The language will change the next time you start OpenRocket.

! Software update checker
update.dlg.error.title = Unable to retrieve update information
Expand Down
6 changes: 3 additions & 3 deletions core/resources/l10n/messages_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -797,9 +797,9 @@ PlotConfiguration.Verticalmotion = \u5782\u76F4\u8FD0\u52A8 vs. \u65F6\u95F
PlotDialog.CheckBox.Showdatapoints = \u663E\u793A\u6570\u636E\u70B9
PlotDialog.lbl.Chart = \u5DE6\u952E\u62D6\u62FD\u79FB\u52A8\u6570\u636E\u533A. \u6EDA\u8F6E\u7F29\u653E. ctrl-\u6EDA\u8F6E\u4EC5\u7F29\u653EX\u8F74. ctrl-\u5DE6\u952E\u62D6\u62FD\u79FB\u52A8\u89C6\u56FE. \u53F3\u952E\u8FC7\u62FD\u8C03\u6574\u663E\u793A\u5927\u5C0F.

PreferencesDialog.languages.default = \u7CFB\u7EDF\u9ED8\u8BA4
PreferencesDialog.lbl.language = \u754C\u9762\u8BED\u8A00:
PreferencesDialog.lbl.languageEffect = \u8BED\u8A00\u8BBE\u7F6E\u5C06\u5728OpenRocket\u91CD\u542F\u540E\u751F\u6548
generalprefs.languages.default = \u7CFB\u7EDF\u9ED8\u8BA4
generalprefs.lbl.language = \u754C\u9762\u8BED\u8A00:
generalprefs.lbl.languageEffect = \u8BED\u8A00\u8BBE\u7F6E\u5C06\u5728OpenRocket\u91CD\u542F\u540E\u751F\u6548

PresetModel.lbl.custompreset = \u5b9a\u5236
PresetModel.lbl.partsLib = \u96f6\u4ef6\u5e93
Expand Down
Binary file modified core/resources/pix/componenticons/pods-small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added core/resources/pix/icons/cd-override_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added core/resources/pix/icons/cg-override_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added core/resources/pix/icons/mass-override_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
62 changes: 25 additions & 37 deletions core/src/net/sf/openrocket/startup/Preferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ public abstract class Preferences implements ChangeSource {
public static final String LAUNCH_USE_ISA = "LaunchUseISA";
public static final String SIMULATION_TIME_STEP = "SimulationTimeStep";
public static final String GEODETIC_COMPUTATION = "GeodeticComputationStrategy";

public static final String UI_THEME = "UITheme";


private static final AtmosphericModel ISA_ATMOSPHERIC_MODEL = new ExtendedISAModel();
Expand Down Expand Up @@ -549,11 +551,6 @@ public void setTimeStep(double timeStep) {
fireChangeEvent();
}


public final float getRocketInfoFontSize() {
return (float) (11.0 + 3 * Application.getPreferences().getChoice(Preferences.ROCKET_INFO_FONT_SIZE, 2, 0));
}

/**
* Enable/Disable the auto-opening of the last edited design file on startup.
*/
Expand Down Expand Up @@ -820,25 +817,6 @@ public final void putEnum(String key, Enum<?> value) {
}
}

public Color getDefaultColor(Class<? extends RocketComponent> c) {
String color = get("componentColors", c, StaticFieldHolder.DEFAULT_COLORS);
if (color == null)
return Color.BLACK;

Color clr = parseColor(color);
if (clr != null) {
return clr;
} else {
return Color.BLACK;
}
}

public final void setDefaultColor(Class<? extends RocketComponent> c, Color color) {
if (color == null)
return;
putString("componentColors", c.getSimpleName(), stringifyColor(color));
}


/**
* Retrieve a Line style for the given component.
Expand Down Expand Up @@ -1014,6 +992,29 @@ protected String get(String directory,
public abstract void setComponentFavorite(ComponentPreset preset, ComponentPreset.Type type, boolean favorite);

public abstract Set<String> getComponentFavorites(ComponentPreset.Type type);


/*
NOTE: It is unusual for the UI Theme to be stored in the preferences instead of SwingPreferences. In fact, this code
is not pretty. Sometimes I just really hate Java and circular dependencies...
But the reason why this is implemented is because it would otherwise be an even bigger nightmare to fix unit tests
that use their own preferences... Also wasn't a fan of always casting the preferences to SwingPreferences.
*/
/**
* Get the current theme used for the UI.
* @return the current theme
*/
public Object getUITheme() {
return null;
}

/**
* Set the theme used for the UI.
* @param theme the theme to set
*/
public void setUITheme(Object theme) {}



/*
* Within a holder class so they will load only when needed.
Expand All @@ -1032,19 +1033,6 @@ private static class StaticFieldHolder {
DEFAULT_LINE_STYLES.put(RocketComponent.class, LineStyle.SOLID.name());
DEFAULT_LINE_STYLES.put(MassObject.class, LineStyle.DASHED.name());
}

private static final HashMap<Class<?>, String> DEFAULT_COLORS = new HashMap<Class<?>, String>();

static {
DEFAULT_COLORS.put(BodyComponent.class, "0,0,240");
DEFAULT_COLORS.put(TubeFinSet.class, "0,0,200");
DEFAULT_COLORS.put(FinSet.class, "0,0,200");
DEFAULT_COLORS.put(LaunchLug.class, "0,0,180");
DEFAULT_COLORS.put(RailButton.class, "0,0,180");
DEFAULT_COLORS.put(InternalComponent.class, "170,0,100");
DEFAULT_COLORS.put(MassObject.class, "0,0,0");
DEFAULT_COLORS.put(RecoveryDevice.class, "255,0,0");
}
}

private final List<EventListener> listeners = new ArrayList<EventListener>();
Expand Down
4 changes: 4 additions & 0 deletions core/src/net/sf/openrocket/util/Color.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ public java.awt.Color toAWTColor() {
return new java.awt.Color(red, green, blue, alpha);
}

public static Color fromAWTColor(java.awt.Color AWTColor) {
return new Color(AWTColor.getRed(), AWTColor.getGreen(), AWTColor.getBlue(), AWTColor.getAlpha());
}

@Override
public boolean equals(Object obj) {
if (super.equals(obj)) {
Expand Down
1 change: 1 addition & 0 deletions install4j/23.xx/openrocket-23.xx.install4j
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
</launcher>
</launchers>
<installerGui>
<laf type="native" />
<applications>
<application id="installer" beanClass="com.install4j.runtime.beans.applications.InstallerApplication" customIcnsFile="../../core/resources/pix/icon/icon-macos.icns" customIcoFile="../../core/resources/pix/icon/icon-windows.ico">
<serializedBean>
Expand Down
1 change: 1 addition & 0 deletions swing/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<classpathentry kind="lib" path="lib/iText-5.0.2.jar"/>
<classpathentry kind="lib" path="lib/jcommon-1.0.18.jar"/>
<classpathentry kind="lib" path="lib/jfreechart-1.0.15.jar"/>
<classpathentry kind="lib" path="lib/darklaf/*.jar"/>
<classpathentry kind="lib" path="lib/jogl/gluegen-rt.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/OpenRocket Core"/>
<classpathentry kind="lib" path="/OpenRocket Core/lib/slf4j-api-1.7.30.jar"/>
Expand Down
Loading

0 comments on commit e2993a6

Please sign in to comment.