diff --git a/WorkPad.pro b/WorkPad.pro
index 75622f3..ca05650 100644
--- a/WorkPad.pro
+++ b/WorkPad.pro
@@ -7,7 +7,7 @@ CONFIG += c++17
win32:VERSION = 3.0.0.0 # major.minor.patch.build
else:VERSION = 3.0.0 # major.minor.patch
-DEFINES += APP_VERSION=\"\\\"$${VERSION}-rc2\\\"\"
+DEFINES += APP_VERSION=\"\\\"$${VERSION}\\\"\"
DEFINES += APP_NAME=\"\\\"WorkPad\\\"\"
# remove possible other optimization flags
diff --git a/resources/style.css b/resources/style.css
index ce0861d..f1f9803 100644
--- a/resources/style.css
+++ b/resources/style.css
@@ -10,6 +10,7 @@
font-size: 16px;
line-height: 1.5;
word-wrap: break-word;
+ margin: 2rem;
}
.markdown-body .octicon {
diff --git a/src/frames/mainwindow.cpp b/src/frames/mainwindow.cpp
index cfb2265..f8d626d 100644
--- a/src/frames/mainwindow.cpp
+++ b/src/frames/mainwindow.cpp
@@ -27,15 +27,14 @@ MainWindow::MainWindow(QWidget *parent)
connect(ui->actionAdd, &QAction::triggered, this, &MainWindow::createNote);
connect(ui->actionSave, &QAction::triggered, this, &MainWindow::save);
connect(ui->actionSettings, &QAction::triggered, this, &MainWindow::showSettingsBox);
- connect(ui->contentEdit, &QPlainTextEdit::textChanged, this, &MainWindow::markdownContentChanged);
connect(ui->plainTextEdit, &QPlainTextEdit::textChanged, this, &MainWindow::plainContentChanged);
connect(ui->treeWidget, &QTreeWidget::itemSelectionChanged, this, &MainWindow::selectionChanged);
connect(ui->treeWidget, &QTreeWidget::customContextMenuRequested, this, &MainWindow::prepareMenu);
connect(this, &MainWindow::updateViewers, this, &MainWindow::viewReady);
const QFont fixedFont = QFontDatabase::systemFont(QFontDatabase::FixedFont);
- ui->contentEdit->setFont(fixedFont);
ui->plainTextEdit->setFont(fixedFont);
ui->treeWidget->setContextMenuPolicy(Qt::CustomContextMenu);
+ ui->renderingProgressBar->setVisible(false);
this->savemng = new SaveManager();
this->cfgmng = new ConfigManager();
updateListView();
@@ -131,19 +130,14 @@ void MainWindow::selectionChanged()
return;
}
ui->plainTextEdit->blockSignals(true);
- ui->contentEdit->blockSignals(true);
this->setWindowTitle(n->getTitle() + " - WorkPad");
- ui->titleLabel->setText(n->getTitle());
ui->plainTextEdit->setDisabled(false);
- ui->contentEdit->setDisabled(false);
ui->plainTextEdit->setPlainText(n->getContent());
- ui->contentEdit->setPlainText(n->getContent());
updateHTMLView();
ui->plainTextEdit->blockSignals(false);
- ui->contentEdit->blockSignals(false);
}
else
{
@@ -390,29 +384,28 @@ void MainWindow::exportNote()
void MainWindow::viewReady(QString html)
{
+ if (queue->count() == 0)
+ {
+ ui->renderingProgressBar->setVisible(false);
+ }
ui->webEngineViewer->setHtml(html);
- ui->webEngineEditor->setHtml(html);
}
void MainWindow::markdownContentChanged()
{
timer->stop();
ui->plainTextEdit->blockSignals(true);
- ui->contentEdit->blockSignals(true);
if (ui->treeWidget->selectedItems().length() == 1)
{
QString uuid = ui->treeWidget->selectedItems()[0]->text(COLUMN_UUID);
Note *n = savemng->getNoteByUUID(uuid);
if (n != nullptr) {
-
- QString content = ui->contentEdit->toPlainText();
- ui->plainTextEdit->setPlainText(content);
+ QString content = ui->plainTextEdit->toPlainText();
n->setContent(content);
updateHTMLView();
}
}
ui->plainTextEdit->blockSignals(false);
- ui->contentEdit->blockSignals(false);
ui->actionSave->setDisabled(false);
if (cfgmng->getConfiguration()->isEnableAutoSave())
{
@@ -424,20 +417,17 @@ void MainWindow::plainContentChanged()
{
timer->stop();
ui->plainTextEdit->blockSignals(true);
- ui->contentEdit->blockSignals(true);
if (ui->treeWidget->selectedItems().length() == 1)
{
QString uuid = ui->treeWidget->selectedItems()[0]->text(COLUMN_UUID);
Note *n = savemng->getNoteByUUID(uuid);
if (n != nullptr) {
QString content = ui->plainTextEdit->toPlainText();
- ui->contentEdit->setPlainText(content);
n->setContent(content);
updateHTMLView();
}
}
ui->plainTextEdit->blockSignals(false);
- ui->contentEdit->blockSignals(false);
ui->actionSave->setDisabled(false);
if (cfgmng->getConfiguration()->isEnableAutoSave())
{
@@ -469,6 +459,7 @@ void MainWindow::updateListView()
void MainWindow::updateHTMLView()
{
queueMutex->lock();
+ ui->renderingProgressBar->setVisible(true);
if (queue->count() > 4) {
queue->pop_front();
}
@@ -478,18 +469,12 @@ void MainWindow::updateHTMLView()
void MainWindow::clearAndDisableFields()
{
- ui->contentEdit->blockSignals(true);
ui->plainTextEdit->blockSignals(true);
-
- ui->contentEdit->setDisabled(true);
ui->plainTextEdit->setDisabled(true);
ui->plainTextEdit->clear();
- ui->contentEdit->clear();
- ui->titleLabel->setText("");
this->setWindowTitle("WorkPad");
- ui->contentEdit->blockSignals(false);
ui->plainTextEdit->blockSignals(false);
}
diff --git a/src/frames/mainwindow.ui b/src/frames/mainwindow.ui
index b3517fc..fe3df70 100644
--- a/src/frames/mainwindow.ui
+++ b/src/frames/mainwindow.ui
@@ -25,131 +25,11 @@
-
-
-
-
-
-
-
- 250
- 16777215
-
-
-
- QAbstractItemView::EditTrigger::NoEditTriggers
-
-
- true
-
-
-
- Workspace
-
-
-
-
- -
-
-
- Qt::Orientation::Vertical
-
-
-
- -
-
-
-
-
-
-
- 14
-
-
-
-
-
-
-
- -
-
-
- QTabWidget::TabPosition::South
-
-
- QTabWidget::TabShape::Rounded
-
-
- 0
-
-
-
- Plain text
-
-
-
-
-
-
- false
-
-
-
-
-
-
-
- Markdown editor
-
-
- -
-
-
-
-
-
- false
-
-
-
- 200
- 0
-
-
-
-
- false
-
-
-
- QPlainTextEdit::LineWrapMode::NoWrap
-
-
-
- -
-
-
-
- 400
- 0
-
-
-
-
-
-
-
-
-
-
- Markdown viewer
-
-
- -
-
-
-
-
-
-
-
-
-
+
+
+ false
+
+
@@ -191,6 +71,90 @@
+
+
+
+ 250
+ 84
+
+
+
+ 2
+
+
+
+ -
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+
+
+ -
+
+
+
+ 160
+ 16777215
+
+
+
+ 0
+
+
+ 0
+
+
+ false
+
+
+
+
+
+
+
+
+
+ 250
+ 120
+
+
+
+ 1
+
+
+
+ -
+
+
+
+ 250
+ 16777215
+
+
+
+ QAbstractItemView::EditTrigger::NoEditTriggers
+
+
+ true
+
+
+
+ Workspace
+
+
+
+
+
+
+
false