GUI: color setting for log and symbol log + use hexedit colors in ASCII and UNICODE edits
This commit is contained in:
parent
8157e110d0
commit
baf40769ce
|
|
@ -407,7 +407,7 @@ void AppearanceDialog::colorInfoListInit()
|
|||
colorInfoIndex=0;
|
||||
colorInfoList.clear();
|
||||
//list entries
|
||||
colorInfoListAppend("AbstractTableView:", "", "");
|
||||
colorInfoListAppend("General:", "", "");
|
||||
colorInfoListAppend("Text", "AbstractTableViewTextColor", "");
|
||||
colorInfoListAppend("Header Text", "AbstractTableViewHeaderTextColor", "");
|
||||
colorInfoListAppend("Background", "AbstractTableViewBackgroundColor", "");
|
||||
|
|
|
|||
|
|
@ -57,9 +57,15 @@
|
|||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QLineEdit {border-style: outset; border-width: 1px; border-color: black}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>#FFFFFF</string>
|
||||
</property>
|
||||
<property name="frame">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="buttonColor">
|
||||
<property name="geometry">
|
||||
|
|
@ -355,9 +361,15 @@
|
|||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QLineEdit {border-style: outset; border-width: 1px; border-color: black}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>#FFFFFF</string>
|
||||
</property>
|
||||
<property name="frame">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="buttonBackgroundColor">
|
||||
<property name="geometry">
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ HexEditDialog::HexEditDialog(QWidget *parent) :
|
|||
ui->lineEditAscii->setFont(font);
|
||||
ui->lineEditUnicode->setFont(font);
|
||||
ui->chkEntireBlock->hide();
|
||||
connect(Bridge::getBridge(), SIGNAL(repaintGui()), this, SLOT(updateStyle()));
|
||||
updateStyle();
|
||||
|
||||
//setup hex editor
|
||||
mHexEdit = new QHexEdit(this);
|
||||
|
|
@ -53,6 +55,13 @@ bool HexEditDialog::entireBlock()
|
|||
return ui->chkEntireBlock->isChecked();
|
||||
}
|
||||
|
||||
void HexEditDialog::updateStyle()
|
||||
{
|
||||
QString style = QString("QLineEdit { border-style: outset; border-width: 1px; border-color: %1; color: %1; background-color: %2 }").arg(ConfigColor("HexEditTextColor").name(), ConfigColor("HexEditBackgroundColor").name());
|
||||
ui->lineEditAscii->setStyleSheet(style);
|
||||
ui->lineEditUnicode->setStyleSheet(style);
|
||||
}
|
||||
|
||||
void HexEditDialog::on_btnAscii2Hex_clicked()
|
||||
{
|
||||
QString text = ui->lineEditAscii->text();
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ public:
|
|||
QHexEdit* mHexEdit;
|
||||
|
||||
private slots:
|
||||
void updateStyle();
|
||||
void on_btnAscii2Hex_clicked();
|
||||
void on_btnUnicode2Hex_clicked();
|
||||
void on_chkKeepSize_toggled(bool checked);
|
||||
|
|
|
|||
|
|
@ -55,12 +55,18 @@
|
|||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QLineEdit {border-style: outset; border-width: 1px; border-color: black}</string>
|
||||
</property>
|
||||
<property name="inputMask">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="maxLength">
|
||||
<number>32767</number>
|
||||
</property>
|
||||
<property name="frame">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit" name="lineEditAscii">
|
||||
<property name="geometry">
|
||||
|
|
@ -71,12 +77,18 @@
|
|||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QLineEdit {border-style: outset; border-width: 1px; border-color: black}</string>
|
||||
</property>
|
||||
<property name="inputMask">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="maxLength">
|
||||
<number>32767</number>
|
||||
</property>
|
||||
<property name="frame">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="labelAscii">
|
||||
<property name="geometry">
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include "LogView.h"
|
||||
#include "Configuration.h"
|
||||
|
||||
LogView::LogView(QWidget *parent) : QTextEdit(parent)
|
||||
{
|
||||
|
|
@ -8,14 +9,19 @@ LogView::LogView(QWidget *parent) : QTextEdit(parent)
|
|||
|
||||
this->setFont(wFont);
|
||||
|
||||
this->setStyleSheet("QTextEdit { background-color: rgb(255, 251, 240) }");
|
||||
updateStyle();
|
||||
this->setUndoRedoEnabled(false);
|
||||
this->setReadOnly(true);
|
||||
|
||||
connect(Bridge::getBridge(), SIGNAL(repaintTableView()), this, SLOT(updateStyle()));
|
||||
connect(Bridge::getBridge(), SIGNAL(addMsgToLog(QString)), this, SLOT(addMsgToLogSlot(QString)));
|
||||
connect(Bridge::getBridge(), SIGNAL(clearLog()), this, SLOT(clearLogSlot()));
|
||||
}
|
||||
|
||||
void LogView::updateStyle()
|
||||
{
|
||||
setStyleSheet(QString("QTextEdit { color: %1; background-color: %2 }").arg(ConfigColor("AbstractTableViewTextColor").name(), ConfigColor("AbstractTableViewBackgroundColor").name()));
|
||||
}
|
||||
|
||||
void LogView::addMsgToLogSlot(QString msg)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ public:
|
|||
signals:
|
||||
|
||||
public slots:
|
||||
void updateStyle();
|
||||
void addMsgToLogSlot(QString msg);
|
||||
void clearLogSlot();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include "SymbolView.h"
|
||||
#include "ui_SymbolView.h"
|
||||
#include "Configuration.h"
|
||||
|
||||
SymbolView::SymbolView(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
|
|
@ -60,6 +61,7 @@ SymbolView::SymbolView(QWidget *parent) :
|
|||
setupContextMenu();
|
||||
|
||||
//Signals and slots
|
||||
connect(Bridge::getBridge(), SIGNAL(repaintTableView()), this, SLOT(updateStyle()));
|
||||
connect(Bridge::getBridge(), SIGNAL(addMsgToSymbolLog(QString)), this, SLOT(addMsgToSymbolLogSlot(QString)));
|
||||
connect(Bridge::getBridge(), SIGNAL(clearLog()), this, SLOT(clearSymbolLogSlot()));
|
||||
connect(Bridge::getBridge(), SIGNAL(clearSymbolLog()), this, SLOT(clearSymbolLogSlot()));
|
||||
|
|
@ -86,6 +88,11 @@ void SymbolView::setupContextMenu()
|
|||
connect(mFollowSymbolDumpAction, SIGNAL(triggered()), this, SLOT(symbolFollowDump()));
|
||||
}
|
||||
|
||||
void SymbolView::updateStyle()
|
||||
{
|
||||
ui->symbolLogEdit->setStyleSheet(QString("QTextEdit { color: %1; background-color: %2 }").arg(ConfigColor("AbstractTableViewTextColor").name(), ConfigColor("AbstractTableViewBackgroundColor").name()));
|
||||
}
|
||||
|
||||
void SymbolView::addMsgToSymbolLogSlot(QString msg)
|
||||
{
|
||||
ui->symbolLogEdit->moveCursor(QTextCursor::End);
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ public:
|
|||
void setupContextMenu();
|
||||
|
||||
private slots:
|
||||
void updateStyle();
|
||||
void addMsgToSymbolLogSlot(QString msg);
|
||||
void clearSymbolLogSlot();
|
||||
void moduleSelectionChanged(int index);
|
||||
|
|
|
|||
Loading…
Reference in New Issue