mirror of
https://github.com/KDE/latte-dock.git
synced 2025-02-02 05:47:18 +03:00
improvements for multips views and sidebars
This commit is contained in:
parent
f011541011
commit
d3a07b5371
@ -895,10 +895,22 @@ void GenericLayout::toggleHiddenState(QString screenName, Plasma::Types::Locatio
|
||||
validScreenName = screenName;
|
||||
}
|
||||
|
||||
int viewsOnEdge{0};
|
||||
|
||||
for(const auto view : latteViews()) {
|
||||
if (view->positioner()->currentScreenName() == validScreenName && view->location() == edge) {
|
||||
view->visibility()->toggleHiddenState();
|
||||
return;
|
||||
viewsOnEdge++;
|
||||
}
|
||||
}
|
||||
|
||||
if (viewsOnEdge >= 1) {
|
||||
for(const auto view : latteViews()) {
|
||||
if (view->positioner()->currentScreenName() == validScreenName && view->location() == edge) {
|
||||
if (viewsOnEdge == 1 || (viewsOnEdge >1 && view->visibility() && view->visibility()->mode() == Latte::Types::SideBar)) {
|
||||
view->visibility()->toggleHiddenState();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -64,10 +64,8 @@ private:
|
||||
Latte::Corona *m_corona{nullptr};
|
||||
|
||||
QList<Latte::Types::Visibility> m_ignoreModes{
|
||||
Latte::Types::None,
|
||||
Latte::Types::AutoHide,
|
||||
Latte::Types::SideBar,
|
||||
Latte::Types::NormalWindow
|
||||
Latte::Types::SideBar
|
||||
};
|
||||
|
||||
QStringList m_lastScreenNames;
|
||||
|
@ -416,10 +416,8 @@ void Positioner::syncGeometry()
|
||||
auto latteCorona = qobject_cast<Latte::Corona *>(m_view->corona());
|
||||
int fixedScreen = m_view->onPrimary() ? latteCorona->screenPool()->primaryScreenId() : m_view->containment()->screen();
|
||||
|
||||
QList<Types::Visibility> ignoreModes({Latte::Types::None,
|
||||
Latte::Types::AutoHide,
|
||||
Latte::Types::SideBar,
|
||||
Latte::Types::NormalWindow});
|
||||
QList<Types::Visibility> ignoreModes({Latte::Types::AutoHide,
|
||||
Latte::Types::SideBar});
|
||||
|
||||
QList<Plasma::Types::Location> ignoreEdges({Plasma::Types::LeftEdge,
|
||||
Plasma::Types::RightEdge});
|
||||
|
@ -231,7 +231,14 @@ void PrimaryConfigView::deleteSecondaryWindow()
|
||||
void PrimaryConfigView::updateAvailableScreenGeometry(View *origin)
|
||||
{
|
||||
int currentScrId = m_latteView->positioner()->currentScreenId();
|
||||
m_availableScreenGeometry = m_corona->availableScreenRectWithCriteria(currentScrId, QString(), {}, {}, false);
|
||||
|
||||
QList<Latte::Types::Visibility> ignoreModes{Latte::Types::SideBar};
|
||||
|
||||
if (m_latteView->visibility() && m_latteView->visibility()->mode() == Latte::Types::SideBar) {
|
||||
ignoreModes.removeAll(Latte::Types::SideBar);
|
||||
}
|
||||
|
||||
m_availableScreenGeometry = m_corona->availableScreenRectWithCriteria(currentScrId, QString(), ignoreModes, {}, false);
|
||||
|
||||
emit availableScreenGeometryChanged();
|
||||
}
|
||||
|
@ -175,7 +175,6 @@ private:
|
||||
|
||||
//! Accept only ALWAYSVISIBLE visibility mode
|
||||
QList<Latte::Types::Visibility> m_ignoreModes{
|
||||
Latte::Types::None,
|
||||
Latte::Types::AutoHide,
|
||||
Latte::Types::DodgeActive,
|
||||
Latte::Types::DodgeMaximized,
|
||||
@ -183,8 +182,7 @@ private:
|
||||
Latte::Types::WindowsGoBelow,
|
||||
Latte::Types::WindowsCanCover,
|
||||
Latte::Types::WindowsAlwaysCover,
|
||||
Latte::Types::SideBar,
|
||||
Latte::Types::NormalWindow
|
||||
Latte::Types::SideBar
|
||||
};
|
||||
|
||||
QMap<WindowId, WindowInfoWrap> m_windows;
|
||||
|
Loading…
x
Reference in New Issue
Block a user