mirror of https://github.com/vitalif/openscad
added few more icons with tool tips
parent
3f37cf8c50
commit
8e3b3e1919
Binary file not shown.
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 889 B |
Binary file not shown.
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 864 B |
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 922 B |
|
@ -41,5 +41,7 @@
|
|||
<file>images/blackaxes.png</file>
|
||||
<file>images/zoomin.png</file>
|
||||
<file>images/zoomout.png</file>
|
||||
<file>images/wireframe1.png</file>
|
||||
<file>images/surface.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QIcon>
|
||||
#include "ui_MainWindow.h"
|
||||
#include "openscad.h"
|
||||
#include "modcontext.h"
|
||||
|
|
|
@ -16,15 +16,25 @@ EditorToolBar::EditorToolBar(QWidget *parent) :
|
|||
buttonNew->setIcon(QIcon("://images/blackNew.png"));
|
||||
buttonOpen->setIcon(QIcon("://images/Open-32(1).png"));
|
||||
buttonSave->setIcon(QIcon("://images/Save-32.png"));
|
||||
buttonZoomIn->setIcon(QIcon("://images/zoomin.png"));
|
||||
buttonZoomOut->setIcon(QIcon("://images/zoomout.png"));
|
||||
} else {
|
||||
|
||||
buttonNew->setIcon(QIcon("://images/Document-New-128.png"));
|
||||
buttonOpen->setIcon(QIcon("://images/Open-128.png"));
|
||||
buttonSave->setIcon(QIcon("://images/Save-128.png"));
|
||||
}
|
||||
buttonNew->setIcon(QIcon("://images/Document-New-128.png"));
|
||||
buttonOpen->setIcon(QIcon("://images/Open-128.png"));
|
||||
buttonSave->setIcon(QIcon("://images/Save-128.png"));
|
||||
}
|
||||
|
||||
buttonNew->setToolTip("New");
|
||||
buttonOpen->setToolTip("Open");
|
||||
buttonSave->setToolTip("Save");
|
||||
buttonZoomIn->setToolTip("Zoom In");
|
||||
buttonZoomOut->setToolTip("Zoom Out");
|
||||
|
||||
this->addWidget(buttonNew);
|
||||
this->addWidget(buttonOpen);
|
||||
this->addWidget(buttonSave);
|
||||
this->addWidget(buttonZoomIn);
|
||||
this->addWidget(buttonZoomOut);
|
||||
|
||||
}
|
||||
|
|
|
@ -451,14 +451,26 @@ MainWindow::MainWindow(const QString &filename)
|
|||
connect(this->replaceAllButton, SIGNAL(clicked()), this, SLOT(replaceAll()));
|
||||
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()));
|
||||
//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()));
|
||||
connect(editortoolbar->buttonZoomIn, SIGNAL(clicked()), editor, SLOT(zoomIn()));
|
||||
connect(editortoolbar->buttonZoomOut, SIGNAL(clicked()), editor, SLOT(zoomOut()));
|
||||
|
||||
|
||||
//Toolbar
|
||||
toolBar = new ToolBar(this);
|
||||
verticalLayout_2->addWidget(toolBar);
|
||||
toolBar = new ToolBar(this);
|
||||
verticalLayout_2->addWidget(toolBar);
|
||||
int defaultcolor = toolBar->palette().background().color().lightness();
|
||||
|
||||
if(defaultcolor > 165){
|
||||
viewActionShowAxes->setIcon(QIcon("://images/blackaxes.png"));
|
||||
toolBar->addAction(viewActionShowAxes);
|
||||
viewActionShowEdges->setIcon(QIcon("://images/Rotation-32.png"));
|
||||
toolBar->addAction(viewActionShowEdges);
|
||||
}
|
||||
|
||||
connect(toolBar->buttonRender, SIGNAL(clicked()), this, SLOT(actionRender()));
|
||||
connect(toolBar->buttonTop, SIGNAL(clicked()), this, SLOT(viewAngleTop()));
|
||||
connect(toolBar->buttonBottom, SIGNAL(clicked()), this, SLOT(viewAngleBottom()));
|
||||
|
@ -466,16 +478,13 @@ MainWindow::MainWindow(const QString &filename)
|
|||
connect(toolBar->buttonRight, SIGNAL(clicked()), this, SLOT(viewAngleRight()));
|
||||
connect(toolBar->buttonFront, SIGNAL(clicked()), this, SLOT(viewAngleFront()));
|
||||
connect(toolBar->buttonBack, SIGNAL(clicked()), this, SLOT(viewModeShowAxes()));
|
||||
connect(toolBar->buttonAxes, SIGNAL(triggered()), this, SLOT(viewModeShowAxes()));
|
||||
connect(toolBar->buttonEdges, SIGNAL(clicked()), this, SLOT(viewModeShowEdges()));
|
||||
connect(toolBar->buttonZoomIn, SIGNAL(clicked()), qglview, SLOT(ZoomIn()));
|
||||
connect(toolBar->buttonZoomOut, SIGNAL(clicked()), qglview, SLOT(ZoomOut()));
|
||||
|
||||
|
||||
connect(toolBar->buttonSurface, SIGNAL(clicked()), this, SLOT(viewModeSurface()));
|
||||
connect(toolBar->buttonWireframe, SIGNAL(clicked()), this, SLOT(viewModeWireframe()));
|
||||
|
||||
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..
|
||||
QSettings settings;
|
||||
|
|
|
@ -12,24 +12,25 @@ ToolBar::ToolBar(QWidget *parent) :
|
|||
buttonRight = new QToolButton;
|
||||
buttonFront = new QToolButton;
|
||||
buttonBack = new QToolButton;
|
||||
buttonAxes = new QAction(this);
|
||||
buttonEdges = new QToolButton;
|
||||
buttonZoomIn = new QToolButton;
|
||||
buttonZoomOut = new QToolButton;
|
||||
|
||||
buttonWireframe = new QToolButton;
|
||||
buttonSurface = new QToolButton;
|
||||
|
||||
if(defaultColor > 165)
|
||||
{
|
||||
buttonRender->setIcon(QIcon("://images/blackRender.png"));
|
||||
buttonRender->setToolTip("Render");
|
||||
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"));
|
||||
buttonWireframe->setIcon(QIcon("://images/wireframe1.png"));
|
||||
buttonSurface->setIcon(QIcon("://images/surface.png"));
|
||||
} else {
|
||||
|
||||
buttonRender->setIcon(QIcon("://images/Arrowhead-Right-32.png"));
|
||||
|
@ -39,11 +40,20 @@ ToolBar::ToolBar(QWidget *parent) :
|
|||
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"));
|
||||
|
||||
}
|
||||
|
||||
buttonRender->setToolTip("Render");
|
||||
buttonTop->setToolTip("Top");
|
||||
buttonBottom->setToolTip("Bottom");
|
||||
buttonLeft->setToolTip("Left");
|
||||
buttonRight->setToolTip("Right");
|
||||
buttonFront->setToolTip("Front");
|
||||
buttonBack->setToolTip("Back");
|
||||
buttonZoomIn->setToolTip("Zoom in");
|
||||
buttonZoomOut->setToolTip("Zoom out");
|
||||
buttonWireframe->setToolTip("Wireframe");
|
||||
buttonSurface->setToolTip("Surfaces");
|
||||
|
||||
this->addWidget(buttonRender);
|
||||
this->addSeparator();
|
||||
this->addWidget(buttonTop);
|
||||
|
@ -52,8 +62,8 @@ ToolBar::ToolBar(QWidget *parent) :
|
|||
this->addWidget(buttonRight);
|
||||
this->addWidget(buttonFront);
|
||||
this->addWidget(buttonBack);
|
||||
this->addAction(buttonAxes);
|
||||
this->addWidget(buttonEdges);
|
||||
this->addWidget(buttonZoomIn);
|
||||
this->addWidget(buttonZoomOut);
|
||||
this->addWidget(buttonWireframe);
|
||||
this->addWidget(buttonSurface);
|
||||
}
|
||||
|
|
|
@ -11,8 +11,8 @@ public:
|
|||
explicit ToolBar(QWidget *parent = 0);
|
||||
QToolButton *buttonZoomIn, *buttonZoomOut, *buttonRender;
|
||||
QToolButton *buttonTop, *buttonBottom, *buttonLeft, *buttonRight;
|
||||
QToolButton *buttonFront, *buttonBack, *buttonEdges;
|
||||
QAction *buttonAxes;
|
||||
QToolButton *buttonFront, *buttonBack, *buttonWireframe, *buttonSurface;
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
|
Loading…
Reference in New Issue