Changeset View
Changeset View
Standalone View
Standalone View
shadow.cpp
Show First 20 Lines • Show All 180 Lines • ▼ Show 20 Line(s) | 141 | { | |||
---|---|---|---|---|---|
181 | buildQuads(); | 181 | buildQuads(); | ||
182 | return true; | 182 | return true; | ||
183 | } | 183 | } | ||
184 | 184 | | |||
185 | bool Shadow::init(KDecoration2::Decoration *decoration) | 185 | bool Shadow::init(KDecoration2::Decoration *decoration) | ||
186 | { | 186 | { | ||
187 | if (m_decorationShadow) { | 187 | if (m_decorationShadow) { | ||
188 | // disconnect previous connections | 188 | // disconnect previous connections | ||
189 | disconnect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::innerShadowRectChanged, m_topLevel, &Toplevel::getShadow); | 189 | disconnect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::innerShadowRectChanged, m_topLevel, &Toplevel::updateShadow); | ||
190 | disconnect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::shadowChanged, m_topLevel, &Toplevel::getShadow); | 190 | disconnect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::shadowChanged, m_topLevel, &Toplevel::updateShadow); | ||
191 | disconnect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::paddingChanged, m_topLevel, &Toplevel::getShadow); | 191 | disconnect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::paddingChanged, m_topLevel, &Toplevel::updateShadow); | ||
192 | } | 192 | } | ||
193 | m_decorationShadow = decoration->shadow(); | 193 | m_decorationShadow = decoration->shadow(); | ||
194 | if (!m_decorationShadow) { | 194 | if (!m_decorationShadow) { | ||
195 | return false; | 195 | return false; | ||
196 | } | 196 | } | ||
197 | // setup connections - all just mapped to recreate | 197 | // setup connections - all just mapped to recreate | ||
198 | connect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::innerShadowRectChanged, m_topLevel, &Toplevel::getShadow); | 198 | connect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::innerShadowRectChanged, m_topLevel, &Toplevel::updateShadow); | ||
199 | connect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::shadowChanged, m_topLevel, &Toplevel::getShadow); | 199 | connect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::shadowChanged, m_topLevel, &Toplevel::updateShadow); | ||
200 | connect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::paddingChanged, m_topLevel, &Toplevel::getShadow); | 200 | connect(m_decorationShadow.data(), &KDecoration2::DecorationShadow::paddingChanged, m_topLevel, &Toplevel::updateShadow); | ||
201 | 201 | | |||
202 | const QMargins &p = m_decorationShadow->padding(); | 202 | const QMargins &p = m_decorationShadow->padding(); | ||
203 | m_topOffset = p.top(); | 203 | m_topOffset = p.top(); | ||
204 | m_rightOffset = p.right(); | 204 | m_rightOffset = p.right(); | ||
205 | m_bottomOffset = p.bottom(); | 205 | m_bottomOffset = p.bottom(); | ||
206 | m_leftOffset = p.left(); | 206 | m_leftOffset = p.left(); | ||
207 | updateShadowRegion(); | 207 | updateShadowRegion(); | ||
208 | if (!prepareBackend()) { | 208 | if (!prepareBackend()) { | ||
▲ Show 20 Lines • Show All 217 Lines • Show Last 20 Lines |