Changeset View
Changeset View
Standalone View
Standalone View
kdecoration/oxygenbutton.cpp
Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Line(s) | 89 | { | |||
---|---|---|---|---|---|
108 | 108 | | |||
109 | connect(decoration->settings().data(), &KDecoration2::DecorationSettings::reconfigured, this, &Button::reconfigure); | 109 | connect(decoration->settings().data(), &KDecoration2::DecorationSettings::reconfigured, this, &Button::reconfigure); | ||
110 | connect( this, &KDecoration2::DecorationButton::hoveredChanged, this, &Button::updateAnimationState ); | 110 | connect( this, &KDecoration2::DecorationButton::hoveredChanged, this, &Button::updateAnimationState ); | ||
111 | 111 | | |||
112 | } | 112 | } | ||
113 | 113 | | |||
114 | //_______________________________________________ | 114 | //_______________________________________________ | ||
115 | Button::Button(QObject *parent, const QVariantList &args) | 115 | Button::Button(QObject *parent, const QVariantList &args) | ||
116 | : KDecoration2::DecorationButton(args.at(0).value<KDecoration2::DecorationButtonType>(), args.at(1).value<Decoration*>(), parent) | 116 | : Button(args.at(0).value<KDecoration2::DecorationButtonType>(), args.at(1).value<Decoration*>(), parent) | ||
117 | , m_flag(FlagStandalone) | 117 | { | ||
118 | , m_animation( new QPropertyAnimation( this ) ) | 118 | m_flag = FlagStandalone; | ||
119 | {} | 119 | //! icon size must return to !valid because it was altered from the default constructor, | ||
120 | //! in Standalone mode the button is not using the decoration metrics but its geometry | ||||
121 | m_iconSize = QSize(-1, -1); | ||||
122 | } | ||||
120 | 123 | | |||
121 | //_______________________________________________ | 124 | //_______________________________________________ | ||
122 | QColor Button::foregroundColor(const QPalette &palette) const | 125 | QColor Button::foregroundColor(const QPalette &palette) const | ||
123 | { | 126 | { | ||
124 | auto d( qobject_cast<Decoration*>( decoration().data() ) ); | 127 | auto d( qobject_cast<Decoration*>( decoration().data() ) ); | ||
125 | if( d->isAnimated() ) | 128 | if( d->isAnimated() ) | ||
126 | { | 129 | { | ||
127 | 130 | | |||
▲ Show 20 Lines • Show All 303 Lines • Show Last 20 Lines |