Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/interface/skyui/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ vars.a_textBorder.value = <0, 0, 1.1, 0> ; left right top bottom
vars.n_iconSize.value = 18

defaults.entryWidth = 530
defaults.columnMargin = 0 ; global spacing between columns of the right block

; Default text format defaults -------------------------------------------------------
defaults.entry.textFormat.font = '$EverywhereMediumFont'
Expand Down
32 changes: 28 additions & 4 deletions source/actionscript/Common/skyui/components/list/ListLayout.as
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,18 @@ class skyui.components.list.ListLayout
return this._sortAttributes;
}

private var _columnMargin: Number;

public function get columnMargin()
{
return this._columnMargin;
}

public function set columnMargin(a_margin: Number)
{
this._columnMargin = a_margin;
}



/* INITIALIZATION */
Expand All @@ -157,6 +169,9 @@ class skyui.components.list.ListLayout

if (this._entryWidth == undefined)
this._entryWidth = this._defaultsData.entryWidth;

if (this._columnMargin == undefined)
this._columnMargin = this._defaultsData.columnMargin;

this.updateViewList();
this.updateColumnList();
Expand Down Expand Up @@ -460,6 +475,8 @@ class skyui.components.list.ListLayout
}
}

var visibleColumnCount = this._columnLayoutData.length;

// Set x positions based on calculated widths, and set label data
var xPos = 0;
c = 0;
Expand All @@ -469,22 +486,29 @@ class skyui.components.list.ListLayout
if (col.hidden == true)
continue;

var currentVisibleIdx = c;
var columnLayoutData = this._columnLayoutData[c++];

if (col.indent != undefined)
xPos += col.indent;

columnLayoutData.labelX = xPos;
var offset = 0;
if (columnLayoutData.type == skyui.components.list.ListLayout.COL_TYPE_TEXT) {
var multiplier = (visibleColumnCount - 1) - currentVisibleIdx;
offset = this.columnMargin * multiplier;
}

columnLayoutData.labelX = xPos - offset;

if (col.border != undefined) {
columnLayoutData.labelWidth = columnLayoutData.width + col.border[skyui.components.list.ListLayout.LEFT] + col.border[skyui.components.list.ListLayout.RIGHT];
columnLayoutData.x = xPos;
columnLayoutData.x = xPos - offset;
xPos += col.border[skyui.components.list.ListLayout.LEFT];
columnLayoutData.x = xPos;
columnLayoutData.x = xPos - offset;
xPos += col.border[skyui.components.list.ListLayout.RIGHT] + columnLayoutData.width;
} else {
columnLayoutData.labelWidth = columnLayoutData.width;
columnLayoutData.x = xPos;
columnLayoutData.x = xPos - offset;
xPos += columnLayoutData.width;
}
}
Expand Down
2 changes: 2 additions & 0 deletions source/swfsources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ Add_SWF(craftingmenu
}
Common/skyui/components/list {
BasicListEntry.as
ListLayout.as
TabularListEntry.as
ScrollingList.as
}
Expand Down Expand Up @@ -661,6 +662,7 @@ Add_SWF(skyui_inventorylists
}
Common/skyui/components/list {
BasicListEntry.as
ListLayout.as
TabularListEntry.as
ScrollingList.as
}
Expand Down