diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-08-19 22:00:56 +0200 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-08-25 03:16:28 +0200 |
commit | c7745408f77a17771c1a26efb981d79aa66c9f66 (patch) | |
tree | 21c29e6927d35d51a1a9becc43f004746a38e777 /src | |
parent | Merge pull request #1063 from Subv/hw_renderer_debug_fb (diff) | |
download | yuzu-c7745408f77a17771c1a26efb981d79aa66c9f66.tar yuzu-c7745408f77a17771c1a26efb981d79aa66c9f66.tar.gz yuzu-c7745408f77a17771c1a26efb981d79aa66c9f66.tar.bz2 yuzu-c7745408f77a17771c1a26efb981d79aa66c9f66.tar.lz yuzu-c7745408f77a17771c1a26efb981d79aa66c9f66.tar.xz yuzu-c7745408f77a17771c1a26efb981d79aa66c9f66.tar.zst yuzu-c7745408f77a17771c1a26efb981d79aa66c9f66.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/citra_qt/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics.cpp | 4 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics_cmdlists.cpp | 6 | ||||
-rw-r--r-- | src/citra_qt/debugger/graphics_vertex_shader.cpp | 4 | ||||
-rw-r--r-- | src/citra_qt/util/util.cpp | 13 | ||||
-rw-r--r-- | src/citra_qt/util/util.h | 8 |
6 files changed, 32 insertions, 5 deletions
diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt index 0c0515054..a82e8a85b 100644 --- a/src/citra_qt/CMakeLists.txt +++ b/src/citra_qt/CMakeLists.txt @@ -18,6 +18,7 @@ set(SRCS debugger/ramview.cpp debugger/registers.cpp util/spinbox.cpp + util/util.cpp bootmanager.cpp hotkeys.cpp main.cpp @@ -42,6 +43,7 @@ set(HEADERS debugger/ramview.h debugger/registers.h util/spinbox.h + util/util.h bootmanager.h hotkeys.h main.h diff --git a/src/citra_qt/debugger/graphics.cpp b/src/citra_qt/debugger/graphics.cpp index 7424671f1..7d15028f0 100644 --- a/src/citra_qt/debugger/graphics.cpp +++ b/src/citra_qt/debugger/graphics.cpp @@ -7,6 +7,8 @@ #include <QVBoxLayout> #include <QDebug> +#include "citra_qt/util/util.h" + extern GraphicsDebugger g_debugger; GPUCommandStreamItemModel::GPUCommandStreamItemModel(QObject* parent) : QAbstractListModel(parent), command_count(0) @@ -79,7 +81,7 @@ GPUCommandStreamWidget::GPUCommandStreamWidget(QWidget* parent) : QDockWidget(tr QListView* command_list = new QListView; command_list->setModel(command_model); - command_list->setFont(QFont("monospace")); + command_list->setFont(GetMonospaceFont()); setWidget(command_list); } diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics_cmdlists.cpp index 35a3140b2..025434687 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics_cmdlists.cpp @@ -14,6 +14,8 @@ #include <QSpinBox> #include <QComboBox> +#include "citra_qt/util/util.h" + #include "common/vector_math.h" #include "video_core/debug_utils/debug_utils.h" @@ -303,9 +305,7 @@ GPUCommandListWidget::GPUCommandListWidget(QWidget* parent) : QDockWidget(tr("Pi list_widget = new QTreeView; list_widget->setModel(model); - QFont font("monospace"); - font.setStyleHint(QFont::Monospace); // Automatic fallback to a monospace font on on platforms without a font called "monospace" - list_widget->setFont(font); + list_widget->setFont(GetMonospaceFont()); list_widget->setRootIsDecorated(false); list_widget->setUniformRowHeights(true); diff --git a/src/citra_qt/debugger/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics_vertex_shader.cpp index 0c17edee0..1d9a00e89 100644 --- a/src/citra_qt/debugger/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics_vertex_shader.cpp @@ -15,6 +15,8 @@ #include <QSpinBox> #include <QTreeView> +#include "citra_qt/util/util.h" + #include "video_core/shader/shader.h" #include "graphics_vertex_shader.h" @@ -245,7 +247,7 @@ QVariant GraphicsVertexShaderModel::data(const QModelIndex& index, int role) con } case Qt::FontRole: - return QFont("monospace"); + return GetMonospaceFont(); case Qt::BackgroundRole: // Highlight instructions which have no debug data associated to them diff --git a/src/citra_qt/util/util.cpp b/src/citra_qt/util/util.cpp new file mode 100644 index 000000000..2cb939af1 --- /dev/null +++ b/src/citra_qt/util/util.cpp @@ -0,0 +1,13 @@ +// Copyright 2015 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "util.h" + +QFont GetMonospaceFont() { + QFont font("monospace"); + // Automatic fallback to a monospace font on on platforms without a font called "monospace" + font.setStyleHint(QFont::Monospace); + font.setFixedPitch(true); + return font; +} diff --git a/src/citra_qt/util/util.h b/src/citra_qt/util/util.h new file mode 100644 index 000000000..0787f9eb7 --- /dev/null +++ b/src/citra_qt/util/util.h @@ -0,0 +1,8 @@ +// Copyright 2015 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include <QFont> + +/// Returns a QFont object appropriate to use as a monospace font for debugging widgets, etc. +QFont GetMonospaceFont(); |