mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-20 07:11:12 -06:00 
			
		
		
		
	ENH:add show labels menu item
1. add show labels menu item at default menu 2. adjust flush option menu position Change-Id: I525db0b486885e1399c6fcd776195b502329c08b
This commit is contained in:
		
							parent
							
								
									f3968c5d99
								
							
						
					
					
						commit
						8222b86a32
					
				
					 1 changed files with 20 additions and 4 deletions
				
			
		|  | @ -779,7 +779,15 @@ void MenuFactory::append_menu_items_flush_options(wxMenu* menu) | |||
|             wxGetApp().obj_settings()->UpdateAndShow(true); | ||||
|         }, menu, []() {return true; }, [&select_object_config]() {const ConfigOption* option = select_object_config.option(FREQ_SETTINGS_BUNDLE_FFF["Flush options"][2]); return option->getBool(); }, m_parent); | ||||
| 
 | ||||
|     menu->Append(wxID_ANY, _L("Flush Options"), flush_options_menu); | ||||
|     size_t i = 0; | ||||
|     for (auto node = menu->GetMenuItems().GetFirst(); node; node = node->GetNext()) | ||||
|     { | ||||
|         i++; | ||||
|         wxMenuItem* item = node->GetData(); | ||||
|         if (item->GetItemLabelText() == "Edit in Parameter Table") | ||||
|             break; | ||||
|     } | ||||
|     menu->Insert(i, wxID_ANY, _L("Flush Options"), flush_options_menu); | ||||
| } | ||||
| 
 | ||||
| void MenuFactory::append_menu_items_convert_unit(wxMenu* menu) | ||||
|  | @ -897,6 +905,12 @@ void MenuFactory::create_default_menu() | |||
|     append_submenu(&m_default_menu, sub_menu, wxID_ANY, _L("Add Primitive"), "", "", | ||||
|         []() {return true; }, m_parent); | ||||
| #endif | ||||
| 
 | ||||
|     m_default_menu.AppendSeparator(); | ||||
| 
 | ||||
|     append_menu_check_item(&m_default_menu, wxID_ANY, _L("Show Labels"), "", | ||||
|         [](wxCommandEvent&) { plater()->show_view3D_labels(!plater()->are_view3D_labels_shown()); plater()->get_current_canvas3D()->post_event(SimpleEvent(wxEVT_PAINT)); }, &m_default_menu, | ||||
|         []() { return plater()->is_view3D_shown(); }, [this]() { return plater()->are_view3D_labels_shown(); }, m_parent); | ||||
| } | ||||
| 
 | ||||
| void MenuFactory::create_common_object_menu(wxMenu* menu) | ||||
|  | @ -1533,9 +1547,11 @@ void MenuFactory::update_object_menu() | |||
| 
 | ||||
| void MenuFactory::update_default_menu() | ||||
| { | ||||
|     const auto menu_item_id = m_default_menu.FindItem(_("Add Primitive")); | ||||
|     if (menu_item_id != wxNOT_FOUND) | ||||
|         m_default_menu.Destroy(menu_item_id); | ||||
|     for (auto& name : { _L("Add Primitive") , _L("Show Labels") }) { | ||||
|         const auto menu_item_id = m_default_menu.FindItem(name); | ||||
|         if (menu_item_id != wxNOT_FOUND) | ||||
|             m_default_menu.Destroy(menu_item_id); | ||||
|     } | ||||
|     create_default_menu(); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 liz.li
						liz.li