Fix some window and scrollbox sizes

This commit is contained in:
GriffinR 2023-09-12 13:25:16 -04:00
parent 26620cd1d4
commit 0c47866e3d
5 changed files with 119 additions and 110 deletions

View file

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>600</width> <width>522</width>
<height>480</height> <height>493</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -23,49 +23,20 @@
<property name="title"> <property name="title">
<string>Miscellaneous</string> <string>Miscellaneous</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item row="0" column="3"> <item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="checkBox_OpenRecentProject">
<property name="text">
<string>Open recent project on launch</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="checkBox_MonitorProjectFiles"> <widget class="QCheckBox" name="checkBox_MonitorProjectFiles">
<property name="text"> <property name="text">
<string>Monitor project files</string> <string>Monitor project files</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item>
<spacer name="horizontalSpacer_2"> <widget class="QCheckBox" name="checkBox_OpenRecentProject">
<property name="orientation"> <property name="text">
<enum>Qt::Horizontal</enum> <string>Open recent project on launch</string>
</property> </property>
<property name="sizeType"> </widget>
<enum>QSizePolicy::Maximum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
</layout> </layout>
</widget> </widget>
@ -117,8 +88,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>570</width> <width>492</width>
<height>322</height> <height>327</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">

View file

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>611</width> <width>600</width>
<height>1137</height> <height>600</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -29,7 +29,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>585</width> <width>585</width>
<height>1486</height> <height>585</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_5"> <layout class="QVBoxLayout" name="verticalLayout_5">

View file

@ -169,7 +169,7 @@
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_4"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="sizeConstraint"> <property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum> <enum>QLayout::SetMinimumSize</enum>
</property> </property>
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
@ -186,8 +186,8 @@
<item> <item>
<widget class="QGroupBox" name="groupBox_2"> <widget class="QGroupBox" name="groupBox_2">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>1</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
@ -201,7 +201,44 @@
<bool>false</bool> <bool>false</bool>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <layout class="QGridLayout" name="gridLayout_3">
<item row="13" column="3"> <item row="0" column="0">
<widget class="QLabel" name="label_BottomTop">
<property name="text">
<string>Bottom/Top</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="3">
<widget class="NoScrollComboBox" name="comboBox_metatileBehaviors"/>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_encounterType">
<property name="text">
<string>Encounter Type</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_terrainType">
<property name="text">
<string>Terrain Type</string>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="NoScrollComboBox" name="comboBox_terrainType"/>
</item>
<item row="12" column="0" colspan="2">
<widget class="QLabel" name="label_metatileLabel">
<property name="text">
<string>Metatile Label (Optional)</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="NoScrollComboBox" name="comboBox_layerType"/>
</item>
<item row="13" column="2">
<widget class="QToolButton" name="copyButton_metatileLabel"> <widget class="QToolButton" name="copyButton_metatileLabel">
<property name="toolTip"> <property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Copies the full metatile label to the clipboard.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Copies the full metatile label to the clipboard.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
@ -215,46 +252,29 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="13" column="0" colspan="3"> <item row="13" column="0" colspan="2">
<widget class="QLineEdit" name="lineEdit_metatileLabel"> <widget class="QLineEdit" name="lineEdit_metatileLabel">
<property name="clearButtonEnabled"> <property name="clearButtonEnabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="12" column="0" colspan="3"> <item row="0" column="1">
<widget class="QLabel" name="label_metatileLabel"> <widget class="QLabel" name="label_layerType">
<property name="text"> <property name="text">
<string>Metatile Label (Optional)</string> <string>Layer Type</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0"> <item row="2" column="0" colspan="2">
<widget class="QLabel" name="label_BottomTop"> <widget class="QLabel" name="label_metatileBehavior">
<property name="text"> <property name="text">
<string>Bottom/Top</string> <string>Metatile Behavior</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="9" column="0">
<spacer name="horizontalSpacer_5"> <widget class="NoScrollComboBox" name="comboBox_encounterType"/>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_encounterType">
<property name="text">
<string>Encounter Type</string>
</property>
</widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QGraphicsView" name="graphicsView_metatileLayers"> <widget class="QGraphicsView" name="graphicsView_metatileLayers">
@ -278,44 +298,17 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="0" colspan="3">
<widget class="NoScrollComboBox" name="comboBox_metatileBehaviors"/>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_layerType">
<property name="text">
<string>Layer Type</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="NoScrollComboBox" name="comboBox_encounterType"/>
</item>
<item row="2" column="0" colspan="3">
<widget class="QLabel" name="label_metatileBehavior">
<property name="text">
<string>Metatile Behavior</string>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="NoScrollComboBox" name="comboBox_terrainType"/>
</item>
<item row="1" column="2">
<widget class="NoScrollComboBox" name="comboBox_layerType"/>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_terrainType">
<property name="text">
<string>Terrain Type</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title"> <property name="title">
<string>Tile Properties</string> <string>Tile Properties</string>
</property> </property>
@ -331,7 +324,14 @@
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QSpinBox" name="spinBox_paletteSelector"/> <widget class="QSpinBox" name="spinBox_paletteSelector">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="label_2"> <widget class="QLabel" name="label_2">
@ -364,7 +364,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0"> <item row="4" column="0">
<widget class="QLabel" name="label_7"> <widget class="QLabel" name="label_7">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -377,7 +377,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0" colspan="2"> <item row="5" column="0" colspan="2">
<widget class="QGraphicsView" name="graphicsView_selectedTile"> <widget class="QGraphicsView" name="graphicsView_selectedTile">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
@ -402,6 +402,32 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="6" column="0">
<spacer name="verticalSpacer_6">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@ -410,6 +436,12 @@
</item> </item>
<item> <item>
<widget class="QScrollArea" name="scrollArea_Tiles"> <widget class="QScrollArea" name="scrollArea_Tiles">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="widgetResizable"> <property name="widgetResizable">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -419,7 +451,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>411</width> <width>411</width>
<height>247</height> <height>272</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">

