summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/debugger/qt/windowqt.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2022-09-17 06:28:25 +1000
committer Vas Crabb <vas@vastheman.com>2022-09-17 06:31:07 +1000
commitc25428f519d401634d2e7555cc5cc0908efb5b0d (patch)
tree870decebdc57c8c742a8059629225aa923034e53 /src/osd/modules/debugger/qt/windowqt.cpp
parentb64b4ef8bbae5c5745740d0861393a2b37b0fd32 (diff)
Added a crude dark theme for the Win32 debugger.
Also made a start on weaning the Qt debugger off its weird configuation objects. It can now save more view state with less string comparisons on memory labels, but it can't restore all of it yet.
Diffstat (limited to 'src/osd/modules/debugger/qt/windowqt.cpp')
-rw-r--r--src/osd/modules/debugger/qt/windowqt.cpp33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/osd/modules/debugger/qt/windowqt.cpp b/src/osd/modules/debugger/qt/windowqt.cpp
index 1d7ba70b5a6..ce198332619 100644
--- a/src/osd/modules/debugger/qt/windowqt.cpp
+++ b/src/osd/modules/debugger/qt/windowqt.cpp
@@ -243,31 +243,30 @@ void WindowQt::debugActQuit()
}
-//=========================================================================
-// WindowQtConfig
-//=========================================================================
-void WindowQtConfig::buildFromQWidget(QWidget *widget)
+void WindowQt::saveConfiguration(util::xml::data_node &parentnode)
{
- m_position.setX(widget->geometry().topLeft().x());
- m_position.setY(widget->geometry().topLeft().y());
- m_size.setX(widget->size().width());
- m_size.setY(widget->size().height());
+ util::xml::data_node *const node = parentnode.add_child(osd::debugger::NODE_WINDOW, nullptr);
+ if (node)
+ saveConfigurationToNode(*node);
}
-void WindowQtConfig::applyToQWidget(QWidget *widget)
+void WindowQt::saveConfigurationToNode(util::xml::data_node &node)
{
- widget->setGeometry(m_position.x(), m_position.y(), m_size.x(), m_size.y());
+ node.set_attribute_int(osd::debugger::ATTR_WINDOW_POSITION_X, geometry().topLeft().x());
+ node.set_attribute_int(osd::debugger::ATTR_WINDOW_POSITION_Y, geometry().topLeft().y());
+ node.set_attribute_int(osd::debugger::ATTR_WINDOW_WIDTH, size().width());
+ node.set_attribute_int(osd::debugger::ATTR_WINDOW_HEIGHT, size().height());
}
-void WindowQtConfig::addToXmlDataNode(util::xml::data_node &node) const
+//=========================================================================
+// WindowQtConfig
+//=========================================================================
+
+void WindowQtConfig::applyToQWidget(QWidget *widget)
{
- node.set_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, m_type);
- node.set_attribute_int(osd::debugger::ATTR_WINDOW_POSITION_X, m_position.x());
- node.set_attribute_int(osd::debugger::ATTR_WINDOW_POSITION_Y, m_position.y());
- node.set_attribute_int(osd::debugger::ATTR_WINDOW_WIDTH, m_size.x());
- node.set_attribute_int(osd::debugger::ATTR_WINDOW_HEIGHT, m_size.y());
+ widget->setGeometry(m_position.x(), m_position.y(), m_size.x(), m_size.y());
}
@@ -277,5 +276,5 @@ void WindowQtConfig::recoverFromXmlNode(util::xml::data_node const &node)
m_size.setY(node.get_attribute_int(osd::debugger::ATTR_WINDOW_HEIGHT, m_size.y()));
m_position.setX(node.get_attribute_int(osd::debugger::ATTR_WINDOW_POSITION_X, m_position.x()));
m_position.setY(node.get_attribute_int(osd::debugger::ATTR_WINDOW_POSITION_Y, m_position.y()));
- m_type = (WindowQtConfig::WindowType)node.get_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, m_type);
+ m_type = node.get_attribute_int(osd::debugger::ATTR_WINDOW_TYPE, m_type);
}