summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qlineedit.cpp8
-rw-r--r--src/gui/widgets/qmainwindowlayout_mac.mm20
-rw-r--r--src/gui/widgets/qtabbar.cpp6
3 files changed, 32 insertions, 2 deletions
diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp
index 1bffde1..981e934 100644
--- a/src/gui/widgets/qlineedit.cpp
+++ b/src/gui/widgets/qlineedit.cpp
@@ -1663,8 +1663,11 @@ void QLineEdit::keyPressEvent(QKeyEvent *event)
}
#endif
d->control->processKeyEvent(event);
- if (event->isAccepted())
+ if (event->isAccepted()) {
+ if (layoutDirection() != d->control->layoutDirection())
+ setLayoutDirection(d->control->layoutDirection());
d->control->setCursorBlinkPeriod(0);
+ }
}
/*!
@@ -1946,7 +1949,8 @@ void QLineEdit::paintEvent(QPaintEvent *)
if (d->control->hasSelectedText() || (d->cursorVisible && !d->control->inputMask().isEmpty() && !d->control->isReadOnly())){
flags |= QLineControl::DrawSelections;
// Palette only used for selections/mask and may not be in sync
- if(d->control->palette() != pal)
+ if (d->control->palette() != pal
+ || d->control->palette().currentColorGroup() != pal.currentColorGroup())
d->control->setPalette(pal);
}
diff --git a/src/gui/widgets/qmainwindowlayout_mac.mm b/src/gui/widgets/qmainwindowlayout_mac.mm
index b8cef93..1bfc746 100644
--- a/src/gui/widgets/qmainwindowlayout_mac.mm
+++ b/src/gui/widgets/qmainwindowlayout_mac.mm
@@ -48,6 +48,7 @@
#include <Carbon/Carbon.h>
#else
#include <private/qcocoatoolbardelegate_mac_p.h>
+#import <private/qcocoawindowdelegate_mac_p.h>
#endif
QT_BEGIN_NAMESPACE
@@ -337,6 +338,17 @@ void QMainWindowLayout::updateHIToolBarStatus()
#endif
layoutState.mainWindow->setUpdatesEnabled(false); // reduces a little bit of flicker, not all though
+#if defined(QT_MAC_USE_COCOA)
+ QMacCocoaAutoReleasePool pool;
+ NSView *cView = [qt_mac_window_for(layoutState.mainWindow) contentView];
+ if (useMacToolbar) {
+ [cView setPostsFrameChangedNotifications:YES];
+ [[NSNotificationCenter defaultCenter] addObserver: [QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate]
+ selector: @selector(syncContentViewFrame:)
+ name: NSViewFrameDidChangeNotification
+ object: cView];
+ }
+#endif
if (!useMacToolbar) {
macWindowToolbarShow(layoutState.mainWindow, false);
// Move everything out of the HIToolbar into the main toolbar.
@@ -356,6 +368,14 @@ void QMainWindowLayout::updateHIToolBarStatus()
}
syncUnifiedToolbarVisibility();
}
+#if defined(QT_MAC_USE_COCOA)
+ if (!useMacToolbar) {
+ [cView setPostsFrameChangedNotifications:NO];
+ [[NSNotificationCenter defaultCenter] removeObserver: [QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate]
+ name: NSViewFrameDidChangeNotification
+ object: cView];
+ }
+#endif
layoutState.mainWindow->setUpdatesEnabled(true);
}
diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp
index d692307..bbc7e5d 100644
--- a/src/gui/widgets/qtabbar.cpp
+++ b/src/gui/widgets/qtabbar.cpp
@@ -1219,6 +1219,12 @@ void QTabBar::setCurrentIndex(int index)
if (oldIndex >= 0 && oldIndex < count())
d->layoutTab(oldIndex);
d->layoutTab(index);
+#ifndef QT_NO_ACCESSIBILITY
+ if (QAccessible::isActive()) {
+ QAccessible::updateAccessibility(this, index + 1, QAccessible::Focus);
+ QAccessible::updateAccessibility(this, index + 1, QAccessible::Selection);
+ }
+#endif
#ifdef QT3_SUPPORT
emit selected(index);
#endif