GUI: added appearance options for the log view
This commit is contained in:
parent
2232138e84
commit
d0ed3a7c96
|
|
@ -653,6 +653,20 @@ void AppearanceDialog::fontInit()
|
|||
index = ui->fontHexEditSize->findText(QString("%1").arg(font.pointSize()));
|
||||
if(index != -1)
|
||||
ui->fontHexEditSize->setCurrentIndex(index);
|
||||
//Log
|
||||
font = fontMap->find("Log").value();
|
||||
ui->fontLog->setCurrentFont(QFont(font.family()));
|
||||
if(font.bold() && font.italic())
|
||||
ui->fontLogStyle->setCurrentIndex(3);
|
||||
else if(font.italic())
|
||||
ui->fontLogStyle->setCurrentIndex(2);
|
||||
else if(font.bold())
|
||||
ui->fontLogStyle->setCurrentIndex(1);
|
||||
else
|
||||
ui->fontLogStyle->setCurrentIndex(0);
|
||||
index = ui->fontLogSize->findText(QString("%1").arg(font.pointSize()));
|
||||
if(index != -1)
|
||||
ui->fontLogSize->setCurrentIndex(index);
|
||||
//Application
|
||||
ui->labelApplicationFont->setText(fontMap->find("Application").value().family());
|
||||
isInit = false;
|
||||
|
|
@ -904,6 +918,47 @@ void AppearanceDialog::on_fontHexEditSize_currentIndexChanged(const QString & ar
|
|||
GuiUpdateAllViews();
|
||||
}
|
||||
|
||||
void AppearanceDialog::on_fontLog_currentFontChanged(const QFont & f)
|
||||
{
|
||||
QString id = "Log";
|
||||
QFont font = fontMap->find(id).value();
|
||||
font.setFamily(f.family());
|
||||
(*fontMap)[id] = font;
|
||||
if(isInit)
|
||||
return;
|
||||
Config()->emitFontsUpdated();
|
||||
GuiUpdateAllViews();
|
||||
}
|
||||
|
||||
void AppearanceDialog::on_fontLogStyle_currentIndexChanged(int index)
|
||||
{
|
||||
QString id = "Log";
|
||||
QFont font = fontMap->find(id).value();
|
||||
font.setBold(false);
|
||||
font.setItalic(false);
|
||||
if(index == 1 || index == 3)
|
||||
font.setBold(true);
|
||||
if(index == 2 || index == 3)
|
||||
font.setItalic(true);
|
||||
(*fontMap)[id] = font;
|
||||
if(isInit)
|
||||
return;
|
||||
Config()->emitFontsUpdated();
|
||||
GuiUpdateAllViews();
|
||||
}
|
||||
|
||||
void AppearanceDialog::on_fontLogSize_currentIndexChanged(const QString & arg1)
|
||||
{
|
||||
QString id = "Log";
|
||||
QFont font = fontMap->find(id).value();
|
||||
font.setPointSize(arg1.toInt());
|
||||
(*fontMap)[id] = font;
|
||||
if(isInit)
|
||||
return;
|
||||
Config()->emitFontsUpdated();
|
||||
GuiUpdateAllViews();
|
||||
}
|
||||
|
||||
void AppearanceDialog::on_buttonApplicationFont_clicked()
|
||||
{
|
||||
QString id = "Application";
|
||||
|
|
|
|||
|
|
@ -68,6 +68,9 @@ private slots:
|
|||
void on_fontHexEdit_currentFontChanged(const QFont & f);
|
||||
void on_fontHexEditStyle_currentIndexChanged(int index);
|
||||
void on_fontHexEditSize_currentIndexChanged(const QString & arg1);
|
||||
void on_fontLog_currentFontChanged(const QFont & f);
|
||||
void on_fontLogStyle_currentIndexChanged(int index);
|
||||
void on_fontLogSize_currentIndexChanged(const QString & arg1);
|
||||
void on_buttonApplicationFont_clicked();
|
||||
void on_buttonFontDefaults_clicked();
|
||||
void rejectedSlot();
|
||||
|
|
|
|||
|
|
@ -677,7 +677,7 @@
|
|||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>190</y>
|
||||
<y>220</y>
|
||||
<width>501</width>
|
||||
<height>25</height>
|
||||
</rect>
|
||||
|
|
@ -1486,6 +1486,153 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="layoutWidget7_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>130</x>
|
||||
<y>190</y>
|
||||
<width>381</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="fontLogLayout">
|
||||
<item>
|
||||
<widget class="QFontComboBox" name="fontLog">
|
||||
<property name="editable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="fontFilters">
|
||||
<set>QFontComboBox::MonospacedFonts</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="fontLogStyle">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Normal</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Bold</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Italic</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Bold + Italic</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="fontLogSize">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maxVisibleItems">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContentsOnFirstShow</enum>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>6</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>7</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>8</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>9</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>10</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>11</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>12</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>14</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>16</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>18</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>20</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>22</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QLabel" name="labelFontLog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>190</y>
|
||||
<width>110</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Log:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<zorder>layoutWidget1</zorder>
|
||||
<zorder>layoutWidget2</zorder>
|
||||
<zorder>layoutWidget3</zorder>
|
||||
|
|
@ -1499,6 +1646,8 @@
|
|||
<zorder>labelFontStack</zorder>
|
||||
<zorder>labelFontRegisters</zorder>
|
||||
<zorder>labelFontHexEdit</zorder>
|
||||
<zorder>layoutWidget7_2</zorder>
|
||||
<zorder>labelFontLog</zorder>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="buttonCancel">
|
||||
|
|
|
|||
|
|
@ -4,23 +4,19 @@
|
|||
|
||||
LogView::LogView(QWidget* parent) : QTextEdit(parent)
|
||||
{
|
||||
QFont wFont("Monospace", 8, QFont::Normal, false);
|
||||
wFont.setStyleHint(QFont::Monospace);
|
||||
wFont.setFixedPitch(true);
|
||||
|
||||
this->setFont(wFont);
|
||||
|
||||
updateStyle();
|
||||
this->setUndoRedoEnabled(false);
|
||||
this->setReadOnly(true);
|
||||
|
||||
connect(Bridge::getBridge(), SIGNAL(repaintTableView()), this, SLOT(updateStyle()));
|
||||
connect(Config(), SIGNAL(colorsUpdated()), this, SLOT(updateStyle()));
|
||||
connect(Config(), SIGNAL(fontsUpdated()), this, SLOT(updateStyle()));
|
||||
connect(Bridge::getBridge(), SIGNAL(addMsgToLog(QString)), this, SLOT(addMsgToLogSlot(QString)));
|
||||
connect(Bridge::getBridge(), SIGNAL(clearLog()), this, SLOT(clearLogSlot()));
|
||||
}
|
||||
|
||||
void LogView::updateStyle()
|
||||
{
|
||||
setFont(ConfigFont("Log"));
|
||||
setStyleSheet(QString("QTextEdit { color: %1; background-color: %2 }").arg(ConfigColor("AbstractTableViewTextColor").name(), ConfigColor("AbstractTableViewBackgroundColor").name()));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -183,6 +183,7 @@ Configuration::Configuration() : QObject()
|
|||
defaultFonts.insert("Registers", font);
|
||||
defaultFonts.insert("HexEdit", font);
|
||||
defaultFonts.insert("Application", QApplication::font());
|
||||
defaultFonts.insert("Log", QFont("Courier", 8, QFont::Normal, false));
|
||||
|
||||
// hotkeys settings
|
||||
defaultShortcuts.insert("FileOpen", Shortcut(tr("File -> Open"), "F3", true));
|
||||
|
|
|
|||
Loading…
Reference in New Issue