Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwindecoration/declarative-plugin/previewbutton.cpp
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Line(s) | 132 | if (!m_button) { | |||
---|---|---|---|---|---|
133 | return; | 133 | return; | ||
134 | } | 134 | } | ||
135 | QRect size { 0, 0, (int)width(), (int)height() }; | 135 | QRect size { 0, 0, (int)width(), (int)height() }; | ||
136 | m_button->paint(painter, size); | 136 | m_button->paint(painter, size); | ||
137 | painter->setCompositionMode(QPainter::CompositionMode_SourceAtop); | 137 | painter->setCompositionMode(QPainter::CompositionMode_SourceAtop); | ||
138 | painter->fillRect(size, m_color); | 138 | painter->fillRect(size, m_color); | ||
139 | } | 139 | } | ||
140 | 140 | | |||
141 | void PreviewButtonItem::setColor(const QColor color) | 141 | void PreviewButtonItem::setColor(const QColor &color) | ||
142 | { | 142 | { | ||
143 | m_color = color; | 143 | m_color = color; | ||
144 | m_color.setAlpha(127); | 144 | m_color.setAlpha(127); | ||
145 | update(); | 145 | update(); | ||
146 | } | 146 | } | ||
147 | 147 | | |||
148 | } | 148 | } | ||
149 | } | 149 | } |