@@ -93,32 +93,26 @@ void OvEditor::Panels::MenuBar::InitializeSettingsMenu()
9393 EDITOR_CONTEXT (uiManager)->ApplyStyle (static_cast <OvUI::Styling::EStyle>(p_value));
9494 };
9595
96- enum class EFontScale : uint32_t
97- {
98- EXTRA_SMALL = 50 ,
99- SMALL = 75 ,
100- MEDIUM = 100 ,
101- BIG = 150 ,
102- EXTRA_BIG = 200
103- };
104-
105- auto & fontSizeMenu = m_settingsMenu->CreateWidget <MenuList>(" Font Size" );
106- auto & fontSizeSelector = fontSizeMenu.CreateWidget <Selection::ComboBox>(static_cast <int >(Settings::EditorSettings::FontScale.Get ()));
107- fontSizeSelector.choices = {
108- { static_cast <int >(EFontScale::EXTRA_SMALL ), " Extra Small" },
109- { static_cast <int >(EFontScale::SMALL ), " Small" },
110- { static_cast <int >(EFontScale::MEDIUM ), " Medium" },
111- { static_cast <int >(EFontScale::BIG ), " Big" },
112- { static_cast <int >(EFontScale::EXTRA_BIG ), " Extra Big" },
113- };
114- fontSizeSelector.ValueChangedEvent += [this ](int p_value) {
115- Settings::EditorSettings::FontScale = p_value;
116- EDITOR_CONTEXT (uiManager)->SetFontScale (p_value / 100 .0f );
96+ auto & uiScale = themeButton.CreateWidget <Selection::ComboBox>(static_cast <int >(Settings::EditorSettings::UIScale.Get ()));
97+ uiScale.choices = {
98+ { 0 , " Automatic (DPI Aware)" },
99+ { 100 , " 100%" },
100+ { 150 , " 150%" },
101+ { 200 , " 200%" },
117102 };
118- auto & fontDpiScaling = fontSizeMenu.CreateWidget <OvUI::Widgets::Selection::CheckBox>(Settings::EditorSettings::FontDpiScaling, " Scale with DPI" );
119- fontDpiScaling.ValueChangedEvent += [this ](bool p_value) {
120- Settings::EditorSettings::FontDpiScaling = p_value;
121- EDITOR_CONTEXT (uiManager)->EnableDPIScaling (p_value);
103+ uiScale.ValueChangedEvent += [this ](int p_value) {
104+ Settings::EditorSettings::UIScale = p_value;
105+ if (p_value == 0 )
106+ {
107+ EDITOR_CONTEXT (uiManager)->DpiScaleUI ();
108+ }
109+ else
110+ {
111+ EDITOR_CONTEXT (uiManager)->SetUIScale (p_value / 100 .0f );
112+ }
113+ // EDITOR_EXEC(DelayAction([p_value]() {
114+ // EDITOR_CONTEXT(uiManager)->SetStyleScale(p_value / 100.0f);
115+ // }));
122116 };
123117
124118 m_settingsMenu->CreateWidget <MenuItem>(" Spawn actors at origin" , " " , true , true ).ValueChangedEvent += EDITOR_BIND (SetActorSpawnAtOrigin, std::placeholders::_1);
0 commit comments