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>Z.png</file>
<file>screenshot.png</file> <file>screenshot.png</file>
<file>wireframe.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> </qresource>
</RCC> </RCC>

View File

@ -1,21 +1,81 @@
QToolButton#test123 { QToolButton {
color: #000000; image: url(:/images/toolbar/placeholder.png);
border-style: none;
padding: 2px;
width: 22px;
height: 22px;
} }
QToolButton:checked { QToolButton:checked {
background-color: #ffffff; image: url(:/images/toolbar/placeholder.png);
border-style: inset; border-style: none;
border-width: 1px; padding: 2px;
border-radius: 5px; width: 22px;
border-color: #b3b3b3; height: 22px;
min-height: 25px
} }
QToolButton:hover { QToolButton:hover {
border-style: solid; border-style: solid;
padding: 1px;
border-width: 1px; border-width: 1px;
border-radius: 5px; border-radius: 5px;
border-color: #a4daff; border-color: #a4daff;
min-height: 25px 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 <QSizePolicy>
#include <QFont> #include <QFont>
#include <QResizeEvent> #include <QResizeEvent>
#include <QToolButton>
#include "..\Header\FileInterface.h" #include "..\Header\FileInterface.h"
#define WINDOW_NAME "Mesh Viewer" #define WINDOW_NAME "Mesh Viewer"
@ -32,7 +33,7 @@ MainWindow::MainWindow(QWidget *parent)
setupWidgets(); setupWidgets();
ui->statusBar->showMessage("MeshViewer by Anakin", 0); printMessage("MeshViewer by Anakin", 0);
m_fileInfo += "Filename: -\nMaterials: -\nVertices: -\nTriangle: -<detail>No file is open"; m_fileInfo += "Filename: -\nMaterials: -\nVertices: -\nTriangle: -<detail>No file is open";
@ -61,36 +62,46 @@ void MainWindow::setupWidgets()
setCentralWidget(viewer); setCentralWidget(viewer);
connect(viewer, &OglViewerWidget::sendMessage, this, &MainWindow::printMessage); connect(viewer, &OglViewerWidget::sendMessage, this, &MainWindow::printMessage);
QAction *openFile = new QAction(QIcon(":/images/toolbar/open.png"), "Open file", this); QToolButton *openFile = new QToolButton(this);
connect(openFile, &QAction::triggered, this, &MainWindow::openFile); openFile->setObjectName("openFile");
ui->mainToolBar->addAction(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); QToolButton *screenshot = new QToolButton(this);
connect(screenShot, &QAction::triggered, this, &MainWindow::takeScreenShot); screenshot->setObjectName("screenshot");
ui->mainToolBar->addAction(screenShot); screenshot->setToolTip("take screenshot");
connect(screenshot, &QToolButton::pressed, this, &MainWindow::takeScreenShot);
ui->mainToolBar->addWidget(screenshot);
ui->mainToolBar->addSeparator(); ui->mainToolBar->addSeparator();
QSignalMapper* signalMapper = new QSignalMapper(this); 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->setCheckable(true);
x->setChecked(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->setCheckable(true);
y->setChecked(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->setCheckable(true);
z->setChecked(true); z->setChecked(true);
ui->mainToolBar->addAction(z); ui->mainToolBar->addWidget(z);
connect(x, SIGNAL(triggered()), signalMapper, SLOT(map())); connect(x, SIGNAL(pressed()), signalMapper, SLOT(map()));
connect(y, SIGNAL(triggered()), signalMapper, SLOT(map())); connect(y, SIGNAL(pressed()), signalMapper, SLOT(map()));
connect(z, SIGNAL(triggered()), signalMapper, SLOT(map())); connect(z, SIGNAL(pressed()), signalMapper, SLOT(map()));
signalMapper->setMapping(x, 1); signalMapper->setMapping(x, 1);
signalMapper->setMapping(y, 2); signalMapper->setMapping(y, 2);
@ -100,32 +111,35 @@ void MainWindow::setupWidgets()
ui->mainToolBar->addSeparator(); 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->setCheckable(true);
wireframe->setChecked(false); wireframe->setChecked(false);
connect(wireframe, &QAction::triggered, viewer, &OglViewerWidget::toggleWireframe); connect(wireframe, &QToolButton::pressed, viewer, &OglViewerWidget::toggleWireframe);
ui->mainToolBar->addAction(wireframe); 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->setCheckable(true);
light->setChecked(false); light->setChecked(false);
connect(light, &QAction::triggered, viewer, &OglViewerWidget::toggleLight); connect(light, &QToolButton::pressed, viewer, &OglViewerWidget::toggleLight);
ui->mainToolBar->addAction(light); ui->mainToolBar->addWidget(light);
ui->mainToolBar->addSeparator(); ui->mainToolBar->addSeparator();
QAction *fileInfo = new QAction(QIcon(":/images/toolbar/info.png"), "File info", this); QToolButton *fileInfo = new QToolButton(this);
connect(fileInfo, &QAction::triggered, this, &MainWindow::aboutFile); fileInfo->setObjectName("fileInfo");
ui->mainToolBar->addAction(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); QToolButton *help = new QToolButton(this);
connect(help, &QAction::triggered, this, &MainWindow::aboutTool); help->setObjectName("help");
ui->mainToolBar->addAction(help); help->setToolTip("help");
connect(help, &QToolButton::pressed, this, &MainWindow::aboutTool);
QAction *test = new QAction(this); ui->mainToolBar->addWidget(help);
test->setCheckable(true);
test->setObjectName("test123");
ui->mainToolBar->addAction(test);
m_output->setObjectName("output"); m_output->setObjectName("output");
m_output->setStyleSheet("QLabel#output{color : white; min-width: 400px; min-height: 50px;}"); 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) for (auto& it : chunkList)
{ {
// texture name // texture name
//TODO: change this
if (!strcmp("CTEX", it->name)) if (!strcmp("CTEX", it->name))
{ {
// read the texture name // read the texture name