mirror of
https://github.com/KDE/latte-dock.git
synced 2025-01-19 06:03:42 +03:00
Revert "remove workaround for struts gap"
This reverts commit 137cd365476ffc417aa6cd7974e4187c29e1a66b.
This commit is contained in:
parent
8a281bc3e8
commit
359b120360
@ -63,17 +63,6 @@ void Effects::init()
|
|||||||
connect(m_view, &Latte::View::behaveAsPlasmaPanelChanged, this, &Effects::updateEffects);
|
connect(m_view, &Latte::View::behaveAsPlasmaPanelChanged, this, &Effects::updateEffects);
|
||||||
connect(m_view, &Latte::View::behaveAsPlasmaPanelChanged, this, &Effects::updateShadows);
|
connect(m_view, &Latte::View::behaveAsPlasmaPanelChanged, this, &Effects::updateShadows);
|
||||||
connect(m_view, &Latte::View::configWindowGeometryChanged, this, &Effects::updateMask);
|
connect(m_view, &Latte::View::configWindowGeometryChanged, this, &Effects::updateMask);
|
||||||
|
|
||||||
connect(m_view, &QQuickWindow::widthChanged, this, [&]() {
|
|
||||||
if (m_view->behaveAsPlasmaPanel() && m_view->formFactor() == Plasma::Types::Vertical) {
|
|
||||||
updateMaskThickness();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
connect(m_view, &QQuickWindow::heightChanged, this, [&]() {
|
|
||||||
if (m_view->behaveAsPlasmaPanel() && m_view->formFactor() == Plasma::Types::Horizontal) {
|
|
||||||
updateMaskThickness();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Effects::animationsBlocked() const
|
bool Effects::animationsBlocked() const
|
||||||
@ -206,40 +195,29 @@ void Effects::setSettingsMaskSubtracted(bool enabled)
|
|||||||
|
|
||||||
int Effects::maskThickness() const
|
int Effects::maskThickness() const
|
||||||
{
|
{
|
||||||
return m_maskThickness;
|
if (m_view->mask().isEmpty()) {
|
||||||
}
|
return m_view->formFactor() == Plasma::Types::Horizontal ? m_view->width() : m_view->height();
|
||||||
|
|
||||||
void Effects::setMaskThickness(const int &thickness)
|
|
||||||
{
|
|
||||||
if (m_maskThickness == thickness) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_maskThickness = thickness;
|
|
||||||
emit maskThicknessChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Effects::updateMaskThickness()
|
|
||||||
{
|
|
||||||
if (m_mask.isNull() || m_mask.width() == 0 || m_mask.height() == 0) {
|
|
||||||
setMaskThickness(m_view->formFactor() == Plasma::Types::Horizontal ? m_view->height() : m_view->width());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (m_view->location()) {
|
switch (m_view->location()) {
|
||||||
case Plasma::Types::TopEdge:
|
case Plasma::Types::TopEdge:
|
||||||
setMaskThickness(m_mask.bottom());
|
return m_view->mask().boundingRect().bottom();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Plasma::Types::LeftEdge:
|
case Plasma::Types::LeftEdge:
|
||||||
setMaskThickness(m_mask.right());
|
return m_view->mask().boundingRect().right();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Plasma::Types::RightEdge:
|
case Plasma::Types::RightEdge:
|
||||||
setMaskThickness(m_mask.left());
|
return m_view->mask().boundingRect().left();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Plasma::Types::BottomEdge:
|
case Plasma::Types::BottomEdge:
|
||||||
setMaskThickness(m_mask.top());
|
return m_view->mask().boundingRect().top();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return 64;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -354,13 +332,11 @@ QRect Effects::mask() const
|
|||||||
|
|
||||||
void Effects::setMask(QRect area)
|
void Effects::setMask(QRect area)
|
||||||
{
|
{
|
||||||
if (m_mask == area) {
|
if (m_mask == area)
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
m_mask = area;
|
m_mask = area;
|
||||||
updateMask();
|
updateMask();
|
||||||
updateMaskThickness();
|
|
||||||
|
|
||||||
// qDebug() << "dock mask set:" << m_mask;
|
// qDebug() << "dock mask set:" << m_mask;
|
||||||
emit maskChanged();
|
emit maskChanged();
|
||||||
|
@ -84,7 +84,6 @@ public:
|
|||||||
void setInnerShadow(int shadow);
|
void setInnerShadow(int shadow);
|
||||||
|
|
||||||
int maskThickness() const;
|
int maskThickness() const;
|
||||||
void setMaskThickness(const int &thickness);
|
|
||||||
|
|
||||||
QRect mask() const;
|
QRect mask() const;
|
||||||
void setMask(QRect area);
|
void setMask(QRect area);
|
||||||
@ -111,14 +110,12 @@ signals:
|
|||||||
void editShadowChanged();
|
void editShadowChanged();
|
||||||
void enabledBordersChanged();
|
void enabledBordersChanged();
|
||||||
void maskChanged();
|
void maskChanged();
|
||||||
void maskThicknessChanged();
|
|
||||||
void innerShadowChanged();
|
void innerShadowChanged();
|
||||||
void rectChanged();
|
void rectChanged();
|
||||||
void settingsMaskSubtractedChanged();
|
void settingsMaskSubtractedChanged();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void init();
|
void init();
|
||||||
void updateMaskThickness();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QRegion subtractedMask();
|
QRegion subtractedMask();
|
||||||
@ -134,7 +131,6 @@ private:
|
|||||||
int m_backgroundOpacity{100};
|
int m_backgroundOpacity{100};
|
||||||
int m_editShadow{0};
|
int m_editShadow{0};
|
||||||
int m_innerShadow{0};
|
int m_innerShadow{0};
|
||||||
int m_maskThickness{64};
|
|
||||||
|
|
||||||
QRect m_rect;
|
QRect m_rect;
|
||||||
QRect m_mask;
|
QRect m_mask;
|
||||||
|
@ -170,17 +170,14 @@ void VisibilityManager::setMode(Latte::Types::Visibility mode)
|
|||||||
updateStrutsBasedOnLayoutsAndActivities();
|
updateStrutsBasedOnLayoutsAndActivities();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_connections[base] = connect(m_latteView->effects(), &ViewPart::Effects::maskThicknessChanged, this, [&]() {
|
|
||||||
updateStrutsBasedOnLayoutsAndActivities();
|
|
||||||
});
|
|
||||||
|
|
||||||
m_connections[base+1] = connect(m_corona->layoutsManager(), &Layouts::Manager::currentLayoutNameChanged, this, [&]() {
|
m_connections[base] = connect(m_corona->layoutsManager(), &Layouts::Manager::currentLayoutNameChanged, this, [&]() {
|
||||||
if (m_corona && m_corona->layoutsManager()->memoryUsage() == Types::MultipleLayouts) {
|
if (m_corona && m_corona->layoutsManager()->memoryUsage() == Types::MultipleLayouts) {
|
||||||
updateStrutsBasedOnLayoutsAndActivities(true);
|
updateStrutsBasedOnLayoutsAndActivities(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
m_connections[base+2] = connect(m_latteView, &Latte::View::activitiesChanged, this, [&]() {
|
m_connections[base+1] = connect(m_latteView, &Latte::View::activitiesChanged, this, [&]() {
|
||||||
if (m_corona && m_corona->layoutsManager()->memoryUsage() == Types::MultipleLayouts) {
|
if (m_corona && m_corona->layoutsManager()->memoryUsage() == Types::MultipleLayouts) {
|
||||||
updateStrutsBasedOnLayoutsAndActivities(true);
|
updateStrutsBasedOnLayoutsAndActivities(true);
|
||||||
}
|
}
|
||||||
@ -273,30 +270,28 @@ QRect VisibilityManager::acceptableStruts()
|
|||||||
|
|
||||||
int visibleThickness = qMin(m_latteView->effects()->maskThickness(), m_latteView->normalThickness());
|
int visibleThickness = qMin(m_latteView->effects()->maskThickness(), m_latteView->normalThickness());
|
||||||
|
|
||||||
qDebug() << " VISIBLE THICKNESS ::: " << visibleThickness;
|
|
||||||
|
|
||||||
switch (m_latteView->location()) {
|
switch (m_latteView->location()) {
|
||||||
case Plasma::Types::TopEdge: {
|
case Plasma::Types::TopEdge: {
|
||||||
calcs = QRect(m_latteView->x(), m_latteView->y(), m_latteView->width(), visibleThickness);
|
calcs = QRect(m_latteView->x(), m_latteView->y(), m_latteView->width(), visibleThickness);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case Plasma::Types::BottomEdge: {
|
case Plasma::Types::BottomEdge: {
|
||||||
int y = m_latteView->y() + m_latteView->height() - visibleThickness;
|
int y = m_latteView->y() + m_latteView->height() - visibleThickness;
|
||||||
calcs = QRect(m_latteView->x(), y, m_latteView->width(), visibleThickness);
|
calcs = QRect(m_latteView->x(), y, m_latteView->width(), visibleThickness);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case Plasma::Types::LeftEdge: {
|
case Plasma::Types::LeftEdge: {
|
||||||
calcs = QRect(m_latteView->x(), m_latteView->y(), visibleThickness, m_latteView->height());
|
calcs = QRect(m_latteView->x(), m_latteView->y(), visibleThickness, m_latteView->height());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case Plasma::Types::RightEdge: {
|
case Plasma::Types::RightEdge: {
|
||||||
int x = m_latteView->x() + m_latteView->width() - visibleThickness;
|
int x = m_latteView->x() + m_latteView->width() - visibleThickness;
|
||||||
calcs = QRect(x, m_latteView->y(), visibleThickness, m_latteView->height());
|
calcs = QRect(x, m_latteView->y(), visibleThickness, m_latteView->height());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return calcs;
|
return calcs;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user