mirror of
https://github.com/KDE/latte-dock.git
synced 2025-01-05 17:17:49 +03:00
update struts properly for TopLayouts
This commit is contained in:
parent
caedf9842e
commit
385b0e0b20
@ -133,6 +133,11 @@ void GenericLayout::setBlockAutomaticLatteViewCreation(bool block)
|
||||
m_blockAutomaticLatteViewCreation = block;
|
||||
}
|
||||
|
||||
bool GenericLayout::isCurrent() const
|
||||
{
|
||||
return name() == m_corona->layoutManager()->currentLayoutName();
|
||||
}
|
||||
|
||||
int GenericLayout::viewsCount(int screen) const
|
||||
{
|
||||
if (!m_corona) {
|
||||
|
@ -71,6 +71,7 @@ public:
|
||||
void importToCorona();
|
||||
bool initToCorona(Latte::Corona *corona);
|
||||
|
||||
virtual bool isCurrent() const;
|
||||
bool isWritable() const;
|
||||
bool layoutIsBroken() const;
|
||||
|
||||
|
@ -36,6 +36,17 @@ TopLayout::~TopLayout()
|
||||
{
|
||||
}
|
||||
|
||||
bool TopLayout::isCurrent() const
|
||||
{
|
||||
for (const auto &layout : m_activeLayouts) {
|
||||
if (layout->isCurrent()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
const QStringList TopLayout::appliedActivities()
|
||||
{
|
||||
if (!m_corona) {
|
||||
|
@ -48,6 +48,9 @@ public:
|
||||
|
||||
const QStringList appliedActivities();
|
||||
|
||||
//! OVERRIDE GeneralLayout implementations
|
||||
bool isCurrent() const override;
|
||||
|
||||
public slots:
|
||||
void addActiveLayout(ActiveLayout *layout);
|
||||
void removeActiveLayout(ActiveLayout *layout);
|
||||
|
@ -244,7 +244,7 @@ void VisibilityManager::updateStrutsBasedOnLayoutsAndActivities()
|
||||
{
|
||||
bool multipleLayoutsAndCurrent = (m_corona->layoutManager()->memoryUsage() == Types::MultipleLayouts
|
||||
&& m_latteView->managedLayout() && !m_latteView->positioner()->inLocationChangeAnimation()
|
||||
&& m_latteView->managedLayout()->name() == m_corona->layoutManager()->currentLayoutName());
|
||||
&& m_latteView->managedLayout()->isCurrent());
|
||||
|
||||
if (m_corona->layoutManager()->memoryUsage() == Types::SingleLayout || multipleLayoutsAndCurrent) {
|
||||
wm->setViewStruts(*m_latteView, m_viewGeometry, m_latteView->location());
|
||||
|
Loading…
Reference in New Issue
Block a user