Commit 2ba77741 authored by hjk's avatar hjk
Browse files

debugger/texteditor: Add font and size option to debugger panels, QTCREATORBUG-189

parent 4f13bac0
......@@ -68,6 +68,7 @@
#include <cplusplus/CppDocument.h>
#include <cpptools/cppmodelmanagerinterface.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h>
#include <texteditor/fontsettings.h>
#include <texteditor/itexteditor.h>
#include <QtCore/QDebug>
......@@ -1877,6 +1878,27 @@ QDebug operator<<(QDebug d, DebuggerState state)
return d << DebuggerManager::stateName(state) << '(' << int(state) << ')';
}
static void changeFontSize(QWidget *widget, int size)
{
QFont font = widget->font();
font.setPointSize(size);
widget->setFont(font);
}
void DebuggerManager::fontSettingsChanged(const TextEditor::FontSettings &settings)
{
int size = settings.fontZoom() * settings.fontSize() / 100;
changeFontSize(d->m_localsWindow, size);
changeFontSize(d->m_watchersWindow, size);
changeFontSize(d->m_breakWindow, size);
changeFontSize(d->m_modulesWindow, size);
changeFontSize(d->m_outputWindow, size);
changeFontSize(d->m_registerWindow, size);
changeFontSize(d->m_stackWindow, size);
changeFontSize(d->m_sourceFilesWindow, size);
changeFontSize(d->m_threadsWindow, size);
}
//////////////////////////////////////////////////////////////////////
//
// AbstractDebuggerEngine
......
......@@ -59,6 +59,7 @@ class FancyMainWindow;
namespace TextEditor {
class ITextEditor;
class FontSettings;
}
namespace CPlusPlus {
......@@ -321,6 +322,7 @@ private:
Q_SLOT void loadSessionData();
Q_SLOT void saveSessionData();
Q_SLOT void dumpLog();
Q_SLOT void fontSettingsChanged(const TextEditor::FontSettings &settings);
public:
// stuff in this block should be made private by moving it to
......
......@@ -72,6 +72,7 @@
#include <texteditor/basetextmark.h>
#include <texteditor/itexteditor.h>
#include <texteditor/texteditorconstants.h>
#include <texteditor/texteditorplugin.h>
#include <utils/qtcassert.h>
#include <utils/styledbar.h>
......@@ -994,6 +995,11 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
// Connections
//
// TextEditor
connect(TextEditor::TextEditorPlugin::instance(),
SIGNAL(fontSettingsChanged(TextEditor::FontSettings)),
m_manager, SLOT(fontSettingsChanged(TextEditor::FontSettings)));
// ProjectExplorer
connect(sessionManager(), SIGNAL(sessionLoaded()),
m_manager, SLOT(sessionLoaded()));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment