mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 12:41:20 -06:00 
			
		
		
		
	FIX:optimize the size of amsmapping item
Change-Id: I791d897c327b51991b203a58fab957cbe74b1b44
This commit is contained in:
		
							parent
							
								
									fba36c6a41
								
							
						
					
					
						commit
						94e097cd05
					
				
					 3 changed files with 34 additions and 26 deletions
				
			
		|  | @ -1,5 +1,12 @@ | |||
| <svg width="328" height="130" viewBox="0 0 328 130" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||||
| <path fill-rule="evenodd" clip-rule="evenodd" d="M4 0C1.79086 0 0 1.79086 0 4V126C0 128.209 1.79086 130 4 130H324C326.209 130 328 128.209 328 126V4C328 1.79086 326.209 0 324 0H4ZM6 2C3.79086 2 2 3.79086 2 6V98C2 100.209 3.79086 102 6 102H322C324.209 102 326 100.209 326 98V6C326 3.79086 324.209 2 322 2H6Z" fill="#595959"/> | ||||
| <circle cx="164" cy="114" r="10" fill="#D9D9D9"/> | ||||
| <path fill-rule="evenodd" clip-rule="evenodd" d="M164.349 112.484V110H168L168.001 113.597L164.349 112.484ZM167.998 118H164.346V113.033L167.998 114.145L167.998 118ZM160 110V114.967L163.652 113.855L163.651 110H160ZM163.651 117.999H160V115.516L163.652 114.402L163.651 117.999Z" fill="#545454"/> | ||||
| <svg width="230" height="78" viewBox="0 0 230 78" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||||
| <g clip-path="url(#clip0_7_8)"> | ||||
| <path fill-rule="evenodd" clip-rule="evenodd" d="M2.80488 0C1.25579 0 0 1.07452 0 2.4V75.6C0 76.9254 1.25579 78 2.80488 78H227.195C228.744 78 230 76.9254 230 75.6V2.4C230 1.07452 228.744 0 227.195 0H2.80488ZM4.20732 1.2C2.65822 1.2 1.40244 2.27452 1.40244 3.6V58.8C1.40244 60.1254 2.65822 61.2 4.20732 61.2H225.793C227.342 61.2 228.598 60.1254 228.598 58.8V3.6C228.598 2.27452 227.342 1.2 225.793 1.2H4.20732Z" fill="#595959"/> | ||||
| <path d="M115.012 77.0102C118.885 77.0102 122.024 73.8739 122.024 70.0051C122.024 66.1363 118.885 63 115.012 63C111.139 63 108 66.1363 108 70.0051C108 73.8739 111.139 77.0102 115.012 77.0102Z" fill="#D9D9D9"/> | ||||
| <path fill-rule="evenodd" clip-rule="evenodd" d="M115.257 68.9431V67.2031H117.817L117.818 69.7228L115.257 68.9431ZM117.816 72.8071H115.255V69.3277L117.816 70.1067V72.8071ZM112.207 67.2031V70.6825L114.768 69.9035L114.767 67.2031H112.207ZM114.767 72.8064H112.207V71.0671L114.768 70.2867L114.767 72.8064Z" fill="#545454"/> | ||||
| </g> | ||||
| <defs> | ||||
| <clipPath id="clip0_7_8"> | ||||
| <rect width="230" height="78" fill="white"/> | ||||
| </clipPath> | ||||
| </defs> | ||||
| </svg> | ||||
|  |  | |||
| Before Width: | Height: | Size: 773 B After Width: | Height: | Size: 1.2 KiB | 
|  | @ -209,9 +209,9 @@ void MaterialItem::doRender(wxDC &dc) | |||
|  AmsMapingPopup::AmsMapingPopup(wxWindow *parent)  | ||||
|     : PopupWindow(parent, wxBORDER_NONE) | ||||
|  { | ||||
|      SetSize(wxSize(FromDIP(360), -1)); | ||||
|      SetMinSize(wxSize(FromDIP(360), -1)); | ||||
|      SetMaxSize(wxSize(FromDIP(360), -1)); | ||||
|      SetSize(wxSize(FromDIP(252), -1)); | ||||
|      SetMinSize(wxSize(FromDIP(252), -1)); | ||||
|      SetMaxSize(wxSize(FromDIP(252), -1)); | ||||
|      Bind(wxEVT_PAINT, &AmsMapingPopup::paintEvent, this); | ||||
| 
 | ||||
| 
 | ||||
|  | @ -245,11 +245,11 @@ void MaterialItem::doRender(wxDC &dc) | |||
|      m_sizer_list = new wxBoxSizer(wxVERTICAL); | ||||
|      for (auto i = 0; i < AMS_TOTAL_COUNT; i++) { | ||||
|          auto sizer_mapping_list = new wxBoxSizer(wxHORIZONTAL); | ||||
|          auto ams_mapping_item_container = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("ams_mapping_container", this, 130), wxDefaultPosition, | ||||
|              wxSize(FromDIP(328), FromDIP(130)), 0); | ||||
|          auto ams_mapping_item_container = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("ams_mapping_container", this, 78), wxDefaultPosition, | ||||
|              wxSize(FromDIP(230), FromDIP(78)), 0); | ||||
|          ams_mapping_item_container->SetSizer(sizer_mapping_list); | ||||
|          ams_mapping_item_container->Layout(); | ||||
|          ams_mapping_item_container->Hide(); | ||||
|          //ams_mapping_item_container->Hide();
 | ||||
