fix(ShaderBake): 细节面板禁用横向滚动
mode="Vertical" 在 2021.3 仍会带出横向滚动条;显式隐藏横向滚动器, 内容容器与 detail-content 都按 100% 宽度收敛(content-viewport / content-container 两个旧新类名都覆盖)。
This commit is contained in:
@@ -177,6 +177,16 @@ namespace XericUI.ShaderBake.Editor
|
||||
m_StatusSource = Require<Label>("status-source");
|
||||
m_DetailPane = Require<VisualElement>("detail-pane");
|
||||
m_DetailSplit = Require<VisualElement>("detail-split");
|
||||
|
||||
// 侧栏只允许纵向滚动。UXML 的 mode="Vertical" 在 2021.3 里仍可能带出横向滚动条,
|
||||
// 这里显式把横向滚动器隐藏掉,宽度不足交给内部的 min-width/flex 规则去收敛。
|
||||
var detailScroll = m_DetailPane as ScrollView;
|
||||
if (detailScroll != null)
|
||||
{
|
||||
detailScroll.mode = ScrollViewMode.Vertical;
|
||||
detailScroll.horizontalScrollerVisibility = ScrollerVisibility.Hidden;
|
||||
detailScroll.verticalScrollerVisibility = ScrollerVisibility.Auto;
|
||||
}
|
||||
}
|
||||
|
||||
private T Require<T>(string name) where T : VisualElement
|
||||
|
||||
@@ -126,12 +126,15 @@
|
||||
border-left-color: rgb(60, 60, 60);
|
||||
}
|
||||
|
||||
.detail-pane > .unity-scroll-view__content-container {
|
||||
/* 2021.2 之前叫 content-viewport,之后叫 content-container,两个都写上省得按版本失效 */
|
||||
.detail-pane > .unity-scroll-view__content-container,
|
||||
.detail-pane > .unity-scroll-view__content-viewport {
|
||||
width: 100%;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.detail-content {
|
||||
width: 100%;
|
||||
flex-shrink: 0;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user