mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-13 12:06:45 +00:00
code cleanup
This commit is contained in:
parent
e76df5f4d3
commit
bbc337a0af
2 changed files with 38 additions and 15 deletions
|
@ -78,6 +78,13 @@ CSVWidget::TextureBrushWindow::TextureBrushWindow(CSMDoc::Document& document, QW
|
||||||
mSelectedBrush = new QLabel(QString::fromStdString(mBrushTextureLabel));
|
mSelectedBrush = new QLabel(QString::fromStdString(mBrushTextureLabel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mButtonPoint = new QPushButton(QIcon (QPixmap (":scenetoolbar/brush-point")), "", this);
|
||||||
|
mButtonSquare = new QPushButton(QIcon (QPixmap (":scenetoolbar/brush-square")), "", this);
|
||||||
|
mButtonCircle = new QPushButton(QIcon (QPixmap (":scenetoolbar/brush-circle")), "", this);
|
||||||
|
mButtonCustom = new QPushButton(QIcon (QPixmap (":scenetoolbar/brush-custom")), "", this);
|
||||||
|
|
||||||
|
mSizeSliders = new BrushSizeControls("Brush size", this);
|
||||||
|
|
||||||
QVBoxLayout *layoutMain = new QVBoxLayout;
|
QVBoxLayout *layoutMain = new QVBoxLayout;
|
||||||
layoutMain->setSpacing(0);
|
layoutMain->setSpacing(0);
|
||||||
layoutMain->setContentsMargins(4,0,4,4);
|
layoutMain->setContentsMargins(4,0,4,4);
|
||||||
|
|
|
@ -20,8 +20,15 @@
|
||||||
|
|
||||||
class QTableWidget;
|
class QTableWidget;
|
||||||
|
|
||||||
|
namespace CSVRender
|
||||||
|
{
|
||||||
|
class TerrainTextureMode;
|
||||||
|
}
|
||||||
|
|
||||||
namespace CSVWidget
|
namespace CSVWidget
|
||||||
{
|
{
|
||||||
|
class SceneToolTextureBrush;
|
||||||
|
|
||||||
/// \brief Layout-box for some brush button settings
|
/// \brief Layout-box for some brush button settings
|
||||||
class BrushSizeControls : public QGroupBox
|
class BrushSizeControls : public QGroupBox
|
||||||
{
|
{
|
||||||
|
@ -29,13 +36,18 @@ namespace CSVWidget
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BrushSizeControls(const QString &title, QWidget *parent);
|
BrushSizeControls(const QString &title, QWidget *parent);
|
||||||
QSlider *mBrushSizeSlider;
|
|
||||||
QSpinBox *mBrushSizeSpinBox;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QHBoxLayout *mLayoutSliderSize;
|
QHBoxLayout *mLayoutSliderSize;
|
||||||
|
QSlider *mBrushSizeSlider;
|
||||||
|
QSpinBox *mBrushSizeSpinBox;
|
||||||
|
|
||||||
|
friend class SceneToolTextureBrush;
|
||||||
|
friend class CSVRender::TerrainTextureMode;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class SceneToolTextureBrush;
|
||||||
|
|
||||||
/// \brief Brush settings window
|
/// \brief Brush settings window
|
||||||
class TextureBrushWindow : public QFrame
|
class TextureBrushWindow : public QFrame
|
||||||
{
|
{
|
||||||
|
@ -45,24 +57,27 @@ namespace CSVWidget
|
||||||
TextureBrushWindow(CSMDoc::Document& document, QWidget *parent = 0);
|
TextureBrushWindow(CSMDoc::Document& document, QWidget *parent = 0);
|
||||||
void configureButtonInitialSettings(QPushButton *button);
|
void configureButtonInitialSettings(QPushButton *button);
|
||||||
|
|
||||||
QPushButton *mButtonPoint = new QPushButton(QIcon (QPixmap (":scenetoolbar/brush-point")), "", this);
|
const QString toolTipPoint = "Paint single point";
|
||||||
QPushButton *mButtonSquare = new QPushButton(QIcon (QPixmap (":scenetoolbar/brush-square")), "", this);
|
const QString toolTipSquare = "Paint with square brush";
|
||||||
QPushButton *mButtonCircle = new QPushButton(QIcon (QPixmap (":scenetoolbar/brush-circle")), "", this);
|
const QString toolTipCircle = "Paint with circle brush";
|
||||||
QPushButton *mButtonCustom = new QPushButton(QIcon (QPixmap (":scenetoolbar/brush-custom")), "", this);
|
const QString toolTipCustom = "Paint custom selection (not implemented yet)";
|
||||||
QString toolTipPoint = "Paint single point";
|
|
||||||
QString toolTipSquare = "Paint with square brush";
|
private:
|
||||||
QString toolTipCircle = "Paint with circle brush";
|
|
||||||
QString toolTipCustom = "Paint custom selection (not implemented yet)";
|
|
||||||
BrushSizeControls* mSizeSliders = new BrushSizeControls("Brush size", this);
|
|
||||||
int mBrushShape;
|
int mBrushShape;
|
||||||
int mBrushSize;
|
int mBrushSize;
|
||||||
std::string mBrushTexture;
|
std::string mBrushTexture;
|
||||||
|
|
||||||
private:
|
|
||||||
CSMDoc::Document& mDocument;
|
CSMDoc::Document& mDocument;
|
||||||
QLabel *mSelectedBrush;
|
QLabel *mSelectedBrush;
|
||||||
QGroupBox *mHorizontalGroupBox;
|
QGroupBox *mHorizontalGroupBox;
|
||||||
std::string mBrushTextureLabel;
|
std::string mBrushTextureLabel;
|
||||||
|
QPushButton *mButtonPoint;
|
||||||
|
QPushButton *mButtonSquare;
|
||||||
|
QPushButton *mButtonCircle;
|
||||||
|
QPushButton *mButtonCustom;
|
||||||
|
BrushSizeControls* mSizeSliders;
|
||||||
|
|
||||||
|
friend class SceneToolTextureBrush;
|
||||||
|
friend class CSVRender::TerrainTextureMode;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setBrushTexture(std::string brushTexture);
|
void setBrushTexture(std::string brushTexture);
|
||||||
|
@ -84,6 +99,7 @@ namespace CSVWidget
|
||||||
QFrame *mPanel;
|
QFrame *mPanel;
|
||||||
QTableWidget *mTable;
|
QTableWidget *mTable;
|
||||||
std::vector<std::string> mBrushHistory;
|
std::vector<std::string> mBrushHistory;
|
||||||
|
TextureBrushWindow *mTextureBrushWindow;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -96,11 +112,11 @@ namespace CSVWidget
|
||||||
virtual void showPanel (const QPoint& position);
|
virtual void showPanel (const QPoint& position);
|
||||||
void updatePanel ();
|
void updatePanel ();
|
||||||
|
|
||||||
TextureBrushWindow *mTextureBrushWindow;
|
|
||||||
|
|
||||||
void dropEvent (QDropEvent *event);
|
void dropEvent (QDropEvent *event);
|
||||||
void dragEnterEvent (QDragEnterEvent *event);
|
void dragEnterEvent (QDragEnterEvent *event);
|
||||||
|
|
||||||
|
friend class CSVRender::TerrainTextureMode;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setButtonIcon(int brushShape);
|
void setButtonIcon(int brushShape);
|
||||||
void updateBrushHistory (const std::string& mBrushTexture);
|
void updateBrushHistory (const std::string& mBrushTexture);
|
||||||
|
|
Loading…
Reference in a new issue