mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-26 00:19:13 +00:00
Reduce size hint for ui::ComboBox
This commit is contained in:
parent
2cac6a0706
commit
65dd457847
@ -395,8 +395,8 @@ void ComboBox::onResize(ResizeEvent& ev)
|
||||
|
||||
void ComboBox::onSizeHint(SizeHintEvent& ev)
|
||||
{
|
||||
Size reqSize(0, 0);
|
||||
Size entrySize = m_entry->sizeHint();
|
||||
Size reqSize = entrySize;
|
||||
|
||||
// Get the text-length of every item and put in 'w' the maximum value
|
||||
ListItems::iterator it, end = m_items.end();
|
||||
@ -404,14 +404,11 @@ void ComboBox::onSizeHint(SizeHintEvent& ev)
|
||||
int item_w =
|
||||
2*guiscale()+
|
||||
font()->textLength((*it)->text().c_str())+
|
||||
10*guiscale();
|
||||
16*guiscale();
|
||||
|
||||
reqSize.w = MAX(reqSize.w, item_w);
|
||||
}
|
||||
|
||||
reqSize.w += entrySize.w;
|
||||
reqSize.h += entrySize.h;
|
||||
|
||||
Size buttonSize = m_button->sizeHint();
|
||||
reqSize.w += buttonSize.w;
|
||||
reqSize.h = MAX(reqSize.h, buttonSize.h);
|
||||
|
Loading…
Reference in New Issue
Block a user