|
|
@ -49,28 +49,24 @@ PANEL_PACKAGE::PANEL_PACKAGE( wxWindow* parent, const ActionCallback& aCallback, |
|
|
|
|
|
|
|
m_minHeight = GetMinHeight(); |
|
|
|
|
|
|
|
wxSizeEvent dummy; |
|
|
|
OnSize( dummy ); |
|
|
|
|
|
|
|
SetState( m_data.state ); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PANEL_PACKAGE::OnSize( wxSizeEvent& event ) |
|
|
|
{ |
|
|
|
Layout(); |
|
|
|
|
|
|
|
int nameLineHeight = m_name->GetTextExtent( "X" ).GetHeight(); |
|
|
|
double descLineHeight = m_desc->GetTextExtent( "X" ).GetHeight() * 1.2 /* leading */; |
|
|
|
|
|
|
|
m_desc->SetLabel( m_data.package.description ); |
|
|
|
m_desc->Wrap( m_desc->GetClientSize().GetWidth() - 10 ); |
|
|
|
descLineHeight = wxSplit( m_desc->GetLabel(), '\n' ).size() * descLineHeight; |
|
|
|
|
|
|
|
int nameLineHeight = m_name->GetTextExtent( "X" ).GetHeight(); |
|
|
|
wxSize minSize = GetMinSize(); |
|
|
|
minSize.y = std::max( nameLineHeight + KiROUND( descLineHeight ) + 15, m_minHeight ); |
|
|
|
SetMinSize( minSize ); |
|
|
|
|
|
|
|
wxSizeEvent dummy; |
|
|
|
OnSize( dummy ); |
|
|
|
|
|
|
|
SetState( m_data.state ); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void PANEL_PACKAGE::OnSize( wxSizeEvent& event ) |
|
|
|
{ |
|
|
|
Layout(); |
|
|
|
} |
|
|
|
|
|
|
|