From 88633d22da338b6f94a4bfae16c19f3737e1fa02 Mon Sep 17 00:00:00 2001 From: Le Tan Date: Thu, 13 Oct 2016 21:15:20 +0800 Subject: [PATCH] change the layout of the directory panel Signed-off-by: Le Tan --- vmainwindow.cpp | 13 +++++-------- vmainwindow.h | 1 + 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/vmainwindow.cpp b/vmainwindow.cpp index ced86d9e..3580ec0b 100644 --- a/vmainwindow.cpp +++ b/vmainwindow.cpp @@ -27,18 +27,15 @@ void VMainWindow::setupUI() { // Notebook directory browser tree notebookLabel = new QLabel(tr("Notebook")); + directoryLabel = new QLabel(tr("Directory")); notebookComboBox = new QComboBox(); + notebookComboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents); directoryTree = new VDirectoryTree(); - QHBoxLayout *nbTopLayout = new QHBoxLayout; - notebookComboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - notebookComboBox->setSizeAdjustPolicy(QComboBox::AdjustToContents); - nbTopLayout->setAlignment(Qt::AlignLeft); - nbTopLayout->addWidget(notebookLabel); - nbTopLayout->addWidget(notebookComboBox); - QVBoxLayout *nbLayout = new QVBoxLayout; - nbLayout->addLayout(nbTopLayout); + nbLayout->addWidget(notebookLabel); + nbLayout->addWidget(notebookComboBox); + nbLayout->addWidget(directoryLabel); nbLayout->addWidget(directoryTree); QWidget *nbContainer = new QWidget(); nbContainer->setLayout(nbLayout); diff --git a/vmainwindow.h b/vmainwindow.h index 5fa561f5..3145b83d 100644 --- a/vmainwindow.h +++ b/vmainwindow.h @@ -38,6 +38,7 @@ private: void initToolBar(); QLabel *notebookLabel; + QLabel *directoryLabel; QComboBox *notebookComboBox; VDirectoryTree *directoryTree; VFileList *fileList;