Changeset View
Changeset View
Standalone View
Standalone View
plugins/kdecorations/aurorae/src/aurorae.cpp
Show First 20 Lines • Show All 384 Lines • ▼ Show 20 Line(s) | 380 | auto trackBorders = [this](KWin::Borders *borders) { | |||
---|---|---|---|---|---|
385 | connect(borders, &KWin::Borders::rightChanged, this, &Decoration::updateBorders); | 385 | connect(borders, &KWin::Borders::rightChanged, this, &Decoration::updateBorders); | ||
386 | connect(borders, &KWin::Borders::topChanged, this, &Decoration::updateBorders); | 386 | connect(borders, &KWin::Borders::topChanged, this, &Decoration::updateBorders); | ||
387 | connect(borders, &KWin::Borders::bottomChanged, this, &Decoration::updateBorders); | 387 | connect(borders, &KWin::Borders::bottomChanged, this, &Decoration::updateBorders); | ||
388 | }; | 388 | }; | ||
389 | trackBorders(m_borders); | 389 | trackBorders(m_borders); | ||
390 | trackBorders(m_maximizedBorders); | 390 | trackBorders(m_maximizedBorders); | ||
391 | if (m_extendedBorders) { | 391 | if (m_extendedBorders) { | ||
392 | auto updateExtendedBorders = [this] { | 392 | auto updateExtendedBorders = [this] { | ||
393 | setResizeOnlyBorders(*m_extendedBorders); | 393 | setResizeOnlyBorders(*m_extendedBorders); | ||
davidedmundson: Do we need to also do your new code here? | |||||
394 | }; | 394 | }; | ||
395 | updateExtendedBorders(); | 395 | updateExtendedBorders(); | ||
396 | connect(m_extendedBorders, &KWin::Borders::leftChanged, this, updateExtendedBorders); | 396 | connect(m_extendedBorders, &KWin::Borders::leftChanged, this, updateExtendedBorders); | ||
397 | connect(m_extendedBorders, &KWin::Borders::rightChanged, this, updateExtendedBorders); | 397 | connect(m_extendedBorders, &KWin::Borders::rightChanged, this, updateExtendedBorders); | ||
398 | connect(m_extendedBorders, &KWin::Borders::topChanged, this, updateExtendedBorders); | 398 | connect(m_extendedBorders, &KWin::Borders::topChanged, this, updateExtendedBorders); | ||
399 | connect(m_extendedBorders, &KWin::Borders::bottomChanged, this, updateExtendedBorders); | 399 | connect(m_extendedBorders, &KWin::Borders::bottomChanged, this, updateExtendedBorders); | ||
400 | } | 400 | } | ||
401 | connect(client().data(), &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::updateBorders, Qt::QueuedConnection); | 401 | connect(client().data(), &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::updateBorders, Qt::QueuedConnection); | ||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | 445 | { | |||
446 | KWin::Borders *b = m_borders; | 446 | KWin::Borders *b = m_borders; | ||
447 | if (client().data()->isMaximized() && m_maximizedBorders) { | 447 | if (client().data()->isMaximized() && m_maximizedBorders) { | ||
448 | b = m_maximizedBorders; | 448 | b = m_maximizedBorders; | ||
449 | } | 449 | } | ||
450 | if (!b) { | 450 | if (!b) { | ||
451 | return; | 451 | return; | ||
452 | } | 452 | } | ||
453 | setBorders(*b); | 453 | setBorders(*b); | ||
454 | | ||||
455 | // extended sizes | ||||
456 | const int extSize = settings()->largeSpacing(); | ||||
457 | int extSides = 0; | ||||
458 | int extBottom = 0; | ||||
459 | if( settings()->borderSize() == KDecoration2::BorderSize::None ) | ||||
460 | { | ||||
461 | if( !client().data()->isMaximizedHorizontally() ) extSides = extSize; | ||||
462 | if( !client().data()->isMaximizedVertically() ) extBottom = extSize; | ||||
463 | | ||||
464 | } else if( settings()->borderSize() == KDecoration2::BorderSize::NoSides && !client().data()->isMaximizedHorizontally() ) { | ||||
465 | | ||||
466 | extSides = extSize; | ||||
467 | | ||||
468 | } | ||||
469 | | ||||
470 | setResizeOnlyBorders(QMargins(extSides, 0, extSides, extBottom)); | ||||
454 | } | 471 | } | ||
455 | 472 | | |||
456 | void Decoration::paint(QPainter *painter, const QRect &repaintRegion) | 473 | void Decoration::paint(QPainter *painter, const QRect &repaintRegion) | ||
457 | { | 474 | { | ||
458 | Q_UNUSED(repaintRegion) | 475 | Q_UNUSED(repaintRegion) | ||
459 | painter->fillRect(rect(), Qt::transparent); | 476 | painter->fillRect(rect(), Qt::transparent); | ||
460 | painter->drawImage(rect(), m_buffer, m_contentRect); | 477 | painter->drawImage(rect(), m_buffer, m_contentRect); | ||
461 | } | 478 | } | ||
▲ Show 20 Lines • Show All 347 Lines • Show Last 20 Lines |
Do we need to also do your new code here?