From 0df33d2b544c59f52b06cdd8f752da8629e0c04a Mon Sep 17 00:00:00 2001 From: fuqunaga Date: Wed, 11 Sep 2024 17:38:26 +0900 Subject: [PATCH] feat: Add ListViewOption.suppressAutoIndent --- ...UIToolkitBuilderElementGroup_ListViewItemContainer.cs | 5 ++++- .../Settings/RosettaUI_DefaultPanelSettings.asset | 9 ++------- .../Runtime/Elements/ElementGroup/ListViewOption.cs | 7 +++++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Packages/ga.fuquna.rosettaui.uitoolkit/Runtime/Builder/ElementGroups/UIToolkitBuilderElementGroup_ListViewItemContainer.cs b/Packages/ga.fuquna.rosettaui.uitoolkit/Runtime/Builder/ElementGroups/UIToolkitBuilderElementGroup_ListViewItemContainer.cs index a6f98127..cb427dc9 100644 --- a/Packages/ga.fuquna.rosettaui.uitoolkit/Runtime/Builder/ElementGroups/UIToolkitBuilderElementGroup_ListViewItemContainer.cs +++ b/Packages/ga.fuquna.rosettaui.uitoolkit/Runtime/Builder/ElementGroups/UIToolkitBuilderElementGroup_ListViewItemContainer.cs @@ -97,7 +97,10 @@ VisualElement MakeItem() // リストの要素は見栄えを気にしてとりあえず強制インデント // marginでのインデントだとreorderable==falseのとき // 選択時の青色がmarginのスペースには反映されないのでpadding - ApplyIndent(itemVe, padding: true); + if (!option.suppressAutoIndent) + { + ApplyIndent(itemVe, padding: true); + } return itemVe; } diff --git a/Packages/ga.fuquna.rosettaui.uitoolkit/Runtime/Settings/RosettaUI_DefaultPanelSettings.asset b/Packages/ga.fuquna.rosettaui.uitoolkit/Runtime/Settings/RosettaUI_DefaultPanelSettings.asset index 822403a6..8a92ab34 100644 --- a/Packages/ga.fuquna.rosettaui.uitoolkit/Runtime/Settings/RosettaUI_DefaultPanelSettings.asset +++ b/Packages/ga.fuquna.rosettaui.uitoolkit/Runtime/Settings/RosettaUI_DefaultPanelSettings.asset @@ -12,13 +12,11 @@ MonoBehaviour: m_Script: {fileID: 19101, guid: 0000000000000000e000000000000000, type: 0} m_Name: RosettaUI_DefaultPanelSettings m_EditorClassIdentifier: - themeUss: {fileID: -4733365628477956816, guid: 6f5bb9440d7de664c85a078c1537f946, type: 3} + themeUss: {fileID: -4733365628477956816, guid: 6f5bb9440d7de664c85a078c1537f946, + type: 3} m_TargetTexture: {fileID: 0} - m_RenderMode: 0 - m_WorldSpaceLayer: 0 m_ScaleMode: 1 m_ReferenceSpritePixelsPerUnit: 100 - m_PixelsPerUnit: 100 m_Scale: 1 m_ReferenceDpi: 96 m_FallbackDpi: 96 @@ -27,11 +25,9 @@ MonoBehaviour: m_Match: 0 m_SortingOrder: 0 m_TargetDisplay: 0 - m_BindingLogLevel: 0 m_ClearDepthStencil: 1 m_ClearColor: 0 m_ColorClearValue: {r: 0, g: 0, b: 0, a: 0} - m_VertexBudget: 0 m_DynamicAtlasSettings: m_MinAtlasSize: 64 m_MaxAtlasSize: 4096 @@ -40,5 +36,4 @@ MonoBehaviour: m_AtlasBlitShader: {fileID: 9101, guid: 0000000000000000f000000000000000, type: 0} m_RuntimeShader: {fileID: 9100, guid: 0000000000000000f000000000000000, type: 0} m_RuntimeWorldShader: {fileID: 9102, guid: 0000000000000000f000000000000000, type: 0} - m_ICUDataAsset: {fileID: 0} textSettings: {fileID: 0} diff --git a/Packages/ga.fuquna.rosettaui/Runtime/Elements/ElementGroup/ListViewOption.cs b/Packages/ga.fuquna.rosettaui/Runtime/Elements/ElementGroup/ListViewOption.cs index 7d69aa1e..2b83aea1 100644 --- a/Packages/ga.fuquna.rosettaui/Runtime/Elements/ElementGroup/ListViewOption.cs +++ b/Packages/ga.fuquna.rosettaui/Runtime/Elements/ElementGroup/ListViewOption.cs @@ -1,4 +1,5 @@ -namespace RosettaUI +// ReSharper disable FieldCanBeMadeReadOnly.Global +namespace RosettaUI { public struct ListViewOption { @@ -7,12 +8,14 @@ public struct ListViewOption public bool reorderable; public bool fixedSize; public bool header; + public bool suppressAutoIndent; - public ListViewOption(bool reorderable, bool fixedSize = false, bool header = true) + public ListViewOption(bool reorderable, bool fixedSize = false, bool header = true, bool suppressAutoIndent = false) { this.reorderable = reorderable; this.fixedSize = fixedSize; this.header = header; + this.suppressAutoIndent = suppressAutoIndent; } } } \ No newline at end of file