Kaydet (Commit) c00a0a4f authored tarafından Miklos Vajna's avatar Miklos Vajna

sfx2 classification: set toolbar listbox width after inserting entries

This way GetOptimalSize() returns a size that allows reading the
selected item after selecting one. (The new width is the double of the
old one, or so.)

Change-Id: I5f935dcbee52844fb325bd74437479f759a85852
üst 900fccc2
......@@ -96,10 +96,7 @@ uno::Reference<awt::XWindow> ClassificationCategoriesController::createItemWindo
vcl::Window* pParent = VCLUnoHelper::GetWindow(rParent);
ToolBox* pToolbar = dynamic_cast<ToolBox*>(pParent);
if (pToolbar)
{
m_pCategories = VclPtr<ListBox>::Create(pToolbar, WB_CLIPCHILDREN|WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_DROPDOWN|WB_SIMPLEMODE);
m_pCategories->SetSizePixel(m_pCategories->GetOptimalSize());
}
return uno::Reference<awt::XWindow>(VCLUnoHelper::GetInterface(m_pCategories));
}
......@@ -119,6 +116,7 @@ void ClassificationCategoriesController::statusChanged(const frame::FeatureState
m_pCategories->InsertEntry(rName);
// Normally VclBuilder::makeObject() does this.
m_pCategories->EnableAutoSize(true);
m_pCategories->SetSizePixel(m_pCategories->GetOptimalSize());
}
} // namespace sfx2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment