Qt: style fixup for filter/scale/move shader options

This commit is contained in:
Brad Parker 2018-08-18 19:07:58 -04:00
parent 380cd7ac53
commit c00fd41b93
4 changed files with 23 additions and 16 deletions

View File

@ -3756,7 +3756,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_HELP_ABOUT_CONTRIBUTORS,
"作成者") "作成者")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_CURRENT_SHADER, MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_CURRENT_SHADER,
"現在のシェーダー") "現在のシェーダー")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_SHADER_MOVE_DOWN, MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MOVE_DOWN,
"下へ移動") "下へ移動")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_SHADER_MOVE_UP, MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MOVE_UP,
"上へ移動") "上へ移動")

View File

@ -4258,7 +4258,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MENU_HELP_ABOUT_CONTRIBUTORS,
"Contributors") "Contributors")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_CURRENT_SHADER, MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_CURRENT_SHADER,
"Current shader") "Current shader")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_SHADER_MOVE_DOWN, MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MOVE_DOWN,
"Move Down") "Move Down")
MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_SHADER_MOVE_UP, MSG_HASH(MENU_ENUM_LABEL_VALUE_QT_MOVE_UP,
"Move Up") "Move Up")

View File

@ -1980,8 +1980,8 @@ enum msg_hash_enums
MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_FINISHED, MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_FINISHED,
MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_FAILED, MENU_ENUM_LABEL_VALUE_QT_UPDATE_RETROARCH_FAILED,
MENU_ENUM_LABEL_VALUE_QT_CURRENT_SHADER, MENU_ENUM_LABEL_VALUE_QT_CURRENT_SHADER,
MENU_ENUM_LABEL_VALUE_QT_SHADER_MOVE_DOWN, MENU_ENUM_LABEL_VALUE_QT_MOVE_DOWN,
MENU_ENUM_LABEL_VALUE_QT_SHADER_MOVE_UP, MENU_ENUM_LABEL_VALUE_QT_MOVE_UP,
MENU_LABEL(MIDI_INPUT), MENU_LABEL(MIDI_INPUT),
MENU_LABEL(MIDI_OUTPUT), MENU_LABEL(MIDI_OUTPUT),

View File

@ -10,6 +10,7 @@
#include <QCheckBox> #include <QCheckBox>
#include <QComboBox> #include <QComboBox>
#include <QPushButton> #include <QPushButton>
#include <QToolButton>
#include "shaderparamsdialog.h" #include "shaderparamsdialog.h"
#include "../ui_qt.h" #include "../ui_qt.h"
@ -418,28 +419,32 @@ void ShaderParamsDialog::reload()
QHBoxLayout *filterScaleHBoxLayout = NULL; QHBoxLayout *filterScaleHBoxLayout = NULL;
QComboBox *filterComboBox = new QComboBox(); QComboBox *filterComboBox = new QComboBox();
QComboBox *scaleComboBox = new QComboBox(); QComboBox *scaleComboBox = new QComboBox();
QPushButton *moveDownButton = NULL; QToolButton *moveDownButton = NULL;
QPushButton *moveUpButton = NULL; QToolButton *moveUpButton = NULL;
unsigned j = 0; unsigned j = 0;
filterComboBox->setProperty("pass", i); filterComboBox->setProperty("pass", i);
scaleComboBox->setProperty("pass", i); scaleComboBox->setProperty("pass", i);
moveDownButton = new QToolButton();
moveDownButton->setText("");
moveDownButton->setProperty("pass", i);
moveUpButton = new QToolButton();
moveUpButton->setText("");
moveUpButton->setProperty("pass", i);
/* Can't move down if we're already at the bottom. */ /* Can't move down if we're already at the bottom. */
if (i < static_cast<int>(video_shader->passes) - 1) if (i < static_cast<int>(video_shader->passes) - 1)
{
moveDownButton = new QPushButton(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_SHADER_MOVE_DOWN));
moveDownButton->setProperty("pass", i);
connect(moveDownButton, SIGNAL(clicked()), this, SLOT(onShaderPassMoveDownClicked())); connect(moveDownButton, SIGNAL(clicked()), this, SLOT(onShaderPassMoveDownClicked()));
} else
moveDownButton->setDisabled(true);
/* Can't move up if we're already at the top. */ /* Can't move up if we're already at the top. */
if (i > 0) if (i > 0)
{
moveUpButton = new QPushButton(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_SHADER_MOVE_UP));
moveUpButton->setProperty("pass", i);
connect(moveUpButton, SIGNAL(clicked()), this, SLOT(onShaderPassMoveUpClicked())); connect(moveUpButton, SIGNAL(clicked()), this, SLOT(onShaderPassMoveUpClicked()));
} else
moveUpButton->setDisabled(true);
for (;;) for (;;)
{ {
@ -482,10 +487,12 @@ void ShaderParamsDialog::reload()
m_layout->addWidget(groupBox); m_layout->addWidget(groupBox);
filterScaleHBoxLayout = new QHBoxLayout(); filterScaleHBoxLayout = new QHBoxLayout();
filterScaleHBoxLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Preferred));
filterScaleHBoxLayout->addWidget(new QLabel(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_FILTER)) + ":")); filterScaleHBoxLayout->addWidget(new QLabel(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_FILTER)) + ":"));
filterScaleHBoxLayout->addWidget(filterComboBox); filterScaleHBoxLayout->addWidget(filterComboBox);
filterScaleHBoxLayout->addWidget(new QLabel(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SCALE)) + ":")); filterScaleHBoxLayout->addWidget(new QLabel(QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SCALE)) + ":"));
filterScaleHBoxLayout->addWidget(scaleComboBox); filterScaleHBoxLayout->addWidget(scaleComboBox);
filterScaleHBoxLayout->addSpacerItem(new QSpacerItem(20, 0, QSizePolicy::Preferred, QSizePolicy::Preferred));
if (moveUpButton) if (moveUpButton)
filterScaleHBoxLayout->addWidget(moveUpButton); filterScaleHBoxLayout->addWidget(moveUpButton);