RearrangeItems();
- RealignItem(__pItems.at(itemIndex));
+ RealignItem(__pItems.at(itemIndex), __pItems.at(itemIndex)->GetTextExtentSizeF());
delete pButton;
}
result
-_Toolbar::RealignItem(_Button* pButton)
+_Toolbar::RealignItem(_Button* pButton, float textExtentSize)
{
SysTryReturnResult(NID_UI_CTRL, pButton, E_INVALID_STATE, "[E_INVALID_STATE] pButton doesn't exist.");
float buttonTextTopMargin = 0.0f;
float iconTextGap = 0.0f;
float contentLength = 0.0f;
- float textExtentSize = pButton->GetTextExtentSizeF();
float segmentedTextAreaHeight = 0.0f;
float revisedTopMargin = 5.0f;
__pItems.at(i)->SetTextSize(fontSize, FONT_STYLE_BOLD);
__pItems.at(i)->SetMultilineTextSize(multilineFontSize);
- RealignItem(__pItems.at(i));
+ RealignItem(__pItems.at(i), __pItems.at(i)->GetTextExtentSizeF());
}
return E_SUCCESS;
__pItems.at(i)->SetTextSize(fontSize, FONT_STYLE_BOLD);
__pItems.at(i)->SetMultilineTextSize(multilineFontSize);
- RealignItem(__pItems.at(i));
+ RealignItem(__pItems.at(i), __pItems.at(i)->GetTextExtentSizeF());
}
return E_SUCCESS;
}
}
- RealignItem(__pItems.at(i));
+ RealignItem(__pItems.at(i), __pItems.at(i)->GetTextExtentSizeF());
}
return E_SUCCESS;
if (__itemCount == 1)
{
+ float textExtentSize_0 = __pItems.at(0)->GetTextExtentSizeF();
+
if (__style == TOOLBAR_TITLE) // item 1, HEADER_STYLE_TITLE_BUTTON
{
blockWidth[0] = __titleTextArea.width;
&& __pItems.at(0)->GetBitmap(_BUTTON_STATUS_SELECTED) == null
&& __pItems.at(0)->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED) == null)) // at least 1 bitmap
{
- blockWidth[0] = __pItems.at(0)->GetTextExtentSizeF() + iconSizeWithText + sideMargin * 3;
+ blockWidth[0] = textExtentSize_0 + iconSizeWithText + sideMargin * 3;
}
else
{
- blockWidth[0] = __pItems.at(0)->GetTextExtentSizeF() + sideMargin * 2;
+ blockWidth[0] = textExtentSize_0 + sideMargin * 2;
}
if (blockWidth[0] > maxItemLength)
}
}
}
+
+ RealignItem(__pItems.at(0), textExtentSize_0);
}
else if(__itemCount == 2)
{
float itemGap = 0.0f;
+ float textExtentSize_0 = __pItems.at(0)->GetTextExtentSizeF();
+ float textExtentSize_1 = __pItems.at(1)->GetTextExtentSizeF();
+
GET_SHAPE_CONFIG(FOOTER::FOOTER_ITEM_WIDTH_2_MAX, GetOrientation(), maxItemLength);
GET_SHAPE_CONFIG(FOOTER::FOOTER_ITEM_WIDTH_2_MIN, GetOrientation(), minItemLength);
GET_SHAPE_CONFIG(FOOTER::FOOTER_ITEM_BUTTON_STYLE_ICON_SIZE_WITH_TEXT, GetOrientation(), iconSizeWithText);
&& __pItems.at(0)->GetBitmap(_BUTTON_STATUS_SELECTED) == null
&& __pItems.at(0)->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED) == null)) // at least 1 bitmap
{
- blockWidth[0] = __pItems.at(0)->GetTextExtentSizeF() + iconSizeWithText + sideMargin * 3;
+ blockWidth[0] = textExtentSize_0 + iconSizeWithText + sideMargin * 3;
}
else
{
- blockWidth[0] = __pItems.at(0)->GetTextExtentSizeF() + sideMargin * 2;
+ blockWidth[0] = textExtentSize_0 + sideMargin * 2;
}
if (blockWidth[0] > maxItemLength)
&& __pItems.at(1)->GetBitmap(_BUTTON_STATUS_SELECTED) == null
&& __pItems.at(1)->GetBitmap(_BUTTON_STATUS_HIGHLIGHTED) == null)) // at least 1 bitmap
{
- blockWidth[1] = __pItems.at(1)->GetTextExtentSizeF() + iconSizeWithText + sideMargin * 3;
+ blockWidth[1] = textExtentSize_1 + iconSizeWithText + sideMargin * 3;
}
else
{
- blockWidth[1] = __pItems.at(1)->GetTextExtentSizeF() + sideMargin * 2;
+ blockWidth[1] = textExtentSize_1 + sideMargin * 2;
}
if (blockWidth[1] > maxItemLength)
}
}
}
+
+ RealignItem(__pItems.at(0), textExtentSize_0);
+ RealignItem(__pItems.at(1), textExtentSize_1);
}
else if (__itemCount == 3)
{
existingBadgeIcon = null;
}
}
+
+ RealignItem(__pItems.at(i), __pItems.at(i)->GetTextExtentSizeF());
}
}
else if (__itemCount == 4)
existingBadgeIcon = null;
}
}
+
+ RealignItem(__pItems.at(i), __pItems.at(i)->GetTextExtentSizeF());
}
}
else if (__itemCount == 5)
existingBadgeIcon = null;
}
}
+
+ RealignItem(__pItems.at(i), __pItems.at(i)->GetTextExtentSizeF());
}
}
__pItems.at(i)->SetTextSize(fontSize, FONT_STYLE_BOLD);
__pItems.at(i)->SetMultilineTextSize(multilineFontSize);
-
- RealignItem(__pItems.at(i));
}
return E_SUCCESS;