Skip to content

Commit

Permalink
Background Editor Layout Improvements (#156)
Browse files Browse the repository at this point in the history
* Changes properties layout from vbox to form so it has two columns where that's needed like the name field.
* Adds the name label and a buddy field.
* Maps the name field to the tree node.
* Changes the tileset groupbox to fixed vertical size policy.
  • Loading branch information
RobertBColton authored Aug 24, 2020
1 parent ba3ca3b commit b597046
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
1 change: 1 addition & 0 deletions Editors/BackgroundEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ BackgroundEditor::BackgroundEditor(MessageModel* model, QWidget* parent)

connect(_ui->actionSave, &QAction::triggered, this, &BaseEditor::OnSave);

_nodeMapper->addMapping(_ui->nameEdit, TreeNode::kNameFieldNumber);
_resMapper->addMapping(_ui->smoothCheckBox, Background::kSmoothEdgesFieldNumber);
_resMapper->addMapping(_ui->preloadCheckBox, Background::kPreloadFieldNumber);
_resMapper->addMapping(_ui->tilesetGroupBox, Background::kUseAsTilesetFieldNumber);
Expand Down
32 changes: 24 additions & 8 deletions Editors/BackgroundEditor.ui
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,16 @@
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="propertiesLayout">
<property name="spacing">
<number>4</number>
</property>
<layout class="QFormLayout" name="propertiesLayout">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<property name="horizontalSpacing">
<number>4</number>
</property>
<property name="verticalSpacing">
<number>4</number>
</property>
<property name="leftMargin">
<number>4</number>
</property>
Expand All @@ -108,24 +111,24 @@
<property name="bottomMargin">
<number>4</number>
</property>
<item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="smoothCheckBox">
<property name="text">
<string>&amp;Smooth edges</string>
</property>
</widget>
</item>
<item>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="preloadCheckBox">
<property name="text">
<string>Pre&amp;load texture</string>
</property>
</widget>
</item>
<item>
<item row="3" column="0" colspan="2">
<widget class="QGroupBox" name="tilesetGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
Expand Down Expand Up @@ -352,6 +355,19 @@
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="nameLabel">
<property name="text">
<string>&amp;Name</string>
</property>
<property name="buddy">
<cstring>nameEdit</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="nameEdit"/>
</item>
</layout>
</item>
<item>
Expand Down

0 comments on commit b597046

Please sign in to comment.