toolBar-subclass of QToolBar added
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 463 B |
After Width: | Height: | Size: 955 B |
Before Width: | Height: | Size: 885 B After Width: | Height: | Size: 885 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 641 B |
Before Width: | Height: | Size: 910 B After Width: | Height: | Size: 910 B |
After Width: | Height: | Size: 884 B |
After Width: | Height: | Size: 882 B |
After Width: | Height: | Size: 884 B |
10
openscad.pro
|
@ -307,7 +307,7 @@ src/FontCache.h \
|
|||
\
|
||||
src/AutoUpdater.h \
|
||||
src/legacyeditor.h \
|
||||
src/scadlexer.h
|
||||
src/toolbar.h
|
||||
|
||||
SOURCES += src/version_check.cc \
|
||||
src/ProgressWidget.cc \
|
||||
|
@ -362,9 +362,9 @@ SOURCES += src/version_check.cc \
|
|||
src/ModuleCache.cc \
|
||||
src/GeometryCache.cc \
|
||||
src/Tree.cc \
|
||||
src/DrawingCallback.cc \
|
||||
src/FreetypeRenderer.cc \
|
||||
src/FontCache.cc \
|
||||
src/DrawingCallback.cc \
|
||||
src/FreetypeRenderer.cc \
|
||||
src/FontCache.cc \
|
||||
\
|
||||
src/rendersettings.cc \
|
||||
src/highlighter.cc \
|
||||
|
@ -395,7 +395,7 @@ src/FontCache.cc \
|
|||
src/mainwin.cc \
|
||||
src/FontListDialog.cc \
|
||||
src/legacyeditor.cc \
|
||||
src/scadlexer.cpp
|
||||
src/toolbar.cpp
|
||||
|
||||
# ClipperLib
|
||||
SOURCES += src/polyclipping/clipper.cpp
|
||||
|
|
28
openscad.qrc
|
@ -8,19 +8,19 @@
|
|||
<file>icons/prefsUpdate.png</file>
|
||||
<file>icons/flattr.png</file>
|
||||
<file>src/AboutDialog.html</file>
|
||||
<file>Arrowhead-Right-32.png</file>
|
||||
<file>axes.png</file>
|
||||
<file>back.png</file>
|
||||
<file>bottom.png</file>
|
||||
<file>Document-New-128.png</file>
|
||||
<file>down.png</file>
|
||||
<file>front.png</file>
|
||||
<file>grid.png</file>
|
||||
<file>left.png</file>
|
||||
<file>Open-128.png</file>
|
||||
<file>openscad.png</file>
|
||||
<file>right.png</file>
|
||||
<file>Save-128.png</file>
|
||||
<file>up.png</file>
|
||||
<file>images/Arrowhead-Right-32.png</file>
|
||||
<file>images/axes.png</file>
|
||||
<file>images/back.png</file>
|
||||
<file>images/Document-New-128.png</file>
|
||||
<file>images/down.png</file>
|
||||
<file>images/front.png</file>
|
||||
<file>images/grid.png</file>
|
||||
<file>images/Open-128.png</file>
|
||||
<file>images/openscad.png</file>
|
||||
<file>images/right.png</file>
|
||||
<file>images/Save-128.png</file>
|
||||
<file>images/up.png</file>
|
||||
<file>images/bottom.png</file>
|
||||
<file>images/left.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "Tree.h"
|
||||
#include "memory.h"
|
||||
#include "editor.h"
|
||||
#include "toolbar.h"
|
||||
#include <vector>
|
||||
#include <QMutex>
|
||||
#include <QSet>
|
||||
|
@ -110,6 +111,7 @@ private:
|
|||
void setDockWidgetTitle(QDockWidget *dockWidget, QString prefix, bool topLevel);
|
||||
|
||||
EditorInterface *editor;
|
||||
ToolBar *toolBar;
|
||||
|
||||
class QMessageBox *openglbox;
|
||||
class FontListDialog *font_list_dialog;
|
||||
|
|
|
@ -440,30 +440,6 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QToolBar" name="toolBar">
|
||||
<property name="windowTitle">
|
||||
<string>toolBar</string>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
</attribute>
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<addaction name="fileActionNew"/>
|
||||
<addaction name="fileActionOpen"/>
|
||||
<addaction name="fileActionSave"/>
|
||||
<addaction name="designActionRender"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="viewActionTop"/>
|
||||
<addaction name="viewActionBottom"/>
|
||||
<addaction name="viewActionLeft"/>
|
||||
<addaction name="viewActionRight"/>
|
||||
<addaction name="viewActionFront"/>
|
||||
<addaction name="viewActionBack"/>
|
||||
<addaction name="viewActionShowEdges"/>
|
||||
<addaction name="viewActionShowAxes"/>
|
||||
</widget>
|
||||
<action name="fileActionNew">
|
||||
<property name="icon">
|
||||
<iconset resource="../openscad.qrc">
|
||||
|
|
|
@ -269,8 +269,9 @@ MainWindow::MainWindow(const QString &filename)
|
|||
connect(this->appActionUpdateCheck, SIGNAL(triggered()), this, SLOT(actionUpdateCheck()));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// File menu
|
||||
connect(this->fileActionNew, SIGNAL(triggered()), this, SLOT(actionNew()));
|
||||
connect(this->fileActionNew, SIGNAL(triggered()), this, SLOT(actionNew()));
|
||||
connect(this->fileActionOpen, SIGNAL(triggered()), this, SLOT(actionOpen()));
|
||||
connect(this->fileActionSave, SIGNAL(triggered()), this, SLOT(actionSave()));
|
||||
connect(this->fileActionSaveAs, SIGNAL(triggered()), this, SLOT(actionSaveAs()));
|
||||
|
@ -445,7 +446,24 @@ MainWindow::MainWindow(const QString &filename)
|
|||
connect(this->replaceAllButton, SIGNAL(clicked()), this, SLOT(replaceAll()));
|
||||
connect(this->replaceInputField, SIGNAL(returnPressed()), this->replaceButton, SLOT(animateClick()));
|
||||
|
||||
toolBar->setStyleSheet("QToolBar{background-color:black;}");
|
||||
|
||||
//Toolbar
|
||||
toolBar = new ToolBar(this);
|
||||
verticalLayout_2->addWidget(toolBar);
|
||||
connect(toolBar->buttonNew, SIGNAL(clicked()), this, SLOT(actionNew()));
|
||||
connect(toolBar->buttonOpen, SIGNAL(clicked()), this, SLOT(actionOpen()));
|
||||
connect(toolBar->buttonSave, SIGNAL(clicked()), this, SLOT(actionSave()));
|
||||
connect(toolBar->buttonRender, SIGNAL(clicked()), this, SLOT(actionRender()));
|
||||
connect(toolBar->buttonTop, SIGNAL(clicked()), this, SLOT(viewAngleTop()));
|
||||
connect(toolBar->buttonBottom, SIGNAL(clicked()), this, SLOT(viewAngleBottom()));
|
||||
connect(toolBar->buttonLeft, SIGNAL(clicked()), this, SLOT(viewAngleLeft()));
|
||||
connect(toolBar->buttonRight, SIGNAL(clicked()), this, SLOT(viewAngleRight()));
|
||||
connect(toolBar->buttonFront, SIGNAL(clicked()), this, SLOT(viewAngleFront()));
|
||||
connect(toolBar->buttonBack, SIGNAL(clicked()), this, SLOT(viewAngleBack()));
|
||||
|
||||
toolBar->setStyleSheet("QToolBar{background-color:black;}"
|
||||
"QToolButton:hover{background-color:green;}");
|
||||
|
||||
// make sure it looks nice..
|
||||
QSettings settings;
|
||||
QByteArray windowState = settings.value("window/state", QByteArray()).toByteArray();
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
#include "toolbar.h"
|
||||
|
||||
ToolBar::ToolBar(QWidget *parent) :
|
||||
QToolBar(parent)
|
||||
{
|
||||
buttonNew = new QToolButton;
|
||||
buttonNew->setIcon(QIcon("://images/Document-New-128.png"));
|
||||
|
||||
buttonOpen = new QToolButton;
|
||||
buttonOpen->setIcon(QIcon("://images/Open-128.png"));
|
||||
|
||||
buttonSave = new QToolButton;
|
||||
buttonSave->setIcon(QIcon("://images/Save-128.png"));
|
||||
|
||||
buttonRender = new QToolButton;
|
||||
buttonRender->setIcon(QIcon("://images/Arrowhead-Right-32.png"));
|
||||
|
||||
buttonTop = new QToolButton;
|
||||
buttonTop->setIcon(QIcon("://images/up.png"));
|
||||
|
||||
buttonBottom = new QToolButton;
|
||||
buttonBottom->setIcon(QIcon("://images/bottom.png"));
|
||||
|
||||
buttonLeft = new QToolButton;
|
||||
buttonLeft->setIcon(QIcon("://images/left.png"));
|
||||
|
||||
buttonRight = new QToolButton;
|
||||
buttonRight->setIcon(QIcon("://images/right.png"));
|
||||
|
||||
buttonFront = new QToolButton;
|
||||
buttonFront->setIcon(QIcon("://images/front.png"));
|
||||
|
||||
buttonBack = new QToolButton;
|
||||
buttonBack->setIcon(QIcon("://images/back.png"));
|
||||
|
||||
this->addWidget(buttonNew);
|
||||
this->addWidget(buttonOpen);
|
||||
this->addWidget(buttonSave);
|
||||
this->addWidget(buttonRender);
|
||||
this->addSeparator();
|
||||
this->addWidget(buttonTop);
|
||||
this->addWidget(buttonBottom);
|
||||
this->addWidget(buttonLeft);
|
||||
this->addWidget(buttonRight);
|
||||
this->addWidget(buttonFront);
|
||||
this->addWidget(buttonBack);
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
#ifndef TOOLBAR_H
|
||||
#define TOOLBAR_H
|
||||
|
||||
#include <QToolBar>
|
||||
#include <QToolButton>
|
||||
class ToolBar : public QToolBar
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ToolBar(QWidget *parent = 0);
|
||||
QToolButton *buttonNew, *buttonOpen, *buttonSave, *buttonRender;
|
||||
QToolButton *buttonTop, *buttonBottom, *buttonLeft, *buttonRight;
|
||||
QToolButton *buttonFront, *buttonBack;
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
};
|
||||
|
||||
#endif // TOOLBAR_H
|