Skip to content

Commit

Permalink
Merge pull request #3083 from torusrxxx/patch000000db
Browse files Browse the repository at this point in the history
Set proper default style for example text in appearance dialog
  • Loading branch information
mrexodia committed May 7, 2023
2 parents c38c03d + cc45d14 commit fbff8ac
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 142 deletions.
200 changes: 63 additions & 137 deletions src/gui/Src/Gui/AppearanceDialog.cpp

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/gui/Src/Gui/AppearanceDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ private slots:
QString propertyName;
QString colorName;
QString backgroundColorName;
QString defaultBackgroundColorName;
QString defaultFontName;
};

QList<ColorInfo> colorInfoList;
Expand All @@ -101,10 +103,12 @@ private slots:
QAction* defaultValueAction;
QAction* currentSettingAction;
QTreeWidgetItem* currentCategory;
QString currentBackgroundColorName;
QString currentFontName;

bool isInit;

void colorInfoListCategory(QString categoryName);
void colorInfoListCategory(QString categoryName, const QString & currentBackgroundColorName, const QString & currentFontName);
void colorInfoListAppend(QString propertyName, QString colorName, QString backgroundColorName);
void colorInfoListInit();
void fontInit();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/Src/Gui/LogView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ LogView::~LogView()
void LogView::updateStyle()
{
setFont(ConfigFont("Log"));
setStyleSheet(QString("QTextEdit { color: %1; background-color: %2 }").arg(ConfigColor("AbstractTableViewTextColor").name(), ConfigColor("AbstractTableViewBackgroundColor").name()));
setStyleSheet(QString("QTextEdit { color: %1; background-color: %2 }").arg(ConfigColor("LogColor").name(), ConfigColor("LogBackgroundColor").name()));
QColor LogLinkBackgroundColor = ConfigColor("LogLinkBackgroundColor");

this->document()->setDefaultStyleSheet(QString("a {color: %1; background-color: %2 }").arg(ConfigColor("LogLinkColor").name(), LogLinkBackgroundColor == Qt::transparent ? "transparent" : LogLinkBackgroundColor.name()));
Expand Down
3 changes: 2 additions & 1 deletion src/gui/Src/Gui/ScriptView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,8 @@ void ScriptView::unload()
void ScriptView::edit()
{
if(!filename.isEmpty())
QDesktopServices::openUrl(QUrl(QDir::fromNativeSeparators(filename)));
if(!QDesktopServices::openUrl(QUrl(QDir::fromNativeSeparators(filename))))
SimpleWarningBox(this, tr("Error!"), tr("File open failed! Please open the file yourself..."));
}

void ScriptView::run()
Expand Down
12 changes: 10 additions & 2 deletions src/gui/Src/Gui/SystemBreakpointScriptDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,12 @@ void SystemBreakpointScriptDialog::on_openDebuggee_clicked()
{
// First open the script if that is available
if(!ui->lineEditDebuggee->text().isEmpty())
QDesktopServices::openUrl(QUrl(QDir::fromNativeSeparators(ui->lineEditDebuggee->text())));
{
if(!QDesktopServices::openUrl(QUrl(QDir::fromNativeSeparators(ui->lineEditDebuggee->text()))))
{
SimpleWarningBox(this, tr("Error!"), tr("File open failed! Please open the file yourself..."));
}
}
else
{
// Ask the user to create a new script
Expand All @@ -129,7 +134,10 @@ void SystemBreakpointScriptDialog::on_openDebuggee_clicked()
ui->lineEditDebuggee->setText(defaultFileName);
ui->openDebuggee->setText(tr("Open"));
// Open the file
QDesktopServices::openUrl(QUrl(QDir::fromNativeSeparators(ui->lineEditDebuggee->text())));
if(!QDesktopServices::openUrl(QUrl(QDir::fromNativeSeparators(ui->lineEditDebuggee->text()))))
{
SimpleWarningBox(this, tr("Error!"), tr("File open failed! Please open the file yourself..."));
}
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/gui/Src/Utils/Configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ Configuration::Configuration() : QObject(), noMoreMsgbox(false)
defaultColors.insert("SymbolLoadedTextColor", QColor("#008000"));
defaultColors.insert("BackgroundFlickerColor", QColor("#ff6961"));
defaultColors.insert("LinkColor", QColor("#0000ff"));
defaultColors.insert("LogColor", QColor("#000000"));
defaultColors.insert("LogBackgroundColor", QColor("#FFF8F0"));

//bool settings
QMap<QString, bool> disassemblyBool;
Expand Down

0 comments on commit fbff8ac

Please sign in to comment.