From 77757ff3c67049c19af09b971d8fc1b7636c3560 Mon Sep 17 00:00:00 2001 From: Gres Date: Wed, 30 Sep 2015 21:28:00 +0300 Subject: [PATCH] Removed obsolete code. --- ResultDialog.cpp | 23 +++++++---------------- ResultDialog.h | 1 - 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/ResultDialog.cpp b/ResultDialog.cpp index 3d90eac..9dc8986 100644 --- a/ResultDialog.cpp +++ b/ResultDialog.cpp @@ -10,7 +10,7 @@ ResultDialog::ResultDialog (const LanguageHelper &dictionary, QWidget *parent) : QDialog (parent), ui (new Ui::ResultDialog), - dictionary_ (dictionary), isShowAtCapturePos_ (true), + dictionary_ (dictionary), contextMenu_ (NULL), recognizeSubMenu_ (NULL), translateSubMenu_ (NULL), clipboardAction_ (NULL) { ui->setupUi (this); @@ -88,21 +88,12 @@ void ResultDialog::showResult (ProcessingItem item) { QDesktopWidget *desktop = QApplication::desktop (); Q_CHECK_PTR (desktop); - if (isShowAtCapturePos_) { - QPoint correction = QPoint (ui->frame->lineWidth (), ui->frame->lineWidth ()); - move (item.screenPos - correction); - QRect screenRect = desktop->screenGeometry (this); - int minY = screenRect.bottom () - height (); - if (y () > minY) { - move (x (), minY); - } - } - else { - - QRect screenRect = desktop->availableGeometry (this); - ST_ASSERT (screenRect.isValid ()); - QPoint newPos (screenRect.width () - width (), screenRect.height () - height ()); - move (newPos); + QPoint correction = QPoint (ui->frame->lineWidth (), ui->frame->lineWidth ()); + move (item.screenPos - correction); + QRect screenRect = desktop->screenGeometry (this); + int minY = screenRect.bottom () - height (); + if (y () > minY) { + move (x (), minY); } activateWindow (); } diff --git a/ResultDialog.h b/ResultDialog.h index cda4a12..e3edd0a 100644 --- a/ResultDialog.h +++ b/ResultDialog.h @@ -37,7 +37,6 @@ class ResultDialog : public QDialog { private: Ui::ResultDialog *ui; const LanguageHelper &dictionary_; - bool isShowAtCapturePos_; QMenu *contextMenu_; QMenu *recognizeSubMenu_; QMenu *translateSubMenu_;