toolbar splitted into two
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 942 B |
After Width: | Height: | Size: 939 B |
After Width: | Height: | Size: 920 B |
After Width: | Height: | Size: 909 B |
After Width: | Height: | Size: 942 B |
After Width: | Height: | Size: 200 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 945 B |
After Width: | Height: | Size: 938 B |
|
@ -307,7 +307,8 @@ src/FontCache.h \
|
||||||
\
|
\
|
||||||
src/AutoUpdater.h \
|
src/AutoUpdater.h \
|
||||||
src/legacyeditor.h \
|
src/legacyeditor.h \
|
||||||
src/toolbar.h
|
src/toolbar.h \
|
||||||
|
src/editortoolbar.h
|
||||||
|
|
||||||
SOURCES += src/version_check.cc \
|
SOURCES += src/version_check.cc \
|
||||||
src/ProgressWidget.cc \
|
src/ProgressWidget.cc \
|
||||||
|
@ -395,7 +396,8 @@ SOURCES += src/version_check.cc \
|
||||||
src/mainwin.cc \
|
src/mainwin.cc \
|
||||||
src/FontListDialog.cc \
|
src/FontListDialog.cc \
|
||||||
src/legacyeditor.cc \
|
src/legacyeditor.cc \
|
||||||
src/toolbar.cpp
|
src/toolbar.cpp \
|
||||||
|
src/editortoolbar.cpp
|
||||||
|
|
||||||
# ClipperLib
|
# ClipperLib
|
||||||
SOURCES += src/polyclipping/clipper.cpp
|
SOURCES += src/polyclipping/clipper.cpp
|
||||||
|
|
19
openscad.qrc
|
@ -22,5 +22,24 @@
|
||||||
<file>images/up.png</file>
|
<file>images/up.png</file>
|
||||||
<file>images/bottom.png</file>
|
<file>images/bottom.png</file>
|
||||||
<file>images/left.png</file>
|
<file>images/left.png</file>
|
||||||
|
<file>images/blackUp.png</file>
|
||||||
|
<file>images/blackNew.png</file>
|
||||||
|
<file>images/blackRender.png</file>
|
||||||
|
<file>images/Rotation-32.png</file>
|
||||||
|
<file>images/Shape-Cube-32.png</file>
|
||||||
|
<file>images/Open-32.png</file>
|
||||||
|
<file>images/Open-32(1).png</file>
|
||||||
|
<file>images/Save-32.png</file>
|
||||||
|
<file>images/blackbottom.png</file>
|
||||||
|
<file>images/blackleft (copy).png</file>
|
||||||
|
<file>images/blackright (copy).png</file>
|
||||||
|
<file>images/blackright.png</file>
|
||||||
|
<file>images/blackright1.png</file>
|
||||||
|
<file>images/rightright.png</file>
|
||||||
|
<file>images/blackfront.png</file>
|
||||||
|
<file>images/blackback.png</file>
|
||||||
|
<file>images/blackaxes.png</file>
|
||||||
|
<file>images/zoomin.png</file>
|
||||||
|
<file>images/zoomout.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "Tree.h"
|
#include "Tree.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "editor.h"
|
#include "editor.h"
|
||||||
|
#include "editortoolbar.h"
|
||||||
#include "toolbar.h"
|
#include "toolbar.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
|
@ -111,6 +112,7 @@ private:
|
||||||
void setDockWidgetTitle(QDockWidget *dockWidget, QString prefix, bool topLevel);
|
void setDockWidgetTitle(QDockWidget *dockWidget, QString prefix, bool topLevel);
|
||||||
|
|
||||||
EditorInterface *editor;
|
EditorInterface *editor;
|
||||||
|
EditorToolBar *editortoolbar;
|
||||||
ToolBar *toolBar;
|
ToolBar *toolBar;
|
||||||
|
|
||||||
class QMessageBox *openglbox;
|
class QMessageBox *openglbox;
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
#include "editortoolbar.h"
|
||||||
|
|
||||||
|
EditorToolBar::EditorToolBar(QWidget *parent) :
|
||||||
|
QToolBar(parent)
|
||||||
|
{
|
||||||
|
int defaultColor = this->palette().background().color().lightness();
|
||||||
|
|
||||||
|
buttonNew = new QToolButton;
|
||||||
|
buttonOpen = new QToolButton;
|
||||||
|
buttonSave = new QToolButton;
|
||||||
|
buttonZoomIn = new QToolButton;
|
||||||
|
buttonZoomOut = new QToolButton;
|
||||||
|
|
||||||
|
if(defaultColor > 165)
|
||||||
|
{
|
||||||
|
buttonNew->setIcon(QIcon("://images/blackNew.png"));
|
||||||
|
buttonOpen->setIcon(QIcon("://images/Open-32(1).png"));
|
||||||
|
buttonSave->setIcon(QIcon("://images/Save-32.png"));
|
||||||
|
} else {
|
||||||
|
|
||||||
|
buttonNew->setIcon(QIcon("://images/Document-New-128.png"));
|
||||||
|
buttonOpen->setIcon(QIcon("://images/Open-128.png"));
|
||||||
|
buttonSave->setIcon(QIcon("://images/Save-128.png"));
|
||||||
|
}
|
||||||
|
|
||||||
|
this->addWidget(buttonNew);
|
||||||
|
this->addWidget(buttonOpen);
|
||||||
|
this->addWidget(buttonSave);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
#ifndef EDITORTOOLBAR_H
|
||||||
|
#define EDITORTOOLBAR_H
|
||||||
|
|
||||||
|
#include <QToolBar>
|
||||||
|
#include <QToolButton>
|
||||||
|
|
||||||
|
class EditorToolBar : public QToolBar
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit EditorToolBar(QWidget *parent = 0);
|
||||||
|
QToolButton *buttonNew, *buttonOpen, *buttonSave;
|
||||||
|
QToolButton *buttonZoomIn, *buttonZoomOut;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // EDITORTOOLBAR_H
|
|
@ -23,6 +23,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
#include <iostream>
|
||||||
#include "GeometryCache.h"
|
#include "GeometryCache.h"
|
||||||
#include "ModuleCache.h"
|
#include "ModuleCache.h"
|
||||||
#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
|
@ -173,6 +174,7 @@ MainWindow::MainWindow(const QString &filename)
|
||||||
editortype = Preferences::inst()->getValue("editor/editortype").toString();
|
editortype = Preferences::inst()->getValue("editor/editortype").toString();
|
||||||
|
|
||||||
useScintilla = (editortype == "QScintilla Editor");
|
useScintilla = (editortype == "QScintilla Editor");
|
||||||
|
|
||||||
#ifdef USE_SCINTILLA_EDITOR
|
#ifdef USE_SCINTILLA_EDITOR
|
||||||
if (useScintilla) {
|
if (useScintilla) {
|
||||||
editor = new ScintillaEditor(editorDockContents);
|
editor = new ScintillaEditor(editorDockContents);
|
||||||
|
@ -183,6 +185,9 @@ MainWindow::MainWindow(const QString &filename)
|
||||||
|
|
||||||
editorDockContents->layout()->addWidget(editor);
|
editorDockContents->layout()->addWidget(editor);
|
||||||
|
|
||||||
|
editortoolbar = new EditorToolBar(this);
|
||||||
|
editorDockContents->layout()->addWidget(editortoolbar);
|
||||||
|
|
||||||
setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
|
setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
|
||||||
setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
|
setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
|
||||||
setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
|
setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
|
||||||
|
@ -398,7 +403,7 @@ MainWindow::MainWindow(const QString &filename)
|
||||||
connect(this->helpActionHomepage, SIGNAL(triggered()), this, SLOT(helpHomepage()));
|
connect(this->helpActionHomepage, SIGNAL(triggered()), this, SLOT(helpHomepage()));
|
||||||
connect(this->helpActionManual, SIGNAL(triggered()), this, SLOT(helpManual()));
|
connect(this->helpActionManual, SIGNAL(triggered()), this, SLOT(helpManual()));
|
||||||
connect(this->helpActionLibraryInfo, SIGNAL(triggered()), this, SLOT(helpLibrary()));
|
connect(this->helpActionLibraryInfo, SIGNAL(triggered()), this, SLOT(helpLibrary()));
|
||||||
connect(this->helpActionFontInfo, SIGNAL(triggered()), this, SLOT(helpFontInfo()));
|
connect(this->helpActionFontInfo, SIGNAL(triggered()), this, SLOT(viewModeShowAxes()));
|
||||||
|
|
||||||
setCurrentOutput();
|
setCurrentOutput();
|
||||||
|
|
||||||
|
@ -446,24 +451,32 @@ MainWindow::MainWindow(const QString &filename)
|
||||||
connect(this->replaceAllButton, SIGNAL(clicked()), this, SLOT(replaceAll()));
|
connect(this->replaceAllButton, SIGNAL(clicked()), this, SLOT(replaceAll()));
|
||||||
connect(this->replaceInputField, SIGNAL(returnPressed()), this->replaceButton, SLOT(animateClick()));
|
connect(this->replaceInputField, SIGNAL(returnPressed()), this->replaceButton, SLOT(animateClick()));
|
||||||
|
|
||||||
|
//EditorToolbar
|
||||||
|
connect(editortoolbar->buttonNew, SIGNAL(clicked()), this, SLOT(actionNew()));
|
||||||
|
connect(editortoolbar->buttonOpen, SIGNAL(clicked()), this, SLOT(actionOpen()));
|
||||||
|
connect(editortoolbar->buttonSave, SIGNAL(clicked()), this, SLOT(actionSave()));
|
||||||
|
|
||||||
//Toolbar
|
//Toolbar
|
||||||
toolBar = new ToolBar(this);
|
toolBar = new ToolBar(this);
|
||||||
verticalLayout_2->addWidget(toolBar);
|
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->buttonRender, SIGNAL(clicked()), this, SLOT(actionRender()));
|
||||||
connect(toolBar->buttonTop, SIGNAL(clicked()), this, SLOT(viewAngleTop()));
|
connect(toolBar->buttonTop, SIGNAL(clicked()), this, SLOT(viewAngleTop()));
|
||||||
connect(toolBar->buttonBottom, SIGNAL(clicked()), this, SLOT(viewAngleBottom()));
|
connect(toolBar->buttonBottom, SIGNAL(clicked()), this, SLOT(viewAngleBottom()));
|
||||||
connect(toolBar->buttonLeft, SIGNAL(clicked()), this, SLOT(viewAngleLeft()));
|
connect(toolBar->buttonLeft, SIGNAL(clicked()), this, SLOT(viewAngleLeft()));
|
||||||
connect(toolBar->buttonRight, SIGNAL(clicked()), this, SLOT(viewAngleRight()));
|
connect(toolBar->buttonRight, SIGNAL(clicked()), this, SLOT(viewAngleRight()));
|
||||||
connect(toolBar->buttonFront, SIGNAL(clicked()), this, SLOT(viewAngleFront()));
|
connect(toolBar->buttonFront, SIGNAL(clicked()), this, SLOT(viewAngleFront()));
|
||||||
connect(toolBar->buttonBack, SIGNAL(clicked()), this, SLOT(viewAngleBack()));
|
connect(toolBar->buttonBack, SIGNAL(clicked()), this, SLOT(viewModeShowAxes()));
|
||||||
|
connect(toolBar->buttonAxes, SIGNAL(triggered()), this, SLOT(viewModeShowAxes()));
|
||||||
toolBar->setStyleSheet("QToolBar{background-color:black;}"
|
connect(toolBar->buttonEdges, SIGNAL(clicked()), this, SLOT(viewModeShowEdges()));
|
||||||
"QToolButton:hover{background-color:green;}");
|
connect(toolBar->buttonZoomIn, SIGNAL(clicked()), qglview, SLOT(ZoomIn()));
|
||||||
|
connect(toolBar->buttonZoomOut, SIGNAL(clicked()), qglview, SLOT(ZoomOut()));
|
||||||
|
|
||||||
|
|
||||||
|
toolBar->setStyleSheet("QToolBar{border:1 solid black;}" );
|
||||||
|
// "QToolButton:hover{background-color:green;}");
|
||||||
|
//std::cout<< toolBar->palette().background().color().name().toStdString()<<std::endl;
|
||||||
|
//std::cout<< toolBar->palette().background().color().lightness()<<std::endl;
|
||||||
|
|
||||||
// make sure it looks nice..
|
// make sure it looks nice..
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
QByteArray windowState = settings.value("window/state", QByteArray()).toByteArray();
|
QByteArray windowState = settings.value("window/state", QByteArray()).toByteArray();
|
||||||
|
@ -529,6 +542,8 @@ void MainWindow::loadViewSettings(){
|
||||||
hideConsole();
|
hideConsole();
|
||||||
editActionHide->setChecked(settings.value("view/hideEditor").toBool());
|
editActionHide->setChecked(settings.value("view/hideEditor").toBool());
|
||||||
hideEditor();
|
hideEditor();
|
||||||
|
toolBarActionHide->setChecked(settings.value("view/hideToolbar").toBool());
|
||||||
|
hideToolbar();
|
||||||
updateMdiMode(settings.value("advanced/mdi").toBool());
|
updateMdiMode(settings.value("advanced/mdi").toBool());
|
||||||
updateUndockMode(settings.value("advanced/undockableWindows").toBool());
|
updateUndockMode(settings.value("advanced/undockableWindows").toBool());
|
||||||
}
|
}
|
||||||
|
@ -2222,8 +2237,10 @@ void MainWindow::hideToolbar()
|
||||||
{
|
{
|
||||||
if(toolBarActionHide->isChecked()){
|
if(toolBarActionHide->isChecked()){
|
||||||
toolBar->hide();
|
toolBar->hide();
|
||||||
|
editortoolbar->hide();
|
||||||
} else {
|
} else {
|
||||||
toolBar->show();
|
toolBar->show();
|
||||||
|
editortoolbar->show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,39 +3,47 @@
|
||||||
ToolBar::ToolBar(QWidget *parent) :
|
ToolBar::ToolBar(QWidget *parent) :
|
||||||
QToolBar(parent)
|
QToolBar(parent)
|
||||||
{
|
{
|
||||||
buttonNew = new QToolButton;
|
int defaultColor = this->palette().background().color().lightness();
|
||||||
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 = new QToolButton;
|
||||||
buttonRender->setIcon(QIcon("://images/Arrowhead-Right-32.png"));
|
|
||||||
|
|
||||||
buttonTop = new QToolButton;
|
buttonTop = new QToolButton;
|
||||||
buttonTop->setIcon(QIcon("://images/up.png"));
|
|
||||||
|
|
||||||
buttonBottom = new QToolButton;
|
buttonBottom = new QToolButton;
|
||||||
buttonBottom->setIcon(QIcon("://images/bottom.png"));
|
|
||||||
|
|
||||||
buttonLeft = new QToolButton;
|
buttonLeft = new QToolButton;
|
||||||
buttonLeft->setIcon(QIcon("://images/left.png"));
|
|
||||||
|
|
||||||
buttonRight = new QToolButton;
|
buttonRight = new QToolButton;
|
||||||
buttonRight->setIcon(QIcon("://images/right.png"));
|
|
||||||
|
|
||||||
buttonFront = new QToolButton;
|
buttonFront = new QToolButton;
|
||||||
buttonFront->setIcon(QIcon("://images/front.png"));
|
|
||||||
|
|
||||||
buttonBack = new QToolButton;
|
buttonBack = new QToolButton;
|
||||||
buttonBack->setIcon(QIcon("://images/back.png"));
|
buttonAxes = new QAction(this);
|
||||||
|
buttonEdges = new QToolButton;
|
||||||
|
buttonZoomIn = new QToolButton;
|
||||||
|
buttonZoomOut = new QToolButton;
|
||||||
|
|
||||||
|
if(defaultColor > 165)
|
||||||
|
{
|
||||||
|
buttonRender->setIcon(QIcon("://images/blackRender.png"));
|
||||||
|
buttonTop->setIcon(QIcon("://images/blackUp.png"));
|
||||||
|
buttonBottom->setIcon(QIcon("://images/blackbottom.png"));
|
||||||
|
buttonLeft->setIcon(QIcon("://images/blackleft (copy).png"));
|
||||||
|
buttonRight->setIcon(QIcon("://images/rightright.png"));
|
||||||
|
buttonFront->setIcon(QIcon("://images/blackfront.png"));
|
||||||
|
buttonBack->setIcon(QIcon("://images/blackback.png"));
|
||||||
|
buttonAxes->setIcon(QIcon("://images/blackaxes.png"));
|
||||||
|
buttonEdges->setIcon(QIcon("://images/Rotation-32.png"));
|
||||||
|
buttonZoomIn->setIcon(QIcon("://images/zoomin.png"));
|
||||||
|
buttonZoomOut->setIcon(QIcon("://images/zoomout.png"));
|
||||||
|
} else {
|
||||||
|
|
||||||
|
buttonRender->setIcon(QIcon("://images/Arrowhead-Right-32.png"));
|
||||||
|
buttonTop->setIcon(QIcon("://images/up.png"));
|
||||||
|
buttonBottom->setIcon(QIcon("://images/bottom.png"));
|
||||||
|
buttonLeft->setIcon(QIcon("://images/left.png"));
|
||||||
|
buttonRight->setIcon(QIcon("://images/right.png"));
|
||||||
|
buttonFront->setIcon(QIcon("://images/front.png"));
|
||||||
|
buttonBack->setIcon(QIcon("://images/back.png"));
|
||||||
|
buttonAxes->setIcon(QIcon("://images/axes.png"));
|
||||||
|
buttonEdges->setIcon(QIcon("://images/grid.png"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
this->addWidget(buttonNew);
|
|
||||||
this->addWidget(buttonOpen);
|
|
||||||
this->addWidget(buttonSave);
|
|
||||||
this->addWidget(buttonRender);
|
this->addWidget(buttonRender);
|
||||||
this->addSeparator();
|
this->addSeparator();
|
||||||
this->addWidget(buttonTop);
|
this->addWidget(buttonTop);
|
||||||
|
@ -44,5 +52,8 @@ ToolBar::ToolBar(QWidget *parent) :
|
||||||
this->addWidget(buttonRight);
|
this->addWidget(buttonRight);
|
||||||
this->addWidget(buttonFront);
|
this->addWidget(buttonFront);
|
||||||
this->addWidget(buttonBack);
|
this->addWidget(buttonBack);
|
||||||
|
this->addAction(buttonAxes);
|
||||||
|
this->addWidget(buttonEdges);
|
||||||
|
this->addWidget(buttonZoomIn);
|
||||||
|
this->addWidget(buttonZoomOut);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,15 +3,16 @@
|
||||||
|
|
||||||
#include <QToolBar>
|
#include <QToolBar>
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
|
#include <QAction>
|
||||||
class ToolBar : public QToolBar
|
class ToolBar : public QToolBar
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit ToolBar(QWidget *parent = 0);
|
explicit ToolBar(QWidget *parent = 0);
|
||||||
QToolButton *buttonNew, *buttonOpen, *buttonSave, *buttonRender;
|
QToolButton *buttonZoomIn, *buttonZoomOut, *buttonRender;
|
||||||
QToolButton *buttonTop, *buttonBottom, *buttonLeft, *buttonRight;
|
QToolButton *buttonTop, *buttonBottom, *buttonLeft, *buttonRight;
|
||||||
QToolButton *buttonFront, *buttonBack;
|
QToolButton *buttonFront, *buttonBack, *buttonEdges;
|
||||||
|
QAction *buttonAxes;
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|