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

This commit is contained in:
hjk
2010-02-12 14:15:20 +01:00
parent 4f13bac035
commit 2ba777415b
3 changed files with 30 additions and 0 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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()));