mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-31 14:45:35 +00:00
added scene toolbar buttons (still not doing anything)
This commit is contained in:
parent
9ea092927f
commit
84cadc10f4
6 changed files with 57 additions and 3 deletions
|
@ -59,7 +59,7 @@ opencs_hdrs_noqt (view/doc
|
|||
|
||||
opencs_units (view/world
|
||||
table tablesubview scriptsubview util regionmapsubview tablebottombox creator genericcreator
|
||||
cellcreator referenceablecreator referencecreator scenesubview scenetoolbar
|
||||
cellcreator referenceablecreator referencecreator scenesubview scenetoolbar scenetool
|
||||
)
|
||||
|
||||
opencs_units_noqt (view/world
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "tablebottombox.hpp"
|
||||
#include "creator.hpp"
|
||||
#include "scenetoolbar.hpp"
|
||||
#include "scenetool.hpp"
|
||||
|
||||
CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document)
|
||||
: SubView (id)
|
||||
|
@ -29,6 +30,10 @@ CSVWorld::SceneSubView::SceneSubView (const CSMWorld::UniversalId& id, CSMDoc::D
|
|||
layout2->setContentsMargins (QMargins (0, 0, 0, 0));
|
||||
|
||||
SceneToolbar *toolbar = new SceneToolbar (this);
|
||||
toolbar->addTool (new SceneTool (this)); // test
|
||||
toolbar->addTool (new SceneTool (this));
|
||||
toolbar->addTool (new SceneTool (this));
|
||||
toolbar->addTool (new SceneTool (this));
|
||||
layout2->addWidget (toolbar, 0);
|
||||
|
||||
/// \todo replace with rendering widget
|
||||
|
|
9
apps/opencs/view/world/scenetool.cpp
Normal file
9
apps/opencs/view/world/scenetool.cpp
Normal file
|
@ -0,0 +1,9 @@
|
|||
|
||||
#include "scenetool.hpp"
|
||||
|
||||
CSVWorld::SceneTool::SceneTool (QWidget *parent) : QPushButton (parent)
|
||||
{
|
||||
setSizePolicy (QSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed));
|
||||
setFixedSize (48, 48);
|
||||
|
||||
}
|
19
apps/opencs/view/world/scenetool.hpp
Normal file
19
apps/opencs/view/world/scenetool.hpp
Normal file
|
@ -0,0 +1,19 @@
|
|||
#ifndef CSV_WORLD_SCENETOOL_H
|
||||
#define CSV_WORLD_SCENETOOL_H
|
||||
|
||||
#include <QPushButton>
|
||||
|
||||
namespace CSVWorld
|
||||
{
|
||||
class SceneTool : public QPushButton
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
SceneTool (QWidget *parent = 0);
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,8 +1,23 @@
|
|||
|
||||
#include "scenetoolbar.hpp"
|
||||
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "scenetool.hpp"
|
||||
|
||||
CSVWorld::SceneToolbar::SceneToolbar (QWidget *parent) : QWidget (parent)
|
||||
{
|
||||
setFixedWidth (52);
|
||||
setFixedWidth (48);
|
||||
|
||||
mLayout = new QVBoxLayout (this);
|
||||
mLayout->setAlignment (Qt::AlignTop);
|
||||
|
||||
mLayout->setContentsMargins (QMargins (0, 0, 0, 0));
|
||||
|
||||
setLayout (mLayout);
|
||||
}
|
||||
|
||||
void CSVWorld::SceneToolbar::addTool (SceneTool *tool)
|
||||
{
|
||||
mLayout->addWidget (tool, 0, Qt::AlignTop);
|
||||
}
|
|
@ -3,17 +3,23 @@
|
|||
|
||||
#include <QWidget>
|
||||
|
||||
class QVBoxLayout;
|
||||
|
||||
namespace CSVWorld
|
||||
{
|
||||
class SceneTool;
|
||||
|
||||
class SceneToolbar : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
QVBoxLayout *mLayout;
|
||||
|
||||
public:
|
||||
|
||||
SceneToolbar (QWidget *parent);
|
||||
|
||||
|
||||
void addTool (SceneTool *tool);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue