summaryrefslogtreecommitdiff
path: root/layout-inspector/src
diff options
context:
space:
mode:
authorJens Ole Lauridsen <jlauridsen@google.com>2022-02-28 14:53:12 -0800
committerTreeHugger Robot <treehugger-gerrit@google.com>2022-03-03 10:41:05 +0000
commit34abb358ab0c570b8a91993ed3fc5737320653ec (patch)
tree8cac9f0f66baad6e4dcedbfea475e0c233908680 /layout-inspector/src
parentb54217d80983972fc79768519e0702fc8c7f4505 (diff)
downloadidea-34abb358ab0c570b8a91993ed3fc5737320653ec.tar.gz
Tune the auto column size computation.
Instead of always give room to a preceding - for negative numbers, compute the widest of max and min values. Bug: 172894679 Test: N/A Change-Id: I0008ad7ba2d07269fd85499d9b2cc04ffb6f51fd
Diffstat (limited to 'layout-inspector/src')
-rw-r--r--layout-inspector/src/com/android/tools/idea/layoutinspector/tree/LayoutInspectorTreePanel.kt21
1 files changed, 16 insertions, 5 deletions
diff --git a/layout-inspector/src/com/android/tools/idea/layoutinspector/tree/LayoutInspectorTreePanel.kt b/layout-inspector/src/com/android/tools/idea/layoutinspector/tree/LayoutInspectorTreePanel.kt
index 35586a7182a..3697e1202c0 100644
--- a/layout-inspector/src/com/android/tools/idea/layoutinspector/tree/LayoutInspectorTreePanel.kt
+++ b/layout-inspector/src/com/android/tools/idea/layoutinspector/tree/LayoutInspectorTreePanel.kt
@@ -15,7 +15,6 @@
*/
package com.android.tools.idea.layoutinspector.tree
-import com.android.tools.adtui.FocusableIcon
import com.android.tools.adtui.stdui.CommonHyperLinkLabel
import com.android.tools.adtui.workbench.ToolContent
import com.android.tools.adtui.workbench.ToolWindowCallback
@@ -123,10 +122,22 @@ class LayoutInspectorTreePanel(parentDisposable: Disposable) : ToolContent<Layou
.withContextMenu(::showPopup)
.withoutTreeSearch()
.withHeaderRenderer(createTreeHeaderRenderer())
- .withColumn(createIntColumn<TreeViewNode>("Counts", { (it.view as? ComposeViewNode)?.recomposeCount }, leftDivider = true,
- maxInt = { inspectorModel?.maxRecompositionCount }, headerRenderer = createCountsHeader()))
- .withColumn(createIntColumn<TreeViewNode>("Skips", { (it.view as? ComposeViewNode)?.recomposeSkips }, foreground = JBColor.lightGray,
- maxInt = { inspectorModel?.maxRecompositionSkips }, headerRenderer = createSkipsHeader()))
+ .withColumn(createIntColumn<TreeViewNode>(
+ "Counts",
+ { (it.view as? ComposeViewNode)?.recomposeCount },
+ leftDivider = true,
+ maxInt = { inspectorModel?.maxRecompositionCount ?: 0 },
+ minInt = { 0 },
+ headerRenderer = createCountsHeader())
+ )
+ .withColumn(createIntColumn<TreeViewNode>(
+ "Skips",
+ { (it.view as? ComposeViewNode)?.recomposeSkips },
+ foreground = JBColor.lightGray,
+ maxInt = { inspectorModel?.maxRecompositionSkips ?: 0 },
+ minInt = { 0 },
+ headerRenderer = createSkipsHeader())
+ )
.withInvokeLaterOption { ApplicationManager.getApplication().invokeLater(it) }
.withHorizontalScrollBar()
.withComponentName("inspectorComponentTree")