MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / drawApplicationTab_

Method drawApplicationTab_

source/MRViewer/MRViewerSettingsPlugin.cpp:289–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287}
288
289void ViewerSettingsPlugin::drawApplicationTab_( float menuWidth )
290{
291 auto ribbonMenu = getViewerInstance().getMenuPluginAs<RibbonMenu>();
292 if ( !ribbonMenu )
293 return;
294 const float btnHalfSizeX = 168.0f * UI::scale();
295
296 drawSeparator_( _t( "Interface" ) );
297
298 drawLanguageSelector_();
299
300 const auto& style = ImGui::GetStyle();
301 ImGui::PushStyleVar( ImGuiStyleVar_ItemSpacing, { style.ItemSpacing.x, style.ItemSpacing.y * 1.5f } );
302 drawThemeSelector_();
303
304 ImGui::SetNextItemWidth( 200.0f * UI::scale() );
305 UI::drag<RatioUnit>( _tr( "UI Scale" ), tempUserScaling_, 0.01f, 0.5f, 4.0f );
306 if ( ImGui::IsItemDeactivatedAfterEdit() )
307 {
308 viewer->getMenuPlugin()->setUserScaling( tempUserScaling_ );
309 tempUserScaling_ = viewer->getMenuPlugin()->getUserScaling();
310 }
311
312 bool savedDialogsBackUp = viewer->getMenuPlugin()->isSavedDialogPositionsEnabled();
313 bool savedDialogsVal = savedDialogsBackUp;
314 UI::checkbox( _tr( "Save Tool Window Positions" ), &savedDialogsVal );
315 UI::setTooltipIfHovered( _tr( "If checked then enables using of saved positions of tool windows in the config file" ) );
316 ImGui::PopStyleVar();
317
318 if ( savedDialogsVal != savedDialogsBackUp )
319 viewer->getMenuPlugin()->enableSavedDialogPositions( savedDialogsVal );
320
321 if ( viewer->isMultiViewportAvailable() )
322 {
323 auto& config = Config::instance();
324 bool value = config.getBool( cDefaultMultiViewportKey, true );
325 if ( UI::checkbox( _tr( "Enable multi-windows" ), &value ) )
326 config.setBool( cDefaultMultiViewportKey, value );
327 UI::setTooltipIfHovered( _tr( "Allow tool windows to be moved outside the main window. To apply the changes, need to restart the application." ) );
328 }
329
330 if ( UI::button( _tr( "Toolbar Customize" ), Vector2f( btnHalfSizeX, 0 ) ) && ribbonMenu )
331 ribbonMenu->openToolbarCustomize();
332
333 drawSeparator_( _t( "Behavior" ) );
334
335 ImGui::SetNextItemWidth( menuWidth * 0.5f );
336 if ( ribbonMenu )
337 {
338 auto sceneObjectsListDrawer = ribbonMenu->getSceneObjectsList();
339 if ( sceneObjectsListDrawer )
340 {
341 UI::checkbox( _tr( "Make Visible on Select" ),
342 std::bind( &SceneObjectsListDrawer::getShowNewSelectedObjects, sceneObjectsListDrawer ),
343 std::bind( &SceneObjectsListDrawer::setShowNewSelectedObjects, sceneObjectsListDrawer, std::placeholders::_1 ) );
344 UI::checkbox( _tr( "Deselect on Hide" ),
345 std::bind( &SceneObjectsListDrawer::getDeselectNewHiddenObjects, sceneObjectsListDrawer ),
346 std::bind( &SceneObjectsListDrawer::setDeselectNewHiddenObjects, sceneObjectsListDrawer, std::placeholders::_1 ) );

Callers

nothing calls this directly

Calls 15

setTooltipIfHoveredFunction · 0.85
instanceFunction · 0.85
utf8stringFunction · 0.85
inputTextFunction · 0.85
LinkFunction · 0.85
OpenDocumentFunction · 0.85
ImVec2Class · 0.85
openFolderDialogFunction · 0.85
setUserScalingMethod · 0.80
getBoolMethod · 0.80
setBoolMethod · 0.80

Tested by

no test coverage detected