1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-11 09:36:37 +00:00
OpenMW/apps/opencs/view/widget/scenetoolmode.hpp

58 lines
1.4 KiB
C++
Raw Normal View History

#ifndef CSV_WIDGET_SCENETOOL_MODE_H
#define CSV_WIDGET_SCENETOOL_MODE_H
2013-09-28 09:27:24 +00:00
#include "scenetool.hpp"
#include <map>
class QHBoxLayout;
namespace CSVWidget
2013-09-28 09:27:24 +00:00
{
class SceneToolbar;
class ModeButton;
2013-09-28 09:27:24 +00:00
///< \brief Mode selector tool
class SceneToolMode : public SceneTool
{
Q_OBJECT
QWidget *mPanel;
QHBoxLayout *mLayout;
std::map<ModeButton *, std::string> mButtons; // widget, id
int mButtonSize;
2014-04-03 11:00:19 +00:00
int mIconSize;
QString mToolTip;
PushButton *mFirst;
ModeButton *mCurrent;
SceneToolbar *mToolbar;
void adjustToolTip (const ModeButton *activeMode);
2013-09-28 09:27:24 +00:00
public:
SceneToolMode (SceneToolbar *parent, const QString& toolTip);
virtual void showPanel (const QPoint& position);
2014-07-10 11:18:24 +00:00
void addButton (const std::string& icon, const std::string& id,
const QString& tooltip = "");
/// The ownership of \a button is transferred to *this.
void addButton (ModeButton *button, const std::string& id);
/// Will return a 0-pointer only if the mode does not have any buttons yet.
ModeButton *getCurrent();
signals:
void modeChanged (const std::string& id);
private slots:
void selected();
2013-09-28 09:27:24 +00:00
};
}
#endif