View file

@ -17,6 +17,8 @@ PreferenceEditor::PreferenceEditor(QWidget *parent) :
ui->setupUi(this); ui->setupUi(this);
auto *formLayout = new QFormLayout(ui->groupBox_Themes); auto *formLayout = new QFormLayout(ui->groupBox_Themes);
themeSelector = new NoScrollComboBox(ui->groupBox_Themes); themeSelector = new NoScrollComboBox(ui->groupBox_Themes);
themeSelector->setEditable(false);
themeSelector->setMinimumContentsLength(0);
formLayout->addRow("Themes", themeSelector); formLayout->addRow("Themes", themeSelector);
setAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_DeleteOnClose);
connect(ui->buttonBox, &QDialogButtonBox::clicked, connect(ui->buttonBox, &QDialogButtonBox::clicked,

View file

@ -117,6 +117,7 @@ void TilesetEditor::setAttributesUi() {
for (int num : project->metatileBehaviorMapInverse.keys()) { for (int num : project->metatileBehaviorMapInverse.keys()) {
this->ui->comboBox_metatileBehaviors->addItem(project->metatileBehaviorMapInverse[num], num); this->ui->comboBox_metatileBehaviors->addItem(project->metatileBehaviorMapInverse[num], num);
} }
this->ui->comboBox_metatileBehaviors->setMinimumContentsLength(0);
} else { } else {
this->ui->comboBox_metatileBehaviors->setVisible(false); this->ui->comboBox_metatileBehaviors->setVisible(false);
this->ui->label_metatileBehavior->setVisible(false); this->ui->label_metatileBehavior->setVisible(false);
@ -129,6 +130,7 @@ void TilesetEditor::setAttributesUi() {
this->ui->comboBox_terrainType->addItem("Water", TERRAIN_WATER); this->ui->comboBox_terrainType->addItem("Water", TERRAIN_WATER);
this->ui->comboBox_terrainType->addItem("Waterfall", TERRAIN_WATERFALL); this->ui->comboBox_terrainType->addItem("Waterfall", TERRAIN_WATERFALL);
this->ui->comboBox_terrainType->setEditable(false); this->ui->comboBox_terrainType->setEditable(false);
this->ui->comboBox_terrainType->setMinimumContentsLength(0);
} else { } else {
this->ui->comboBox_terrainType->setVisible(false); this->ui->comboBox_terrainType->setVisible(false);
this->ui->label_terrainType->setVisible(false); this->ui->label_terrainType->setVisible(false);
@ -140,6 +142,7 @@ void TilesetEditor::setAttributesUi() {
this->ui->comboBox_encounterType->addItem("Land", ENCOUNTER_LAND); this->ui->comboBox_encounterType->addItem("Land", ENCOUNTER_LAND);
this->ui->comboBox_encounterType->addItem("Water", ENCOUNTER_WATER); this->ui->comboBox_encounterType->addItem("Water", ENCOUNTER_WATER);
this->ui->comboBox_encounterType->setEditable(false); this->ui->comboBox_encounterType->setEditable(false);
this->ui->comboBox_encounterType->setMinimumContentsLength(0);
} else { } else {
this->ui->comboBox_encounterType->setVisible(false); this->ui->comboBox_encounterType->setVisible(false);
this->ui->label_encounterType->setVisible(false); this->ui->label_encounterType->setVisible(false);
@ -151,6 +154,7 @@ void TilesetEditor::setAttributesUi() {
this->ui->comboBox_layerType->addItem("Covered - Bottom/Middle", METATILE_LAYER_BOTTOM_MIDDLE); this->ui->comboBox_layerType->addItem("Covered - Bottom/Middle", METATILE_LAYER_BOTTOM_MIDDLE);
this->ui->comboBox_layerType->addItem("Split - Bottom/Top", METATILE_LAYER_BOTTOM_TOP); this->ui->comboBox_layerType->addItem("Split - Bottom/Top", METATILE_LAYER_BOTTOM_TOP);
this->ui->comboBox_layerType->setEditable(false); this->ui->comboBox_layerType->setEditable(false);
this->ui->comboBox_layerType->setMinimumContentsLength(0);
if (!Metatile::getLayerTypeMask()) { if (!Metatile::getLayerTypeMask()) {
// User doesn't have triple layer metatiles, but has no layer type attribute. // User doesn't have triple layer metatiles, but has no layer type attribute.
// Porymap is still using the layer type value to render metatiles, and with // Porymap is still using the layer type value to render metatiles, and with