citra-emu
/
citra
Archived
1
0
Fork 0

Shader Debugger: Improve space efficiency of the layout

This commit is contained in:
Yuri Kunde Schlesner 2015-08-19 05:48:22 -03:00
parent 8540e02176
commit 2d195ba64e
1 changed files with 18 additions and 9 deletions

View File

@ -7,6 +7,7 @@
#include <QBoxLayout> #include <QBoxLayout>
#include <QFileDialog> #include <QFileDialog>
#include <QFormLayout>
#include <QGroupBox> #include <QGroupBox>
#include <QLabel> #include <QLabel>
#include <QLineEdit> #include <QLineEdit>
@ -395,6 +396,9 @@ GraphicsVertexShaderWidget::GraphicsVertexShaderWidget(std::shared_ptr< Pica::De
// Create an HBoxLayout to store the widgets used to specify a particular attribute // Create an HBoxLayout to store the widgets used to specify a particular attribute
// and store it in a QWidget to allow for easy hiding and unhiding. // and store it in a QWidget to allow for easy hiding and unhiding.
auto row_layout = new QHBoxLayout; auto row_layout = new QHBoxLayout;
// Remove unecessary padding between rows
row_layout->setContentsMargins(0, 0, 0, 0);
row_layout->addWidget(new QLabel(tr("Attribute %1").arg(i, 2))); row_layout->addWidget(new QLabel(tr("Attribute %1").arg(i, 2)));
for (unsigned comp = 0; comp < 4; ++comp) for (unsigned comp = 0; comp < 4; ++comp)
row_layout->addWidget(input_data[4 * i + comp]); row_layout->addWidget(input_data[4 * i + comp]);
@ -414,20 +418,25 @@ GraphicsVertexShaderWidget::GraphicsVertexShaderWidget(std::shared_ptr< Pica::De
input_data_group->setLayout(sub_layout); input_data_group->setLayout(sub_layout);
main_layout->addWidget(input_data_group); main_layout->addWidget(input_data_group);
} }
{
auto sub_layout = new QHBoxLayout; // Make program listing expand to fill available space in the dialog
sub_layout->addWidget(binary_list); binary_list->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
main_layout->addLayout(sub_layout); main_layout->addWidget(binary_list);
}
main_layout->addWidget(dump_shader); main_layout->addWidget(dump_shader);
{ {
auto sub_layout = new QHBoxLayout; auto sub_layout = new QFormLayout;
sub_layout->addWidget(new QLabel(tr("Cycle Index:"))); sub_layout->addRow(tr("Cycle Index:"), cycle_index);
sub_layout->addWidget(cycle_index);
main_layout->addLayout(sub_layout); main_layout->addLayout(sub_layout);
} }
// Set a minimum height so that the size of this label doesn't cause the rest of the bottom
// part of the UI to keep jumping up and down when cycling through instructions.
instruction_description->setMinimumHeight(instruction_description->fontMetrics().lineSpacing() * 6);
instruction_description->setAlignment(Qt::AlignLeft | Qt::AlignTop);
main_layout->addWidget(instruction_description); main_layout->addWidget(instruction_description);
main_layout->addStretch();
main_widget->setLayout(main_layout); main_widget->setLayout(main_layout);
setWidget(main_widget); setWidget(main_widget);