Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.apache.hop.ui.core.gui.GuiResource;
import org.apache.hop.ui.hopgui.HopGui;
import org.apache.hop.ui.hopgui.perspective.configuration.ConfigurationPerspective;
import org.apache.hop.ui.util.EnvironmentUtils;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
Expand Down Expand Up @@ -165,9 +166,12 @@ public void reloadValues() {
wHideMenuBar.setSelection(props.isHidingMenuBar());
wShowTableViewToolbar.setSelection(props.isShowTableViewToolbar());
// On macOS (and other non-Windows), dark mode follows system; sync from system so UI and
// props match
boolean darkMode = Const.isWindows() ? props.isDarkMode() : Display.isSystemDarkTheme();
if (!Const.isWindows()) {
// props match. In Web environment, isSystemDarkTheme() is not available.
boolean darkMode;
if (EnvironmentUtils.getInstance().isWeb() || Const.isWindows()) {
darkMode = props.isDarkMode();
} else {
darkMode = Display.isSystemDarkTheme();
props.setDarkMode(darkMode);
}
wDarkMode.setSelection(darkMode);
Expand Down Expand Up @@ -941,8 +945,13 @@ private void saveValues() {
props.setInfiniteCanvasMoveEnabled(wEnableInfiniteMove.getSelection());
props.setZoomScrollingDisabled(wDisableZoomScrolling.getSelection());
// On macOS (and other non-Windows), dark mode follows system; persist system theme, not
// checkbox
boolean darkMode = Const.isWindows() ? wDarkMode.getSelection() : Display.isSystemDarkTheme();
// checkbox. In Web environment, isSystemDarkTheme() is not available.
boolean darkMode;
if (EnvironmentUtils.getInstance().isWeb() || Const.isWindows()) {
darkMode = wDarkMode.getSelection();
} else {
darkMode = Display.isSystemDarkTheme();
}
props.setDarkMode(darkMode);
props.setHidingMenuBar(wHideMenuBar.getSelection());
props.setShowTableViewToolbar(wShowTableViewToolbar.getSelection());
Expand Down
Loading