mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
Revert to WxWidgets 3.1.5 (#3249)
* revert to WxWidgets 3.1.5 * update nanosvg unicode path
This commit is contained in:
parent
cc23ec6626
commit
374f78c768
95 changed files with 6841 additions and 1618 deletions
|
@ -29,7 +29,7 @@ END_EVENT_TABLE()
|
|||
*/
|
||||
|
||||
DropDown::DropDown(std::vector<wxString> &texts,
|
||||
std::vector<wxBitmapBundle> &icons)
|
||||
std::vector<wxBitmap> &icons)
|
||||
: texts(texts)
|
||||
, icons(icons)
|
||||
, state_handler(this)
|
||||
|
@ -44,7 +44,7 @@ DropDown::DropDown(std::vector<wxString> &texts,
|
|||
|
||||
DropDown::DropDown(wxWindow * parent,
|
||||
std::vector<wxString> &texts,
|
||||
std::vector<wxBitmapBundle> &icons,
|
||||
std::vector<wxBitmap> &icons,
|
||||
long style)
|
||||
: DropDown(texts, icons)
|
||||
{
|
||||
|
@ -188,6 +188,15 @@ void DropDown::paintNow()
|
|||
Refresh();
|
||||
}
|
||||
|
||||
static wxSize GetBmpSize(wxBitmap & bmp)
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
return bmp.GetScaledSize();
|
||||
#else
|
||||
return bmp.GetSize();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Here we do the actual rendering. I put it in a separate
|
||||
* method so that it can work no matter what type of DC
|
||||
|
@ -256,13 +265,13 @@ void DropDown::render(wxDC &dc)
|
|||
rcContent.x += 5;
|
||||
rcContent.width -= 5;
|
||||
if (check_bitmap.bmp().IsOk()) {
|
||||
auto szBmp = check_bitmap.GetSize();
|
||||
auto szBmp = check_bitmap.GetBmpSize();
|
||||
if (selection >= 0) {
|
||||
wxPoint pt = rcContent.GetLeftTop();
|
||||
pt.y += (rcContent.height - szBmp.y) / 2;
|
||||
pt.y += rowSize.y * selection;
|
||||
if (pt.y + szBmp.y > 0 && pt.y < size.y)
|
||||
dc.DrawBitmap(check_bitmap.get_bitmap(), pt);
|
||||
dc.DrawBitmap(check_bitmap.bmp(), pt);
|
||||
}
|
||||
rcContent.x += szBmp.x + 5;
|
||||
rcContent.width -= szBmp.x + 5;
|
||||
|
@ -277,17 +286,17 @@ void DropDown::render(wxDC &dc)
|
|||
if (rcContent.y > size.y) break;
|
||||
wxPoint pt = rcContent.GetLeftTop();
|
||||
auto & icon = icons[i];
|
||||
auto size2 = get_preferred_size(icon, m_parent);
|
||||
auto size2 = GetBmpSize(icon);
|
||||
if (iconSize.x > 0) {
|
||||
if (icon.IsOk()) {
|
||||
pt.y += (rcContent.height - size2.y) / 2;
|
||||
dc.DrawBitmap(icon.GetBitmapFor(m_parent), pt);
|
||||
dc.DrawBitmap(icon, pt);
|
||||
}
|
||||
pt.x += iconSize.x + 5;
|
||||
pt.y = rcContent.y;
|
||||
} else if (icon.IsOk()) {
|
||||
pt.y += (rcContent.height - size2.y) / 2;
|
||||
dc.DrawBitmap(icon.GetBitmapFor(m_parent), pt);
|
||||
dc.DrawBitmap(icon, pt);
|
||||
pt.x += size2.x + 5;
|
||||
pt.y = rcContent.y;
|
||||
}
|
||||
|
@ -317,7 +326,7 @@ void DropDown::messureSize()
|
|||
for (size_t i = 0; i < texts.size(); ++i) {
|
||||
wxSize size1 = text_off ? wxSize() : dc.GetMultiLineTextExtent(texts[i]);
|
||||
if (icons[i].IsOk()) {
|
||||
wxSize size2 = get_preferred_size(icons[i], m_parent);
|
||||
wxSize size2 = GetBmpSize(icons[i]);
|
||||
if (size2.x > iconSize.x) iconSize = size2;
|
||||
if (!align_icon) {
|
||||
size1.x += size2.x + (text_off ? 0 : 5);
|
||||
|
@ -329,7 +338,7 @@ void DropDown::messureSize()
|
|||
wxSize szContent = textSize;
|
||||
szContent.x += 10;
|
||||
if (check_bitmap.bmp().IsOk()) {
|
||||
auto szBmp = check_bitmap.GetSize();
|
||||
auto szBmp = check_bitmap.GetBmpSize();
|
||||
szContent.x += szBmp.x + 5;
|
||||
}
|
||||
if (iconSize.x > 0) szContent.x += iconSize.x + (text_off ? 0 : 5);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue