Skip to content

Commit

Permalink
feat: Add ListViewOption.suppressAutoIndent
Browse files Browse the repository at this point in the history
  • Loading branch information
fuqunaga committed Sep 11, 2024
1 parent ca01c8a commit 0df33d2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ VisualElement MakeItem()
// リストの要素は見栄えを気にしてとりあえず強制インデント
// marginでのインデントだとreorderable==falseのとき
// 選択時の青色がmarginのスペースには反映されないのでpadding
ApplyIndent(itemVe, padding: true);
if (!option.suppressAutoIndent)
{
ApplyIndent(itemVe, padding: true);
}

return itemVe;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace RosettaUI
// ReSharper disable FieldCanBeMadeReadOnly.Global
namespace RosettaUI
{
public struct ListViewOption
{
Expand All @@ -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;
}
}
}

0 comments on commit 0df33d2

Please sign in to comment.