Browse Source

Add method to determine whether a SettingsConfigurations behave the same at the time of calling the method.

pull/245/head
weisj 4 years ago
parent
commit
72cc85aedb
No known key found for this signature in database
GPG Key ID: 31124CB75461DA2A
  1. 12
      core/src/main/java/com/github/weisj/darklaf/settings/SettingsConfiguration.java

12
core/src/main/java/com/github/weisj/darklaf/settings/SettingsConfiguration.java

@ -22,6 +22,7 @@
package com.github.weisj.darklaf.settings;
import java.io.Serializable;
import java.util.Objects;
import com.github.weisj.darklaf.LafManager;
import com.github.weisj.darklaf.platform.ThemePreferencesHandler;
@ -277,4 +278,15 @@ public class SettingsConfiguration implements Serializable {
+ ", isSelectionColorFollowsSystem=" + isSelectionColorFollowsSystem + ", accentColorRule="
+ accentColorRule + ", fontSizeRule=" + fontSizeRule + ", theme=" + theme + '}';
}
public boolean isResultingAppearanceEqualTo(final SettingsConfiguration other) {
return other.isSystemPreferencesEnabled() == isSystemPreferencesEnabled() &&
other.isThemeFollowsSystem() == isThemeFollowsSystem() &&
other.isAccentColorFollowsSystem() == isAccentColorFollowsSystem() &&
other.isSelectionColorFollowsSystem() == isSelectionColorFollowsSystem() &&
other.isFontSizeFollowsSystem() == isFontSizeFollowsSystem() &&
Objects.equals(other.getAccentColorRule(), getAccentColorRule()) &&
Objects.equals(other.getFontSizeRule(), getFontSizeRule()) &&
Objects.equals(Theme.baseThemeOf(other.getTheme()), Theme.baseThemeOf(getTheme()));
}
}

Loading…
Cancel
Save