Sync switch theme with graph view. Still has bugs

This commit is contained in:
Hugo Teso 2017-04-05 16:03:36 +02:00
parent f656bea94b
commit d790ad69df
3 changed files with 16 additions and 1 deletions

View File

@ -35,7 +35,7 @@
.ec_gui_cflow {color: rgb(255,255,0);}
.ec_gui_dataoffset {color: rgb(127,127,0);}
.ec_gui_background {background-color: rgb(255,255,255); }
.ec_gui_alt_background {background-color: rgb(50, 50, 50); }
.ec_gui_alt_background {background-color: rgb(64, 64, 64); }
.ec_gui_border {border-color: rgb(0, 0, 0); }
.autohighlight { background-color: #8AFF77 !important; }

View File

@ -167,6 +167,8 @@ MemoryWidget::MemoryWidget(MainWindow *main, QWidget *parent) :
// Control Disasm and Hex scroll to add more contents
connect(this->disasTextEdit->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(disasmScrolled()));
connect(this->hexASCIIText->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(hexScrolled()));
connect(ui->graphWebView->page()->mainFrame(), SIGNAL(loadFinished(bool)), this, SLOT(frameLoadFinished(bool)));
}
/*
@ -1720,3 +1722,14 @@ void MemoryWidget::seek_back() {
//this->main->add_debug_output("Back!");
this->main->on_backButton_clicked();
}
void MemoryWidget::frameLoadFinished(bool ok) {
//qDebug() << "LOAD FRAME: " << ok;
if (ok) {
QSettings settings;
if (settings.value("dark").toBool()) {
QString js = "r2ui.graph_panel.set_theme('dark');";
qDebug() << ui->graphWebView->page()->mainFrame()->evaluateJavaScript(js);
}
}
}

View File

@ -82,6 +82,8 @@ public slots:
void selectHexPreview();
void frameLoadFinished(bool ok);
protected:
bool eventFilter(QObject *obj, QEvent *event) override;