diff options
author | Arno <arno@disconnect.de> | 2018-03-30 18:18:06 +0200 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2018-03-30 18:18:06 +0200 |
commit | 8e685d4ab524da43bae639274e12221fc28fc847 (patch) | |
tree | f1a937cc2fba101d5302c4f9c6819ca84b740ab5 | |
parent | e932aafaa203f70c9be29879fc17bde9d2ac53c2 (diff) | |
download | SheMov-8e685d4ab524da43bae639274e12221fc28fc847.tar.gz SheMov-8e685d4ab524da43bae639274e12221fc28fc847.tar.bz2 SheMov-8e685d4ab524da43bae639274e12221fc28fc847.zip |
Basic layout for new FSWidget
Just the layout, does absolutely nothing yet.
-rw-r--r-- | fswidget.cpp | 63 | ||||
-rw-r--r-- | fswidget.h | 25 | ||||
-rw-r--r-- | shemov.cpp | 3 | ||||
-rw-r--r-- | shemov.h | 2 | ||||
-rw-r--r-- | shemov.pro | 6 |
5 files changed, 97 insertions, 2 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); +} diff --git a/fswidget.h b/fswidget.h new file mode 100644 index 0000000..e77ab2d --- /dev/null +++ b/fswidget.h @@ -0,0 +1,25 @@ +#ifndef FSWIDGET_H +#define FSWIDGET_H + +#include <QWidget> + +class QComboBox; +class QTreeView; + +class FSWidget : public QWidget { + Q_OBJECT + public: + explicit FSWidget(QWidget *parent = nullptr); + + signals: + + public slots: + + private: + void setupWidget(); + QComboBox *mDirCB; + QComboBox *mFilterCB; + QTreeView *mFileView; +}; + +#endif // FSWIDGET_H @@ -38,6 +38,7 @@ #include "archivebrowser.h" #include "searchdialog.h" #include "randomtab.h" +#include "fswidget.h" SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, flags), mOpenWithGroupFS(0), mOpenWithGroupAV(0) { //application icon @@ -61,6 +62,8 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla mTab = new QTabWidget; mTab->addTab(mFSWidget, tr("Filemanager")); connect(this, &SheMov::configChanged, mFSWidget, &FilesystemWidget::configChanged); + mFileWidget = new FSWidget; + mTab->addTab(mFileWidget, tr("FS")); //experimental splash.showMessage(tr("Creating Movie archive..."), Qt::AlignHCenter, Qt::yellow); @@ -24,6 +24,7 @@ class ArchiveView; class ArchiveBrowser; class SearchDialog; class RandomTab; +class FSWidget; class SheMov : public QMainWindow { Q_OBJECT @@ -218,5 +219,6 @@ class SheMov : public QMainWindow { ArchiveView *mArchive; ArchiveBrowser *mArchiveBrowser; RandomTab *mRandomTab; + FSWidget* mFileWidget; //rename me! }; #endif @@ -47,7 +47,8 @@ SOURCES = main.cpp \ unpacker.cpp \ searchdialog.cpp \ copyworker.cpp \ - randomtab.cpp + randomtab.cpp \ + fswidget.cpp HEADERS = \ filesystemdirproxy.h \ filesystemwidget.h \ @@ -89,7 +90,8 @@ HEADERS = \ unpacker.h \ searchdialog.h \ copyworker.h \ - randomtab.h + randomtab.h \ + fswidget.h LIBS += -lmagic -lXfixes -lX11 -lMagick++-6.Q16HDRI INCLUDEPATH += /usr/include/ImageMagick-6/ RESOURCES = shemov.qrc |