1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-09 05:18:18 +03:00

improve settings windows shown trigerring behavior

--when the user uses Meta+A to cycle between the Views
configuration windows then in such case when NO Config
window is shown the LAST ONE USED should be shown again.
IF a Config View is already shown then the NEXT should
be shown afterwards
This commit is contained in:
Michail Vourlakos 2019-07-10 17:10:31 +03:00
parent 804d3d4d73
commit eb0c52c52b
5 changed files with 25 additions and 3 deletions

View File

@ -292,6 +292,16 @@ void CentralLayout::addView(Plasma::Containment *containment, bool forceOnPrimar
}
}
bool CentralLayout::configViewIsShown() const
{
bool genericShown = GenericLayout::configViewIsShown();
if (m_sharedLayout) {
return (m_sharedLayout->configViewIsShown() || genericShown);
}
return genericShown;
}
const QStringList CentralLayout::appliedActivities()
{
if (!m_corona) {

View File

@ -67,8 +67,6 @@ public:
QStringList activities() const;
void setActivities(QStringList activities);
Latte::View *lastSettingsView();
SharedLayout *sharedLayout() const;
void setSharedLayout(SharedLayout *layout);
@ -76,6 +74,7 @@ public:
void addView(Plasma::Containment *containment, bool forceOnPrimary = false, int explicitScreen = -1, Layout::ViewsMap *occupied = nullptr);
void syncLatteViewsToScreens(Layout::ViewsMap *occupiedMap = nullptr) override;
void unloadContainments() override;
bool configViewIsShown() const override;
const QStringList appliedActivities() override;
Types::ViewType latteViewType(int containmentId) const override;
QList<Latte::View *> latteViews() override;

View File

@ -139,6 +139,17 @@ void GenericLayout::setBlockAutomaticLatteViewCreation(bool block)
m_blockAutomaticLatteViewCreation = block;
}
bool GenericLayout::configViewIsShown() const
{
for (const auto view : m_latteViews) {
if (view && view->settingsWindowIsShown()) {
return true;
}
}
return false;
}
bool GenericLayout::isActive() const
{
if (!m_corona) {

View File

@ -76,6 +76,8 @@ public:
bool isWritable() const;
bool layoutIsBroken() const;
virtual bool configViewIsShown() const;
virtual int viewsCount(int screen) const;
virtual int viewsCount(QScreen *screen) const;
virtual int viewsCount() const;

View File

@ -732,7 +732,7 @@ void GlobalShortcuts::showSettings()
}
if (openSettings >= 0 && sortedViews.count() > 1) {
openSettings = openSettings + 1;
openSettings = currentLayout->configViewIsShown() ? openSettings + 1 : openSettings;
if (openSettings >= sortedViews.size()) {
openSettings = 0;