gui changes

This commit is contained in:
Anakin 2017-01-22 12:25:59 +01:00
parent a948590255
commit 5f104e46f2
20 changed files with 122 additions and 42 deletions

View File

@ -20,6 +20,11 @@
<file>Z.png</file>
<file>screenshot.png</file>
<file>wireframe.png</file>
<file>light.png</file>
<file>light_off.png</file>
<file>light_on.png</file>
<file>solid.png</file>
<file>X_disabled.png</file>
<file>Y_disabled.png</file>
<file>Z_disabled.png</file>
</qresource>
</RCC>

View File

@ -1,21 +1,81 @@
QToolButton#test123 {
color: #000000;
QToolButton {
image: url(:/images/toolbar/placeholder.png);
border-style: none;
padding: 2px;
width: 22px;
height: 22px;
}
QToolButton:checked {
background-color: #ffffff;
border-style: inset;
border-width: 1px;
border-radius: 5px;
border-color: #b3b3b3;
min-height: 25px
image: url(:/images/toolbar/placeholder.png);
border-style: none;
padding: 2px;
width: 22px;
height: 22px;
}
QToolButton:hover {
border-style: solid;
padding: 1px;
border-width: 1px;
border-radius: 5px;
border-color: #a4daff;
min-height: 25px
}
QToolButton#openFile {
image: url(:/images/toolbar/open.png);
}
QToolButton#screenshot {
image: url(:/images/toolbar/screenshot.png);
}
QToolButton#x {
image: url(:/images/toolbar/X_disabled.png);
}
QToolButton#x:checked {
image: url(:/images/toolbar/X.png);
}
QToolButton#y {
image: url(:/images/toolbar/Y_disabled.png);
}
QToolButton#y:checked {
image: url(:/images/toolbar/Y.png);
}
QToolButton#z {
image: url(:/images/toolbar/Z_disabled.png);
}
QToolButton#z:checked {
image: url(:/images/toolbar/Z.png);
}
QToolButton#wireframe {
image: url(:/images/toolbar/solid.png);
}
QToolButton#wireframe:checked {
image: url(:/images/toolbar/wireframe.png);
}
QToolButton#light {
image: url(:/images/toolbar/light_off.png);
}
QToolButton#light:checked {
image: url(:/images/toolbar/light_on.png);
}
QToolButton#fileInfo {
image: url(:/images/toolbar/info.png);
}
QToolButton#help {
image: url(:/images/toolbar/about.png);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 932 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 885 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 884 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 883 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 883 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 974 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 879 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 940 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 880 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 898 B

View File

