mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
colorBlindness as property
This commit is contained in:
@@ -136,7 +136,7 @@ class UISettings : BaseState(), PersistentStateComponent<UISettings> {
|
||||
@get:OptionTag("ACTIVATE_RIGHT_EDITOR_ON_CLOSE") var activeRigtEditorOnClose by storedProperty(false)
|
||||
@get:OptionTag("IDE_AA_TYPE") var ideAAType by storedProperty(AntialiasingType.SUBPIXEL)
|
||||
@get:OptionTag("EDITOR_AA_TYPE") var editorAAType by storedProperty(AntialiasingType.SUBPIXEL)
|
||||
@JvmField var COLOR_BLINDNESS: ColorBlindness? = null
|
||||
@get:OptionTag("COLOR_BLINDNESS") var colorBlindness: ColorBlindness? = null
|
||||
@get:OptionTag("MOVE_MOUSE_ON_DEFAULT_BUTTON") var moveMouseOnDefaultButton by storedProperty(false)
|
||||
@get:OptionTag("ENABLE_ALPHA_MODE") var enableAlphaMode by storedProperty(false)
|
||||
@get:OptionTag("ALPHA_MODE_DELAY") var alphaModeDelay by storedProperty(1500)
|
||||
@@ -209,7 +209,7 @@ class UISettings : BaseState(), PersistentStateComponent<UISettings> {
|
||||
// todo remove when all old properties will be converted
|
||||
incrementModificationCount()
|
||||
|
||||
IconLoader.setFilter(ColorBlindnessSupport.get(COLOR_BLINDNESS)?.filter)
|
||||
IconLoader.setFilter(ColorBlindnessSupport.get(colorBlindness)?.filter)
|
||||
|
||||
// if this is the main UISettings instance (and not on first call to getInstance) push event to bus and to all current components
|
||||
if (this === _instance) {
|
||||
|
||||
+1
-1
@@ -308,7 +308,7 @@ public abstract class AbstractColorsScheme implements EditorColorsScheme, Serial
|
||||
@Override
|
||||
public void readExternal(@NotNull Element parentNode) {
|
||||
UISettings settings = UISettings.getInstanceOrNull();
|
||||
ColorBlindness blindness = settings == null ? null : settings.COLOR_BLINDNESS;
|
||||
ColorBlindness blindness = settings == null ? null : settings.getColorBlindness();
|
||||
myValueReader.setAttribute(blindness == null ? null : blindness.name());
|
||||
if (SCHEME_ELEMENT.equals(parentNode.getName())) {
|
||||
readScheme(parentNode);
|
||||
|
||||
@@ -227,8 +227,8 @@ public class AppearanceConfigurable extends BaseConfigurable implements Searchab
|
||||
|
||||
ColorBlindness blindness = myComponent.myColorBlindnessPanel.getColorBlindness();
|
||||
boolean updateEditorScheme = false;
|
||||
if (settings.COLOR_BLINDNESS != blindness) {
|
||||
settings.COLOR_BLINDNESS = blindness;
|
||||
if (settings.getColorBlindness() != blindness) {
|
||||
settings.setColorBlindness(blindness);
|
||||
update = true;
|
||||
ServiceKt.getStateStore(ApplicationManager.getApplication()).reloadState(DefaultColorSchemesManager.class);
|
||||
updateEditorScheme = true;
|
||||
@@ -348,7 +348,7 @@ public class AppearanceConfigurable extends BaseConfigurable implements Searchab
|
||||
myComponent.myRightLayoutCheckBox.setSelected(settings.getRightHorizontalSplit());
|
||||
myComponent.myNavigateToPreviewCheckBox.setSelected(settings.getNavigateToPreview());
|
||||
myComponent.myNavigateToPreviewCheckBox.setVisible(false);//disabled for a while
|
||||
myComponent.myColorBlindnessPanel.setColorBlindness(settings.COLOR_BLINDNESS);
|
||||
myComponent.myColorBlindnessPanel.setColorBlindness(settings.getColorBlindness());
|
||||
myComponent.myDisableMnemonicInControlsCheckBox.setSelected(settings.getDisableMnemonicsInControls());
|
||||
|
||||
boolean alphaModeEnabled = WindowManagerEx.getInstanceEx().isAlphaModeSupported();
|
||||
@@ -412,7 +412,7 @@ public class AppearanceConfigurable extends BaseConfigurable implements Searchab
|
||||
isModified |= myComponent.myLeftLayoutCheckBox.isSelected() != settings.getLeftHorizontalSplit();
|
||||
isModified |= myComponent.myRightLayoutCheckBox.isSelected() != settings.getRightHorizontalSplit();
|
||||
isModified |= myComponent.myNavigateToPreviewCheckBox.isSelected() != settings.getNavigateToPreview();
|
||||
isModified |= myComponent.myColorBlindnessPanel.getColorBlindness() != settings.COLOR_BLINDNESS;
|
||||
isModified |= myComponent.myColorBlindnessPanel.getColorBlindness() != settings.getColorBlindness();
|
||||
|
||||
isModified |= myComponent.myHideIconsInQuickNavigation.isSelected() != settings.getShowIconInQuickNavigation();
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,10 +20,8 @@ import com.intellij.openapi.ui.GraphicsConfig;
|
||||
import com.intellij.ui.ColorUtil;
|
||||
import com.intellij.ui.Gray;
|
||||
import com.intellij.ui.JBColor;
|
||||
import com.intellij.util.NotNullProducer;
|
||||
import com.intellij.util.ui.GraphicsUtil;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
@@ -41,13 +39,13 @@ public class ColorProgressBar extends JComponent {
|
||||
|
||||
public static final Color GREEN = new JBColor(() -> {
|
||||
UISettings settings = UISettings.getInstance();
|
||||
return settings == null || null == settings.COLOR_BLINDNESS
|
||||
return settings == null || null == settings.getColorBlindness()
|
||||
? new JBColor(new Color(0x6cad74), new Color(0x4a8c53))
|
||||
: new JBColor(new Color(0x6ca69c), new Color(0x639990));
|
||||
});
|
||||
public static final Color RED = new JBColor(() -> {
|
||||
UISettings settings = UISettings.getInstance();
|
||||
return settings == null || null == settings.COLOR_BLINDNESS
|
||||
return settings == null || null == settings.getColorBlindness()
|
||||
? new JBColor(new Color(0xd67b76), new Color(0xe55757))
|
||||
: new JBColor(new Color(0xcc7447), new Color(0xcc7447));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user