UISettings — use smart state class (stored properties), part 5

This commit is contained in:
Vladimir Krivosheev
2017-02-03 11:33:41 +01:00
parent dcd4684684
commit 073b01ba30
4 changed files with 12 additions and 12 deletions
@@ -75,8 +75,8 @@ class UISettings : BaseState(), PersistentStateComponent<UISettings> {
@get:OptionTag("WIDESCREEN_SUPPORT") var wideScreenSupport by storedProperty(false)
@get:OptionTag("LEFT_HORIZONTAL_SPLIT") var leftGorizontalSplit by storedProperty(false)
@get:OptionTag("RIGHT_HORIZONTAL_SPLIT") var rightGorizontalSplit by storedProperty(false)
@get:OptionTag("SHOW_EDITOR_TOOLTIP") var showEditorToolTip by storedProperty(true)
@JvmField var SHOW_EDITOR_TOOLTIP = true
@JvmField var SHOW_MEMORY_INDICATOR = false
@JvmField var ALLOW_MERGE_BUTTONS = true
@JvmField var SHOW_MAIN_TOOLBAR = false
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2016 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.
@@ -128,7 +128,7 @@ public class EditorAppearanceConfigurable extends CompositeConfigurable<UnnamedC
myShowBreadcrumbsCheckBox.setSelected(editorSettings.isBreadcrumbsShown());
//myAntialiasingInEditorCheckBox.setSelected(UISettings.getInstance().ANTIALIASING_IN_EDITOR);
//myUseLCDRendering.setSelected(UISettings.getInstance().USE_LCD_RENDERING_IN_EDITOR);
myShowCodeLensInEditorCheckBox.setSelected(UISettings.getInstance().SHOW_EDITOR_TOOLTIP);
myShowCodeLensInEditorCheckBox.setSelected(UISettings.getInstance().getShowToolWindowsNumbers());
updateWhitespaceCheckboxesState();
@@ -173,8 +173,8 @@ public class EditorAppearanceConfigurable extends CompositeConfigurable<UnnamedC
// uiSettingsModified = true;
//}
if (uiSettings.SHOW_EDITOR_TOOLTIP != myShowCodeLensInEditorCheckBox.isSelected()) {
uiSettings.SHOW_EDITOR_TOOLTIP = myShowCodeLensInEditorCheckBox.isSelected();
if (uiSettings.getShowEditorToolTip() != myShowCodeLensInEditorCheckBox.isSelected()) {
uiSettings.setShowToolWindowsNumbers(myShowCodeLensInEditorCheckBox.isSelected());
uiSettingsModified = true;
lafSettingsModified = true;
}
@@ -216,7 +216,7 @@ public class EditorAppearanceConfigurable extends CompositeConfigurable<UnnamedC
isModified |= isModified(myCbShowMethodSeparators, DaemonCodeAnalyzerSettings.getInstance().SHOW_METHOD_SEPARATORS);
//isModified |= myAntialiasingInEditorCheckBox.isSelected() != UISettings.getInstance().ANTIALIASING_IN_EDITOR;
//isModified |= myUseLCDRendering.isSelected() != UISettings.getInstance().USE_LCD_RENDERING_IN_EDITOR;
isModified |= myShowCodeLensInEditorCheckBox.isSelected() != UISettings.getInstance().SHOW_EDITOR_TOOLTIP;
isModified |= myShowCodeLensInEditorCheckBox.isSelected() != UISettings.getInstance().getShowEditorToolTip();
isModified |= myShowBreadcrumbsCheckBox.isSelected() != editorSettings.isBreadcrumbsShown();
isModified |= myShowParameterNameHints.isSelected() != editorSettings.isShowParameterNameHints();
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 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.
@@ -90,13 +90,13 @@ public class DaemonEditorPopup extends PopupHandler {
}
});
final JBCheckboxMenuItem previewCheckbox = new JBCheckboxMenuItem(IdeBundle.message("checkbox.show.editor.preview.popup"), UISettings.getInstance().SHOW_EDITOR_TOOLTIP);
final JBCheckboxMenuItem previewCheckbox = new JBCheckboxMenuItem(IdeBundle.message("checkbox.show.editor.preview.popup"), UISettings.getInstance().getShowEditorToolTip());
popupMenu.addSeparator();
popupMenu.add(previewCheckbox);
previewCheckbox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
UISettings.getInstance().SHOW_EDITOR_TOOLTIP = previewCheckbox.isSelected();
UISettings.getInstance().setShowToolWindowsNumbers(previewCheckbox.isSelected());
UISettings.getInstance().fireUISettingsChanged();
}
});
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2016 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.
@@ -192,7 +192,7 @@ public class EditorMarkupModelImpl extends MarkupModelImpl implements EditorMark
int visualY = myEditor.getLineHeight() * visualLine;
boolean isVisible = area.contains(area.x, visualY) && myWheelAccumulator == 0;
if (UIUtil.uiParents(myEditor.getComponent(), false).filter(EditorWindowHolder.class).isEmpty() || isVisible || !UISettings.getInstance().SHOW_EDITOR_TOOLTIP) {
if (UIUtil.uiParents(myEditor.getComponent(), false).filter(EditorWindowHolder.class).isEmpty() || isVisible || !UISettings.getInstance().getShowEditorToolTip()) {
final Set<RangeHighlighter> highlighters = new THashSet<>();
getNearestHighlighters(this, me.getY(), highlighters);
getNearestHighlighters(((EditorEx)getEditor()).getFilteredDocumentMarkupModel(), me.getY(), highlighters);
@@ -553,7 +553,7 @@ public class EditorMarkupModelImpl extends MarkupModelImpl implements EditorMark
@Override
public void uiSettingsChanged(UISettings uiSettings) {
if (!uiSettings.SHOW_EDITOR_TOOLTIP) {
if (!uiSettings.getShowEditorToolTip()) {
hideMyEditorPreviewHint();
}
setMinMarkHeight(DaemonCodeAnalyzerSettings.getInstance().ERROR_STRIPE_MARK_MIN_HEIGHT);