summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm49
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac_p_p.h4
2 files changed, 6 insertions, 47 deletions
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm
index d8c40ac156..7124f1a468 100644
--- a/src/plugins/styles/mac/qmacstyle_mac.mm
+++ b/src/plugins/styles/mac/qmacstyle_mac.mm
@@ -1763,24 +1763,9 @@ void QMacStylePrivate::getSliderInfo(QStyle::ComplexControl cc, const QStyleOpti
}
}
-void QMacStylePrivate::setAutoDefaultButton(QObject *button) const
-{
- if (autoDefaultButton != button) {
- if (QStyleAnimation *anim = animation(autoDefaultButton)) {
- anim->updateTarget();
- stopAnimation(autoDefaultButton);
- }
- autoDefaultButton = button;
- }
- if (autoDefaultButton && !animation(autoDefaultButton))
- startAnimation(new QStyleAnimation(autoDefaultButton));
-}
-
QMacStylePrivate::QMacStylePrivate()
: backingStoreNSView(nil)
-{
- defaultButtonStart = CFAbsoluteTimeGetCurrent();
-}
+{ }
QMacStylePrivate::~QMacStylePrivate()
{
@@ -3826,36 +3811,14 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
break;
}
- // No default button pulsating animation on Yosemite,
- // so we have to do few things differently.
-
// a focused auto-default button within an active window
// takes precedence over a normal default button
- if (btn->features & QStyleOptionButton::AutoDefaultButton
- && opt->state & State_Active && opt->state & State_HasFocus) {
+ if ((btn->features & QStyleOptionButton::AutoDefaultButton)
+ && (opt->state & State_Active)
+ && (opt->state & State_HasFocus))
d->autoDefaultButton = opt->styleObject;
- } else if (d->autoDefaultButton == opt->styleObject) {
- d->setAutoDefaultButton(0);
- }
-
- if (!d->autoDefaultButton) {
- if (btn->features & QStyleOptionButton::DefaultButton && opt->state & State_Active) {
- d->defaultButton = opt->styleObject;
- } else if (d->defaultButton == opt->styleObject) {
- if (QStyleAnimation *animation = d->animation(opt->styleObject)) {
- animation->updateTarget();
- d->stopAnimation(opt->styleObject);
- }
- d->defaultButton = 0;
- }
- }
-
- // TODO: find out the pressed button in a qwidget independent way
- extern QWidget *qt_button_down; // qwidgetwindow.cpp
- if (opt->styleObject == qt_button_down)
- d->pressedButton = opt->styleObject;
- else if (d->pressedButton == opt->styleObject)
- d->pressedButton = 0;
+ else if (d->autoDefaultButton == opt->styleObject)
+ d->autoDefaultButton = nullptr;
bool hasMenu = btn->features & QStyleOptionButton::HasMenu;
HIThemeButtonDrawInfo bdi;
diff --git a/src/plugins/styles/mac/qmacstyle_mac_p_p.h b/src/plugins/styles/mac/qmacstyle_mac_p_p.h
index 704627cd7b..2c701713c8 100644
--- a/src/plugins/styles/mac/qmacstyle_mac_p_p.h
+++ b/src/plugins/styles/mac/qmacstyle_mac_p_p.h
@@ -119,7 +119,6 @@ Q_FORWARD_DECLARE_MUTABLE_CG_TYPE(CGContext);
Q_FORWARD_DECLARE_OBJC_CLASS(NSView);
Q_FORWARD_DECLARE_OBJC_CLASS(NSCell);
-Q_FORWARD_DECLARE_OBJC_CLASS(NSButtonCell);
Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(NotificationReceiver));
QT_BEGIN_NAMESPACE
@@ -244,13 +243,10 @@ public:
#endif
public:
- mutable QPointer<QObject> pressedButton;
- mutable QPointer<QObject> defaultButton;
mutable QPointer<QObject> autoDefaultButton;
static QVector<QPointer<QObject> > scrollBars;
mutable QPointer<QFocusFrame> focusWidget;
- CFAbsoluteTime defaultButtonStart;
QT_MANGLE_NAMESPACE(NotificationReceiver) *receiver;
NSView *backingStoreNSView;
QHash<QCocoaWidget, NSView *> cocoaControls;