]> git.zarvox.org Git - shareboard.git/commitdiff
Changed some icons and added toolbar widgets.
authorluke.segars <lukes@eecs.berkeley.edu>
Fri, 8 Oct 2010 07:31:42 +0000 (00:31 -0700)
committerluke.segars <lukes@eecs.berkeley.edu>
Fri, 8 Oct 2010 07:31:42 +0000 (00:31 -0700)
icons/play.png
icons/rewind.png
icons/stop.png
mainwindow.cpp
mainwindow.h

index 2e8f4159bb236aee0643c0dd34f939fe7a1269d2..6ef8de76e0f5bf01c09da24a07c61cfe558d7a4b 100644 (file)
Binary files a/icons/play.png and b/icons/play.png differ
index 77ffb1cd9b38d8899ac9fa09d8e83c7e48f47239..9c15c09e95c3430b5bd1bf24e7a01e8203a2e9a8 100644 (file)
Binary files a/icons/rewind.png and b/icons/rewind.png differ
index d86254085638a76110b3ee8275fd38e2e0b48240..ab6808fba55428710250c72b2569ca5288cd6df2 100644 (file)
Binary files a/icons/stop.png and b/icons/stop.png differ
index 5eca4c896fbbc9fe5371d3973553d13a76398ff3..720e85b1d89655ea2d4a61dfeb4809b1fa87a6ef 100644 (file)
@@ -6,6 +6,10 @@
 #include <QLabel>
 #include <QMenuBar>
 #include <QStatusBar>
+#include <QToolBar>
+#include <QSlider>
+#include <QSpinBox>
+#include <QColorDialog>
 
 #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);
+}
index 692bc3c2d810b3d45a532ebb5a90d4bf8485b486..867bd6cb6903f84f3cb878bd622a1a77207c0998 100644 (file)
@@ -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;