diff options
Diffstat (limited to 'fswidget.cpp')
-rw-r--r-- | fswidget.cpp | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/fswidget.cpp b/fswidget.cpp new file mode 100644 index 0000000..21e0435 --- /dev/null +++ b/fswidget.cpp @@ -0,0 +1,63 @@ +#include <QToolBar> +#include <QLabel> +#include <QComboBox> +#include <QHBoxLayout> +#include <QVBoxLayout> +#include <QTreeView> + +#include "fswidget.h" + +FSWidget::FSWidget(QWidget *parent) : QWidget(parent) { + setupWidget(); +} + +void FSWidget::setupWidget(){ + QToolBar *toolbar = new QToolBar; + QPixmap buttplug(":/butt_plug.png"); + QMatrix rotatematrix; + rotatematrix.rotate(90); + QIcon buttplugRight(buttplug.transformed(rotatematrix)); + rotatematrix.rotate(-180); + QIcon buttplugLeft(buttplug.transformed(rotatematrix)); + QAction *backA = new QAction(buttplugLeft, tr("Prev. dir"), this); + toolbar->addAction(backA); + QAction *forwardA = new QAction(buttplugRight, tr("Next dir"), this); + toolbar->addAction(forwardA); + + QLabel *dirL = new QLabel(tr("Dir")); + mDirCB = new QComboBox; + QAction *addDirA = new QAction(QIcon(":/gaping_ass.png"), tr("Add dir..."), this); + QAction *removeDirA = new QAction(QIcon(":/hourglass_figure.png"), tr("Remove dir."), this); + QToolBar *dirTB = new QToolBar; + dirTB->addAction(addDirA); + dirTB->addAction(removeDirA); + + QLabel *filterL = new QLabel(tr("Filter")); + mFilterCB = new QComboBox; + QAction *addFilterA = new QAction(QIcon(":/gaping_ass.png"), tr("Add filter..."), this); + QAction *removeFilterA = new QAction(QIcon(":/hourglass_figure.png"), tr("Remove filter"), this); + QToolBar *filterTB = new QToolBar; + filterTB->addAction(addFilterA); + filterTB->addAction(removeFilterA); + + QHBoxLayout *topWL = new QHBoxLayout; + topWL->addWidget(dirL); + topWL->addWidget(mDirCB); + topWL->addWidget(dirTB); + topWL->addWidget(filterL); + topWL->addWidget(mFilterCB); + topWL->addWidget(filterTB); + topWL->addWidget(toolbar); + topWL->addStretch(); + + mFileView = new QTreeView; + mFileView->setSortingEnabled(true); + mFileView->setUniformRowHeights(true); + mFileView->setSelectionBehavior(QAbstractItemView::SelectRows); + mFileView->setSelectionMode(QAbstractItemView::ExtendedSelection); + + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addLayout(topWL); + mainLayout->addWidget(mFileView); + setLayout(mainLayout); +} |