forked from qt-creator/qt-creator
debugger/texteditor: Add font and size option to debugger panels, QTCREATORBUG-189
This commit is contained in:
@@ -68,6 +68,7 @@
|
|||||||
#include <cplusplus/CppDocument.h>
|
#include <cplusplus/CppDocument.h>
|
||||||
#include <cpptools/cppmodelmanagerinterface.h>
|
#include <cpptools/cppmodelmanagerinterface.h>
|
||||||
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
||||||
|
#include <texteditor/fontsettings.h>
|
||||||
#include <texteditor/itexteditor.h>
|
#include <texteditor/itexteditor.h>
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
@@ -1877,6 +1878,27 @@ QDebug operator<<(QDebug d, DebuggerState state)
|
|||||||
return d << DebuggerManager::stateName(state) << '(' << int(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
|
// AbstractDebuggerEngine
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ class FancyMainWindow;
|
|||||||
|
|
||||||
namespace TextEditor {
|
namespace TextEditor {
|
||||||
class ITextEditor;
|
class ITextEditor;
|
||||||
|
class FontSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace CPlusPlus {
|
namespace CPlusPlus {
|
||||||
@@ -321,6 +322,7 @@ private:
|
|||||||
Q_SLOT void loadSessionData();
|
Q_SLOT void loadSessionData();
|
||||||
Q_SLOT void saveSessionData();
|
Q_SLOT void saveSessionData();
|
||||||
Q_SLOT void dumpLog();
|
Q_SLOT void dumpLog();
|
||||||
|
Q_SLOT void fontSettingsChanged(const TextEditor::FontSettings &settings);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// stuff in this block should be made private by moving it to
|
// stuff in this block should be made private by moving it to
|
||||||
|
|||||||
@@ -72,6 +72,7 @@
|
|||||||
#include <texteditor/basetextmark.h>
|
#include <texteditor/basetextmark.h>
|
||||||
#include <texteditor/itexteditor.h>
|
#include <texteditor/itexteditor.h>
|
||||||
#include <texteditor/texteditorconstants.h>
|
#include <texteditor/texteditorconstants.h>
|
||||||
|
#include <texteditor/texteditorplugin.h>
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/styledbar.h>
|
#include <utils/styledbar.h>
|
||||||
@@ -994,6 +995,11 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
|
|||||||
// Connections
|
// Connections
|
||||||
//
|
//
|
||||||
|
|
||||||
|
// TextEditor
|
||||||
|
connect(TextEditor::TextEditorPlugin::instance(),
|
||||||
|
SIGNAL(fontSettingsChanged(TextEditor::FontSettings)),
|
||||||
|
m_manager, SLOT(fontSettingsChanged(TextEditor::FontSettings)));
|
||||||
|
|
||||||
// ProjectExplorer
|
// ProjectExplorer
|
||||||
connect(sessionManager(), SIGNAL(sessionLoaded()),
|
connect(sessionManager(), SIGNAL(sessionLoaded()),
|
||||||
m_manager, SLOT(sessionLoaded()));
|
m_manager, SLOT(sessionLoaded()));
|
||||||
|
|||||||
Reference in New Issue
Block a user