Commit 5b20bb06 authored by vadim.lomshakov's avatar vadim.lomshakov
Browse files

[rider]: allow to change initial icon area width

parent cc8ad998
Showing with 19 additions and 1 deletion
+19 -1
......@@ -214,6 +214,7 @@ public class DiffUtil {
editor.getSettings().setShowIntentionBulb(false);
((EditorMarkupModel)editor.getMarkupModel()).setErrorStripeVisible(true);
editor.getGutterComponentEx().setShowDefaultGutterPopup(false);
editor.getGutterComponentEx().resetInitialIconAreaWidth();
if (enableFolding) {
setFoldingModelSupport(editor);
......
......@@ -83,6 +83,7 @@ public class ConsoleViewUtil {
editorSettings.setRightMarginShown(false);
editorSettings.setCaretRowShown(false);
editor.getGutterComponentEx().setPaintBackground(false);
editor.getGutterComponentEx().resetInitialIconAreaWidth();
editor.putUserData(EDITOR_IS_CONSOLE_VIEW, true);
......
......@@ -93,6 +93,7 @@ public class DiffUtil {
EditorEx editor = (EditorEx)(isViewer ? factory.createViewer(document, project) : factory.createEditor(document, project));
editor.putUserData(DiffManagerImpl.EDITOR_IS_DIFF_KEY, Boolean.TRUE);
editor.getGutterComponentEx().revalidateMarkup();
editor.getGutterComponentEx().resetInitialIconAreaWidth();
if (fileType != null && project != null && !project.isDisposed()) {
CodeStyleFacade codeStyleFacade = CodeStyleFacade.getInstance(project);
......
......@@ -62,4 +62,8 @@ public abstract class EditorGutterComponentEx extends JComponent implements Edit
public abstract void setForceShowLeftFreePaintersArea(boolean value);
public abstract void setForceShowRightFreePaintersArea(boolean value);
public abstract void setInitialIconAreaWidth(int width);
public abstract void resetInitialIconAreaWidth();
}
......@@ -127,6 +127,7 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse
private final EditorImpl myEditor;
private final FoldingAnchorsOverlayStrategy myAnchorsDisplayStrategy;
@Nullable private TIntObjectHashMap<List<GutterMark>> myLineToGutterRenderers;
private int myStartIconAreaWidth = START_ICON_AREA_WIDTH;
private int myIconsAreaWidth;
private int myLineNumberAreaWidth;
private int myAdditionalLineNumberAreaWidth;
......@@ -809,7 +810,7 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse
}
});
int minWidth = areIconsShown() ? scaleWidth(START_ICON_AREA_WIDTH) : 0;
int minWidth = areIconsShown() ? scaleWidth(myStartIconAreaWidth) : 0;
myIconsAreaWidth = canShrink ? minWidth : Math.max(myIconsAreaWidth, minWidth);
processGutterRenderers((line, renderers) -> {
......@@ -1804,6 +1805,16 @@ class EditorGutterComponentImpl extends EditorGutterComponentEx implements Mouse
myForceRightFreePaintersAreaShown = value;
}
@Override
public void setInitialIconAreaWidth(int width) {
myStartIconAreaWidth = width;
}
@Override
public void resetInitialIconAreaWidth() {
myStartIconAreaWidth = START_ICON_AREA_WIDTH;
}
private void invokePopup(MouseEvent e) {
final ActionManager actionManager = ActionManager.getInstance();
if (myEditor.getMouseEventArea(e) == EditorMouseEventArea.ANNOTATIONS_AREA) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment