diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/dialogs/qfiledialog.cpp | 10 | ||||
-rw-r--r-- | src/gui/styles/qs60style.cpp | 15 |
2 files changed, 22 insertions, 3 deletions
diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index eab842f..50823cd 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -3187,7 +3187,17 @@ void QFileDialogTreeView::keyPressEvent(QKeyEvent *e) if (!d_ptr->itemViewKeyboardEvent(e)) { QTreeView::keyPressEvent(e); } +#ifdef QT_KEYPAD_NAVIGATION + else if ((QApplication::navigationMode() == Qt::NavigationModeKeypadTabOrder + || QApplication::navigationMode() == Qt::NavigationModeKeypadDirectional) + && !hasEditFocus()) { + e->ignore(); + } else { + e->accept(); + } +#else e->accept(); +#endif } QSize QFileDialogTreeView::sizeHint() const diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index b87f3a8..dc38397 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2266,10 +2266,19 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt, sz += QSize(2*f->lineWidth, 4*f->lineWidth); break; case CT_TabBarTab: - QSize naviPaneSize = QS60StylePrivate::naviPaneSize(); + { + const QSize naviPaneSize = QS60StylePrivate::naviPaneSize(); + sz = QCommonStyle::sizeFromContents(ct, opt, csz, widget); + if (naviPaneSize.height() > sz.height()) + sz.setHeight(naviPaneSize.height()); + } + break; + case CT_ItemViewItem: sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget); - if (naviPaneSize.height() > sz.height()) - sz.setHeight(naviPaneSize.height()); + if (QS60StylePrivate::isTouchSupported()) + //Make itemview easier to use in touch devices + //QCommonStyle does not adjust height with horizontal margin, it only adjusts width + sz.setHeight(sz.height() + 2*pixelMetric(QStyle::PM_FocusFrameVMargin)); break; default: sz = QCommonStyle::sizeFromContents( ct, opt, csz, widget); |