@ -10,6 +10,7 @@
#include <QSizePolicy>
#include <QFont>
#include <QResizeEvent>
#include <QToolButton>
#include "..\Header\FileInterface.h"
#define WINDOW_NAME "Mesh Viewer"
@ -32,7 +33,7 @@ MainWindow::MainWindow(QWidget *parent)
setupWidgets();
ui->statusBar->showMessage("MeshViewer by Anakin", 0);
printMessage("MeshViewer by Anakin", 0);
m_fileInfo += "Filename: -\nMaterials: -\nVertices: -\nTriangle: -<detail>No file is open";
@ -61,36 +62,46 @@ void MainWindow::setupWidgets()
setCentralWidget(viewer);
connect(viewer, &OglViewerWidget::sendMessage, this, &MainWindow::printMessage);
QAction *openFile = new QAction(QIcon(":/images/toolbar/open.png"), "Open file", this);
connect(openFile, &QAction::triggered, this, &MainWindow::openFile);
ui->mainToolBar->addAction(openFile);
QToolButton *openFile = new QToolButton(this);
openFile->setObjectName("openFile");
openFile->setToolTip("open file");
connect(openFile, &QToolButton::pressed, this, &MainWindow::openFile);
ui->mainToolBar->addWidget(openFile);
QAction *screenShot = new QAction(QIcon(":/images/toolbar/screenshot.png"), "Screenshot", this);
connect(screenShot, &QAction::triggered, this, &MainWindow::takeScreenShot);
ui->mainToolBar->addAction(screenShot);
QToolButton *screenshot = new QToolButton(this);
screenshot->setObjectName("screenshot");
screenshot->setToolTip("take screenshot");
connect(screenshot, &QToolButton::pressed, this, &MainWindow::takeScreenShot);
ui->mainToolBar->addWidget(screenshot);
ui->mainToolBar->addSeparator();
QSignalMapper* signalMapper = new QSignalMapper(this);
QAction *x = new QAction(QIcon(":/images/toolbar/X.png"), "X", this);
QToolButton *x = new QToolButton(this);
x->setObjectName("x");
x->setToolTip("x-direction");
x->setCheckable(true);
x->setChecked(true);
ui->mainToolBar->addAction(x);
ui->mainToolBar->addWidget(x);
QAction *y = new QAction(QIcon(":/images/toolbar/Y.png"), "Y", this);
QToolButton *y = new QToolButton(this);
y->setObjectName("y");
y->setToolTip("y-direction");
y->setCheckable(true);
y->setChecked(true);
ui->mainToolBar->addAction(y);
ui->mainToolBar->addWidget(y);
QAction *z = new QAction(QIcon(":/images/toolbar/Z.png"), "Z", this);
QToolButton *z = new QToolButton(this);
z->setObjectName("z");
z->setToolTip("z-direction");
z->setCheckable(true);
z->setChecked(true);
ui->mainToolBar->addAction(z);
ui->mainToolBar->addWidget(z);
connect(x, SIGNAL(triggered()), signalMapper, SLOT(map()));
connect(y, SIGNAL(triggered()), signalMapper, SLOT(map()));
connect(z, SIGNAL(triggered()), signalMapper, SLOT(map()));
connect(x, SIGNAL(pressed()), signalMapper, SLOT(map()));
connect(y, SIGNAL(pressed()), signalMapper, SLOT(map()));
connect(z, SIGNAL(pressed()), signalMapper, SLOT(map()));
signalMapper->setMapping(x, 1);
signalMapper->setMapping(y, 2);
@ -100,32 +111,35 @@ void MainWindow::setupWidgets()
ui->mainToolBar->addSeparator();
QAction *wireframe = new QAction(QIcon(":/images/toolbar/wireframe.png"), "Wireframe", this);
QToolButton *wireframe = new QToolButton(this);
wireframe->setObjectName("wireframe");
wireframe->setToolTip("wireframe");
wireframe->setCheckable(true);
wireframe->setChecked(false);
connect(wireframe, &QAction::triggered, viewer, &OglViewerWidget::toggleWireframe);
ui->mainToolBar->addAction(wireframe);
connect(wireframe, &QToolButton::pressed, viewer, &OglViewerWidget::toggleWireframe);
ui->mainToolBar->addWidget(wireframe);
QAction *light = new QAction(QIcon(":/images/toolbar/light.png"), "Light", this);
QToolButton *light = new QToolButton(this);
light->setObjectName("light");
light->setToolTip("toggle light");
light->setCheckable(true);
light->setChecked(false);
connect(light, &QAction::triggered, viewer, &OglViewerWidget::toggleLight);
ui->mainToolBar->addAction(light);
connect(light, &QToolButton::pressed, viewer, &OglViewerWidget::toggleLight);
ui->mainToolBar->addWidget(light);
ui->mainToolBar->addSeparator();
QAction *fileInfo = new QAction(QIcon(":/images/toolbar/info.png"), "File info", this);
connect(fileInfo, &QAction::triggered, this, &MainWindow::aboutFile);
ui->mainToolBar->addAction(fileInfo);
QToolButton *fileInfo = new QToolButton(this);
fileInfo->setObjectName("fileInfo");
fileInfo->setToolTip("file info");
connect(fileInfo, &QToolButton::pressed, this, &MainWindow::aboutFile);
ui->mainToolBar->addWidget(fileInfo);
QAction *help = new QAction(QIcon(":/images/toolbar/about.png"), "Help", this);
connect(help, &QAction::triggered, this, &MainWindow::aboutTool);
ui->mainToolBar->addAction(help);
QAction *test = new QAction(this);
test->setCheckable(true);
test->setObjectName("test123");
ui->mainToolBar->addAction(test);
QToolButton *help = new QToolButton(this);
help->setObjectName("help");
help->setToolTip("help");
connect(help, &QToolButton::pressed, this, &MainWindow::aboutTool);
ui->mainToolBar->addWidget(help);
m_output->setObjectName("output");
m_output->setStyleSheet("QLabel#output{color : white; min-width: 400px; min-height: 50px;}");

View File

@ -572,6 +572,7 @@ void MshFile::analyseClthChunks(Model * dataDestination, std::list<ChunkHeader*>
for (auto& it : chunkList)
{
// texture name
//TODO: change this
if (!strcmp("CTEX", it->name))
{
// read the texture name