From 730b7fc8337e220ea8d9c963c026a9c095bb3c7c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=C3=A9o=20Lam?=
Date: Thu, 7 Sep 2017 21:09:36 +0200
Subject: [PATCH 01/11] Qt: Remove __DATE__ to make builds reproducible
See also PR #3259.
Also makes the copyright text identical to DolphinWX.
---
Source/Core/DolphinQt2/AboutDialog.cpp | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/Source/Core/DolphinQt2/AboutDialog.cpp b/Source/Core/DolphinQt2/AboutDialog.cpp
index 73303ba5da..898237dc82 100644
--- a/Source/Core/DolphinQt2/AboutDialog.cpp
+++ b/Source/Core/DolphinQt2/AboutDialog.cpp
@@ -29,7 +29,6 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent)
QStringLiteral("
"));
text.append(small + tr("Revision: ") + QString::fromUtf8(Common::scm_rev_git_str.c_str()) +
QStringLiteral(""));
- text.append(small + tr("Compiled: ") + QStringLiteral(__DATE__ " " __TIME__ ""));
text.append(medium + tr("Check for updates: ") +
QStringLiteral(
@@ -62,9 +61,8 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent)
// in your translation, please use the type of curly quotes that's appropriate for
// your language. If you aren't sure which type is appropriate, see
// https://en.wikipedia.org/wiki/Quotation_mark#Specific_language_features
- new QLabel(tr("\u00A9 2003-%1 Dolphin Team. \u201cGameCube\u201d and \u201cWii\u201d are "
- "trademarks of Nintendo. Dolphin is not affiliated with Nintendo in any way.")
- .arg(QStringLiteral(__DATE__).right(4)));
+ new QLabel(tr("\u00A9 2003-2015+ Dolphin Team. \u201cGameCube\u201d and \u201cWii\u201d are "
+ "trademarks of Nintendo. Dolphin is not affiliated with Nintendo in any way."));
QLabel* logo = new QLabel();
logo->setPixmap(Resources::GetMisc(Resources::LOGO_LARGE));
From 8f2558dc89c323f090ccd48db9408b8ae76bd4bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=C3=A9o=20Lam?=
Date: Thu, 14 Sep 2017 17:01:43 +0200
Subject: [PATCH 02/11] Qt: Simplify AboutDialog creation
Just create the AboutDialog on the stack -- the actual object lives on
the heap anyway, since Qt uses the pimpl idiom. Removes the need for
an explicit new and a special delete on close attribute.
---
Source/Core/DolphinQt2/AboutDialog.cpp | 1 -
Source/Core/DolphinQt2/MainWindow.cpp | 4 ++--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/Source/Core/DolphinQt2/AboutDialog.cpp b/Source/Core/DolphinQt2/AboutDialog.cpp
index 898237dc82..7f6f4f380a 100644
--- a/Source/Core/DolphinQt2/AboutDialog.cpp
+++ b/Source/Core/DolphinQt2/AboutDialog.cpp
@@ -14,7 +14,6 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent)
{
setWindowTitle(tr("About Dolphin"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
- setAttribute(Qt::WA_DeleteOnClose);
QString text = QStringLiteral("");
QString small = QStringLiteral("");
diff --git a/Source/Core/DolphinQt2/MainWindow.cpp b/Source/Core/DolphinQt2/MainWindow.cpp
index ce710b6ce0..e93c6c2f29 100644
--- a/Source/Core/DolphinQt2/MainWindow.cpp
+++ b/Source/Core/DolphinQt2/MainWindow.cpp
@@ -553,8 +553,8 @@ void MainWindow::ShowAudioWindow()
void MainWindow::ShowAboutDialog()
{
- AboutDialog* about = new AboutDialog(this);
- about->show();
+ AboutDialog about{this};
+ about.exec();
}
void MainWindow::ShowHotkeyDialog()
From a158b87f9b8de428091c6ba02bbc64119595bfe6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=C3=A9o=20Lam?=
Date: Thu, 14 Sep 2017 17:10:00 +0200
Subject: [PATCH 03/11] Qt/About: Fix the HTML
* remove useless units after 'zero' values
* reduce the size of 'Dolphin' to be more reasonable and look better
* avoid hardcoding the normal and small font sizes
---
Source/Core/DolphinQt2/AboutDialog.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Source/Core/DolphinQt2/AboutDialog.cpp b/Source/Core/DolphinQt2/AboutDialog.cpp
index 7f6f4f380a..be06ce76bc 100644
--- a/Source/Core/DolphinQt2/AboutDialog.cpp
+++ b/Source/Core/DolphinQt2/AboutDialog.cpp
@@ -16,12 +16,12 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent)
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
QString text = QStringLiteral("");
- QString small = QStringLiteral("");
- QString medium = QStringLiteral("
");
+ QString small = QStringLiteral("
");
+ QString medium = QStringLiteral("
");
- text.append(QStringLiteral("
") +
+ text.append(QStringLiteral("
") +
tr("Dolphin") + QStringLiteral("
"));
- text.append(QStringLiteral("%1
")
+ text.append(QStringLiteral("%1
")
.arg(QString::fromUtf8(Common::scm_desc_str.c_str())));
text.append(small + tr("Branch: ") + QString::fromUtf8(Common::scm_branch_str.c_str()) +
From 6db55fc2d0615e7f351cc7424f4913d057f0e832 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=C3=A9o=20Lam?=
Date: Thu, 14 Sep 2017 17:34:04 +0200
Subject: [PATCH 04/11] Qt/About: Fix text size to better match WX
---
Source/Core/DolphinQt2/AboutDialog.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/Source/Core/DolphinQt2/AboutDialog.cpp b/Source/Core/DolphinQt2/AboutDialog.cpp
index be06ce76bc..61a0a17c65 100644
--- a/Source/Core/DolphinQt2/AboutDialog.cpp
+++ b/Source/Core/DolphinQt2/AboutDialog.cpp
@@ -60,8 +60,10 @@ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent)
// in your translation, please use the type of curly quotes that's appropriate for
// your language. If you aren't sure which type is appropriate, see
// https://en.wikipedia.org/wiki/Quotation_mark#Specific_language_features
- new QLabel(tr("\u00A9 2003-2015+ Dolphin Team. \u201cGameCube\u201d and \u201cWii\u201d are "
- "trademarks of Nintendo. Dolphin is not affiliated with Nintendo in any way."));
+ new QLabel(small +
+ tr("\u00A9 2003-2015+ Dolphin Team. \u201cGameCube\u201d and \u201cWii\u201d are "
+ "trademarks of Nintendo. Dolphin is not affiliated with Nintendo in any way.") +
+ QStringLiteral("
"));
QLabel* logo = new QLabel();
logo->setPixmap(Resources::GetMisc(Resources::LOGO_LARGE));
From ca3be07e59f3248fad7e00b8293a1e168086f2db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=C3=A9o=20Lam?=
Date: Thu, 14 Sep 2017 18:11:06 +0200
Subject: [PATCH 05/11] Qt/GameList: Fix broken File Name column
---
Source/Core/DolphinQt2/GameList/GameList.cpp | 3 ++-
Source/Core/DolphinQt2/GameList/GameListModel.cpp | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/Source/Core/DolphinQt2/GameList/GameList.cpp b/Source/Core/DolphinQt2/GameList/GameList.cpp
index 90510c5b04..1402cfeaa5 100644
--- a/Source/Core/DolphinQt2/GameList/GameList.cpp
+++ b/Source/Core/DolphinQt2/GameList/GameList.cpp
@@ -484,7 +484,8 @@ void GameList::OnColumnVisibilityToggled(const QString& row, bool visible)
{tr("Platform"), GameListModel::COL_PLATFORM},
{tr("Size"), GameListModel::COL_SIZE},
{tr("Title"), GameListModel::COL_TITLE},
- {tr("State"), GameListModel::COL_RATING}};
+ {tr("State"), GameListModel::COL_RATING},
+ {tr("File Name"), GameListModel::COL_FILE_NAME}};
m_list->setColumnHidden(rowname_to_col_index[row], !visible);
}
diff --git a/Source/Core/DolphinQt2/GameList/GameListModel.cpp b/Source/Core/DolphinQt2/GameList/GameListModel.cpp
index f6060c1deb..01744150a3 100644
--- a/Source/Core/DolphinQt2/GameList/GameListModel.cpp
+++ b/Source/Core/DolphinQt2/GameList/GameListModel.cpp
@@ -101,6 +101,7 @@ QVariant GameListModel::data(const QModelIndex& index, int role) const
case COL_FILE_NAME:
if (role == Qt::DisplayRole || role == Qt::InitialSortOrderRole)
return game->GetFileName();
+ break;
case COL_SIZE:
if (role == Qt::DisplayRole)
return FormatSize(game->GetFileSize());
From 6cfd7baac97ee5006c4fd3b243b2c39592f81fff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=C3=A9o=20Lam?=
Date: Thu, 14 Sep 2017 18:48:20 +0200
Subject: [PATCH 06/11] Qt/Config: Fix inconsistent spacing between options
---
Source/Core/DolphinQt2/Config/Graphics/AdvancedWidget.cpp | 1 +
Source/Core/DolphinQt2/Config/Graphics/EnhancementsWidget.cpp | 1 +
Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp | 1 +
Source/Core/DolphinQt2/Config/Graphics/HacksWidget.cpp | 1 +
.../Core/DolphinQt2/Config/Graphics/SoftwareRendererWidget.cpp | 1 +
5 files changed, 5 insertions(+)
diff --git a/Source/Core/DolphinQt2/Config/Graphics/AdvancedWidget.cpp b/Source/Core/DolphinQt2/Config/Graphics/AdvancedWidget.cpp
index 6be05f7398..88f566a131 100644
--- a/Source/Core/DolphinQt2/Config/Graphics/AdvancedWidget.cpp
+++ b/Source/Core/DolphinQt2/Config/Graphics/AdvancedWidget.cpp
@@ -100,6 +100,7 @@ void AdvancedWidget::CreateWidgets()
main_layout->addWidget(debugging_box);
main_layout->addWidget(utility_box);
main_layout->addWidget(misc_box);
+ main_layout->addStretch();
setLayout(main_layout);
}
diff --git a/Source/Core/DolphinQt2/Config/Graphics/EnhancementsWidget.cpp b/Source/Core/DolphinQt2/Config/Graphics/EnhancementsWidget.cpp
index cb4b021760..c4f0c2dc93 100644
--- a/Source/Core/DolphinQt2/Config/Graphics/EnhancementsWidget.cpp
+++ b/Source/Core/DolphinQt2/Config/Graphics/EnhancementsWidget.cpp
@@ -113,6 +113,7 @@ void EnhancementsWidget::CreateWidgets()
main_layout->addWidget(enhancements_box);
main_layout->addWidget(stereoscopy_box);
+ main_layout->addStretch();
setLayout(main_layout);
}
diff --git a/Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp b/Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp
index f746b711bb..b3ae65a802 100644
--- a/Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp
+++ b/Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp
@@ -116,6 +116,7 @@ void GeneralWidget::CreateWidgets()
main_layout->addWidget(m_video_box);
main_layout->addWidget(m_options_box);
+ main_layout->addStretch();
setLayout(main_layout);
}
diff --git a/Source/Core/DolphinQt2/Config/Graphics/HacksWidget.cpp b/Source/Core/DolphinQt2/Config/Graphics/HacksWidget.cpp
index 93b686fd26..3690a43161 100644
--- a/Source/Core/DolphinQt2/Config/Graphics/HacksWidget.cpp
+++ b/Source/Core/DolphinQt2/Config/Graphics/HacksWidget.cpp
@@ -94,6 +94,7 @@ void HacksWidget::CreateWidgets()
main_layout->addWidget(texture_cache_box);
main_layout->addWidget(xfb_box);
main_layout->addWidget(other_box);
+ main_layout->addStretch();
setLayout(main_layout);
}
diff --git a/Source/Core/DolphinQt2/Config/Graphics/SoftwareRendererWidget.cpp b/Source/Core/DolphinQt2/Config/Graphics/SoftwareRendererWidget.cpp
index 015acc1f64..65cd96b2c5 100644
--- a/Source/Core/DolphinQt2/Config/Graphics/SoftwareRendererWidget.cpp
+++ b/Source/Core/DolphinQt2/Config/Graphics/SoftwareRendererWidget.cpp
@@ -99,6 +99,7 @@ void SoftwareRendererWidget::CreateWidgets()
main_layout->addWidget(overlay_box);
main_layout->addWidget(utility_box);
main_layout->addWidget(object_range_box);
+ main_layout->addStretch();
setLayout(main_layout);
}
From 587b275c8e26baab5c9547d84834ca76d62cbe45 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=C3=A9o=20Lam?=
Date: Thu, 14 Sep 2017 19:28:36 +0200
Subject: [PATCH 07/11] Qt: Increase the height of game list items
This makes the images in the game list look less weird (since they are
not squashed together anymore). The list also looks more like WX now.
---
Source/Core/DolphinQt2/GameList/GameList.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Source/Core/DolphinQt2/GameList/GameList.cpp b/Source/Core/DolphinQt2/GameList/GameList.cpp
index 1402cfeaa5..072775165f 100644
--- a/Source/Core/DolphinQt2/GameList/GameList.cpp
+++ b/Source/Core/DolphinQt2/GameList/GameList.cpp
@@ -74,6 +74,8 @@ void GameList::MakeListView()
m_list->setCurrentIndex(QModelIndex());
m_list->setContextMenuPolicy(Qt::CustomContextMenu);
m_list->setWordWrap(false);
+ m_list->verticalHeader()->setDefaultSectionSize(m_list->verticalHeader()->defaultSectionSize() *
+ 1.25);
connect(m_list, &QTableView::customContextMenuRequested, this, &GameList::ShowContextMenu);
connect(m_list->selectionModel(), &QItemSelectionModel::selectionChanged,
From f28839acf936d2562fa048420b285d4bba99530a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=C3=A9o=20Lam?=
Date: Thu, 14 Sep 2017 19:34:14 +0200
Subject: [PATCH 08/11] Qt: Make toolbar buttons wider
Makes the toolbar look more comfortable instead of all squished
together, and more similar to our current look.
Instead of setting a hardcoded minimal size for buttons, MakeActions()
now uses the maximum size hint width.
---
Source/Core/DolphinQt2/ToolBar.cpp | 37 ++++++++++++++++--------------
1 file changed, 20 insertions(+), 17 deletions(-)
diff --git a/Source/Core/DolphinQt2/ToolBar.cpp b/Source/Core/DolphinQt2/ToolBar.cpp
index b8e6e6760d..e1c3b2658c 100644
--- a/Source/Core/DolphinQt2/ToolBar.cpp
+++ b/Source/Core/DolphinQt2/ToolBar.cpp
@@ -2,6 +2,9 @@
// Licensed under GPLv2+
// Refer to the license.txt file included.
+#include
+#include
+
#include
#include "Core/Core.h"
@@ -45,36 +48,36 @@ void ToolBar::OnEmulationStateChanged(Core::State state)
void ToolBar::MakeActions()
{
- constexpr int button_width = 65;
m_open_action = AddAction(this, tr("Open"), this, &ToolBar::OpenPressed);
- widgetForAction(m_open_action)->setMinimumWidth(button_width);
-
m_play_action = AddAction(this, tr("Play"), this, &ToolBar::PlayPressed);
- widgetForAction(m_play_action)->setMinimumWidth(button_width);
-
m_pause_action = AddAction(this, tr("Pause"), this, &ToolBar::PausePressed);
- widgetForAction(m_pause_action)->setMinimumWidth(button_width);
-
m_stop_action = AddAction(this, tr("Stop"), this, &ToolBar::StopPressed);
- widgetForAction(m_stop_action)->setMinimumWidth(button_width);
-
m_fullscreen_action = AddAction(this, tr("FullScr"), this, &ToolBar::FullScreenPressed);
- widgetForAction(m_fullscreen_action)->setMinimumWidth(button_width);
-
m_screenshot_action = AddAction(this, tr("ScrShot"), this, &ToolBar::ScreenShotPressed);
- widgetForAction(m_screenshot_action)->setMinimumWidth(button_width);
addSeparator();
m_config_action = AddAction(this, tr("Config"), this, &ToolBar::SettingsPressed);
- widgetForAction(m_config_action)->setMinimumWidth(button_width);
-
m_graphics_action = AddAction(this, tr("Graphics"), this, &ToolBar::GraphicsPressed);
- widgetForAction(m_graphics_action)->setMinimumWidth(button_width);
-
m_controllers_action = AddAction(this, tr("Controllers"), this, &ToolBar::ControllersPressed);
- widgetForAction(m_controllers_action)->setMinimumWidth(button_width);
m_controllers_action->setEnabled(true);
+
+ // Ensure every button has the same width
+ std::vector items;
+ for (const auto& action : {m_open_action, m_play_action, m_pause_action, m_stop_action,
+ m_stop_action, m_fullscreen_action, m_screenshot_action,
+ m_config_action, m_graphics_action, m_controllers_action})
+ {
+ items.emplace_back(widgetForAction(action));
+ }
+
+ std::vector widths;
+ std::transform(items.begin(), items.end(), std::back_inserter(widths),
+ [](QWidget* item) { return item->sizeHint().width(); });
+
+ const int min_width = *std::max_element(widths.begin(), widths.end());
+ for (QWidget* widget : items)
+ widget->setMinimumWidth(min_width);
}
void ToolBar::UpdateIcons()
From b05207325d1b6ab14477d423da04c2b67859d866 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=C3=A9o=20Lam?=
Date: Fri, 15 Sep 2017 22:39:55 +0200
Subject: [PATCH 09/11] Qt: Fix render to main
The render widget was not hidden at the right moment.
---
Source/Core/DolphinQt2/MainWindow.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/Source/Core/DolphinQt2/MainWindow.cpp b/Source/Core/DolphinQt2/MainWindow.cpp
index e93c6c2f29..b8a7b0a871 100644
--- a/Source/Core/DolphinQt2/MainWindow.cpp
+++ b/Source/Core/DolphinQt2/MainWindow.cpp
@@ -353,7 +353,7 @@ void MainWindow::Pause()
void MainWindow::OnStopComplete()
{
m_stop_requested = false;
- m_render_widget->hide();
+ HideRenderWidget();
if (m_exit_requested)
QGuiApplication::instance()->quit();
@@ -425,7 +425,6 @@ bool MainWindow::RequestStop()
void MainWindow::ForceStop()
{
BootManager::Stop();
- HideRenderWidget();
}
void MainWindow::Reset()
From 8dcd5cdd1de6d9bd90437a62cd5c9795586301b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=C3=A9o=20Lam?=
Date: Tue, 19 Sep 2017 22:26:03 +0200
Subject: [PATCH 10/11] Qt: Reduce spacing between toolbar actions
---
Source/Core/DolphinQt2/ToolBar.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Source/Core/DolphinQt2/ToolBar.cpp b/Source/Core/DolphinQt2/ToolBar.cpp
index e1c3b2658c..ed563532b4 100644
--- a/Source/Core/DolphinQt2/ToolBar.cpp
+++ b/Source/Core/DolphinQt2/ToolBar.cpp
@@ -75,7 +75,7 @@ void ToolBar::MakeActions()
std::transform(items.begin(), items.end(), std::back_inserter(widths),
[](QWidget* item) { return item->sizeHint().width(); });
- const int min_width = *std::max_element(widths.begin(), widths.end());
+ const int min_width = *std::max_element(widths.begin(), widths.end()) * 0.85;
for (QWidget* widget : items)
widget->setMinimumWidth(min_width);
}
From 5c2e03380f7a23b8dfe8f6d17946b167a0a99ae2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=C3=A9o=20Lam?=
Date: Tue, 26 Sep 2017 17:42:51 +0200
Subject: [PATCH 11/11] Qt: Always show the stop button in the toolbar
Reverts a previous Qt change that was likely not intended to match WX.
---
Source/Core/DolphinQt2/ToolBar.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/Source/Core/DolphinQt2/ToolBar.cpp b/Source/Core/DolphinQt2/ToolBar.cpp
index ed563532b4..fe13a74c90 100644
--- a/Source/Core/DolphinQt2/ToolBar.cpp
+++ b/Source/Core/DolphinQt2/ToolBar.cpp
@@ -35,7 +35,6 @@ void ToolBar::OnEmulationStateChanged(Core::State state)
{
bool running = state != Core::State::Uninitialized;
m_stop_action->setEnabled(running);
- m_stop_action->setVisible(running);
m_fullscreen_action->setEnabled(running);
m_screenshot_action->setEnabled(running);
@@ -62,7 +61,7 @@ void ToolBar::MakeActions()
m_controllers_action = AddAction(this, tr("Controllers"), this, &ToolBar::ControllersPressed);
m_controllers_action->setEnabled(true);
- // Ensure every button has the same width
+ // Ensure every button has about the same width
std::vector items;
for (const auto& action : {m_open_action, m_play_action, m_pause_action, m_stop_action,
m_stop_action, m_fullscreen_action, m_screenshot_action,