Commit 90b37961 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner: adding reset position to context widget

parent 67a65d9b
......@@ -48,6 +48,10 @@ ContextPaneWidget::ContextPaneWidget(QWidget *parent) : QFrame(parent), m_curren
setAutoFillBackground(true);
setContextMenuPolicy(Qt::ActionsContextMenu);
QAction *resetAction = new QAction(tr("Reset position"), this);
addAction(resetAction);
connect(resetAction, SIGNAL(triggered()), this, SLOT(onResetPosition()));
QAction *disableAction = new QAction(tr("Disable permanently"), this);
addAction(disableAction);
connect(disableAction, SIGNAL(triggered()), this, SLOT(onDisable()));
......@@ -80,6 +84,7 @@ void ContextPaneWidget::rePosition(const QPoint &position, const QPoint &alterna
else
move(alternative);
m_originalPos = pos();
if (m_xPos > 0)
move(m_xPos, pos().y());
}
......@@ -198,6 +203,12 @@ void ContextPaneWidget::onDisable()
colorDialog()->hide();
}
void ContextPaneWidget::onResetPosition()
{
move(m_originalPos);
m_xPos = -1;
}
QWidget* ContextPaneWidget::createFontWidget()
{
m_textWidget = new ContextPaneTextWidget(this);
......
......@@ -41,6 +41,7 @@ signals:
private slots:
void onDisable();
void onResetPosition();
protected:
QWidget *createFontWidget();
......@@ -57,6 +58,7 @@ private:
QWeakPointer<BauhausColorDialog> m_bauhausColorDialog;
QString m_colorName;
int m_xPos;
QPoint m_originalPos;
};
} //QmlDesigner
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment