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 <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);
}

View File

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

View File

@ -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;