|          m_amsmapping_container_sizer_list.push_back(sizer_mapping_list); | ||||
|          m_amsmapping_container_list.push_back(ams_mapping_item_container); | ||||
|          m_sizer_list->Add(ams_mapping_item_container, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM, FromDIP(5)); | ||||
|  | @ -260,17 +260,18 @@ void MaterialItem::doRender(wxDC &dc) | |||
|      m_warning_text->SetFont(::Label::Body_12); | ||||
|      auto cant_not_match_tip = _L("Note: Only the AMS slots loaded with the same material type can be selected."); | ||||
|      m_warning_text->SetLabel(format_text(cant_not_match_tip)); | ||||
|      m_warning_text->SetMinSize(wxSize(FromDIP(280), FromDIP(-1))); | ||||
|      m_warning_text->Wrap(FromDIP(280)); | ||||
|      m_warning_text->SetMinSize(wxSize(FromDIP(248), FromDIP(-1))); | ||||
|      m_warning_text->Wrap(FromDIP(248)); | ||||
| 
 | ||||
|      m_sizer_main->Add(title_panel, 0, wxEXPAND | wxALL, FromDIP(2)); | ||||
|      m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(8)); | ||||
|      m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(5)); | ||||
|      m_sizer_main->Add(m_sizer_list, 0, wxEXPAND | wxALL, FromDIP(0)); | ||||
|      m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(8)); | ||||
|      m_sizer_main->Add(m_warning_text, 0, wxEXPAND | wxALL, FromDIP(10)); | ||||
|      m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(5)); | ||||
|      m_sizer_main->Add(m_warning_text, 0, wxEXPAND | wxALL, FromDIP(6)); | ||||
| 
 | ||||
|      SetSizer(m_sizer_main); | ||||
|      Layout(); | ||||
|      Fit(); | ||||
|  } | ||||
| 
 | ||||
