diff --git a/src/Gui/DlgExpressionInput.cpp b/src/Gui/DlgExpressionInput.cpp
index 3d3531d942..d8cc47199f 100644
--- a/src/Gui/DlgExpressionInput.cpp
+++ b/src/Gui/DlgExpressionInput.cpp
@@ -28,6 +28,7 @@
#include "ui_DlgExpressionInput.h"
#include "ExpressionCompleter.h"
#include
+#include
#include
#include
@@ -41,7 +42,7 @@ DlgExpressionInput::DlgExpressionInput(const App::ObjectIdentifier & _path, boos
path(_path),
discarded(false),
impliedUnit(_impliedUnit),
- minimumWidth(300)
+ minimumWidth(10)
{
assert(path.getDocumentObject() != 0);
@@ -64,10 +65,8 @@ DlgExpressionInput::DlgExpressionInput(const App::ObjectIdentifier & _path, boos
setWindowFlags(Qt::Widget | Qt::FramelessWindowHint);
setAttribute(Qt::WA_NoSystemBackground, true);
setAttribute(Qt::WA_TranslucentBackground, true);
- setParent(0);
-
setWindowFlags(Qt::Popup);
- setModal(true);
+
ui->expression->setFocus();
}
@@ -155,5 +154,13 @@ void DlgExpressionInput::setExpressionInputSize(int width, int height) {
minimumWidth = width;
}
+void DlgExpressionInput::mousePressEvent(QMouseEvent*) {
+
+
+ //we need to reject the dialog when clicked on the background. As the background is transparent
+ //this is the expected behaviour for the user
+ this->reject();
+}
+
#include "moc_DlgExpressionInput.cpp"
diff --git a/src/Gui/DlgExpressionInput.h b/src/Gui/DlgExpressionInput.h
index d69cf08e8b..d5b950e23e 100644
--- a/src/Gui/DlgExpressionInput.h
+++ b/src/Gui/DlgExpressionInput.h
@@ -66,6 +66,7 @@ public:
private Q_SLOTS:
void textChanged(const QString & text);
void setDiscarded();
+ void mousePressEvent(QMouseEvent*);
private:
::Ui::DlgExpressionInput *ui;