aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-09-22 14:13:51 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-23 14:15:22 -0700
commitfdec250723549453e714580724231ee2fb866907 (patch)
tree50f9a88aa614d7dc434160c491a86163bef2b24b /qt-ui
parentdd21ab6b11af632b7277c40d96a0fa1c8632acaa (diff)
downloadsubsurface-fdec250723549453e714580724231ee2fb866907.tar.gz
Whitespace fix
Sorry. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/locationinformation.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp
index 68096db84..a66b96c19 100644
--- a/qt-ui/locationinformation.cpp
+++ b/qt-ui/locationinformation.cpp
@@ -521,42 +521,42 @@ void DiveLocationLineEdit::keyPressEvent(QKeyEvent *ev)
void DiveLocationLineEdit::showPopup()
{
- const QRect screen = QApplication::desktop()->availableGeometry(this);
- const int maxVisibleItems = 5;
- Qt::LayoutDirection dir = layoutDirection();
- QPoint pos;
- int rh, w;
- int h = (view->sizeHintForRow(0) * qMin(maxVisibleItems, view->model()->rowCount()) + 3) + 3;
- QScrollBar *hsb = view->horizontalScrollBar();
- if (hsb && hsb->isVisible())
- h += view->horizontalScrollBar()->sizeHint().height();
-
- rh = height();
- pos = mapToGlobal(QPoint(0, height() - 2));
- w = width();
-
- if (w > screen.width())
- w = screen.width();
- if ((pos.x() + w) > (screen.x() + screen.width()))
- pos.setX(screen.x() + screen.width() - w);
- if (pos.x() < screen.x())
- pos.setX(screen.x());
-
- int top = pos.y() - rh - screen.top() + 2;
- int bottom = screen.bottom() - pos.y();
- h = qMax(h, view->minimumHeight());
- if (h > bottom) {
- h = qMin(qMax(top, bottom), h);
- if (top > bottom)
- pos.setY(pos.y() - h - rh + 2);
- }
+ const QRect screen = QApplication::desktop()->availableGeometry(this);
+ const int maxVisibleItems = 5;
+ Qt::LayoutDirection dir = layoutDirection();
+ QPoint pos;
+ int rh, w;
+ int h = (view->sizeHintForRow(0) * qMin(maxVisibleItems, view->model()->rowCount()) + 3) + 3;
+ QScrollBar *hsb = view->horizontalScrollBar();
+ if (hsb && hsb->isVisible())
+ h += view->horizontalScrollBar()->sizeHint().height();
+
+ rh = height();
+ pos = mapToGlobal(QPoint(0, height() - 2));
+ w = width();
+
+ if (w > screen.width())
+ w = screen.width();
+ if ((pos.x() + w) > (screen.x() + screen.width()))
+ pos.setX(screen.x() + screen.width() - w);
+ if (pos.x() < screen.x())
+ pos.setX(screen.x());
+
+ int top = pos.y() - rh - screen.top() + 2;
+ int bottom = screen.bottom() - pos.y();
+ h = qMax(h, view->minimumHeight());
+ if (h > bottom) {
+ h = qMin(qMax(top, bottom), h);
+ if (top > bottom)
+ pos.setY(pos.y() - h - rh + 2);
+ }
- view->setGeometry(pos.x(), pos.y(), w, h);
+ view->setGeometry(pos.x(), pos.y(), w, h);
- if (!view->isVisible()) {
- view->show();
- view->setFocus();
- }
+ if (!view->isVisible()) {
+ view->show();
+ view->setFocus();
+ }
}
DiveLocationListView::DiveLocationListView(QWidget *parent)