mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 06:51:26 +12:00
Splitter fix
This commit is contained in:
parent
2b24635ef7
commit
96dfa9b526
4 changed files with 56 additions and 13 deletions
|
@ -1,7 +1,6 @@
|
||||||
#include "debugger_frame.h"
|
#include "debugger_frame.h"
|
||||||
|
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include <QSplitter>
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QFontDatabase>
|
#include <QFontDatabase>
|
||||||
#include <QCompleter>
|
#include <QCompleter>
|
||||||
|
@ -9,7 +8,8 @@
|
||||||
inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), _in.size()); }
|
inline QString qstr(const std::string& _in) { return QString::fromUtf8(_in.data(), _in.size()); }
|
||||||
extern bool user_asked_for_frame_capture;
|
extern bool user_asked_for_frame_capture;
|
||||||
|
|
||||||
debugger_frame::debugger_frame(QWidget *parent) : QDockWidget(tr("Debugger"), parent)
|
debugger_frame::debugger_frame(std::shared_ptr<gui_settings> settings, QWidget *parent)
|
||||||
|
: QDockWidget(tr("Debugger"), parent), xgui_settings(settings)
|
||||||
{
|
{
|
||||||
pSize = 10;
|
pSize = 10;
|
||||||
|
|
||||||
|
@ -64,12 +64,12 @@ debugger_frame::debugger_frame(QWidget *parent) : QDockWidget(tr("Debugger"), pa
|
||||||
m_list->setFont(mono);
|
m_list->setFont(mono);
|
||||||
m_regs->setFont(mono);
|
m_regs->setFont(mono);
|
||||||
|
|
||||||
QSplitter* splitter = new QSplitter(this);
|
m_splitter = new QSplitter(this);
|
||||||
splitter->addWidget(m_list);
|
m_splitter->addWidget(m_list);
|
||||||
splitter->addWidget(m_regs);
|
m_splitter->addWidget(m_regs);
|
||||||
|
|
||||||
QHBoxLayout* hbox_w_list = new QHBoxLayout();
|
QHBoxLayout* hbox_w_list = new QHBoxLayout();
|
||||||
hbox_w_list->addWidget(splitter);
|
hbox_w_list->addWidget(m_splitter);
|
||||||
|
|
||||||
vbox_p_main->addLayout(hbox_b_main);
|
vbox_p_main->addLayout(hbox_b_main);
|
||||||
vbox_p_main->addLayout(hbox_w_list);
|
vbox_p_main->addLayout(hbox_w_list);
|
||||||
|
@ -113,12 +113,42 @@ debugger_frame::debugger_frame(QWidget *parent) : QDockWidget(tr("Debugger"), pa
|
||||||
UpdateUnitList();
|
UpdateUnitList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void debugger_frame::SaveSettings()
|
||||||
|
{
|
||||||
|
xgui_settings->SetValue(GUI::d_splitterState, m_splitter->saveState());
|
||||||
|
}
|
||||||
|
|
||||||
void debugger_frame::closeEvent(QCloseEvent *event)
|
void debugger_frame::closeEvent(QCloseEvent *event)
|
||||||
{
|
{
|
||||||
QDockWidget::closeEvent(event);
|
QDockWidget::closeEvent(event);
|
||||||
DebugFrameClosed();
|
DebugFrameClosed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void debugger_frame::showEvent(QShowEvent * event)
|
||||||
|
{
|
||||||
|
// resize splitter widgets
|
||||||
|
QByteArray state = xgui_settings->GetValue(GUI::d_splitterState).toByteArray();
|
||||||
|
|
||||||
|
if (state.isEmpty()) // resize 2:1
|
||||||
|
{
|
||||||
|
const int width_right = width() / 3;
|
||||||
|
const int width_left = width() - width_right;
|
||||||
|
m_splitter->setSizes({ width_left, width_right });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_splitter->restoreState(state);
|
||||||
|
}
|
||||||
|
QDockWidget::showEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void debugger_frame::hideEvent(QHideEvent * event)
|
||||||
|
{
|
||||||
|
// save splitter state or it will resume its initial state on next show
|
||||||
|
xgui_settings->SetValue(GUI::d_splitterState, m_splitter->saveState());
|
||||||
|
QDockWidget::hideEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
std::map<u32, bool> g_breakpoints;
|
std::map<u32, bool> g_breakpoints;
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
#include "instruction_editor_dialog.h"
|
#include "instruction_editor_dialog.h"
|
||||||
#include "register_editor_dialog.h"
|
#include "register_editor_dialog.h"
|
||||||
|
#include "gui_settings.h"
|
||||||
|
|
||||||
#include <QDockWidget>
|
#include <QDockWidget>
|
||||||
#include <QListWidget>
|
#include <QListWidget>
|
||||||
|
@ -26,6 +27,7 @@
|
||||||
#include <QWheelEvent>
|
#include <QWheelEvent>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QTextEdit>
|
#include <QTextEdit>
|
||||||
|
#include <QSplitter>
|
||||||
|
|
||||||
class debugger_list;
|
class debugger_list;
|
||||||
|
|
||||||
|
@ -53,17 +55,21 @@ class debugger_frame : public QDockWidget
|
||||||
u32 m_last_stat = 0;
|
u32 m_last_stat = 0;
|
||||||
|
|
||||||
QTimer* update;
|
QTimer* update;
|
||||||
|
QSplitter* m_splitter;
|
||||||
|
|
||||||
const QString NoThread = tr("No Thread");
|
const QString NoThread = tr("No Thread");
|
||||||
const QString Run = tr("Run");
|
const QString Run = tr("Run");
|
||||||
const QString Pause = tr("Pause");
|
const QString Pause = tr("Pause");
|
||||||
|
|
||||||
|
std::shared_ptr<gui_settings> xgui_settings;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
std::unique_ptr<CPUDisAsm> m_disasm;
|
std::unique_ptr<CPUDisAsm> m_disasm;
|
||||||
std::weak_ptr<cpu_thread> cpu;
|
std::weak_ptr<cpu_thread> cpu;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit debugger_frame(QWidget *parent = 0);
|
explicit debugger_frame(std::shared_ptr<gui_settings> settings, QWidget *parent = 0);
|
||||||
|
void SaveSettings();
|
||||||
|
|
||||||
void UpdateUI();
|
void UpdateUI();
|
||||||
void UpdateUnitList();
|
void UpdateUnitList();
|
||||||
|
@ -80,6 +86,8 @@ public:
|
||||||
protected:
|
protected:
|
||||||
/** Override inherited method from Qt to allow signalling when close happened.*/
|
/** Override inherited method from Qt to allow signalling when close happened.*/
|
||||||
void closeEvent(QCloseEvent* event);
|
void closeEvent(QCloseEvent* event);
|
||||||
|
void showEvent(QShowEvent* event);
|
||||||
|
void hideEvent(QHideEvent* event);
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void DebugFrameClosed();
|
void DebugFrameClosed();
|
||||||
|
|
|
@ -50,6 +50,7 @@ namespace GUI
|
||||||
const QString main_window = "main_window";
|
const QString main_window = "main_window";
|
||||||
const QString game_list = "GameList";
|
const QString game_list = "GameList";
|
||||||
const QString logger = "Logger";
|
const QString logger = "Logger";
|
||||||
|
const QString debugger = "Debugger";
|
||||||
const QString meta = "Meta";
|
const QString meta = "Meta";
|
||||||
const QString fs = "FileSystem";
|
const QString fs = "FileSystem";
|
||||||
const QString gs_frame = "GSFrame";
|
const QString gs_frame = "GSFrame";
|
||||||
|
@ -112,6 +113,8 @@ namespace GUI
|
||||||
const GUI_SAVE l_level = GUI_SAVE( logger, "level", (uint)(logs::level::success) );
|
const GUI_SAVE l_level = GUI_SAVE( logger, "level", (uint)(logs::level::success) );
|
||||||
const GUI_SAVE l_stack = GUI_SAVE( logger, "stack", false );
|
const GUI_SAVE l_stack = GUI_SAVE( logger, "stack", false );
|
||||||
|
|
||||||
|
const GUI_SAVE d_splitterState = GUI_SAVE( debugger, "splitterState", QByteArray());
|
||||||
|
|
||||||
const GUI_SAVE m_currentConfig = GUI_SAVE(meta, "currentConfig", QObject::tr("CurrentSettings"));
|
const GUI_SAVE m_currentConfig = GUI_SAVE(meta, "currentConfig", QObject::tr("CurrentSettings"));
|
||||||
const GUI_SAVE m_currentStylesheet = GUI_SAVE(meta, "currentStylesheet", QObject::tr("default"));
|
const GUI_SAVE m_currentStylesheet = GUI_SAVE(meta, "currentStylesheet", QObject::tr("default"));
|
||||||
|
|
||||||
|
|
|
@ -639,6 +639,8 @@ void main_window::SaveWindowState()
|
||||||
|
|
||||||
// Save column settings
|
// Save column settings
|
||||||
gameListFrame->SaveSettings();
|
gameListFrame->SaveSettings();
|
||||||
|
// Save splitter state
|
||||||
|
debuggerFrame->SaveSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void main_window::RepaintToolBarIcons()
|
void main_window::RepaintToolBarIcons()
|
||||||
|
@ -1224,7 +1226,7 @@ void main_window::CreateDockWindows()
|
||||||
|
|
||||||
gameListFrame = new game_list_frame(guiSettings, m_Render_Creator, m_mw);
|
gameListFrame = new game_list_frame(guiSettings, m_Render_Creator, m_mw);
|
||||||
gameListFrame->setObjectName("gamelist");
|
gameListFrame->setObjectName("gamelist");
|
||||||
debuggerFrame = new debugger_frame(m_mw);
|
debuggerFrame = new debugger_frame(guiSettings, m_mw);
|
||||||
debuggerFrame->setObjectName("debugger");
|
debuggerFrame->setObjectName("debugger");
|
||||||
logFrame = new log_frame(guiSettings, m_mw);
|
logFrame = new log_frame(guiSettings, m_mw);
|
||||||
logFrame->setObjectName("logger");
|
logFrame->setObjectName("logger");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue