paysages: Icons and UI polishing.

git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@291 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
This commit is contained in:
Michaël Lemaire 2012-04-11 19:59:50 +00:00 committed by ThunderK
parent e9fd162907
commit 81cbbb9880
12 changed files with 125 additions and 93 deletions

2
TODO
View file

@ -1,3 +1,5 @@
- Make colorgradation dialog sizable (and reduce minimum size).
- Make all UI more sizable.
- Implement scaling and scrolling on previews.
- Add a material editor dialog.
- Replace FILE* by a custom type for Save and Load.

View file

@ -14,61 +14,62 @@
BaseForm::BaseForm(QWidget* parent, bool auto_apply, bool with_layers) : QWidget(parent)
{
QWidget* hwidget;
QVBoxLayout* vlayout;
QHBoxLayout* hlayout;
QWidget* control;
QWidget* layers;
QLabel* label;
this->auto_apply = auto_apply;
this->with_layers = with_layers;
vlayout = new QVBoxLayout();
hlayout = new QHBoxLayout();
setLayout(new QHBoxLayout());
setObjectName("_base_form_");
control = new QWidget(this);
control->setLayout(new QVBoxLayout());
layout()->addWidget(control);
if (with_layers)
{
hwidget = new QWidget(this);
hwidget->setLayout(new QHBoxLayout());
layers = new QWidget(this);
layers->setLayout(new QHBoxLayout());
layers->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
hwidget->layout()->addWidget(new QLabel(tr("Layers : "), hwidget));
label = new QLabel(tr("Layers : "), layers);
label->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
layers->layout()->addWidget(label);
layer_list = new QComboBox(hwidget);
hwidget->layout()->addWidget(layer_list);
layer_list = new QComboBox(layers);
layers->layout()->addWidget(layer_list);
QObject::connect(layer_list, SIGNAL(currentIndexChanged(int)), this, SLOT(layerListChanged()));
layer_new = new QPushButton(tr("Add layer"), hwidget);
hwidget->layout()->addWidget(layer_new);
layer_new = new QPushButton(tr("Add layer"), layers);
layers->layout()->addWidget(layer_new);
QObject::connect(layer_new, SIGNAL(clicked()), this, SLOT(layerAddClicked()));
layer_del = new QPushButton(tr("Delete layer"), hwidget);
hwidget->layout()->addWidget(layer_del);
layer_del = new QPushButton(tr("Delete layer"), layers);
layers->layout()->addWidget(layer_del);
QObject::connect(layer_del, SIGNAL(clicked()), this, SLOT(layerDelClicked()));
vlayout->addWidget(hwidget);
control->layout()->addWidget(layers);
control->layout()->setAlignment(buttons, Qt::AlignTop);
}
hwidget = new QWidget(this);
previews = new QWidget(this);
previews->setLayout(new QVBoxLayout());
previews->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
layout()->addWidget(previews);
layout()->setAlignment(previews, Qt::AlignTop);
form = new QWidget(this);
form->setLayout(new QGridLayout());
form->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
form->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
control->layout()->addWidget(form);
control->layout()->setAlignment(form, Qt::AlignTop | Qt::AlignLeft);
buttons = new QWidget(this);
buttons->setLayout(new QHBoxLayout());
hlayout->addWidget(previews);
hlayout->addWidget(form);
hlayout->setAlignment(form, Qt::AlignTop);
vlayout->addWidget(hwidget);
vlayout->addWidget(buttons);
hwidget->setLayout(hlayout);
this->setLayout(vlayout);
this->setObjectName("_base_form_");
control->layout()->addWidget(buttons);
control->layout()->setAlignment(buttons, Qt::AlignBottom);
button_apply = addButton(tr("Apply"));
button_apply->setEnabled(false);

View file

@ -92,6 +92,9 @@ DialogRender::DialogRender(QWidget *parent, Renderer* renderer):
progress->setValue(0);
layout()->addWidget(progress);
progress_value = 0;
// TEMP
progress->hide();
}
DialogRender::~DialogRender()
@ -131,5 +134,5 @@ void DialogRender::applyRenderSize(int width, int height)
area->setMinimumSize(width, height);
area->setMaximumSize(width, height);
area->resize(width, height);
scroll->setMinimumSize(width > 800 ? 850 : width + 50, height > 600 ? 650 : height + 50);
scroll->setMinimumSize(width > 800 ? 820 : width + 20, height > 600 ? 620 : height + 20);
}

View file

