1
0
Fork 0

changed example font, added MODULEPARTY enum

This commit is contained in:
torusrxxx 2020-08-07 21:15:07 +08:00 committed by Duncan Ogilvie
parent e36ca4c982
commit c5c55de12f
9 changed files with 34 additions and 11 deletions

View File

@ -226,6 +226,8 @@ StackSelectionColor=#414141
StackTextColor=#E0E0E0
StructAlternateBackgroundColor=#313131
StructBackgroundColor=#212121
SymbolUserTextColor=#F88478
SymbolSystemTextColor=#A0A0A0
SymbolLoadedTextColor=#E0E0E0
SymbolLoadingTextColor=#E1EA76
SymbolUnloadedTextColor=#A0A0A0

View File

@ -513,6 +513,12 @@ typedef enum
sym_symbol
} SYMBOLTYPE;
typedef enum
{
mod_user,
mod_system
} MODULEPARTY;
//Debugger typedefs
typedef MEMORY_SIZE VALUE_SIZE;

View File

@ -24,6 +24,7 @@ AppearanceDialog::AppearanceDialog(QWidget* parent) : QDialog(parent), ui(new Ui
fontMap = &Config()->Fonts;
fontBackupMap = *fontMap;
fontInit();
ui->exampleText->setFont(ConfigFont("AbstractTableView"));
connect(this, SIGNAL(rejected()), this, SLOT(rejectedSlot()));
}
@ -205,10 +206,21 @@ void AppearanceDialog::on_editBackgroundColor_textChanged(const QString & arg1)
if(colorMap->contains(id))
ui->buttonSave->setEnabled(false); //we cannot save with an invalid color
}
if(QColor(ui->editColor->text()).isValid())
ui->exampleText->setStyleSheet(QString("color: %1; background-color: %2").arg(ui->editColor->text()).arg(arg1));
if(ui->editBackgroundColor->isEnabled())
{
if(QColor(ui->editColor->text()).isValid())
ui->exampleText->setStyleSheet(QString("color: %1; background-color: %2").arg(ui->editColor->text()).arg(arg1));
else
ui->exampleText->setStyleSheet(QString("color: black; background-color: %1").arg(arg1));
}
else
ui->exampleText->setStyleSheet(QString("color: black; background-color: %1").arg(arg1));
{
if(QColor(ui->editColor->text()).isValid())
ui->exampleText->setStyleSheet(QString("color: %1").arg(ui->editColor->text()));
else
ui->exampleText->setStyleSheet(QString("color: black"));
}
ui->exampleText->setFont(ConfigFont("AbstractTableView"));
}
ui->buttonBackgroundColor->setStyleSheet(styleSheet);
}
@ -240,10 +252,11 @@ void AppearanceDialog::on_editColor_textChanged(const QString & arg1)
emit Config()->colorsUpdated();
GuiUpdateAllViews();
}
if(QColor(ui->editBackgroundColor->text()).isValid())
if(QColor(ui->editBackgroundColor->text()).isValid() && ui->editBackgroundColor->isEnabled())
ui->exampleText->setStyleSheet(QString("color: %1; background-color: %2").arg(arg1).arg(ui->editBackgroundColor->text()));
else
ui->exampleText->setStyleSheet(QString("color: %1").arg(arg1));
ui->exampleText->setFont(ConfigFont("AbstractTableView"));
}
else
{
@ -451,7 +464,6 @@ void AppearanceDialog::colorInfoListInit()
colorInfoListAppend(tr("Conditional Jump Backwards Lines (no jump)"), "SideBarConditionalJumpLineFalseBackwardsColor", "");
colorInfoListAppend(tr("Unconditional Jump Backwards Lines (jump)"), "SideBarUnconditionalJumpLineTrueBackwardsColor", "");
colorInfoListAppend(tr("Unconditional Jump Backwards Lines (no jump)"), "SideBarUnconditionalJumpLineFalseBackwardsColor", "");
colorInfoListAppend(tr("Jump Lines (executing)"), "SideBarJumpLineExecuteColor", "");
colorInfoListAppend(tr("Code Folding Checkbox Color"), "SideBarCheckBoxForeColor", "SideBarCheckBoxBackColor");
colorInfoListAppend(tr("Background"), "SideBarBackgroundColor", "");

View File

@ -641,6 +641,9 @@ border-width: 1px 2px 2px 1px;</string>
<property name="text">
<string>Example Text</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<zorder>groupBackgroundColor</zorder>
<zorder>groupColor</zorder>

View File

@ -467,7 +467,7 @@ QString CPUStack::paintContent(QPainter* painter, dsint rowBase, int rowOffset,
int width = 5;
int offset = 2;
auto result = HexDump::paintContent(painter, rowBase, rowOffset, 1, x + (width - 2), y, w - (width - 2), h);
if(party == 0)
if(party == MODULEPARTY::mod_user)
painter->setPen(QPen(mUserStackFrameColor, 2));
else
painter->setPen(QPen(mSystemStackFrameColor, 2));

View File

@ -84,10 +84,10 @@ void CallStackView::updateCallStack()
int party = DbgFunctions()->ModGetParty(callstack.entries[i].to);
switch(party)
{
case 0:
case MODULEPARTY::mod_user:
setCellContent(i, 5, tr("User"));
break;
case 1:
case MODULEPARTY::mod_system:
setCellContent(i, 5, tr("System"));
break;
default:

View File

@ -1144,7 +1144,7 @@ void DisassemblerGraphView::mouseMoveEvent(QMouseEvent* event)
void DisassemblerGraphView::mouseReleaseEvent(QMouseEvent* event)
{
// Bring the user back to disassembly if the user is stuck in an empty graph view (Alt+G)
if((!this->ready || !DbgIsDebugging()) && event->button() == Qt::LeftButton)
if((!this->ready || !DbgIsDebugging()) && (event->button() == Qt::LeftButton || event->button() == Qt::BackButton))
GuiFocusView(GUI_DISASSEMBLY);
this->viewport()->update();

View File

@ -310,7 +310,7 @@ QString MemoryMapView::paintContent(QPainter* painter, dsint rowBase, int rowOff
painter->drawText(QRect(x + 4, y, getColumnWidth(col) - 4, getRowHeight()), Qt::AlignVCenter | Qt::AlignLeft, wStr);
return QString();
}
else if(DbgFunctions()->ModGetParty(getCellUserdata(rowBase + rowOffset, 0)) == 0)
else if(DbgFunctions()->ModGetParty(getCellUserdata(rowBase + rowOffset, 0)) == MODULEPARTY::mod_user)
{
painter->setPen(ConfigColor("SymbolUserTextColor"));
painter->drawText(QRect(x + 4, y, getColumnWidth(col) - 4, getRowHeight()), Qt::AlignVCenter | Qt::AlignLeft, wStr);

View File

@ -42,7 +42,7 @@ public:
{
if(c == ColParty || c == ColPath)
{
if(DbgFunctions()->ModGetParty(getCellUserdata(r, ColBase)) != 1)
if(DbgFunctions()->ModGetParty(getCellUserdata(r, ColBase)) != MODULEPARTY::mod_system)
return mSymbolUserTextColor;
else
return mSymbolSystemTextColor;