Răsfoiți Sursa

small fix

1. Use `Dir::homePath()` when creating QFileDialog;
2. Add `overflow:auto` to `pre` in markdown.css;

Signed-off-by: Le Tan <[email protected]>
Le Tan 9 ani în urmă
părinte
comite
359f886732
3 a modificat fișierele cu 6 adăugiri și 4 ștergeri
  1. 4 3
      dialog/vnewnotebookdialog.cpp
  2. 1 1
      dialog/vnewnotebookdialog.h
  3. 1 0
      resources/markdown.css

+ 4 - 3
dialog/vnewnotebookdialog.cpp

@@ -1,11 +1,12 @@
 #include <QtWidgets>
+#include <QDir>
 #include "vnewnotebookdialog.h"
 
 VNewNotebookDialog::VNewNotebookDialog(const QString &title, const QString &info,
                                        const QString &defaultName, const QString &defaultPath,
                                        QWidget *parent)
-    : QDialog(parent), title(title), info(info), defaultName(defaultName), defaultPath(defaultPath),
-      infoLabel(NULL)
+    : QDialog(parent), infoLabel(NULL),
+      title(title), info(info), defaultName(defaultName), defaultPath(defaultPath)
 {
     setupUI();
 
@@ -81,6 +82,6 @@ QString VNewNotebookDialog::getPathInput() const
 void VNewNotebookDialog::handleBrowseBtnClicked()
 {
     QString dirPath = QFileDialog::getExistingDirectory(this, tr("Select a directory as the path of the notebook"),
-                                                        "", QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
+                                                        QDir::homePath(), QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
     pathEdit->setText(dirPath);
 }

+ 1 - 1
dialog/vnewnotebookdialog.h

@@ -33,8 +33,8 @@ private:
     QPushButton *cancelBtn;
 
     QString title;
-    QString defaultName;
     QString info;
+    QString defaultName;
     QString defaultPath;
 };
 

+ 1 - 0
resources/markdown.css

@@ -67,6 +67,7 @@ pre {
     background-color: #f8f8f8;
     border-radius: 3px;
     border: 1px solid #cccccc;
+    overflow: auto;
 }
 code {
     font-family: Consolas, Monaco, Andale Mono, monospace;