Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
Use short double spin box for Vector3Edit, use ShortVector3Edit in Mo…
Browse files Browse the repository at this point in the history
…del panel
  • Loading branch information
SamVanheer committed Aug 20, 2023
1 parent 95a5df4 commit ef11c89
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ ModelPanel::ModelPanel(StudioModelAssetProvider* provider)
{
_ui.setupUi(this);

_ui.Origin->SetRange(std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max());
_ui.Origin->SetDecimals(6);

connect(_provider, &StudioModelAssetProvider::AssetChanged, this, &ModelPanel::OnAssetChanged);

connect(_ui.Origin, &qt::widgets::Vector3Edit::ValueChanged, this, &ModelPanel::OnOriginChanged);
connect(_ui.Origin, &qt::widgets::ShortVector3Edit::ValueChanged, this, &ModelPanel::OnOriginChanged);
connect(_ui.CenterOnWorldOrigin, &QPushButton::clicked, this, &ModelPanel::OnCenterOnWorldOrigin);
connect(_ui.AlignOnGround, &QPushButton::clicked, this, &ModelPanel::OnAlignOnGround);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>120</width>
<height>56</height>
<height>61</height>
</rect>
</property>
<property name="windowTitle">
Expand All @@ -33,7 +33,18 @@
<number>0</number>
</property>
<item>
<widget class="qt::widgets::Vector3Edit" name="Origin" native="true"/>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Origin</string>
</property>
</widget>
</item>
<item>
<widget class="qt::widgets::ShortVector3Edit" name="Origin" native="true"/>
</item>
</layout>
</item>
<item>
<widget class="QPushButton" name="CenterOnWorldOrigin">
Expand Down Expand Up @@ -66,9 +77,9 @@
</widget>
<customwidgets>
<customwidget>
<class>qt::widgets::Vector3Edit</class>
<class>qt::widgets::ShortVector3Edit</class>
<extends>QWidget</extends>
<header>qt/widgets/Vector3Edit.hpp</header>
<header>qt/widgets/ShortVector3Edit.hpp</header>
<container>1</container>
</customwidget>
</customwidgets>
Expand Down
13 changes: 10 additions & 3 deletions src/hlam/qt/widgets/Vector3Edit.ui
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,23 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="XEdit"/>
<widget class="qt::widgets::ShortDoubleSpinBox" name="XEdit"/>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="YEdit"/>
<widget class="qt::widgets::ShortDoubleSpinBox" name="YEdit"/>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="ZEdit"/>
<widget class="qt::widgets::ShortDoubleSpinBox" name="ZEdit"/>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>qt::widgets::ShortDoubleSpinBox</class>
<extends>QDoubleSpinBox</extends>
<header>qt/widgets/ShortDoubleSpinBox.hpp</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

0 comments on commit ef11c89

Please sign in to comment.