diff --git a/app/Icons.h b/app/Icons.h index a14d0fe..588eec5 100644 --- a/app/Icons.h +++ b/app/Icons.h @@ -40,6 +40,272 @@ namespace gLabels } }; + class Barcode : public QIcon + { + public: + Barcode() + { + addFile( ":icons/16x16/actions/glabels-barcode.png" ); + addFile( ":icons/24x24/actions/glabels-barcode.png" ); + } + }; + + class Box : public QIcon + { + public: + Box() + { + addFile( ":icons/16x16/actions/glabels-box.png" ); + addFile( ":icons/24x24/actions/glabels-box.png" ); + } + }; + + class Ellipse : public QIcon + { + public: + Ellipse() + { + addFile( ":icons/16x16/actions/glabels-ellipse.png" ); + addFile( ":icons/24x24/actions/glabels-ellipse.png" ); + } + }; + + class Image : public QIcon + { + public: + Image() + { + addFile( ":icons/16x16/actions/glabels-image.png" ); + addFile( ":icons/24x24/actions/glabels-image.png" ); + } + }; + + class Line : public QIcon + { + public: + Line() + { + addFile( ":icons/16x16/actions/glabels-line.png" ); + addFile( ":icons/24x24/actions/glabels-line.png" ); + } + }; + + class Text : public QIcon + { + public: + Text() + { + addFile( ":icons/16x16/actions/glabels-text.png" ); + addFile( ":icons/24x24/actions/glabels-text.png" ); + } + }; + + class Merge : public QIcon + { + public: + Merge() + { + addFile( ":icons/16x16/actions/glabels-merge.png" ); + addFile( ":icons/24x24/actions/glabels-merge.png" ); + } + }; + + class ObjectProperties : public QIcon + { + public: + ObjectProperties() + { + addFile( ":icons/16x16/actions/glabels-object-properties.png" ); + addFile( ":icons/24x24/actions/glabels-object-properties.png" ); + } + }; + + class AlignLeft : public QIcon + { + public: + AlignLeft() + { + addFile( ":icons/16x16/actions/glabels-align-left.png" ); + } + }; + + class AlignHCenter : public QIcon + { + public: + AlignHCenter() + { + addFile( ":icons/16x16/actions/glabels-align-hcenter.png" ); + } + }; + + class AlignRight : public QIcon + { + public: + AlignRight() + { + addFile( ":icons/16x16/actions/glabels-align-right.png" ); + } + }; + + class AlignBottom : public QIcon + { + public: + AlignBottom() + { + addFile( ":icons/16x16/actions/glabels-align-bottom.png" ); + } + }; + + class AlignVCenter : public QIcon + { + public: + AlignVCenter() + { + addFile( ":icons/16x16/actions/glabels-align-vcenter.png" ); + } + }; + + class AlignTop : public QIcon + { + public: + AlignTop() + { + addFile( ":icons/16x16/actions/glabels-align-top.png" ); + } + }; + + class CenterHoriz : public QIcon + { + public: + CenterHoriz() + { + addFile( ":icons/16x16/actions/glabels-center-horiz.png" ); + } + }; + + class CenterVert : public QIcon + { + public: + CenterVert() + { + addFile( ":icons/16x16/actions/glabels-center-vert.png" ); + } + }; + + class FlipHoriz : public QIcon + { + public: + FlipHoriz() + { + addFile( ":icons/16x16/actions/glabels-flip-horiz.png" ); + } + }; + + class FlipVert : public QIcon + { + public: + FlipVert() + { + addFile( ":icons/16x16/actions/glabels-flip-vert.png" ); + } + }; + + class RotateLeft : public QIcon + { + public: + RotateLeft() + { + addFile( ":icons/16x16/actions/glabels-rotate-left.png" ); + } + }; + + class RotateRight : public QIcon + { + public: + RotateRight() + { + addFile( ":icons/16x16/actions/glabels-rotate-right.png" ); + } + }; + + class OrderBottom : public QIcon + { + public: + OrderBottom() + { + addFile( ":icons/16x16/actions/glabels-order-bottom.png" ); + } + }; + + class OrderTop : public QIcon + { + public: + OrderTop() + { + addFile( ":icons/16x16/actions/glabels-order-top.png" ); + } + }; + + class AlignTextBottom : public QIcon + { + public: + AlignTextBottom() + { + addFile( ":icons/24x24/actions/glabels-align-text-bottom.png" ); + } + }; + + class AlignTextMiddle : public QIcon + { + public: + AlignTextMiddle() + { + addFile( ":icons/24x24/actions/glabels-align-text-middle.png" ); + } + }; + + class AlignTextTop : public QIcon + { + public: + AlignTextTop() + { + addFile( ":icons/24x24/actions/glabels-align-text-top.png" ); + } + }; + + class BucketFill : public QIcon + { + public: + BucketFill() + { + addFile( ":icons/16x16/actions/glabels-bucket-fill.png" ); + addFile( ":icons/24x24/actions/glabels-bucket-fill.png" ); + } + }; + + class Pencil : public QIcon + { + public: + Pencil() + { + addFile( ":icons/16x16/actions/glabels-pencil.png" ); + addFile( ":icons/24x24/actions/glabels-pencil.png" ); + } + }; + + class Glabels : public QIcon + { + public: + Glabels() + { + addFile( ":icons/16x16/apps/glabels.png" ); + addFile( ":icons/24x24/apps/glabels.png" ); + addFile( ":icons/32x32/apps/glabels.png" ); + addFile( ":icons/48x48/apps/glabels.png" ); + addFile( ":icons/scalable/apps/glabels.svg" ); + } + }; + } } diff --git a/app/MainWindow.cpp b/app/MainWindow.cpp index 9e73eaa..83f4a2a 100644 --- a/app/MainWindow.cpp +++ b/app/MainWindow.cpp @@ -208,6 +208,66 @@ namespace gLabels objectsArrowModeAction->setStatusTip( tr("Select, move and modify objects") ); connect( objectsArrowModeAction, SIGNAL(triggered()), this, SLOT(objectsArrowMode()) ); + objectsCreateTextAction = new QAction( tr("Text"), this ); + objectsCreateTextAction->setIcon( Icons::Text() ); + objectsCreateTextAction->setStatusTip( tr("Create text object") ); + connect( objectsCreateTextAction, SIGNAL(triggered()), this, SLOT(objectsCreateText()) ); + + objectsCreateBoxAction = new QAction( tr("Box"), this ); + objectsCreateBoxAction->setIcon( Icons::Box() ); + objectsCreateBoxAction->setStatusTip( tr("Create box object") ); + connect( objectsCreateBoxAction, SIGNAL(triggered()), this, SLOT(objectsCreateBox()) ); + + objectsCreateLineAction = new QAction( tr("Line"), this ); + objectsCreateLineAction->setIcon( Icons::Line() ); + objectsCreateLineAction->setStatusTip( tr("Create line object") ); + connect( objectsCreateLineAction, SIGNAL(triggered()), this, SLOT(objectsCreateLine()) ); + + objectsCreateEllipseAction = new QAction( tr("Ellipse"), this ); + objectsCreateEllipseAction->setIcon( Icons::Ellipse() ); + objectsCreateEllipseAction->setStatusTip( tr("Create ellipse/circle object") ); + connect( objectsCreateEllipseAction, SIGNAL(triggered()), this, SLOT(objectsCreateEllipse()) ); + + objectsCreateImageAction = new QAction( tr("Image"), this ); + objectsCreateImageAction->setIcon( Icons::Image() ); + objectsCreateImageAction->setStatusTip( tr("Create image object") ); + connect( objectsCreateImageAction, SIGNAL(triggered()), this, SLOT(objectsCreateImage()) ); + + objectsCreateBarcodeAction = new QAction( tr("Barcode"), this ); + objectsCreateBarcodeAction->setIcon( Icons::Barcode() ); + objectsCreateBarcodeAction->setStatusTip( tr("Create barcode object") ); + connect( objectsCreateBarcodeAction, SIGNAL(triggered()), this, SLOT(objectsCreateBarcode()) ); + + objectsOrderRaiseAction = new QAction( tr("Bring To Front"), this ); + objectsOrderRaiseAction->setIcon( Icons::OrderTop() ); + objectsOrderRaiseAction->setStatusTip( tr("Raise selection to top") ); + connect( objectsOrderRaiseAction, SIGNAL(triggered()), this, SLOT(objectsOrderRaise()) ); + + objectsOrderLowerAction = new QAction( tr("Send To Back"), this ); + objectsOrderLowerAction->setIcon( Icons::OrderBottom() ); + objectsOrderLowerAction->setStatusTip( tr("Lower selection to bottom") ); + connect( objectsOrderLowerAction, SIGNAL(triggered()), this, SLOT(objectsOrderLower()) ); + + objectsXformRotateLeftAction = new QAction( tr("Rotate Left"), this ); + objectsXformRotateLeftAction->setIcon( Icons::RotateLeft() ); + objectsXformRotateLeftAction->setStatusTip( tr("Rotate object(s) 90 degrees counter-clockwise") ); + connect( objectsXformRotateLeftAction, SIGNAL(triggered()), this, SLOT(objectsXformRotateLeft()) ); + + objectsXformRotateRightAction = new QAction( tr("Rotate Right"), this ); + objectsXformRotateRightAction->setIcon( Icons::RotateRight() ); + objectsXformRotateRightAction->setStatusTip( tr("Rotate object(s) 90 degrees clockwise") ); + connect( objectsXformRotateRightAction, SIGNAL(triggered()), this, SLOT(objectsXformRotateRight()) ); + + objectsXformFlipHorizAction = new QAction( tr("Flip Horizontally"), this ); + objectsXformFlipHorizAction->setIcon( Icons::FlipHoriz() ); + objectsXformFlipHorizAction->setStatusTip( tr("Flip object(s) horizontally") ); + connect( objectsXformFlipHorizAction, SIGNAL(triggered()), this, SLOT(objectsXformFlipHoriz()) ); + + objectsXformFlipVertAction = new QAction( tr("Flip Vertically"), this ); + objectsXformFlipVertAction->setIcon( Icons::FlipVert() ); + objectsXformFlipVertAction->setStatusTip( tr("Flip object(s) vertically") ); + connect( objectsXformFlipVertAction, SIGNAL(triggered()), this, SLOT(objectsXformFlipVert()) ); + /* Help actions */ helpAboutAction = new QAction( tr("&About..."), this ); @@ -261,6 +321,21 @@ namespace gLabels objectsMenu = menuBar()->addMenu( tr("&Objects") ); objectsMenu->addAction( objectsArrowModeAction ); + objectsCreateMenu = objectsMenu->addMenu( tr("&Create") ); + objectsCreateMenu->addAction( objectsCreateTextAction ); + objectsCreateMenu->addAction( objectsCreateBoxAction ); + objectsCreateMenu->addAction( objectsCreateLineAction ); + objectsCreateMenu->addAction( objectsCreateEllipseAction ); + objectsCreateMenu->addAction( objectsCreateImageAction ); + objectsCreateMenu->addAction( objectsCreateBarcodeAction ); + objectsOrderMenu = objectsMenu->addMenu( tr("&Order") ); + objectsOrderMenu->addAction( objectsOrderRaiseAction ); + objectsOrderMenu->addAction( objectsOrderLowerAction ); + objectsXformMenu = objectsMenu->addMenu( tr("&Rotate/Flip") ); + objectsXformMenu->addAction( objectsXformRotateLeftAction ); + objectsXformMenu->addAction( objectsXformRotateRightAction ); + objectsXformMenu->addAction( objectsXformFlipHorizAction ); + objectsXformMenu->addAction( objectsXformFlipVertAction ); helpMenu = menuBar()->addMenu( tr("&Help") ); helpMenu->addAction( helpAboutAction ); @@ -429,6 +504,78 @@ namespace gLabels } + void MainWindow::objectsCreateText() + { + std::cout << "ACTION: objects->Create->Text" << std::endl; + } + + + void MainWindow::objectsCreateBox() + { + std::cout << "ACTION: objects->Create->Box" << std::endl; + } + + + void MainWindow::objectsCreateLine() + { + std::cout << "ACTION: objects->Create->Line" << std::endl; + } + + + void MainWindow::objectsCreateEllipse() + { + std::cout << "ACTION: objects->Create->Ellipse" << std::endl; + } + + + void MainWindow::objectsCreateImage() + { + std::cout << "ACTION: objects->Create->Image" << std::endl; + } + + + void MainWindow::objectsCreateBarcode() + { + std::cout << "ACTION: objects->Create->Barcode" << std::endl; + } + + + void MainWindow::objectsOrderRaise() + { + std::cout << "ACTION: objects->Order->Bring to front" << std::endl; + } + + + void MainWindow::objectsOrderLower() + { + std::cout << "ACTION: objects->Order->Send to back" << std::endl; + } + + + void MainWindow::objectsXformRotateLeft() + { + std::cout << "ACTION: objects->Rotate/Flip->Rotate Left" << std::endl; + } + + + void MainWindow::objectsXformRotateRight() + { + std::cout << "ACTION: objects->Rotate/Flip->Rotate Right" << std::endl; + } + + + void MainWindow::objectsXformFlipHoriz() + { + std::cout << "ACTION: objects->Rotate/Flip->Flip Horizontally" << std::endl; + } + + + void MainWindow::objectsXformFlipVert() + { + std::cout << "ACTION: objects->Rotate/Flip->Flip Vertically" << std::endl; + } + + void MainWindow::helpAbout() { QMessageBox aboutBox( QMessageBox::NoIcon, @@ -448,3 +595,4 @@ namespace gLabels } } + diff --git a/app/MainWindow.h b/app/MainWindow.h index c51e266..cae85fe 100644 --- a/app/MainWindow.h +++ b/app/MainWindow.h @@ -74,6 +74,18 @@ namespace gLabels void viewZoomToFit(); void objectsArrowMode(); + void objectsCreateText(); + void objectsCreateBox(); + void objectsCreateLine(); + void objectsCreateEllipse(); + void objectsCreateImage(); + void objectsCreateBarcode(); + void objectsOrderRaise(); + void objectsOrderLower(); + void objectsXformRotateLeft(); + void objectsXformRotateRight(); + void objectsXformFlipHoriz(); + void objectsXformFlipVert(); void helpAbout(); @@ -86,6 +98,9 @@ namespace gLabels QMenu *editMenu; QMenu *viewMenu; QMenu *objectsMenu; + QMenu *objectsCreateMenu; + QMenu *objectsOrderMenu; + QMenu *objectsXformMenu; QMenu *helpMenu; QAction *fileNewAction; @@ -118,6 +133,18 @@ namespace gLabels QAction *viewZoomToFitAction; QAction *objectsArrowModeAction; + QAction *objectsCreateTextAction; + QAction *objectsCreateBoxAction; + QAction *objectsCreateLineAction; + QAction *objectsCreateEllipseAction; + QAction *objectsCreateImageAction; + QAction *objectsCreateBarcodeAction; + QAction *objectsOrderRaiseAction; + QAction *objectsOrderLowerAction; + QAction *objectsXformRotateLeftAction; + QAction *objectsXformRotateRightAction; + QAction *objectsXformFlipHorizAction; + QAction *objectsXformFlipVertAction; QAction *helpAboutAction; diff --git a/app/icons.qrc b/app/icons.qrc index fbdc52d..5ce1660 100644 --- a/app/icons.qrc +++ b/app/icons.qrc @@ -36,16 +36,12 @@ icons/24x24/actions/glabels-box.png icons/24x24/actions/glabels-bucket-fill.png icons/24x24/actions/glabels-ellipse.png - icons/24x24/actions/glabels-hchain-broken.png - icons/24x24/actions/glabels-hchain.png icons/24x24/actions/glabels-image.png icons/24x24/actions/glabels-line.png icons/24x24/actions/glabels-merge.png icons/24x24/actions/glabels-object-properties.png icons/24x24/actions/glabels-pencil.png icons/24x24/actions/glabels-text.png - icons/24x24/actions/glabels-vchain-broken.png - icons/24x24/actions/glabels-vchain.png icons/24x24/apps/glabels.png icons/32x32/apps/glabels.png icons/48x48/apps/glabels.png diff --git a/app/icons/24x24/actions/glabels-hchain-broken.png b/app/icons/24x24/actions/glabels-hchain-broken.png deleted file mode 100644 index 2e961a3..0000000 Binary files a/app/icons/24x24/actions/glabels-hchain-broken.png and /dev/null differ diff --git a/app/icons/24x24/actions/glabels-hchain.png b/app/icons/24x24/actions/glabels-hchain.png deleted file mode 100644 index 5bc2eed..0000000 Binary files a/app/icons/24x24/actions/glabels-hchain.png and /dev/null differ diff --git a/app/icons/24x24/actions/glabels-vchain-broken.png b/app/icons/24x24/actions/glabels-vchain-broken.png deleted file mode 100644 index 8ef1363..0000000 Binary files a/app/icons/24x24/actions/glabels-vchain-broken.png and /dev/null differ diff --git a/app/icons/24x24/actions/glabels-vchain.png b/app/icons/24x24/actions/glabels-vchain.png deleted file mode 100644 index 7dc2031..0000000 Binary files a/app/icons/24x24/actions/glabels-vchain.png and /dev/null differ