mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
variable indent options for trees (IDEA-126373)
This commit is contained in:
@@ -503,6 +503,9 @@ vcs.add.remove.silent=true
|
||||
ide.ui.scale.override=false
|
||||
ide.ui.scale=1.0
|
||||
|
||||
ide.ui.tree.indent=-1
|
||||
ide.ui.tree.indent.description=Allows to increase or decrease indents in trees. Use -1 to use default indent
|
||||
|
||||
ide.new.notification.enabled=true
|
||||
ide.new.notification.visible.count=2
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 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.
|
||||
@@ -18,6 +18,8 @@ package com.intellij.util.ui.tree;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.Conditions;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import com.intellij.util.ui.MouseEventAdapter;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
@@ -73,19 +75,15 @@ public class WideSelectionTreeUI extends BasicTreeUI {
|
||||
|
||||
@Override
|
||||
public int getRightChildIndent() {
|
||||
return isSkinny() ? 8 : super.getRightChildIndent();
|
||||
return isCustomIndent() ? getCustomIndent() : super.getRightChildIndent();
|
||||
}
|
||||
|
||||
public boolean isSkinny() {
|
||||
return mySkinny;
|
||||
public boolean isCustomIndent() {
|
||||
return getCustomIndent() > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setting to <code>true</code> make tree to reduce row offset
|
||||
* @param skinny <code>true</code> to reduce row offset
|
||||
*/
|
||||
public void setSkinny(boolean skinny) {
|
||||
mySkinny = skinny;
|
||||
protected int getCustomIndent() {
|
||||
return JBUI.scale(Registry.intValue("ide.ui.tree.indent"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -237,7 +235,7 @@ public class WideSelectionTreeUI extends BasicTreeUI {
|
||||
|
||||
@Override
|
||||
protected int getRowX(int row, int depth) {
|
||||
if (isSkinny()) {
|
||||
if (isCustomIndent()) {
|
||||
int off = tree.isRootVisible() ? 8 : 0;
|
||||
return 8 * depth + 8 + off;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user