mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-03-23 18:54:01 +08:00
Simplify wxAuiToolBar::GetOverflowRect()
Don't call m_overflowSizerItem->GetRect() unnecessarily: all fields of overflow_rect were overwritten immediately after assigning the result of this call to it, so this was just useless. Also replace "cli_rect" with "cli_size" as we only used the size part anyhow. No real changes.
This commit is contained in:
@@ -2244,23 +2244,23 @@ int wxAuiToolBar::GetOverflowState() const
|
||||
|
||||
wxRect wxAuiToolBar::GetOverflowRect() const
|
||||
{
|
||||
wxRect cli_rect(wxPoint(0,0), GetClientSize());
|
||||
wxRect overflow_rect = m_overflowSizerItem->GetRect();
|
||||
const wxSize cli_size = GetClientSize();
|
||||
wxRect overflow_rect;
|
||||
int overflow_size = m_art->GetElementSizeForWindow(wxAUI_TBART_OVERFLOW_SIZE, this);
|
||||
|
||||
if (m_orientation == wxVERTICAL)
|
||||
{
|
||||
overflow_rect.y = cli_rect.height - overflow_size;
|
||||
overflow_rect.y = cli_size.y - overflow_size;
|
||||
overflow_rect.x = 0;
|
||||
overflow_rect.width = cli_rect.width;
|
||||
overflow_rect.width = cli_size.x;
|
||||
overflow_rect.height = overflow_size;
|
||||
}
|
||||
else
|
||||
{
|
||||
overflow_rect.x = cli_rect.width - overflow_size;
|
||||
overflow_rect.x = cli_size.x - overflow_size;
|
||||
overflow_rect.y = 0;
|
||||
overflow_rect.width = overflow_size;
|
||||
overflow_rect.height = cli_rect.height;
|
||||
overflow_rect.height = cli_size.y;
|
||||
}
|
||||
|
||||
return overflow_rect;
|
||||
|
||||
Reference in New Issue
Block a user