mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-06 03:25:36 +00:00
Qt: Fix sizing of patch detail widgets
This commit is contained in:
parent
0ee3f235b6
commit
54444475f5
@ -6,82 +6,44 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>541</width>
|
<width>480</width>
|
||||||
<height>112</height>
|
<height>92</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
|
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="0,1">
|
<property name="minimumSize">
|
||||||
<item>
|
<size>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<width>480</width>
|
||||||
<item>
|
<height>0</height>
|
||||||
<widget class="QLabel" name="name">
|
</size>
|
||||||
<property name="sizePolicy">
|
</property>
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<horstretch>0</horstretch>
|
<item row="0" column="1">
|
||||||
<verstretch>0</verstretch>
|
<widget class="QCheckBox" name="enabled">
|
||||||
</sizepolicy>
|
<property name="text">
|
||||||
</property>
|
<string>Enabled</string>
|
||||||
<property name="font">
|
</property>
|
||||||
<font>
|
</widget>
|
||||||
<pointsize>12</pointsize>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Patch Title</string>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Orientation::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QCheckBox" name="enabled">
|
|
||||||
<property name="text">
|
|
||||||
<string>Enabled</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Orientation::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="1" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="description">
|
<widget class="QLabel" name="description">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>480</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><html><head/><body><p><span style=" font-weight:700;">Author: </span>Patch Author</p><p>Description would go here</p></body></html></string>
|
<string><html><head/><body><p><span style=" font-weight:700;">Author: </span>Patch Author</p><p>Description would go here</p></body></html></string>
|
||||||
</property>
|
</property>
|
||||||
@ -93,6 +55,22 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="name">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Patch Title</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
@ -21,7 +21,11 @@ GamePatchDetailsWidget::GamePatchDetailsWidget(std::string name, const std::stri
|
|||||||
{
|
{
|
||||||
m_ui.setupUi(this);
|
m_ui.setupUi(this);
|
||||||
|
|
||||||
|
QFont title_font(m_ui.name->font());
|
||||||
|
title_font.setPointSizeF(title_font.pointSizeF() + 4.0f);
|
||||||
|
title_font.setBold(true);
|
||||||
m_ui.name->setText(QString::fromStdString(name));
|
m_ui.name->setText(QString::fromStdString(name));
|
||||||
|
m_ui.name->setFont(title_font);
|
||||||
m_ui.description->setText(
|
m_ui.description->setText(
|
||||||
tr("<strong>Author: </strong>%1%2<br>%3")
|
tr("<strong>Author: </strong>%1%2<br>%3")
|
||||||
.arg(author.empty() ? tr("Unknown") : QString::fromStdString(author))
|
.arg(author.empty() ? tr("Unknown") : QString::fromStdString(author))
|
||||||
@ -88,11 +92,14 @@ void GamePatchSettingsWidget::reloadList()
|
|||||||
delete m_ui.scrollArea->takeWidget();
|
delete m_ui.scrollArea->takeWidget();
|
||||||
|
|
||||||
QWidget* container = new QWidget(m_ui.scrollArea);
|
QWidget* container = new QWidget(m_ui.scrollArea);
|
||||||
|
m_ui.scrollArea->setWidget(container);
|
||||||
|
|
||||||
QVBoxLayout* layout = new QVBoxLayout(container);
|
QVBoxLayout* layout = new QVBoxLayout(container);
|
||||||
layout->setContentsMargins(0, 0, 0, 0);
|
|
||||||
|
|
||||||
if (!patches.empty())
|
if (!patches.empty())
|
||||||
{
|
{
|
||||||
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
bool first = true;
|
bool first = true;
|
||||||
|
|
||||||
for (Cheats::CodeInfo& pi : patches)
|
for (Cheats::CodeInfo& pi : patches)
|
||||||
@ -117,9 +124,13 @@ void GamePatchSettingsWidget::reloadList()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QLabel* label = new QLabel(tr("There are no patches available for this game."), container);
|
QLabel* label = new QLabel(tr("No patches are available for this game."), container);
|
||||||
|
QFont font(label->font());
|
||||||
|
font.setPointSizeF(font.pointSizeF() + 2.0f);
|
||||||
|
font.setBold(true);
|
||||||
|
label->setFont(font);
|
||||||
layout->addWidget(label);
|
layout->addWidget(label);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ui.scrollArea->setWidget(container);
|
layout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>766</width>
|
<width>766</width>
|
||||||
<height>392</height>
|
<height>200</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
@ -28,6 +28,9 @@
|
|||||||
<property name="horizontalScrollBarPolicy">
|
<property name="horizontalScrollBarPolicy">
|
||||||
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
|
<enum>Qt::ScrollBarPolicy::ScrollBarAlwaysOff</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="sizeAdjustPolicy">
|
||||||
|
<enum>QAbstractScrollArea::SizeAdjustPolicy::AdjustToContents</enum>
|
||||||
|
</property>
|
||||||
<property name="widgetResizable">
|
<property name="widgetResizable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
@ -49,8 +52,8 @@
|
|||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>40</width>
|
<width>0</width>
|
||||||
<height>20</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user