|  wxString AmsMapingPopup::format_text(wxString &m_msg) | ||||
|  | @ -434,7 +435,7 @@ std::vector<TrayData> AmsMapingPopup::parse_ams_mapping(std::map<std::string, Am | |||
| 
 | ||||
| void AmsMapingPopup::add_ams_mapping(std::vector<TrayData> tray_data, wxWindow* container, wxBoxSizer* sizer) | ||||
| {  | ||||
|     sizer->Add(0,0,0,wxLEFT,FromDIP(8)); | ||||
|     sizer->Add(0,0,0,wxLEFT,FromDIP(6)); | ||||
|     for (auto i = 0; i < tray_data.size(); i++) { | ||||
| 
 | ||||
|         // set number
 | ||||
|  | @ -446,9 +447,9 @@ void AmsMapingPopup::add_ams_mapping(std::vector<TrayData> tray_data, wxWindow* | |||
| 
 | ||||
|         // set button
 | ||||
|         MappingItem *m_mapping_item = new MappingItem(container); | ||||
|         m_mapping_item->SetSize(wxSize(FromDIP(68), FromDIP(100))); | ||||
|         m_mapping_item->SetMinSize(wxSize(FromDIP(68), FromDIP(100))); | ||||
|         m_mapping_item->SetMaxSize(wxSize(FromDIP(68), FromDIP(100))); | ||||
|         m_mapping_item->SetSize(wxSize(FromDIP(68 * 0.7), FromDIP(100 * 0.6))); | ||||
|         m_mapping_item->SetMinSize(wxSize(FromDIP(68 * 0.7), FromDIP(100 * 0.6))); | ||||
|         m_mapping_item->SetMaxSize(wxSize(FromDIP(68 * 0.7), FromDIP(100 * 0.6))); | ||||
|         //m_mapping_item->SetCornerRadius(5);
 | ||||
|         m_mapping_item->SetFont(::Label::Body_12); | ||||
|         m_mapping_item_list.push_back(m_mapping_item); | ||||
|  | @ -491,8 +492,8 @@ void AmsMapingPopup::add_ams_mapping(std::vector<TrayData> tray_data, wxWindow* | |||
|         //sizer_mapping_item->Add(number, 0, wxALIGN_CENTER_HORIZONTAL, 0);
 | ||||
|         //sizer_mapping_item->Add(m_mapping_item, 0, wxALIGN_CENTER_HORIZONTAL, 0);
 | ||||
|         m_mapping_item->set_tray_index(wxGetApp().transition_tridid(tray_data[i].id)); | ||||
|         sizer->Add(0,0,0,wxRIGHT,FromDIP(8)); | ||||
|         sizer->Add(m_mapping_item, 0, wxTOP, FromDIP(2)); | ||||
|         sizer->Add(0,0,0,wxRIGHT,FromDIP(6)); | ||||
|         sizer->Add(m_mapping_item, 0, wxTOP, FromDIP(1)); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  | @ -576,7 +577,7 @@ void MappingItem::render(wxDC &dc) | |||
| #endif | ||||
| 
 | ||||
|     // materials name
 | ||||
|     dc.SetFont(::Label::Head_14); | ||||
|     dc.SetFont(::Label::Head_13); | ||||
| 
 | ||||
|     auto txt_colour = m_coloul.GetLuminance() < 0.5 ? *wxWHITE : wxColour(0x26, 0x2E, 0x30); | ||||
|     txt_colour      = m_unmatch ? wxColour(0xCE, 0xCE, 0xCE) : txt_colour; | ||||
|  | @ -589,12 +590,12 @@ void MappingItem::render(wxDC &dc) | |||
|     }*/ | ||||
| 
 | ||||
|     auto txt_size = dc.GetTextExtent(m_tray_index); | ||||
|     auto top = (GetSize().y - MAPPING_ITEM_REAL_SIZE.y) / 2 + FromDIP(16); | ||||
|     auto top = (GetSize().y - MAPPING_ITEM_REAL_SIZE.y) / 2 + FromDIP(8); | ||||
|     dc.DrawText(m_tray_index, wxPoint((GetSize().x - txt_size.x) / 2, top)); | ||||
| 
 | ||||
| 
 | ||||
|     top += txt_size.y + FromDIP(12); | ||||
|     dc.SetFont(::Label::Head_13); | ||||
|     top += txt_size.y + FromDIP(7); | ||||
|     dc.SetFont(::Label::Body_12); | ||||
|     txt_size = dc.GetTextExtent(m_name); | ||||
|     dc.DrawText(m_name, wxPoint((GetSize().x - txt_size.x) / 2, top)); | ||||
| } | ||||
|  |  | |||
|  | @ -42,7 +42,7 @@ namespace Slic3r { namespace GUI { | |||
| 
 | ||||
| #define MATERIAL_ITEM_SIZE wxSize(FromDIP(64), FromDIP(34)) | ||||
| #define MATERIAL_ITEM_REAL_SIZE wxSize(FromDIP(62), FromDIP(32)) | ||||
| #define MAPPING_ITEM_REAL_SIZE wxSize(FromDIP(68), FromDIP(76)) | ||||
| #define MAPPING_ITEM_REAL_SIZE wxSize(FromDIP(48), FromDIP(45)) | ||||
| #define AMS_TOTAL_COUNT 4 | ||||
| 
 | ||||
| enum TrayType { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 tao wang
						tao wang