diff --git a/relightlab/imageframe.cpp b/relightlab/imageframe.cpp index 15da0d04..228747ad 100644 --- a/relightlab/imageframe.cpp +++ b/relightlab/imageframe.cpp @@ -1,6 +1,33 @@ +#include +#include +#include + +#include "relightapp.h" #include "imageframe.h" -ImageFrame::ImageFrame() -{ +ImageFrame::ImageFrame() { + QVBoxLayout *container = new QVBoxLayout(this); + + QHBoxLayout *toolbars = new QHBoxLayout(); + + QToolBar *left_toolbar = new QToolBar; + left_toolbar->addAction(qRelightApp->action("zoom_fit")); + left_toolbar->addAction(qRelightApp->action("zoom_one")); + left_toolbar->addAction(qRelightApp->action("zoom_in")); + left_toolbar->addAction(qRelightApp->action("zoom_out")); + left_toolbar->addAction(qRelightApp->action("rotate_right")); + left_toolbar->addAction(qRelightApp->action("rotate_left")); + + toolbars->addWidget(left_toolbar); + toolbars->addSpacing(1); + + QToolBar *right_toolbar = new QToolBar; + right_toolbar->addAction(qRelightApp->action("show_image")); + right_toolbar->addAction(qRelightApp->action("show_list")); + right_toolbar->addAction(qRelightApp->action("show_grid")); + toolbars->addWidget(right_toolbar); + + container->addLayout(toolbars); + container->addWidget(new QGraphicsView); } diff --git a/relightlab/imagestab.cpp b/relightlab/imagestab.cpp deleted file mode 100644 index 2759d771..00000000 --- a/relightlab/imagestab.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include -#include -#include - -#include "imagestab.h" -#include "relightapp.h" - -ImagesTab::ImagesTab() { - - QVBoxLayout *container = new QVBoxLayout(this); - - QToolBar *toolbar = new QToolBar(this); - toolbar->addAction(qRelightApp->action("fullscreen")); -} diff --git a/relightlab/imagestab.h b/relightlab/imagestab.h deleted file mode 100644 index 1c6c20db..00000000 --- a/relightlab/imagestab.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef IMAGESTAB_H -#define IMAGESTAB_H - -#include - -class ImagesTab: public QFrame { -public: - ImagesTab(); -}; - -#endif // IMAGESTAB_H diff --git a/relightlab/mainwindow.cpp b/relightlab/mainwindow.cpp index 7dfb0c96..7acce943 100644 --- a/relightlab/mainwindow.cpp +++ b/relightlab/mainwindow.cpp @@ -171,7 +171,6 @@ void MainWindow::openProject() { } void MainWindow::closeProject() { - cout << "close Project" << endl; qRelightApp->action("close_project")->setEnabled(false); } @@ -181,8 +180,8 @@ void MainWindow::initInterface() { } bool MainWindow::needsSavingProceed() { - if(!qRelightApp->project().needs_saving); - return true; + if(!qRelightApp->project().needs_saving) + return true; auto answer = QMessageBox::question(this, "Current project is unsaved", "Do you want to proceed without saving?"); return answer == QMessageBox::Yes; } diff --git a/relightlab/relightapp.cpp b/relightlab/relightapp.cpp index bfff6e6f..cc791ae2 100644 --- a/relightlab/relightapp.cpp +++ b/relightlab/relightapp.cpp @@ -21,6 +21,18 @@ RelightApp::RelightApp(int &argc, char **argv): QApplication(argc, argv) { addAction("open_project", "Open project...", "Ctrl+O"); addAction("close_project", "Close project", "Ctrl-W"); addAction("exit", "Exit", "Alt+F4"); + + //imagesframe + addAction("zoom_fit", "Fit", ""); + addAction("zoom_one", "Zoom 1x", "1"); + addAction("zoom_in", "Zoom in", "+"); + addAction("zoom_out", "Zoom out", "-"); + addAction("rotate_left", "Rotate left", ""); + addAction("rotate_right", "Rotate right", ""); + + addAction("show_image", "Show image", ""); + addAction("show_list", "Show list", ""); + addAction("show_grid", "Show grid", ""); } void RelightApp::addAction(const QString &id, const QString &label, const QString &shortcut) { diff --git a/relightlab/relightlab.pro b/relightlab/relightlab.pro index b5bac944..6f15fc15 100644 --- a/relightlab/relightlab.pro +++ b/relightlab/relightlab.pro @@ -37,7 +37,6 @@ SOURCES += main.cpp \ ../src/project.cpp \ ../src/sphere.cpp \ ../src/white.cpp \ - imagestab.cpp \ mainwindow.cpp \ recentprojects.cpp \ relightapp.cpp \ @@ -66,7 +65,6 @@ HEADERS += \ ../src/project.h \ ../src/sphere.h \ ../src/white.h \ - imagestab.h \ mainwindow.h \ mainwindow.h \ recentprojects.h \