Improving window layouts (#532)

* improving component window layouts

* sound window update

* transform window update

* editor top gui animation; delete callback for entity tree

* layer window update

* other layout changes

* grid helper ini

* don't allow negative or zero local scale

* version bump

* camera fps config check if exists
This commit is contained in:
Turánszki János
2022-08-26 09:21:19 +02:00
committed by GitHub
parent e9debd0487
commit eff37576b5
47 changed files with 1165 additions and 105 deletions
+44 -2
View File
@@ -10,7 +10,7 @@ void DecalWindow::Create(EditorComponent* _editor)
{
editor = _editor;
wi::gui::Window::Create(ICON_DECAL " Decal", wi::gui::Window::WindowControls::COLLAPSE | wi::gui::Window::WindowControls::CLOSE);
SetSize(XMFLOAT2(300, 150));
SetSize(XMFLOAT2(300, 180));
closeButton.SetTooltip("Delete DecalComponent");
OnClose([=](wi::gui::EventArgs args) {
@@ -41,7 +41,7 @@ void DecalWindow::Create(EditorComponent* _editor)
y += step;
infoLabel.Create("");
infoLabel.SetText("Selecting decals will select the according material. Set decal properties (texture, color, etc.) in the Material window.");
infoLabel.SetText("Set decal properties (texture, color, etc.) in the Material window.");
infoLabel.SetSize(XMFLOAT2(300, 100));
infoLabel.SetPos(XMFLOAT2(10, y));
infoLabel.SetColor(wi::Color::Transparent());
@@ -70,3 +70,45 @@ void DecalWindow::SetEntity(Entity entity)
SetEnabled(false);
}
}
void DecalWindow::ResizeLayout()
{
wi::gui::Window::ResizeLayout();
const float padding = 4;
const float width = GetWidgetAreaSize().x;
float y = padding;
float jump = 20;
auto add = [&](wi::gui::Widget& widget) {
if (!widget.IsVisible())
return;
const float margin_left = 80;
const float margin_right = 40;
widget.SetPos(XMFLOAT2(margin_left, y));
widget.SetSize(XMFLOAT2(width - margin_left - margin_right, widget.GetScale().y));
y += widget.GetSize().y;
y += padding;
};
auto add_right = [&](wi::gui::Widget& widget) {
if (!widget.IsVisible())
return;
const float margin_right = padding;
widget.SetPos(XMFLOAT2(width - margin_right - widget.GetSize().x, y));
y += widget.GetSize().y;
y += padding;
};
auto add_fullwidth = [&](wi::gui::Widget& widget) {
if (!widget.IsVisible())
return;
const float margin_left = padding;
const float margin_right = padding;
widget.SetPos(XMFLOAT2(margin_left, y));
widget.SetSize(XMFLOAT2(width - margin_left - margin_right, widget.GetScale().y));
y += widget.GetSize().y;
y += padding;
};
add_fullwidth(infoLabel);
add_right(placementCheckBox);
}