@ -12,18 +12,18 @@ InputColorGradation::InputColorGradation(QWidget* form, QString label, ColorGrad
{
_value = value;
_preview = new PreviewColorGradation(form, value, COLORGRADATIONBAND_FINAL);
_preview->setMinimumSize(200, 20);
_control = new PreviewColorGradation(form, value, COLORGRADATIONBAND_FINAL);
_control->setMinimumSize(200, 20);
_control = new QPushButton(tr("Edit"), form);
_control->setMaximumWidth(150);
_preview = new QPushButton(tr("Edit"), form);
_preview->setMaximumWidth(150);
connect((QPushButton*)_control, SIGNAL(clicked()), this, SLOT(editGradation()));
connect((QPushButton*)_preview, SIGNAL(clicked()), this, SLOT(editGradation()));
}
void InputColorGradation::updatePreview()
{
_preview->update();
_control->update();
BaseInput::updatePreview();
}
@ -43,7 +43,7 @@ void InputColorGradation::editGradation()
gradation = colorGradationCreate();
colorGradationCopy(_value, gradation);
if (DialogColorGradation::getGradation(_preview, gradation))
if (DialogColorGradation::getGradation(_control, gradation))
{
colorGradationCopy(gradation, _value);
applyValue();

View file

@ -4,6 +4,7 @@
#include <QMenuBar>
#include <QMenu>
#include <QIcon>
#include <QToolBar>
#include <QFileDialog>
#include <QTabWidget>
#include <QTranslator>
@ -67,8 +68,8 @@ MainWindow::MainWindow(QWidget *parent) :
{
BaseForm* form;
QTabWidget* tabs;
QMenu* menu;
QToolBar* toolbar;
tabs = new QTabWidget(this);
form = new FormTerrain(tabs);
@ -102,20 +103,22 @@ MainWindow::MainWindow(QWidget *parent) :
_form_render = new FormRender(tabs);
tabs->addTab(_form_render, tr("Render"));
menu = menuBar()->addMenu(tr("&Scene"));
menu->addAction(tr("&New"), this, SLOT(fileNew()), QKeySequence(tr("Crtl+N")));
menu->addSeparator();
menu->addAction(tr("&Save"), this, SLOT(fileSave()), QKeySequence(tr("Crtl+S")));
menu->addAction(tr("&Open"), this, SLOT(fileLoad()), QKeySequence(tr("Crtl+O")));
menu->addSeparator();
menu->addAction(tr("&Quit"), this, SLOT(close()), QKeySequence(tr("Crtl+Q")));
menu = menuBar()->addMenu(tr("&Actions"));
menu->addAction(tr("&Explore in 3D"), this, SLOT(explore3D()), QKeySequence("F2"));
menu->addAction(tr("&Quick render"), this, SLOT(quickPreview()), QKeySequence("F5"));
menu = menuBar()->addMenu(tr("&Help"));
menu->addAction(tr("&About"), this, SLOT(showAboutDialog()));
toolbar = new QToolBar(this);
toolbar->setOrientation(Qt::Vertical);
toolbar->setAllowedAreas(Qt::LeftToolBarArea);
toolbar->setMovable(false);
toolbar->setFloatable(false);
toolbar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
toolbar->toggleViewAction()->setEnabled(false);
toolbar->setIconSize(QSize(32, 32));
addToolBar(Qt::LeftToolBarArea, toolbar);
toolbar->addAction(QIcon("images/new.png"), tr("&New"), this, SLOT(fileNew()))->setShortcut(QKeySequence(tr("Crtl+N")));
toolbar->addAction(QIcon("images/save.png"), tr("&Save"), this, SLOT(fileSave()))->setShortcut(QKeySequence(tr("Crtl+S")));
toolbar->addAction(QIcon("images/load.png"), tr("&Load"), this, SLOT(fileLoad()))->setShortcut(QKeySequence(tr("Crtl+L")));
toolbar->addAction(QIcon("images/explore.png"), tr("&Explore (F2)"), this, SLOT(explore3D()))->setShortcut(QKeySequence(tr("F2")));
toolbar->addAction(QIcon("images/render.png"), tr("&Quick\nrender (F5)"), this, SLOT(quickPreview()))->setShortcut(QKeySequence(tr("F5")));
toolbar->addAction(QIcon("images/about.png"), tr("&About"), this, SLOT(showAboutDialog()));
setCentralWidget(tabs);

View file

@ -4,32 +4,32 @@
<context>
<name>BaseForm</name>
<message>
<location filename="../gui_qt/baseform.cpp" line="32"/>
<location filename="../gui_qt/baseform.cpp" line="37"/>
<source>Layers : </source>
<translation>Niveaux :</translation>
</message>
<message>
<location filename="../gui_qt/baseform.cpp" line="38"/>
<location filename="../gui_qt/baseform.cpp" line="45"/>
<source>Add layer</source>
<translation>Ajouter un niveau</translation>
</message>
<message>
<location filename="../gui_qt/baseform.cpp" line="42"/>
<location filename="../gui_qt/baseform.cpp" line="49"/>
<source>Delete layer</source>
<translation>Supprimer un niveau</translation>
</message>
<message>
<location filename="../gui_qt/baseform.cpp" line="73"/>
<location filename="../gui_qt/baseform.cpp" line="74"/>
<source>Apply</source>
<translation>Appliquer</translation>
</message>
<message>
<location filename="../gui_qt/baseform.cpp" line="76"/>
<location filename="../gui_qt/baseform.cpp" line="77"/>
<source>Revert</source>
<translation>Annuler les modifications</translation>
</message>
<message>
<location filename="../gui_qt/baseform.cpp" line="244"/>
<location filename="../gui_qt/baseform.cpp" line="245"/>
<source>Layer %1</source>
<translation>Niveau %1</translation>
</message>
@ -682,32 +682,64 @@ Maintenir Ctrl : Plus rapide</translation>
<context>
<name>MainWindow</name>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="75"/>
<location filename="../gui_qt/mainwindow.cpp" line="76"/>
<source>Terrain</source>
<translation>Terrain</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="79"/>
<location filename="../gui_qt/mainwindow.cpp" line="80"/>
<source>Textures</source>
<translation>Textures</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="83"/>
<location filename="../gui_qt/mainwindow.cpp" line="84"/>
<source>Water</source>
<translation>Eau</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="91"/>
<location filename="../gui_qt/mainwindow.cpp" line="92"/>
<source>Atmosphere</source>
<translation>Atmosphère</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="87"/>
<location filename="../gui_qt/mainwindow.cpp" line="118"/>
<source>&amp;Load</source>
<translation>&amp;Ouvrir</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="118"/>
<source>Crtl+L</source>
<translation>Ctrl+O</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="119"/>
<source>&amp;Explore (F2)</source>
<translation>&amp;Explorer (F2)</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="119"/>
<source>F2</source>
<translation>F2</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="120"/>
<source>&amp;Quick
render (F5)</source>
<translation>&amp;Rendu
rapide (F5)</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="120"/>
<source>F5</source>
<translation>F5</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="88"/>
<source>Sky</source>
<translation>Ciel</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="95"/>
<location filename="../gui_qt/mainwindow.cpp" line="96"/>
<source>Clouds</source>
<translation>Nuages</translation>
</message>
@ -716,87 +748,78 @@ Maintenir Ctrl : Plus rapide</translation>
<translation type="obsolete">Eclairage</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="103"/>
<location filename="../gui_qt/mainwindow.cpp" line="104"/>
<source>Render</source>
<translation>Rendu</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="105"/>
<source>&amp;Scene</source>
<translation>&amp;Scène</translation>
<translation type="obsolete">&amp;Scène</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="106"/>
<location filename="../gui_qt/mainwindow.cpp" line="116"/>
<source>&amp;New</source>
<translation>&amp;Nouvelle</translation>
<translation>&amp;Nouveau</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="106"/>
<location filename="../gui_qt/mainwindow.cpp" line="116"/>
<source>Crtl+N</source>
<translation>Ctrl+N</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="108"/>
<location filename="../gui_qt/mainwindow.cpp" line="117"/>
<source>&amp;Save</source>
<translation>&amp;Sauvegarder</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="108"/>
<location filename="../gui_qt/mainwindow.cpp" line="117"/>
<source>Crtl+S</source>
<translation>Ctrl+S</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="109"/>
<source>&amp;Open</source>
<translation>&amp;Ouvrir</translation>
<translation type="obsolete">&amp;Ouvrir</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="109"/>
<source>Crtl+O</source>
<translation>Ctrl+O</translation>
<translation type="obsolete">Ctrl+O</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="111"/>
<source>&amp;Quit</source>
<translation>&amp;Quitter</translation>
<translation type="obsolete">&amp;Quitter</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="111"/>
<source>Crtl+Q</source>
<translation>Ctrl+Q</translation>
<translation type="obsolete">Ctrl+Q</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="113"/>
<source>&amp;Actions</source>
<translation>&amp;Actions</translation>
<translation type="obsolete">&amp;Actions</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="114"/>
<source>&amp;Explore in 3D</source>
<translation>&amp;Explorer en 3D</translation>
<translation type="obsolete">&amp;Explorer en 3D</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="115"/>
<source>&amp;Quick render</source>
<translation>Rendu r&amp;apide</translation>
<translation type="obsolete">Rendu r&amp;apide</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="117"/>
<source>&amp;Help</source>
<translation>Ai&amp;de</translation>
<translation type="obsolete">Ai&amp;de</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="118"/>
<location filename="../gui_qt/mainwindow.cpp" line="121"/>
<source>&amp;About</source>
<translation>&amp;A propos</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="163"/>
<location filename="../gui_qt/mainwindow.cpp" line="166"/>
<source>Paysages 3D</source>
<translation>Paysages 3D</translation>
</message>
<message>
<location filename="../gui_qt/mainwindow.cpp" line="163"/>
<location filename="../gui_qt/mainwindow.cpp" line="166"/>
<source>A 3D landscape editing and rendering software.
Credits :

BIN
images/about.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
images/explore.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
images/load.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

BIN
images/new.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
images/render.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
images/save.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB