Skip to content

Commit c1c43dc

Browse files
committed
+ Now all the new UI elements are stored in the ModernUI_widgets.cpp
* UI elements remake with style in one function and reuse in anothers. * Deleted unused local styling from UIMainForm.cpp
1 parent 8a44501 commit c1c43dc

File tree

9 files changed

+284
-537
lines changed

9 files changed

+284
-537
lines changed

src/Editors/LevelEditor/UI/Tools/UIObjectTool.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,19 @@ void UIObjectTool::HandleDragDrop()
8080

8181
void UIObjectTool::Draw()
8282
{
83+
float buttonHeight = XRay::ImGui::GetEditorSize(XRay::ImGui::EEditorSizes::ButtonSize);
8384
if (ImGui::Button("Multiple Append in World Center", { -1, 25 }))
8485
{
8586
m_MultiAppend = true;
8687
UIChooseForm::SelectItem(smObject, 512, 0);
8788
}
8889
ImGui::Separator();
8990

90-
const float TumblerWidth = ImGui::GetContentRegionAvail().x - (27 * 2);
91+
const float tumblerWidth = ImGui::GetContentRegionAvail().x - (27 * 2);
9192

9293
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0.0f, ImGui::GetStyle().ItemSpacing.y));
9394

94-
if (XRay::ImGui::TumblerButton("Random Append", m_RandomAppend, { TumblerWidth, 25 }))
95+
if (XRay::ImGui::ToggleButton("Random Append", m_RandomAppend, { tumblerWidth, buttonHeight }))
9596
{
9697
ParentTools->ActivateAppendRandom(m_RandomAppend);
9798
}
@@ -162,7 +163,7 @@ void UIObjectTool::Draw()
162163
m_RemoveTexture.destroy();
163164

164165
static bool ShowRefSel = false;
165-
XRay::ImGui::TumblerButton("Reference Select", ShowRefSel, { -1, 25 });
166+
XRay::ImGui::ToggleButton("Reference Select", ShowRefSel, { -1, buttonHeight });
166167

167168
if (ShowRefSel)
168169
{
@@ -175,7 +176,7 @@ void UIObjectTool::Draw()
175176
XSize /= 2;
176177

177178
static bool ShowSurf = false;
178-
XRay::ImGui::TumblerButton("Surface", ShowSurf, { -1, 25 });
179+
XRay::ImGui::ToggleButton("Surface", ShowSurf, { -1, buttonHeight });
179180
if (ShowSurf)
180181
{
181182
if (ImGui::Button("Clear Select", ImVec2(XSize, 0)))
@@ -196,7 +197,7 @@ void UIObjectTool::Draw()
196197
}
197198

198199
static bool ShowCurObject = false;
199-
XRay::ImGui::TumblerButton("Current Object", ShowCurObject, { -1, 25 });
200+
XRay::ImGui::ToggleButton("Current Object", ShowCurObject, { -1, buttonHeight });
200201
if (ShowCurObject)
201202
{
202203
if (ImGui::Button("Select", ImVec2(XSize, 0)))

src/Editors/LevelEditor/UI/Tools/UISpawnTool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ UISpawnTool::~UISpawnTool()
1818
void UISpawnTool::Draw()
1919
{
2020
static bool ShowRefSel = false;
21-
XRay::ImGui::TumblerButton("Reference Select", ShowRefSel, { -1, 25 });
21+
XRay::ImGui::ToggleButton("Reference Select", ShowRefSel, { -1, XRay::ImGui::GetEditorSize(XRay::ImGui::EEditorSizes::ButtonSize) });
2222

2323
if (ShowRefSel)
2424
{

0 commit comments

Comments
 (0)