This commit is contained in:
Vojtech Bubnik 2021-12-02 16:40:26 +01:00
commit a6202c8f16
9 changed files with 139 additions and 8 deletions

View file

@ -1398,7 +1398,7 @@ void MainFrame::init_menubar_as_editor()
if (!input_files.IsEmpty())
m_plater->sidebar().obj_list()->load_shape_object_from_gallery(input_files);
}
}, "cog", nullptr, []() {return true; }, this);
}, "shape_gallery", nullptr, []() {return true; }, this);
windowMenu->AppendSeparator();
append_menu_item(windowMenu, wxID_ANY, _L("Print &Host Upload Queue") + "\tCtrl+J", _L("Display the Print Host Upload Queue window"),

View file

@ -46,10 +46,10 @@ struct InfoItemAtributes {
const std::map<InfoItemType, InfoItemAtributes> INFO_ITEMS{
// info_item Type info_item Name info_item BitmapName
{ InfoItemType::CustomSupports, {L("Paint-on supports"), "fdm_supports" }, },
{ InfoItemType::CustomSeam, {L("Paint-on seam"), "seam" }, },
{ InfoItemType::MmuSegmentation, {L("Multimaterial painting"), "mmu_segmentation"}, },
{ InfoItemType::Sinking, {L("Sinking"), "support_blocker"}, },
{ InfoItemType::CustomSupports, {L("Paint-on supports"), "fdm_supports_" }, },
{ InfoItemType::CustomSeam, {L("Paint-on seam"), "seam_" }, },
{ InfoItemType::MmuSegmentation, {L("Multimaterial painting"), "mmu_segmentation_"}, },
{ InfoItemType::Sinking, {L("Sinking"), "sinking"}, },
{ InfoItemType::VariableLayerHeight, {L("Variable layer height"), "layers"}, },
};
@ -1682,6 +1682,9 @@ void ObjectDataViewModel::Rescale()
m_warning_bmp = create_scaled_bitmap(WarningIcon);
m_warning_manifold_bmp = create_scaled_bitmap(WarningManifoldIcon);
for (auto item : INFO_ITEMS)
m_info_bmps[item.first] = create_scaled_bitmap(item.second.bmp_name);
wxDataViewItemArray all_items;
GetAllChildren(wxDataViewItem(0), all_items);
@ -1705,6 +1708,8 @@ void ObjectDataViewModel::Rescale()
node->m_bmp = create_scaled_bitmap(LayerRootIcon);
case itLayer:
node->m_bmp = create_scaled_bitmap(LayerIcon);
case itInfo:
node->m_bmp = m_info_bmps.at(node->m_info_item_type);
break;
default: break;
}

View file

@ -236,6 +236,7 @@ void ObjectInfo::show_sizer(bool show)
void ObjectInfo::msw_rescale()
{
manifold_warning_icon->SetBitmap(create_scaled_bitmap(m_warning_icon_name));
info_icon->SetBitmap(create_scaled_bitmap("info"));
}
void ObjectInfo::update_warning_icon(const std::string& warning_icon_name)
@ -1134,6 +1135,7 @@ void Sidebar::sys_color_changed()
for (wxWindow* win : std::vector<wxWindow*>{ this, p->sliced_info->GetStaticBox(), p->object_info->GetStaticBox(), p->btn_reslice, p->btn_export_gcode })
wxGetApp().UpdateDarkUI(win);
p->object_info->msw_rescale();
for (wxWindow* win : std::vector<wxWindow*>{ p->scrolled, p->presets_panel })
wxGetApp().UpdateAllStaticTextDarkUI(win);
for (wxWindow* btn : std::vector<wxWindow*>{ p->btn_reslice, p->btn_export_gcode })

View file

@ -35,9 +35,16 @@ std::string substitute_host(const std::string& orig_addr, const std::string sub_
// userinfo
size_t at = orig_addr.find("@");
host_start = (at != std::string::npos && at > host_start ? at + 1 : host_start);
// end of host, could be port, subpath (could be query or fragment?)
size_t host_end = orig_addr.find_first_of(":/?#", host_start);
host_end = (host_end == std::string::npos ? orig_addr.length() : host_end);
// end of host, could be port(:), subpath(/) (could be query(?) or fragment(#)?)
// or it will be ']' if address is ipv6 )
size_t potencial_host_end = orig_addr.find_first_of(":/", host_start);
// if there are more ':' it must be ipv6
if (potencial_host_end != std::string::npos && orig_addr[potencial_host_end] == ':' && orig_addr.rfind(':') != potencial_host_end) {
size_t ipv6_end = orig_addr.find(']', host_start);
// DK: Uncomment and replace orig_addr.length() if we want to allow subpath after ipv6 without [] parentheses.
potencial_host_end = (ipv6_end != std::string::npos ? ipv6_end + 1 : orig_addr.length()); //orig_addr.find('/', host_start));
}
size_t host_end = (potencial_host_end != std::string::npos ? potencial_host_end : orig_addr.length());
// now host_start and host_end should mark where to put resolved addr
// check host_start. if its nonsense, lets just use original addr (or resolved addr?)
if (host_start >= orig_addr.length()) {