Skip to content

Commit

Permalink
fix re-enable markdown preview
Browse files Browse the repository at this point in the history
  • Loading branch information
MetaDevo committed Feb 3, 2024
1 parent 6eb342e commit 9ad0479
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,18 @@ void MainWindow::on_actionOpen_triggered()

}

void MainWindow::on_textEdit_textChanged()
void MainWindow::markdownUpdate()
{
if (m_docIsMarkdown) {
ui->textEditRich->setMarkdown(ui->textEdit->toPlainText());
}
}

void MainWindow::on_textEdit_textChanged()
{
markdownUpdate();
}

void MainWindow::on_hidePreviewButton_clicked()
{
ui->textEditRich->setVisible(false);
Expand All @@ -268,6 +273,7 @@ void MainWindow::on_hidePreviewButton_clicked()

void MainWindow::on_actionMarkdown_Preview_triggered()
{
markdownUpdate();
ui->textEditRich->setVisible(true);
ui->hidePreviewButton->setVisible(true);
}
Expand Down
1 change: 1 addition & 0 deletions gui/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ private slots:
private:
void contextMenuEvent(QContextMenuEvent* event);
void setupShortcuts();
void markdownUpdate();

static const int STATUS_MILLISECONDS = 2000;
static const int MIN_BORDER = 50;
Expand Down

0 comments on commit 9ad0479

Please sign in to comment.