changeset 19475:521d4959fc42 gui-release

fix positioning issues of editor find dialog (bug #43174) * file-editor.cc (find, change_editor_state): correct the recovered position by 10 px in each direction * find-dialog.cc (ctor): put the find dialog in the lower left corner of editor
author Torsten <ttl@justmail.de>
date Tue, 30 Dec 2014 15:38:57 +0100
parents 9c719c504e8d
children 8c47eb286151
files libgui/src/m-editor/file-editor-tab.cc libgui/src/m-editor/find-dialog.cc
diffstat 2 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc	Tue Dec 30 08:24:14 2014 +0100
+++ b/libgui/src/m-editor/file-editor-tab.cc	Tue Dec 30 15:38:57 2014 +0100
@@ -1024,14 +1024,15 @@
       _find_dialog->setWindowModality (Qt::NonModal);
       _find_dialog_geometry = _find_dialog->geometry ();
     }
-
-  if (!_find_dialog->isVisible ())
+  else if (!_find_dialog->isVisible ())
     {
       _find_dialog->setGeometry (_find_dialog_geometry);
-      _find_dialog->show ();
-      _find_dialog_is_visible = true;
+      QPoint p = _find_dialog->pos ();
+      _find_dialog->move(p.x ()+10, p.y ()+10);
     }
 
+  _find_dialog->show ();
+  _find_dialog_is_visible = true;
   _find_dialog->activateWindow ();
   _find_dialog->init_search_text ();
 
@@ -1961,6 +1962,8 @@
   if (_find_dialog && _find_dialog_is_visible)
     {
       _find_dialog->setGeometry (_find_dialog_geometry);
+      QPoint p = _find_dialog->pos ();
+      _find_dialog->move(p.x ()+10, p.y ()+10);
       _find_dialog->show ();
     }
 
--- a/libgui/src/m-editor/find-dialog.cc	Tue Dec 30 08:24:14 2014 +0100
+++ b/libgui/src/m-editor/find-dialog.cc	Tue Dec 30 15:38:57 2014 +0100
@@ -175,14 +175,11 @@
   _rep_active = false;
 
   // move dialog to side of the parent if there is room on the desktop to do so.
-  QWidget * desktop = QApplication::desktop ();
-  int xp = p->x () + p->frameGeometry ().width ();
-  int yp=  p->y ();
-  if (desktop != 0 && sizeHint ().isValid ())
-    {
-      if (xp + sizeHint ().width () > desktop->width ())
-        xp = desktop->width () - sizeHint ().width ();
-    }
+  int xp = p->x () +20;
+  int yp = p->y () + p->frameGeometry ().height () - sizeHint ().height () -20;
+
+  if (yp < 0)
+    yp = 0;
 
   move (xp, yp);