small fix

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

Signed-off-by: Le Tan <tamlokveer@gmail.com>
This commit is contained in:
Le Tan 2016-10-17 21:33:48 +08:00
parent f31272966e
commit 359f886732
3 changed files with 6 additions and 4 deletions

View File

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

View File

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

View File

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