Commit 96cb6d00 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner: keep context widget inside the text editor

parent 74610a91
......@@ -178,13 +178,17 @@ void ContextPaneWidget::mouseReleaseEvent(QMouseEvent *event)
void ContextPaneWidget::mouseMoveEvent(QMouseEvent * event)
{
if (event->buttons() && Qt::LeftButton) {
if (pos().x() < 10 && event->pos().x() < -20)
return;
if (m_oldPos != QPoint(-1, -1)) {
QPoint diff = event->globalPos() - m_oldPos;
move(pos() + diff);
if (m_bauhausColorDialog)
m_bauhausColorDialog->move(m_bauhausColorDialog->pos() + diff);
m_xPos = pos().x();
if (m_bauhausColorDialog) {
QPoint newPos = pos() + diff;
if (newPos.x() > 0 && newPos.y() > 0 && (newPos.x() + width()) < parentWidget()->width() && (newPos.y() + height()) < parentWidget()->height()) {
m_bauhausColorDialog->move(m_bauhausColorDialog->pos() + diff);
move(newPos);
}
}
} else {
m_opacityEffect = new QGraphicsOpacityEffect;
setGraphicsEffect(m_opacityEffect);
......
......@@ -28,7 +28,7 @@ class QmlContextPane : public QmlJS::IContextPane
public:
QmlContextPane(QObject *parent = 0);
~QmlContextPane();
void apply(TextEditor::BaseTextEditorEditable *editor, QmlJS::Document::Ptr doc, QmlJS::AST::Node *node, bool update);
void apply(TextEditor::BaseTextEditorEditable *editor, QmlJS::Document::Ptr doc, const QmlJS::Snapshot &snapshot, QmlJS::AST::Node *node, bool update);
void setProperty(const QString &propertyName, const QVariant &value);
void removeProperty(const QString &propertyName);
void setEnabled(bool);
......
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