mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 00:37:51 -06:00
Merge remote-tracking branch 'origin/master' into ys_unsaved_changes
This commit is contained in:
commit
4d053cc4ee
148 changed files with 13789 additions and 3328 deletions
|
@ -174,7 +174,6 @@ wxMenuItem* append_menu_check_item(wxMenu* menu, int id, const wxString& string,
|
|||
|
||||
const unsigned int wxCheckListBoxComboPopup::DefaultWidth = 200;
|
||||
const unsigned int wxCheckListBoxComboPopup::DefaultHeight = 200;
|
||||
const unsigned int wxCheckListBoxComboPopup::DefaultItemHeight = 18;
|
||||
|
||||
bool wxCheckListBoxComboPopup::Create(wxWindow* parent)
|
||||
{
|
||||
|
@ -198,17 +197,22 @@ wxString wxCheckListBoxComboPopup::GetStringValue() const
|
|||
|
||||
wxSize wxCheckListBoxComboPopup::GetAdjustedSize(int minWidth, int prefHeight, int maxHeight)
|
||||
{
|
||||
// matches owner wxComboCtrl's width
|
||||
// and sets height dinamically in dependence of contained items count
|
||||
// set width dinamically in dependence of items text
|
||||
// and set height dinamically in dependence of items count
|
||||
|
||||
wxComboCtrl* cmb = GetComboCtrl();
|
||||
if (cmb != nullptr)
|
||||
{
|
||||
if (cmb != nullptr) {
|
||||
wxSize size = GetComboCtrl()->GetSize();
|
||||
|
||||
unsigned int count = GetCount();
|
||||
if (count > 0)
|
||||
size.SetHeight(count * DefaultItemHeight);
|
||||
if (count > 0) {
|
||||
int max_width = size.x;
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
max_width = std::max(max_width, 60 + GetTextExtent(GetString(i)).x);
|
||||
}
|
||||
size.SetWidth(max_width);
|
||||
size.SetHeight(count * cmb->GetCharHeight());
|
||||
}
|
||||
else
|
||||
size.SetHeight(DefaultHeight);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue