Changeset View
Changeset View
Standalone View
Standalone View
source/gui/COList.cpp
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | if (GUI<CStrW>::GetSetting(this, "font", font) != PSRETURN_OK || font.empty()) | ||||
font = L"default"; | font = L"default"; | ||||
bool scrollbar; | bool scrollbar; | ||||
GUI<bool>::GetSetting(this, "scrollbar", scrollbar); | GUI<bool>::GetSetting(this, "scrollbar", scrollbar); | ||||
float width = GetListRect().GetWidth(); | float width = GetListRect().GetWidth(); | ||||
// remove scrollbar if applicable | // remove scrollbar if applicable | ||||
if (scrollbar && GetScrollBar(0).GetStyle()) | if (scrollbar && GetScrollBar(0).GetStyle()) | ||||
width -= GetScrollBar(0).GetStyle()->m_Width; | width -= GetScrollBar(0).GetStyle()->m_Breadth; | ||||
m_TotalAvailableColumnWidth = width; | m_TotalAvailableColumnWidth = width; | ||||
float buffer_zone = 0.f; | float buffer_zone = 0.f; | ||||
GUI<float>::GetSetting(this, "buffer_zone", buffer_zone); | GUI<float>::GetSetting(this, "buffer_zone", buffer_zone); | ||||
for (COListColumn column : m_Columns) | for (COListColumn column : m_Columns) | ||||
{ | { | ||||
Show All 30 Lines | for (size_t i = 0; i < pList->m_Items.size(); ++i) | ||||
} | } | ||||
buffered_y += shift; | buffered_y += shift; | ||||
} | } | ||||
m_ItemsYPositions[pList->m_Items.size()] = buffered_y; | m_ItemsYPositions[pList->m_Items.size()] = buffered_y; | ||||
if (scrollbar) | if (scrollbar) | ||||
{ | { | ||||
CRect rect = GetListRect(); | |||||
GetScrollBar(0).SetScrollRange(m_ItemsYPositions.back()); | GetScrollBar(0).SetScrollRange(m_ItemsYPositions.back()); | ||||
GetScrollBar(0).SetScrollSpace(rect.GetHeight()); | GetScrollBar(0).Setup(GetListRect()); | ||||
GetScrollBar(0).SetX(rect.right); | |||||
GetScrollBar(0).SetY(rect.top); | |||||
GetScrollBar(0).SetZ(GetBufferedZ()); | |||||
GetScrollBar(0).SetLength(rect.bottom - rect.top); | |||||
} | } | ||||
} | } | ||||
CRect COList::GetListRect() const | CRect COList::GetListRect() const | ||||
{ | { | ||||
float headingHeight; | float headingHeight; | ||||
GUI<float>::GetSetting(this, "heading_height", headingHeight); | GUI<float>::GetSetting(this, "heading_height", headingHeight); | ||||
return m_CachedActualSize + CRect(0, headingHeight, 0, 0); | return m_CachedActualSize + CRect(0, headingHeight, 0, 0); | ||||
▲ Show 20 Lines • Show All 357 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator