Skip to content

Commit

Permalink
GUI - refresh context pane on theme change
Browse files Browse the repository at this point in the history
  • Loading branch information
samaaron committed Oct 15, 2020
1 parent f8edb4c commit acba13f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/gui/qt/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1922,7 +1922,10 @@ void MainWindow::updateColourTheme(){
}

errorPane->document()->setDefaultStyleSheet(css);

// update context pane
contextPane->setTextColor(QColor(theme->color("LogForeground")));
updateContextWithCurrentWs();

// clear stylesheets
this->setStyleSheet("");
Expand Down Expand Up @@ -1968,6 +1971,8 @@ void MainWindow::updateColourTheme(){
scopeInterface->SetColor(theme->color("Scope"));
scopeInterface->SetColor2(theme->color("Scope_2"));
lexer->unhighlightAll();


}

void MainWindow::showLineNumbersMenuChanged() {
Expand Down Expand Up @@ -3201,6 +3206,13 @@ void MainWindow::focusErrors(){
errorPane->activateWindow();
}

void MainWindow::updateContextWithCurrentWs() {
SonicPiScintilla* ws = ((SonicPiScintilla*)tabs->currentWidget());
int line, index;
ws->getCursorPosition(&line, &index);
updateContext(line, index);
}

void MainWindow::updateContext(int line, int index){
contextPane->setContent(tr("Line: %1, Position: %2").arg(line + 1).arg(index + 1));
}
1 change: 1 addition & 0 deletions app/gui/qt/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class MainWindow : public QMainWindow
private slots:

void updateContext(int line, int index);
void updateContextWithCurrentWs();
void addCuePath(QString path, QString val);
void docLinkClicked(const QUrl &url);
void handleCustomUrl(const QUrl &url);
Expand Down

0 comments on commit acba13f

Please sign in to comment.