Changeset View
Changeset View
Standalone View
Standalone View
kdecoration/breezebutton.cpp
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 40 | { | |||
---|---|---|---|---|---|
57 | connect( this, &KDecoration2::DecorationButton::hoveredChanged, this, &Button::updateAnimationState ); | 57 | connect( this, &KDecoration2::DecorationButton::hoveredChanged, this, &Button::updateAnimationState ); | ||
58 | 58 | | |||
59 | reconfigure(); | 59 | reconfigure(); | ||
60 | 60 | | |||
61 | } | 61 | } | ||
62 | 62 | | |||
63 | //__________________________________________________________________ | 63 | //__________________________________________________________________ | ||
64 | Button::Button(QObject *parent, const QVariantList &args) | 64 | Button::Button(QObject *parent, const QVariantList &args) | ||
65 | : DecorationButton(args.at(0).value<DecorationButtonType>(), args.at(1).value<Decoration*>(), parent) | 65 | : Button(args.at(0).value<DecorationButtonType>(), args.at(1).value<Decoration*>(), parent) | ||
66 | , m_flag(FlagStandalone) | 66 | { | ||
67 | , m_animation( new QPropertyAnimation( this ) ) | 67 | m_flag = FlagStandalone; | ||
68 | {} | 68 | //! icon size must return to !valid because it was altered from the default constructor, | ||
69 | //! in Standalone mode the button is not using the decoration metrics but its geometry | ||||
70 | m_iconSize = QSize(-1, -1); | ||||
71 | } | ||||
69 | 72 | | |||
70 | //__________________________________________________________________ | 73 | //__________________________________________________________________ | ||
71 | Button *Button::create(DecorationButtonType type, KDecoration2::Decoration *decoration, QObject *parent) | 74 | Button *Button::create(DecorationButtonType type, KDecoration2::Decoration *decoration, QObject *parent) | ||
72 | { | 75 | { | ||
73 | if (auto d = qobject_cast<Decoration*>(decoration)) | 76 | if (auto d = qobject_cast<Decoration*>(decoration)) | ||
74 | { | 77 | { | ||
75 | Button *b = new Button(type, d, parent); | 78 | Button *b = new Button(type, d, parent); | ||
76 | switch( type ) | 79 | switch( type ) | ||
▲ Show 20 Lines • Show All 399 Lines • Show Last 20 Lines |