summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/styles/qwindowsstyle.cpp3
-rw-r--r--src/widgets/widgets/qtabbar.cpp6
2 files changed, 5 insertions, 4 deletions
diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp
index bea7593ef77..916c019bcd3 100644
--- a/src/widgets/styles/qwindowsstyle.cpp
+++ b/src/widgets/styles/qwindowsstyle.cpp
@@ -116,8 +116,7 @@ bool QWindowsStyle::eventFilter(QObject *o, QEvent *e)
// Alt has been pressed - find all widgets that care
const QList<QWidget *> children = widget->findChildren<QWidget *>();
auto ignorable = [](QWidget *w) {
- return w->isWindow() || !w->isVisible()
- || w->style()->styleHint(SH_UnderlineShortcut, nullptr, w);
+ return w->isWindow() || !w->isVisible();
};
// Update states before repainting
d->seenAlt.append(widget);
diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp
index 44218d41ded..84fe8c3f44a 100644
--- a/src/widgets/widgets/qtabbar.cpp
+++ b/src/widgets/widgets/qtabbar.cpp
@@ -834,7 +834,7 @@ void QTabBarPrivate::scrollTabs()
const auto &tabRect = tab->rect;
int start = horizontal ? tabRect.left() : tabRect.top();
int end = horizontal ? tabRect.right() : tabRect.bottom();
- if (end > scrollRect.right() && start > scrollOffset) {
+ if (end > scrollRect.right() && start > scrollRect.left()) {
makeVisible(i);
return;
}
@@ -2449,10 +2449,12 @@ void QTabBar::wheelEvent(QWheelEvent *event)
if (!d->rightB->isVisible())
scrollRectExtent += tabsVertical ? d->rightB->height() : d->rightB->width();
+ const QRect scrollRect0 = d->normalizedScrollRect(0);
+ const int minScrollOffset = -1 * scrollRect0.left();
const int maxScrollOffset = qMax((tabsVertical ?
lastTabRect.bottom() :
lastTabRect.right()) - scrollRectExtent, 0);
- d->scrollOffset = qBound(0, d->scrollOffset - delta, maxScrollOffset);
+ d->scrollOffset = qBound(minScrollOffset, d->scrollOffset - delta, maxScrollOffset);
d->leftB->setEnabled(d->scrollOffset > -scrollRect.left());
d->rightB->setEnabled(maxScrollOffset > d->scrollOffset);
if (oldScrollOffset != d->scrollOffset) {