mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-10 00:07:52 -06:00
Update wxWidgets to v3.2.1 (#2905)
* Upgrade wxWidgets to 3.2.1
Based on prusa3d/PrusaSlicer@9a7e024
Co-authored-by: tamasmeszaros <meszaros.q@gmail.com>
* Implement BitmapCache
* update wxExtensions while keeping legacy items
* update dc.DrawBitmap calls to use get_bitmap
* Fix GetSize/Width/Height calls
* update BitmapComboBox
* fix ifndef in wxExtensions.hpp
* update my todos to OcraftyoneTODO
* Get to a compilable state
Everything seems to be working (including the plater). I am not seeing any graphical issues
* fix extruder color icons
* fix crash on opening support tab
* remove GetBmpSize method from DropDown.cpp
* Update TextInput to use bitmap bundles
* update a TODO after testing
* fix the rendering of the icons on combobox
* fix a few todos
* fix WipeTowerDialog.cpp
* Overhaul WipeTowerDialog
Removed simple version of the dialog since BBS removed the functionality but left the code.
Center the table (only seen when the table is smaller than the minimum size of the dialog)
Fix issue where editing a value causes the m_min_flush_label to change colors slightly
Fix an issue where changing a value or running an auto calc changes the disabled value from "-" to "0"
* update a few todos
* Update some todos
* Show dropdown when editing is started
* Update NanoSVG.cmake
Update NanoSVG to work with PR #2780
* Dim the icon on ComboBox when disabled
* solve ObjectDataViewModel todos
leaving colPrint and colEditing cases alone as it does not seem to impact anything
* Update names in wxExtensions
-Rename msw_rescale to sys_color_changed
-Replace GetBmpSize, GetBmpWidth, GetBmpHeight with renamed version (same name without "Bmp")
Both of these changes were also made by PrusaSlicer.
Original Commit: Prusa3D/PrusaSlicer@066b567
Co-authored-by: YuSanka <yusanka@gmail.com>
* update BitmapCache::from_svg
disable finding bundle in the cache to match load_svg
update to match values used in load_svg
* Update ScalableButton
change the signature and remove functions/vars pertaining to a default bmp
fix TODOs in ScalableButton
Original Commit: Prusa3D/PrusaSlicer@066b567
Co-authored-by: YuSanka <yusanka@gmail.com>
* fix up some more todos in wxExtensions
* update ScalableBitmap to use bmp bundles
use wxBitmapBundle by default
add flag to use old scaled bitmap function (specifically to solve issue with advanced toggle)
* attempt to fix macos deps build
* fix ubuntu build
* Revert "attempt to fix macos deps build"
Mistakenly made change to wrong file
This reverts commit d9c20b5121
.
* update wxWidgets patch
an attempt to fix macOS build
* Remove duplicate variable from OrcaSlicer.cpp
* Fix macOS build issue
* Fix blank DataViewItem being added to objects list
* Filament ComboBox editor updates
-Add show drop down feature to ObjectTable
-Call finish editing when ComboBox is closed in ObjectList
* remove Apple specific declarations missed during refactor
* delete old wxWidgets patch
* fix ubuntu seg fault
* include patch from #2926
* update patch to include wxWidgets/wxWidgets@991a74c
* fix deps not compiling on Windows
* update WipeTowerDialog
relocates the recalculate button back to its previous position
changes the wording of the tip message label
add spacing below the matrix
* finish patching wxWidgets
from prusa3d/PrusaSlicer@f8477d1 and prusa3d/PrusaSlicer@066b567
Co-authored-by: YuSanka <yusanka@gmail.com>
* fix combobox crash
* revert outside plate changes
---------
Co-authored-by: tamasmeszaros <meszaros.q@gmail.com>
Co-authored-by: YuSanka <yusanka@gmail.com>
This commit is contained in:
parent
0bf65aa217
commit
25a055491e
98 changed files with 1639 additions and 6221 deletions
|
@ -28,12 +28,12 @@ static bool is_point_in_rect(const wxPoint& pt, const wxRect& rect)
|
|||
rect.GetTop() <= pt.y && pt.y <= rect.GetBottom();
|
||||
}
|
||||
|
||||
static wxSize get_bitmap_size(const wxBitmap& bmp)
|
||||
static wxSize get_bitmap_size(const wxBitmapBundle* bmp, wxWindow* parent)
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
return bmp.GetScaledSize();
|
||||
#ifndef __WIN32__
|
||||
return bmp->GetBitmapFor(parent).GetSize();
|
||||
#else
|
||||
return bmp.GetSize();
|
||||
return bmp->GetDefaultSize();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -58,8 +58,8 @@ OG_CustomCtrl::OG_CustomCtrl( wxWindow* parent,
|
|||
m_v_gap2 = lround(0.8 * m_em_unit);
|
||||
m_h_gap = lround(0.2 * m_em_unit);
|
||||
|
||||
//m_bmp_mode_sz = get_bitmap_size(create_scaled_bitmap("mode_simple", this, wxOSX ? 10 : 12));
|
||||
m_bmp_blinking_sz = get_bitmap_size(create_scaled_bitmap("blank_16", this));
|
||||
//m_bmp_mode_sz = get_bitmap_size(get_bmp_bundle("mode_simple", wxOSX ? 10 : 12), this);
|
||||
m_bmp_blinking_sz = get_bitmap_size(get_bmp_bundle("blank_16"), this);
|
||||
|
||||
init_ctrl_lines();// from og.lines()
|
||||
|
||||
|
@ -572,8 +572,8 @@ void OG_CustomCtrl::msw_rescale()
|
|||
m_v_gap2 = lround(0.8 * m_em_unit);
|
||||
m_h_gap = lround(0.2 * m_em_unit);
|
||||
|
||||
//m_bmp_mode_sz = create_scaled_bitmap("mode_simple", this, wxOSX ? 10 : 12).GetSize();
|
||||
m_bmp_blinking_sz = create_scaled_bitmap("blank_16", this).GetSize();
|
||||
//m_bmp_mode_sz = get_bitmap_size(get_bmp_bundle("mode_simple", wxOSX ? 10 : 12), this);
|
||||
m_bmp_blinking_sz = get_bitmap_size(get_bmp_bundle("blank_16"), this);
|
||||
|
||||
m_max_win_width = 0;
|
||||
|
||||
|
@ -666,7 +666,7 @@ void OG_CustomCtrl::CtrlLine::msw_rescale()
|
|||
{
|
||||
// if we have a single option with no label, no sidetext
|
||||
if (draw_just_act_buttons)
|
||||
height = get_bitmap_size(create_scaled_bitmap("empty")).GetHeight();
|
||||
height = get_bitmap_size(get_bmp_bundle("empty"), ctrl).GetHeight();
|
||||
|
||||
if (ctrl->opt_group->label_width != 0 && !og_line.label.IsEmpty()) {
|
||||
wxSize label_sz = ctrl->GetTextExtent(og_line.label);
|
||||
|
@ -748,7 +748,7 @@ void OG_CustomCtrl::CtrlLine::render(wxDC& dc, wxCoord h_pos, wxCoord v_pos)
|
|||
if (field && field->undo_bitmap())
|
||||
//if (field)
|
||||
// BBS: new layout
|
||||
draw_act_bmps(dc, wxPoint(h_pos, v_pos), field->undo_to_sys_bitmap()->bmp(), field->undo_bitmap()->bmp(), field->blink());
|
||||
draw_act_bmps(dc, wxPoint(h_pos, v_pos), field->undo_to_sys_bitmap()->get_bitmap(), field->undo_bitmap()->get_bitmap(), field->blink());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -802,7 +802,7 @@ void OG_CustomCtrl::CtrlLine::render(wxDC& dc, wxCoord h_pos, wxCoord v_pos)
|
|||
|
||||
auto draw_buttons = [&h_pos, &dc, &v_pos, this](Field* field, size_t bmp_rect_id = 0) {
|
||||
if (field && field->undo_to_sys_bitmap()) {
|
||||
h_pos = draw_act_bmps(dc, wxPoint(h_pos, v_pos), field->undo_to_sys_bitmap()->bmp(), field->undo_bitmap()->bmp(), field->blink(), bmp_rect_id);
|
||||
h_pos = draw_act_bmps(dc, wxPoint(h_pos, v_pos), field->undo_to_sys_bitmap()->get_bitmap(), field->undo_bitmap()->get_bitmap(), field->blink(), bmp_rect_id);
|
||||
}
|
||||
#ifndef DISABLE_BLINKING
|
||||
else if (field && !field->undo_to_sys_bitmap() && field->blink())
|
||||
|
@ -933,19 +933,19 @@ wxCoord OG_CustomCtrl::CtrlLine::draw_text(wxDC &dc, wxPoint pos, const wxString
|
|||
|
||||
wxPoint OG_CustomCtrl::CtrlLine::draw_blinking_bmp(wxDC& dc, wxPoint pos, bool is_blinking)
|
||||
{
|
||||
wxBitmap bmp_blinking = create_scaled_bitmap(is_blinking ? "blank_16" : "empty", ctrl);
|
||||
wxBitmapBundle* bmp_blinking = get_bmp_bundle(is_blinking ? "blank_16" : "empty");
|
||||
wxCoord h_pos = pos.x;
|
||||
wxCoord v_pos = pos.y + lround((height - get_bitmap_size(bmp_blinking).GetHeight()) / 2);
|
||||
wxCoord v_pos = pos.y + lround((height - get_bitmap_size(bmp_blinking, ctrl).GetHeight()) / 2);
|
||||
|
||||
dc.DrawBitmap(bmp_blinking, h_pos, v_pos);
|
||||
dc.DrawBitmap(bmp_blinking->GetBitmapFor(ctrl), h_pos, v_pos);
|
||||
|
||||
int bmp_dim = get_bitmap_size(bmp_blinking).GetWidth();
|
||||
int bmp_dim = get_bitmap_size(bmp_blinking, ctrl).GetWidth();
|
||||
|
||||
h_pos += bmp_dim + ctrl->m_h_gap;
|
||||
return wxPoint(h_pos, v_pos);
|
||||
}
|
||||
|
||||
wxCoord OG_CustomCtrl::CtrlLine::draw_act_bmps(wxDC& dc, wxPoint pos, const wxBitmap& bmp_undo_to_sys, const wxBitmap& bmp_undo, bool is_blinking, size_t rect_id)
|
||||
wxCoord OG_CustomCtrl::CtrlLine::draw_act_bmps(wxDC& dc, wxPoint pos, const wxBitmapBundle& bmp_undo_to_sys, const wxBitmapBundle& bmp_undo, bool is_blinking, size_t rect_id)
|
||||
{
|
||||
#ifndef DISABLE_BLINKING
|
||||
pos = draw_blinking_bmp(dc, pos, is_blinking);
|
||||
|
@ -953,11 +953,11 @@ wxCoord OG_CustomCtrl::CtrlLine::draw_act_bmps(wxDC& dc, wxPoint pos, const wxBi
|
|||
if (ctrl->opt_group->split_multi_line) { // BBS
|
||||
const std::vector<Option> &option_set = og_line.get_options();
|
||||
if (option_set.size() > 1)
|
||||
pos.y += lround(((height - ctrl->m_v_gap + ctrl->m_v_gap2) / option_set.size() - get_bitmap_size(bmp_undo).GetHeight()) / 2);
|
||||
pos.y += lround(((height - ctrl->m_v_gap + ctrl->m_v_gap2) / option_set.size() - get_bitmap_size(&bmp_undo, ctrl).GetHeight()) / 2);
|
||||
else
|
||||
pos.y += lround((height - get_bitmap_size(bmp_undo).GetHeight()) / 2);
|
||||
pos.y += lround((height - get_bitmap_size(&bmp_undo, ctrl).GetHeight()) / 2);
|
||||
} else {
|
||||
pos.y += lround((height - get_bitmap_size(bmp_undo).GetHeight()) / 2);
|
||||
pos.y += lround((height - get_bitmap_size(&bmp_undo, ctrl).GetHeight()) / 2);
|
||||
}
|
||||
#endif
|
||||
wxCoord h_pos = pos.x;
|
||||
|
@ -965,16 +965,16 @@ wxCoord OG_CustomCtrl::CtrlLine::draw_act_bmps(wxDC& dc, wxPoint pos, const wxBi
|
|||
|
||||
#ifndef DISABLE_UNDO_SYS
|
||||
//BBS: GUI refactor
|
||||
dc.DrawBitmap(bmp_undo_to_sys, h_pos, v_pos);
|
||||
dc.DrawBitmap(bmp_undo_to_sys.GetBitmapFor(ctrl), h_pos, v_pos);
|
||||
|
||||
int bmp_dim = get_bitmap_size(bmp_undo_to_sys).GetWidth();
|
||||
int bmp_dim = get_bitmap_size(&bmp_undo_to_sys, ctrl).GetWidth();
|
||||
rects_undo_to_sys_icon[rect_id] = wxRect(h_pos, v_pos, bmp_dim, bmp_dim);
|
||||
|
||||
h_pos += bmp_dim + ctrl->m_h_gap;
|
||||
#endif
|
||||
dc.DrawBitmap(og_line.undo_to_sys ? bmp_undo_to_sys : bmp_undo, h_pos, v_pos);
|
||||
dc.DrawBitmap(og_line.undo_to_sys ? bmp_undo_to_sys.GetBitmapFor(ctrl) : bmp_undo.GetBitmapFor(ctrl), h_pos, v_pos);
|
||||
|
||||
int bmp_dim2 = get_bitmap_size(bmp_undo).GetWidth();
|
||||
int bmp_dim2 = get_bitmap_size(&bmp_undo, ctrl).GetWidth();
|
||||
(og_line.undo_to_sys ? rects_undo_to_sys_icon[rect_id] : rects_undo_icon[rect_id]) = wxRect(h_pos, v_pos, bmp_dim2, bmp_dim2);
|
||||
|
||||
h_pos += bmp_dim2 + ctrl->m_h_gap;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue