Whitespace fix

Sorry.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-09-22 14:13:51 -03:00 committed by Dirk Hohndel
parent dd21ab6b11
commit fdec250723

View file

@ -521,42 +521,42 @@ void DiveLocationLineEdit::keyPressEvent(QKeyEvent *ev)
void DiveLocationLineEdit::showPopup() void DiveLocationLineEdit::showPopup()
{ {
const QRect screen = QApplication::desktop()->availableGeometry(this); const QRect screen = QApplication::desktop()->availableGeometry(this);
const int maxVisibleItems = 5; const int maxVisibleItems = 5;
Qt::LayoutDirection dir = layoutDirection(); Qt::LayoutDirection dir = layoutDirection();
QPoint pos; QPoint pos;
int rh, w; int rh, w;
int h = (view->sizeHintForRow(0) * qMin(maxVisibleItems, view->model()->rowCount()) + 3) + 3; int h = (view->sizeHintForRow(0) * qMin(maxVisibleItems, view->model()->rowCount()) + 3) + 3;
QScrollBar *hsb = view->horizontalScrollBar(); QScrollBar *hsb = view->horizontalScrollBar();
if (hsb && hsb->isVisible()) if (hsb && hsb->isVisible())
h += view->horizontalScrollBar()->sizeHint().height(); h += view->horizontalScrollBar()->sizeHint().height();
rh = height(); rh = height();
pos = mapToGlobal(QPoint(0, height() - 2)); pos = mapToGlobal(QPoint(0, height() - 2));
w = width(); w = width();
if (w > screen.width()) if (w > screen.width())
w = screen.width(); w = screen.width();
if ((pos.x() + w) > (screen.x() + screen.width())) if ((pos.x() + w) > (screen.x() + screen.width()))
pos.setX(screen.x() + screen.width() - w); pos.setX(screen.x() + screen.width() - w);
if (pos.x() < screen.x()) if (pos.x() < screen.x())
pos.setX(screen.x()); pos.setX(screen.x());
int top = pos.y() - rh - screen.top() + 2; int top = pos.y() - rh - screen.top() + 2;
int bottom = screen.bottom() - pos.y(); int bottom = screen.bottom() - pos.y();
h = qMax(h, view->minimumHeight()); h = qMax(h, view->minimumHeight());
if (h > bottom) { if (h > bottom) {
h = qMin(qMax(top, bottom), h); h = qMin(qMax(top, bottom), h);
if (top > bottom) if (top > bottom)
pos.setY(pos.y() - h - rh + 2); 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()) { if (!view->isVisible()) {
view->show(); view->show();
view->setFocus(); view->setFocus();
} }
} }
DiveLocationListView::DiveLocationListView(QWidget *parent) DiveLocationListView::DiveLocationListView(QWidget *parent)