From: luke.segars Date: Fri, 8 Oct 2010 07:31:42 +0000 (-0700) Subject: Changed some icons and added toolbar widgets. X-Git-Url: https://git.zarvox.org/shortlog/month?a=commitdiff_plain;h=b9bf3ce155203b7afcc7ac28cf495a6924f1ded4;p=shareboard.git Changed some icons and added toolbar widgets. --- diff --git a/icons/play.png b/icons/play.png index 2e8f415..6ef8de7 100644 Binary files a/icons/play.png and b/icons/play.png differ diff --git a/icons/rewind.png b/icons/rewind.png index 77ffb1c..9c15c09 100644 Binary files a/icons/rewind.png and b/icons/rewind.png differ diff --git a/icons/stop.png b/icons/stop.png index d862540..ab6808f 100644 Binary files a/icons/stop.png and b/icons/stop.png differ diff --git a/mainwindow.cpp b/mainwindow.cpp index 5eca4c8..720e85b 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -6,6 +6,10 @@ #include #include #include +#include +#include +#include +#include #include "connectionmanager.h" #include "shareboard.h" @@ -15,6 +19,8 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent) { createActions(); createMenus(); + createToolBars(); + board = new Shareboard(this); setCentralWidget(board); @@ -114,3 +120,56 @@ void MainWindow::createMenus() { } +void MainWindow::createToolBars() { + + // Create some of the basic tool actions. + // They should also be added to an exclusive tool group. + QActionGroup* toolGroup = new QActionGroup(this); + QAction* penAction = new QAction(QIcon("icons/pen.png"), "Pen", this); + QAction* eraserAction = new QAction(QIcon("icons/eraser.png"), "Eraser", this); + penAction->setChecked(true); + toolGroup->addAction(penAction); + toolGroup->addAction(eraserAction); + + // Create some other one-click actions that are not a part of the action group. + QAction* imageAction = new QAction(QIcon("icons/import_image.png"), "Import Image", this); + QAction* clearAction = new QAction(QIcon("icons/clear.png"), "Clear", this); + + // Style + QSpinBox* spinboxWidget = new QSpinBox(this); + spinboxWidget->setMinimum(4); + spinboxWidget->setMaximum(40); + + + QPixmap pixmap(16, 16); + pixmap.fill(QColor(0, 0, 255)); + QAction* colorAction = new QAction(QIcon(pixmap), "Select Color", this); + + // Create the history UI elements. + QAction* restartAction = new QAction(QIcon("icons/rewind.png"), "Replay History", this); + QAction* playAction = new QAction(QIcon("icons/play.png"), "Play", this); + QSlider* sliderWidget = new QSlider(Qt::Horizontal, this); + + toolBar = addToolBar("Test"); + toolBar->setMovable(false); + + toolBar->addSeparator(); +// toolBar->addWidget(new QLabel("Tools", this)); + toolBar->addAction(penAction); + toolBar->addAction(eraserAction); + toolBar->addAction(imageAction); + toolBar->addAction(clearAction); + toolBar->addSeparator(); + +// toolBar->addWidget(new QLabel("Style", this)); + toolBar->addWidget(new QLabel("Width: ", this)); + toolBar->addWidget(spinboxWidget); + toolBar->addWidget(new QLabel("Color: ", this)); + toolBar->addAction(colorAction); + toolBar->addSeparator(); + +// toolBar->addWidget(new QLabel("History", this)); + toolBar->addAction(restartAction); + toolBar->addWidget(sliderWidget); + toolBar->addAction(playAction); +} diff --git a/mainwindow.h b/mainwindow.h index 692bc3c..867bd6c 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -27,7 +27,9 @@ public slots: private: void createActions(); void createMenus(); + void createToolBars(); QMenu* fileMenu; + QToolBar* toolBar; // QAction* joinAction; // Removed in favor of central widget handling this. QAction* loadPastAction; QAction* saveAction;