debugger: make "debugger font size follows main editor optional"

Task-number: QTCREATORBUG-2420
This commit is contained in:
hjk
2011-04-01 12:01:14 +02:00
parent fadc6ef251
commit dec9622cfa
5 changed files with 29 additions and 6 deletions

View File

@@ -73,6 +73,8 @@ CommonOptionsPageWidget::CommonOptionsPageWidget
m_ui.checkBoxCloseBuffersOnExit);
m_group->insert(dc->action(SwitchModeOnExit),
m_ui.checkBoxSwitchModeOnExit);
m_group->insert(dc->action(FontSizeFollowsEditor),
m_ui.checkBoxFontSizeFollowsEditor);
m_group->insert(dc->action(AutoDerefPointers), 0);
m_group->insert(dc->action(UseToolTipsInLocalsView), 0);
m_group->insert(dc->action(AlwaysAdjustLocalsColumnWidths), 0);
@@ -110,6 +112,7 @@ QString CommonOptionsPageWidget::searchKeyWords() const
const QLatin1Char sep(' ');
QTextStream(&rc)
<< sep << m_ui.checkBoxUseAlternatingRowColors->text()
<< sep << m_ui.checkBoxFontSizeFollowsEditor->text()
<< sep << m_ui.checkBoxUseToolTipsInMainEditor->text()
<< sep << m_ui.checkBoxListSourceFiles->text()
#ifdef Q_OS_WIN

View File

@@ -25,13 +25,23 @@
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxFontSizeFollowsEditor">
<property name="text">
<string>Debugger font size follows main editor</string>
</property>
<property name="toolTip">
<string>Selecting this results in font size changes in the debugger views whenever the font size in the main editor changes.</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxUseToolTipsInMainEditor">
<property name="text">
<string>Use tooltips in main editor while debugging</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxListSourceFiles">
<property name="toolTip">
<string>Checking this will populate the source file view automatically but might slow down debugger startup considerably.</string>
@@ -41,7 +51,7 @@
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxRegisterForPostMortem">
<property name="toolTip">
<string>Register Qt Creator for debugging crashed applications.</string>
@@ -51,7 +61,7 @@
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<item row="6" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxCloseBuffersOnExit">
<property name="toolTip">
<string>Close temporary buffers on debugger exit.</string>
@@ -61,7 +71,7 @@
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<item row="7" column="0" colspan="2">
<widget class="QCheckBox" name="checkBoxSwitchModeOnExit">
<property name="toolTip">
<string>Switch to previous mode on debugger exit.</string>
@@ -71,7 +81,7 @@
</property>
</widget>
</item>
<item row="7" column="0">
<item row="8" column="0">
<widget class="QLabel" name="labelMaximalStackDepth">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
@@ -84,7 +94,7 @@
</property>
</widget>
</item>
<item row="7" column="1">
<item row="9" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QSpinBox" name="spinBoxMaximalStackDepth">

View File

@@ -176,6 +176,13 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
item->setDefaultValue(false);
insertItem(UseAlternatingRowColors, item);
item = new SavedAction(this);
item->setText(tr("Debugger Font Size Follows Main Editor"));
item->setSettingsKey(debugModeGroup, QLatin1String("FontSizeFollowsEditor"));
item->setCheckable(true);
item->setDefaultValue(false);
insertItem(FontSizeFollowsEditor, item);
item = new SavedAction(this);
item->setText(tr("Show a Message Box When Receiving a Signal"));
item->setSettingsKey(debugModeGroup, QLatin1String("UseMessageBoxForSignals"));

View File

@@ -91,6 +91,7 @@ enum DebuggerActionCode
// General
SettingsDialog,
UseAlternatingRowColors,
FontSizeFollowsEditor,
UseMessageBoxForSignals,
AutoQuit,
LockView,

View File

@@ -1822,6 +1822,8 @@ static void changeFontSize(QWidget *widget, qreal size)
void DebuggerPluginPrivate::fontSettingsChanged
(const TextEditor::FontSettings &settings)
{
if (!boolSetting(FontSizeFollowsEditor))
return;
qreal size = settings.fontZoom() * settings.fontSize() / 100.;
changeFontSize(m_breakWindow, size);
changeFontSize(m_logWindow, size);