From f2c18392a0b94f16ebe3c4088fee8a24303f332c Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Wed, 17 Jul 2019 07:42:26 +0200 Subject: [PATCH 01/55] GIT_SILENT made messages (after extraction) --- app/org.kde.latte-dock.appdata.xml.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/org.kde.latte-dock.appdata.xml.cmake b/app/org.kde.latte-dock.appdata.xml.cmake index 3dbad4edf..b4a738c9b 100644 --- a/app/org.kde.latte-dock.appdata.xml.cmake +++ b/app/org.kde.latte-dock.appdata.xml.cmake @@ -75,7 +75,7 @@

Latte è un'area di aggancio basata su plasma frameworks. Offre ai tuoi processi e ai tuoi plasmoidi un'esperienza elegante ed intuitiva, animando il loro contenuto con un effetto zoom parabolico e facendosi trovare solo quando necessario.

Latte는 Plasma 프레임워크 기반의 독으로 작업 및 plasmoids에 대한 우아하고 직관적인 경험을 제공합니다. 상직적인 확대/축소 효과를 사용하여 내용을 애니메이션화하고 필요할 때만 사용할 수 있습니다.

Latte is een dock gebaseerd op plasma frameworks die een elegante en intuïtieve ervaring voor uw taken en plasmoids is. Het animeert zijn inhoud door een parabolisch zoomeffect te gebruiken en probeert er alleen te zijn wanneer nodig.

-

Latte er ein dokk basert på Plasma-rammeverket og som gjev elegant og intuitiv tilgang til program/oppgåver og skjermelement. Innhaldet vert animerte med parabolske forstørringseffektar og programmet prøver å ikkje vera i vegen når det ikkje trengst.

+

Latte er ei dokk basert på Plasma-rammeverket og som gjev elegant og intuitiv tilgang til program/oppgåver og skjerm­element. Innhaldet vert animerte med parabolske forstørrings­effektar og programmet prøver å ikkje vera i vegen når det ikkje trengst.

Latte jest dokiem opartym na szkieletach plazmy, który zapewnia przyjemne i intuicyjne odczucia w pracy z zadaniami i plazmoidami. Animuje swoją zawartośc przy użyciu efektu przybliżenia parabolicznego i próbuje być widocznym tylko wtedy, gdy jest potrzebny.

O Latte é uma área acoplável baseada nas plataformas do Plasma que oferece uma experiência elegante e intuitiva para as suas tarefas e plasmóides. Ele anima o seu conteúdo, usando um efeito de ampliação parabólico e tenta estar apenas onde for necessário.

O Latte é uma área acoplável baseada nos frameworks do Plasma que oferece uma experiência elegante e intuitiva para as suas tarefas e plasmoides. Ele anima o seu conteúdo, usando um efeito de zoom parabólico e tenta estar apenas onde for necessário.

From 750f05dc3bd9a68ef9dd9bcb460861cae070df28 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Wed, 17 Jul 2019 09:41:41 +0300 Subject: [PATCH 02/55] beta release v0.8.97 (for upcoming v0.9) --first beta release to give to the public --- CMakeLists.txt | 2 +- containment/package/metadata.desktop | 2 +- plasmoid/package/metadata.desktop | 2 +- shell/package/metadata.desktop | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a99c85999..ae7ffaa1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ project(lattedock) cmake_minimum_required(VERSION 3.0 FATAL_ERROR) set(CMAKE_CXX_STANDARD 14) -set(VERSION 0.8.96) +set(VERSION 0.8.97) set(AUTHOR "Michail Vourlakos, Smith Ar") set(EMAIL "mvourlakos@gmail.com, audoban@openmailbox.org") set(WEBSITE "https://github.com/psifidotos/Latte-Dock") diff --git a/containment/package/metadata.desktop b/containment/package/metadata.desktop index a0f310ba8..21b9f1ae6 100644 --- a/containment/package/metadata.desktop +++ b/containment/package/metadata.desktop @@ -57,7 +57,7 @@ NoDisplay=true X-KDE-PluginInfo-Author=Michail Vourlakos, Smith Ar X-KDE-PluginInfo-Email=mvourlakos@gmail.com, audoban@openmailbox.org X-KDE-PluginInfo-Name=org.kde.latte.containment -X-KDE-PluginInfo-Version=0.8.96 +X-KDE-PluginInfo-Version=0.8.97 X-KDE-PluginInfo-Website=https://github.com/psifidotos/Latte-Dock X-KDE-PluginInfo-Category=X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-License=GPL diff --git a/plasmoid/package/metadata.desktop b/plasmoid/package/metadata.desktop index 0dc0d641d..a0165226a 100644 --- a/plasmoid/package/metadata.desktop +++ b/plasmoid/package/metadata.desktop @@ -45,7 +45,7 @@ X-Plasma-Provides=org.kde.plasma.multitasking X-KDE-PluginInfo-Author=Michail Vourlakos, Smith Ar X-KDE-PluginInfo-Email=mvourlakos@gmail.com, audoban@openmailbox.org X-KDE-PluginInfo-Name=org.kde.latte.plasmoid -X-KDE-PluginInfo-Version=0.8.96 +X-KDE-PluginInfo-Version=0.8.97 X-KDE-PluginInfo-Website=https://github.com/psifidotos/Latte-Dock X-KDE-PluginInfo-Category=Windows and Tasks X-KDE-PluginInfo-Depends=X-KDE-PluginInfo-License=GPL v2+ diff --git a/shell/package/metadata.desktop b/shell/package/metadata.desktop index 5cd2e1326..20a6fbf2e 100644 --- a/shell/package/metadata.desktop +++ b/shell/package/metadata.desktop @@ -83,5 +83,5 @@ X-KDE-PluginInfo-Author=Michail Vourlakos, Smith Ar X-KDE-PluginInfo-Email=mvourlakos@gmail.com, audoban@openmailbox.org X-KDE-PluginInfo-License=GPLv3+ X-KDE-PluginInfo-Name=org.kde.latte.shell -X-KDE-PluginInfo-Version=0.8.96 +X-KDE-PluginInfo-Version=0.8.97 X-KDE-PluginInfo-Website=https://github.com/psifidotos/Latte-Dock From 4c7e800ce7ff5db3cfbee5e4aa853df1204e1288 Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Thu, 18 Jul 2019 08:41:07 +0200 Subject: [PATCH 03/55] SVN_SILENT made messages (.desktop file) - always resolve ours In case of conflict in i18n, keep the version of the branch "ours" To resolve a particular conflict, "git checkout --ours path/to/file.desktop" --- app/latte-indicators.knsrc | 1 + app/lattedock.notifyrc | 6 ++++++ app/packageplugins/indicator/latte-indicator.desktop | 1 + .../indicator/latte-packagestructure-indicator.desktop | 1 + indicators/default/metadata.desktop | 1 + indicators/org.kde.latte.plasma/metadata.desktop | 1 + plasmoid/metadata.desktop.cmake | 2 ++ plasmoid/package/metadata.desktop | 2 ++ 8 files changed, 15 insertions(+) diff --git a/app/latte-indicators.knsrc b/app/latte-indicators.knsrc index fbb14c1f9..ae80e8053 100644 --- a/app/latte-indicators.knsrc +++ b/app/latte-indicators.knsrc @@ -9,6 +9,7 @@ Name[gl]=Indicadores de Latte Name[it]=Indicatori Latte Name[ko]=Latte 표시기 Name[nl]=Indicatoren van Latte +Name[nn]=Latte-markørar Name[pl]=Wskaźniki Latte Name[pt]=Indicadores do Latte Name[pt_BR]=Indicadores do Latte diff --git a/app/lattedock.notifyrc b/app/lattedock.notifyrc index 3ca8cb942..af17653f6 100644 --- a/app/lattedock.notifyrc +++ b/app/lattedock.notifyrc @@ -65,6 +65,7 @@ Name[gl]=Importouse correctamente Name[it]=Importata con successo Name[ko]=성공적으로 가져왔습니다 Name[nl]=Met succes geïmporteerd +Name[nn]=Import fullført Name[pl]=Pomyślnie zaimportowano Name[pt]=Importado com sucesso Name[pt_BR]=Importado com sucesso @@ -88,6 +89,7 @@ Name[gl]=Non se puido importar Name[it]=Impossibile importare Name[ko]=가져오지 못했습니다 Name[nl]=Importeren is mislukt +Name[nn]=Feil ved import Name[pl]=Nie udało się zaimportować Name[pt]=Não foi possível importar Name[pt_BR]=Ocorreu um erro ao importar @@ -111,6 +113,7 @@ Name[gl]=Exportouse correctamente Name[it]=Esportata correttamente Name[ko]=성공적으로 내보냈습니다 Name[nl]=Met succes geëxporteerd +Name[nn]=Eksport fullført Name[pl]=Pomyślnie wyeksportowano Name[pt]=Exportada com sucesso Name[pt_BR]=Exportado com sucesso @@ -134,6 +137,7 @@ Name[gl]=Non se puido exportar Name[it]=Impossibile esportare Name[ko]=내보내지 못했습니다 Name[nl]=Exporteren is mislukt +Name[nn]=Feil ved eksport Name[pl]=Nie udało się wyeksportować Name[pt]=Não foi possível exportar Name[pt_BR]=Ocorreu um erro ao exportar @@ -157,6 +161,7 @@ Name[gl]=Retirouse correctamente Name[it]=Rimossa con successo Name[ko]=성공적으로 삭제했습니다 Name[nl]=Met succes verwijderd +Name[nn]=Vart fjerna Name[pl]=Pomyślnie usunięto Name[pt]=Removido com sucesso Name[pt_BR]=Removido com sucesso @@ -180,6 +185,7 @@ Name[gl]=Non se puido retirar Name[it]=Impossibile rimuovere Name[ko]=삭제할 수 없음 Name[nl]=Verwijderen is mislukt +Name[nn]=Feil ved fjerning Name[pl]=Nie udało się usunąć Name[pt]=Não foi possível remover Name[pt_BR]=Ocorreu um erro ao remover diff --git a/app/packageplugins/indicator/latte-indicator.desktop b/app/packageplugins/indicator/latte-indicator.desktop index b92e4ea48..9680bc0bb 100644 --- a/app/packageplugins/indicator/latte-indicator.desktop +++ b/app/packageplugins/indicator/latte-indicator.desktop @@ -12,6 +12,7 @@ Comment[gl]=Indicador de Latte Comment[it]=Indicatore Latte Comment[ko]=Latte 표시기 Comment[nl]=Indicator van Latte +Comment[nn]=Latte-markør Comment[pl]=Wskaźnik Latte Comment[pt]=Indicador do Latte Comment[pt_BR]=Indicador do Latte diff --git a/app/packageplugins/indicator/latte-packagestructure-indicator.desktop b/app/packageplugins/indicator/latte-packagestructure-indicator.desktop index 0e4c6aa5d..0c418ea01 100644 --- a/app/packageplugins/indicator/latte-packagestructure-indicator.desktop +++ b/app/packageplugins/indicator/latte-packagestructure-indicator.desktop @@ -9,6 +9,7 @@ Name[gl]=Indicador Name[it]=Indicatore Name[ko]=표시기 Name[nl]=Indicator +Name[nn]=Markør Name[pl]=Wskaźnik Name[pt]=Indicador Name[pt_BR]=Indicador diff --git a/indicators/default/metadata.desktop b/indicators/default/metadata.desktop index 92eb8d47c..4994f171b 100644 --- a/indicators/default/metadata.desktop +++ b/indicators/default/metadata.desktop @@ -35,6 +35,7 @@ Comment[gl]=Indicador predeterminado de Latte Comment[it]=Indicatore predefinito di Latte Comment[ko]=Latte 기본 표시기 Comment[nl]=Standaard indicator van Latte +Comment[nn]=Standard Latte-markør Comment[pl]=Domyślny wskaźnik Latte Comment[pt]=Indicador predefinido do Latte Comment[pt_BR]=Indicador padrão do Latte diff --git a/indicators/org.kde.latte.plasma/metadata.desktop b/indicators/org.kde.latte.plasma/metadata.desktop index db425da93..347b80c49 100644 --- a/indicators/org.kde.latte.plasma/metadata.desktop +++ b/indicators/org.kde.latte.plasma/metadata.desktop @@ -32,6 +32,7 @@ Comment[gl]=Indicador de estilo Plasma de Latte Comment[it]=Indicatore stile di Plasma di Latte Comment[ko]=Latte Plasma 스타일 표시기 Comment[nl]=Plasma stijlindicator van Latte +Comment[nn]=Latte-markør i Plasma-stil Comment[pl]=Wskaźnik Latte dla Plazmy Comment[pt]=Indicador de estilo do Plasma no Latte Comment[pt_BR]=Indicador de estilo do Plasma no Latte diff --git a/plasmoid/metadata.desktop.cmake b/plasmoid/metadata.desktop.cmake index e6dd18f12..db00dfb8d 100644 --- a/plasmoid/metadata.desktop.cmake +++ b/plasmoid/metadata.desktop.cmake @@ -9,6 +9,7 @@ Name[gl]=Tarefas de Latte Name[it]=Processi di Latte Name[ko]=Latte 태스크 Name[nl]=Latte-taken +Name[nn]=Latte-oppgåver Name[pl]=Zadania Latte Name[pt]=Tarefas do Latte Name[pt_BR]=Tarefas do Latte @@ -27,6 +28,7 @@ Comment[gl]=Plasmoides de tarefas da doca Latte Comment[it]=Plasmoide dei processi da Latte Dock Comment[ko]=Latte 독의 태스크 Plasmoid Comment[nl]=Plasmoid voor taken uit Latte Dock +Comment[nn]=Oppgåve-skjermelement frå Latte-dokk Comment[pl]=Plazmoidy zadań dla doku Latte Comment[pt]=Plasmóide de tarefas da Área Acoplável do Latte Comment[pt_BR]=Plasmoide de tarefas do Latte Dock diff --git a/plasmoid/package/metadata.desktop b/plasmoid/package/metadata.desktop index a0165226a..a77740ea6 100644 --- a/plasmoid/package/metadata.desktop +++ b/plasmoid/package/metadata.desktop @@ -9,6 +9,7 @@ Name[gl]=Tarefas de Latte Name[it]=Processi di Latte Name[ko]=Latte 태스크 Name[nl]=Latte-taken +Name[nn]=Latte-oppgåver Name[pl]=Zadania Latte Name[pt]=Tarefas do Latte Name[pt_BR]=Tarefas do Latte @@ -27,6 +28,7 @@ Comment[gl]=Plasmoides de tarefas da doca Latte Comment[it]=Plasmoide dei processi da Latte Dock Comment[ko]=Latte 독의 태스크 Plasmoid Comment[nl]=Plasmoid voor taken uit Latte Dock +Comment[nn]=Oppgåve-skjermelement frå Latte-dokk Comment[pl]=Plazmoidy zadań dla doku Latte Comment[pt]=Plasmóide de tarefas da Área Acoplável do Latte Comment[pt_BR]=Plasmoide de tarefas do Latte Dock From b81684a1a9cf8afc46e8c3f8ce57720dd75f149e Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 22 Jul 2019 09:32:50 +0300 Subject: [PATCH 04/55] embrace X-KDE-Wayland-Interfaces --- app/org.kde.latte-dock.desktop.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/org.kde.latte-dock.desktop.cmake b/app/org.kde.latte-dock.desktop.cmake index 116209c0d..98bbcb867 100644 --- a/app/org.kde.latte-dock.desktop.cmake +++ b/app/org.kde.latte-dock.desktop.cmake @@ -78,7 +78,7 @@ GenericName[zh_CN]=停靠栏 GenericName[zh_TW]=Dock Icon=latte-dock Categories=Utility;X-SuSE-DesktopUtility; -Exec=latte-dock %u +Exec=@CMAKE_INSTALL_PREFIX@/bin/latte-dock InitialPreference=1 StartupNotify=false Terminal=false @@ -92,4 +92,5 @@ X-KDE-PluginInfo-Version=@VERSION@ X-KDE-PluginInfo-Website=@WEBSITE@ X-KDE-StartupNotify=false X-KDE-SubstituteUID=false +X-KDE-Wayland-Interfaces=org_kde_plasma_window_management From e7cb61a5e9089e20123acfbe2e1d4a51518f45f4 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 22 Jul 2019 09:49:04 +0300 Subject: [PATCH 05/55] fix Importer::standardPath behavior --- app/layouts/importer.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/app/layouts/importer.cpp b/app/layouts/importer.cpp index 372be5463..155a4212e 100644 --- a/app/layouts/importer.cpp +++ b/app/layouts/importer.cpp @@ -220,19 +220,10 @@ QString Importer::standardPath(QString subPath, bool localfirst) { QStringList paths = standardPaths(localfirst); - if (localfirst) { - for(const auto &pt : paths) { - QString ptF = pt + "/" +subPath; - if (QFileInfo(ptF).exists()) { - return ptF; - } - } - } else { - for (int i=paths.count()-1; i>=0; i--) { - QString ptF = paths[i] + "/" +subPath; - if (QFileInfo(ptF).exists()) { - return ptF; - } + for(const auto &pt : paths) { + QString ptF = pt + "/" +subPath; + if (QFileInfo(ptF).exists()) { + return ptF; } } From 964f2282f28950bf70bd4d5325beef2d3f0d526d Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 23 Jul 2019 00:05:01 +0300 Subject: [PATCH 06/55] consider main window also for dodge active --if the main window is not active but is touching the dock then the dock is not shown for dodge active state --fix the cleanup code in order to cleanup windows that have a ghost wid ( 0 ) --- app/wm/tracker/windowstracker.cpp | 61 +++++++++++++++++++++++++------ app/wm/tracker/windowstracker.h | 2 +- app/wm/waylandinterface.cpp | 4 +- app/wm/windowinfowrap.h | 37 +++++++++++++++++++ app/wm/xwindowinterface.cpp | 6 ++- 5 files changed, 96 insertions(+), 14 deletions(-) diff --git a/app/wm/tracker/windowstracker.cpp b/app/wm/tracker/windowstracker.cpp index 60266e30b..c9a4df2bd 100644 --- a/app/wm/tracker/windowstracker.cpp +++ b/app/wm/tracker/windowstracker.cpp @@ -674,7 +674,7 @@ void Windows::cleanupFaultyWindows() auto winfo = m_windows[key]; //! garbage windows removing - if (winfo.geometry() == QRect(0, 0, 0, 0)) { + if (winfo.wid()<=0 || winfo.geometry() == QRect(0, 0, 0, 0)) { //qDebug() << "Faulty Geometry ::: " << winfo.wid(); m_windows.remove(key); } @@ -734,6 +734,8 @@ void Windows::updateHints(Latte::View *view) bool foundTouchInCurScreen{false}; bool foundMaximizedInCurScreen{false}; + bool foundActiveGroupTouchInCurScreen{false}; + //! the notification window is not sending a remove signal and creates windows of geometry (0x0 0,0), //! maybe a garbage collector here is a good idea!!! bool existsFaultyWindow{false}; @@ -743,7 +745,12 @@ void Windows::updateHints(Latte::View *view) WindowId touchWinId; WindowId activeTouchWinId; + //! First Pass for (const auto &winfo : m_windows) { + if (!existsFaultyWindow && (winfo.wid()<=0 || winfo.geometry() == QRect(0, 0, 0, 0))) { + existsFaultyWindow = true; + } + if (winfo.isPlasmaDesktop() || !inCurrentDesktopActivity(winfo)) { continue; } @@ -780,10 +787,6 @@ void Windows::updateHints(Latte::View *view) } } - if (!existsFaultyWindow && winfo.geometry() == QRect(0, 0, 0, 0)) { - existsFaultyWindow = true; - } - //qDebug() << "window geometry ::: " << winfo.geometry(); } @@ -791,6 +794,39 @@ void Windows::updateHints(Latte::View *view) cleanupFaultyWindows(); } + //! PASS 2 + if (foundActiveInCurScreen && !foundActiveTouchInCurScreen) { + qDebug() << "Windows Array..."; + for (const auto &winfo : m_windows) { + qDebug() << " - " << winfo.wid() << " - " << winfo.display() << " parent : " << winfo.parentId(); + } + qDebug() << " - - - - - "; + + //! Second Pass to track also Child windows if needed + WindowInfoWrap activeInfo = m_windows[activeWinId]; + WindowId mainWindowId = activeInfo.isChildWindow() ? activeInfo.parentId() : activeWinId; + + for (const auto &winfo : m_windows) { + if (winfo.isPlasmaDesktop() || !inCurrentDesktopActivity(winfo)) { + continue; + } + + bool inActiveGroup = (winfo.wid() == mainWindowId || winfo.parentId() == mainWindowId); + + //! consider only windows that belong to active window group meaning the main window + //! and its children + if (!inActiveGroup) { + continue; + } + + if (isTouchingViewEdge(view, winfo) || isTouchingView(view, winfo)) { + foundActiveGroupTouchInCurScreen = true; + break; + } + } + } + + //! HACK: KWin Effects such as ShowDesktop have no way to be identified and as such //! create issues with identifying properly touching and maximized windows. BUT when //! they are enabled then NO ACTIVE window is found. This is a way to identify these @@ -803,10 +839,10 @@ void Windows::updateHints(Latte::View *view) //! assign flags setExistsWindowActive(view, foundActiveInCurScreen); - setActiveWindowTouching(view, foundActiveTouchInCurScreen); + setActiveWindowTouching(view, foundActiveTouchInCurScreen || foundActiveGroupTouchInCurScreen); setActiveWindowMaximized(view, (maxWinId.toInt()>0 && (maxWinId == activeTouchWinId))); setExistsWindowMaximized(view, foundMaximizedInCurScreen); - setExistsWindowTouching(view, (foundTouchInCurScreen || foundActiveTouchInCurScreen)); + setExistsWindowTouching(view, (foundTouchInCurScreen || foundActiveTouchInCurScreen || foundActiveGroupTouchInCurScreen)); //! update color schemes for active and touching windows setActiveWindowScheme(view, (foundActiveInCurScreen ? m_wm->schemesTracker()->schemeForWindow(activeWinId) : nullptr)); @@ -827,10 +863,12 @@ void Windows::updateHints(Latte::View *view) } //! Debug + //qDebug() << " -- TRACKING REPORT --"; //qDebug() << "TRACKING | SCREEN: " << view->positioner()->currentScreenId() << " , EDGE:" << view->location() << " , ENABLED:" << enabled(view); //qDebug() << "TRACKING | activeWindowTouching: " << foundActiveTouchInCurScreen << " ,activeWindowMaximized: " << activeWindowMaximized(view); //qDebug() << "TRACKING | existsWindowActive: " << foundActiveInCurScreen << " , existsWindowMaximized:" << existsWindowMaximized(view) // << " , existsWindowTouching:"<positioner()->currentScreenId() << " , EDGE:" << view->location() << " , ENABLED:" << enabled(view); //qDebug() << "TRACKING | activeWindowTouching: " << foundActiveTouchInCurScreen << " ,activeWindowMaximized: " << activeWindowMaximized(view); //qDebug() << "TRACKING | existsWindowActive: " << foundActiveInCurScreen << " , existsWindowMaximized:" << existsWindowMaximized(view) diff --git a/app/wm/tracker/windowstracker.h b/app/wm/tracker/windowstracker.h index 4f560d65a..c95e068a4 100644 --- a/app/wm/tracker/windowstracker.h +++ b/app/wm/tracker/windowstracker.h @@ -163,7 +163,7 @@ private: QHash m_views; QHash m_layouts; - QMap m_windows; + QMap m_windows; }; } diff --git a/app/wm/waylandinterface.cpp b/app/wm/waylandinterface.cpp index ea77b5c40..8606613b8 100644 --- a/app/wm/waylandinterface.cpp +++ b/app/wm/waylandinterface.cpp @@ -418,7 +418,7 @@ WindowInfoWrap WaylandInterface::requestInfoActive() const if (!w) return {}; - return requestInfo(w->internalId()); + return requestInfo(w->internalId()); } WindowInfoWrap WaylandInterface::requestInfo(WindowId wid) const @@ -435,6 +435,7 @@ WindowInfoWrap WaylandInterface::requestInfo(WindowId wid) const } else if (isValidWindow(w)) { winfoWrap.setIsValid(true); winfoWrap.setWid(wid); + winfoWrap.setParentId(w->parentWindow() ? w->parentWindow()->internalId() : 0); winfoWrap.setIsActive(w->isActive()); winfoWrap.setIsMinimized(w->isMinimized()); winfoWrap.setIsMaxVert(w->isMaximized()); @@ -657,6 +658,7 @@ void WaylandInterface::windowCreatedProxy(KWayland::Client::PlasmaWindow *w) connect(w, SIGNAL(skipTaskbarChanged()), mapper, SLOT(map()) ); connect(w, SIGNAL(onAllDesktopsChanged()), mapper, SLOT(map()) ); connect(w, SIGNAL(virtualDesktopChanged()), mapper, SLOT(map()) ); + connect(w, SIGNAL(parentWindowChanged()), mapper, SLOT(map()) ); #if KF5_VERSION_MINOR >= 52 connect(w, &KWayland::Client::PlasmaWindow::plasmaVirtualDesktopEntered, this, diff --git a/app/wm/windowinfowrap.h b/app/wm/windowinfowrap.h index f836f1d80..134d4cbcd 100644 --- a/app/wm/windowinfowrap.h +++ b/app/wm/windowinfowrap.h @@ -53,6 +53,7 @@ public: WindowInfoWrap(const WindowInfoWrap &o) noexcept : m_wid(o.m_wid) + , m_parentId(o.m_parentId) , m_geometry(o.m_geometry) , m_isValid(o.m_isValid) , m_isActive(o.m_isActive) @@ -73,6 +74,7 @@ public: WindowInfoWrap(WindowInfoWrap &&o) noexcept : m_wid(o.m_wid) + , m_parentId(o.m_parentId) , m_geometry(o.m_geometry) , m_isValid(o.m_isValid) , m_isActive(o.m_isActive) @@ -135,6 +137,9 @@ public: inline bool isOnAllActivities() const noexcept; inline void setIsOnAllActivities(bool allactivities) noexcept; + inline bool isMainWindow() const noexcept; + inline bool isChildWindow() const noexcept; + inline QRect geometry() const noexcept; inline void setGeometry(const QRect &geometry) noexcept; @@ -150,6 +155,9 @@ public: inline WindowId wid() const noexcept; inline void setWid(const WindowId &wid) noexcept; + inline WindowId parentId() const noexcept; + inline void setParentId(const WindowId &parentId) noexcept; + inline QStringList desktops() const noexcept; inline void setDesktops(const QStringList &desktops) noexcept; @@ -161,6 +169,8 @@ public: private: WindowId m_wid{0}; + WindowId m_parentId{0}; + QRect m_geometry; bool m_isValid : 1; @@ -189,6 +199,7 @@ private: inline WindowInfoWrap &WindowInfoWrap::operator=(WindowInfoWrap &&rhs) noexcept { m_wid = rhs.m_wid; + m_parentId = rhs.m_parentId; m_geometry = rhs.m_geometry; m_isValid = rhs.m_isValid; m_isActive = rhs.m_isActive; @@ -211,6 +222,7 @@ inline WindowInfoWrap &WindowInfoWrap::operator=(WindowInfoWrap &&rhs) noexcept inline WindowInfoWrap &WindowInfoWrap::operator=(const WindowInfoWrap &rhs) noexcept { m_wid = rhs.m_wid; + m_parentId = rhs.m_parentId; m_geometry = std::move(rhs.m_geometry); m_isValid = rhs.m_isValid; m_isActive = rhs.m_isActive; @@ -370,6 +382,17 @@ inline void WindowInfoWrap::setIsOnAllActivities(bool allactivities) noexcept m_isOnAllActivities = allactivities; } +inline bool WindowInfoWrap::isMainWindow() const noexcept +{ + return (m_parentId.toInt() <= 0); +} + +inline bool WindowInfoWrap::isChildWindow() const noexcept +{ + return (m_parentId.toInt() > 0); +} + + inline QString WindowInfoWrap::appName() const noexcept { return m_appName; @@ -420,6 +443,20 @@ inline void WindowInfoWrap::setWid(const WindowId &wid) noexcept m_wid = wid; } +inline WindowId WindowInfoWrap::parentId() const noexcept +{ + return m_parentId; +} + +inline void WindowInfoWrap::setParentId(const WindowId &parentId) noexcept +{ + if (m_wid == parentId) { + return; + } + + m_parentId = parentId; +} + inline QStringList WindowInfoWrap::desktops() const noexcept { return m_desktops; diff --git a/app/wm/xwindowinterface.cpp b/app/wm/xwindowinterface.cpp index cf2d8de99..8c942737e 100644 --- a/app/wm/xwindowinterface.cpp +++ b/app/wm/xwindowinterface.cpp @@ -308,7 +308,8 @@ WindowInfoWrap XWindowInterface::requestInfo(WindowId wid) const | NET::WMName | NET::WMVisibleName, NET::WM2WindowClass - | NET::WM2Activities}; + | NET::WM2Activities + | NET::WM2TransientFor}; //! update desktop id @@ -323,6 +324,7 @@ WindowInfoWrap XWindowInterface::requestInfo(WindowId wid) const if (isValidWindow(winfo) && !isPlasmaDesktop) { winfoWrap.setIsValid(true); winfoWrap.setWid(wid); + winfoWrap.setParentId(winfo.transientFor()); winfoWrap.setIsActive(KWindowSystem::activeWindow() == wid.value()); winfoWrap.setIsMinimized(winfo.hasState(NET::Hidden)); winfoWrap.setIsMaxVert(winfo.hasState(NET::MaxVert)); @@ -342,6 +344,7 @@ WindowInfoWrap XWindowInterface::requestInfo(WindowId wid) const winfoWrap.setIsValid(true); winfoWrap.setIsPlasmaDesktop(true); winfoWrap.setWid(wid); + winfoWrap.setParentId(0); winfoWrap.setHasSkipTaskbar(true); } @@ -653,6 +656,7 @@ void XWindowInterface::windowChangedProxy(WId wid, NET::Properties prop1, NET::P && !(prop1 & NET::ActiveWindow) && !(prop1 & NET::WMDesktop) && !(prop1 & (NET::WMName | NET::WMVisibleName) + && !(prop2 & NET::WM2TransientFor) && !(prop2 & NET::WM2Activities)) ) { return; } From 71e291ccececb76787616e408d16b804cf95a6c4 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 23 Jul 2019 11:01:30 +0300 Subject: [PATCH 07/55] comment debug messages --- app/wm/tracker/windowstracker.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/wm/tracker/windowstracker.cpp b/app/wm/tracker/windowstracker.cpp index c9a4df2bd..0a744cf5c 100644 --- a/app/wm/tracker/windowstracker.cpp +++ b/app/wm/tracker/windowstracker.cpp @@ -796,13 +796,14 @@ void Windows::updateHints(Latte::View *view) //! PASS 2 if (foundActiveInCurScreen && !foundActiveTouchInCurScreen) { - qDebug() << "Windows Array..."; + //! Second Pass to track also Child windows if needed + /*qDebug() << "Windows Array..."; for (const auto &winfo : m_windows) { qDebug() << " - " << winfo.wid() << " - " << winfo.display() << " parent : " << winfo.parentId(); } qDebug() << " - - - - - "; + */ - //! Second Pass to track also Child windows if needed WindowInfoWrap activeInfo = m_windows[activeWinId]; WindowId mainWindowId = activeInfo.isChildWindow() ? activeInfo.parentId() : activeWinId; From e41ed77ce6d6747a6a3a732b5678dfa986ec156a Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 23 Jul 2019 11:19:48 +0300 Subject: [PATCH 08/55] add report error message for unknown screens --- app/layout/genericlayout.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/app/layout/genericlayout.cpp b/app/layout/genericlayout.cpp index 88e6ef244..495709a60 100644 --- a/app/layout/genericlayout.cpp +++ b/app/layout/genericlayout.cpp @@ -1431,6 +1431,8 @@ QString GenericLayout::reportHtml(const ScreenPool *screenPool) //! sort views data viewsData = sortedViewsData(viewsData); + QStringList unknownScreens; + //! print viewData results for (int i=0; i"; } if (!viewsData[i].onPrimary) { - screenStr = screenPool->connector(viewsData[i].screenId); + if (!screenPool->hasId(viewsData[i].screenId)) { + screenStr = "[" + QString::number(viewsData[i].screenId) + "]"; + + unknownScreens << QString("[" + QString::number(viewsData[i].screenId) + "]"); + } else { + screenStr = screenPool->connector(viewsData[i].screenId); + } } if(viewsData[i].active) { screenStr = "" + screenStr + ""; @@ -1489,15 +1497,22 @@ QString GenericLayout::reportHtml(const ScreenPool *screenPool) QStringList errorsList; bool broken = m_storage->layoutIsBroken(errorsList); - if (!broken) { + if (!broken && unknownScreens.count() == 0) { report += "" + i18n("No errors were identified for this layout...") + "
"; } else { report += "" + i18n("Errors:") + "
"; + } + + if (broken){ for(int i=0; i
"; } } + if (unknownScreens.count() > 0) { + report += "" + i18n("Unknown screens: ") + unknownScreens.join(", ") + "
"; + } + return report; } From fcee8d98cc448fc911a84986fbfc8b17e62145c4 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 23 Jul 2019 12:05:21 +0300 Subject: [PATCH 09/55] x11 fixes for invalid windows --when a window is stacked back to its parent window for example the firefox case (dragging a tab to create a new firefox window and redrag it afterwards to the main window) the wm::windows array had inconsistent window records. --This is fixed and also any X11 transient changed signals are not blocked for windowChanged signals --- app/wm/tracker/windowstracker.cpp | 12 ++++++------ app/wm/waylandinterface.cpp | 2 +- app/wm/xwindowinterface.cpp | 6 ++++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/wm/tracker/windowstracker.cpp b/app/wm/tracker/windowstracker.cpp index 0a744cf5c..1955488a3 100644 --- a/app/wm/tracker/windowstracker.cpp +++ b/app/wm/tracker/windowstracker.cpp @@ -797,12 +797,12 @@ void Windows::updateHints(Latte::View *view) //! PASS 2 if (foundActiveInCurScreen && !foundActiveTouchInCurScreen) { //! Second Pass to track also Child windows if needed - /*qDebug() << "Windows Array..."; - for (const auto &winfo : m_windows) { - qDebug() << " - " << winfo.wid() << " - " << winfo.display() << " parent : " << winfo.parentId(); - } - qDebug() << " - - - - - "; - */ + + //qDebug() << "Windows Array..."; + //for (const auto &winfo : m_windows) { + // qDebug() << " - " << winfo.wid() << " - " << winfo.isValid() << " - " << winfo.display() << " - " << winfo.geometry() << " parent : " << winfo.parentId(); + //} + //qDebug() << " - - - - - "; WindowInfoWrap activeInfo = m_windows[activeWinId]; WindowId mainWindowId = activeInfo.isChildWindow() ? activeInfo.parentId() : activeWinId; diff --git a/app/wm/waylandinterface.cpp b/app/wm/waylandinterface.cpp index 8606613b8..7a547a7bf 100644 --- a/app/wm/waylandinterface.cpp +++ b/app/wm/waylandinterface.cpp @@ -453,7 +453,7 @@ WindowInfoWrap WaylandInterface::requestInfo(WindowId wid) const winfoWrap.setActivities(QStringList()); } } else { - return {}; + winfoWrap.setIsValid(false); } return winfoWrap; diff --git a/app/wm/xwindowinterface.cpp b/app/wm/xwindowinterface.cpp index 8c942737e..114e73a4d 100644 --- a/app/wm/xwindowinterface.cpp +++ b/app/wm/xwindowinterface.cpp @@ -321,7 +321,9 @@ WindowInfoWrap XWindowInterface::requestInfo(WindowId wid) const WindowInfoWrap winfoWrap; - if (isValidWindow(winfo) && !isPlasmaDesktop) { + if (!winfo.valid()) { + winfoWrap.setIsValid(false); + } else if (isValidWindow(winfo) && !isPlasmaDesktop) { winfoWrap.setIsValid(true); winfoWrap.setWid(wid); winfoWrap.setParentId(winfo.transientFor()); @@ -645,7 +647,7 @@ void XWindowInterface::windowChangedProxy(WId wid, NET::Properties prop1, NET::P //! ignore when the user presses a key, or a window is sending X events etc. //! without needing to (e.g. Firefox, https://bugzilla.mozilla.org/show_bug.cgi?id=1389953) //! NET::WM2UserTime, NET::WM2IconPixmap etc.... - if (prop1 == 0 && !(prop2 & NET::WM2Activities)) { + if (prop1 == 0 && !(prop2 & (NET::WM2Activities | NET::WM2TransientFor))) { return; } From 53b4257edc88be4eaa6ef277e285ada55e73af20 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 28 Jul 2019 12:04:37 +0300 Subject: [PATCH 10/55] update information to v0.9.0 --- CHANGELOG.md | 18 ++++++++++++++++++ README.md | 7 ++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11c84d9e3..72e31ae8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ #**CHANGELOG**# +#### Version 0.9.0 + +* Smart Coloring + --maximum contrast with desktop background when needed + --use active or touching window color scheme to paint dock/panel contents + --use reverse colors from plasma theme, meaning dark plasma themes can provide also whitish docks/panels +* Self-packaged Indicators that can be installed from kde store +* Live Editing Mode to inspect your settings changes immediately +* Flexible window layout for settings +* Shared Layouts under Multiple Layouts Environments +* Improve badges experience and layout +* Enhanced Active Window experience, drag/maximize/restore active window from empty areas +* Track "LastActiveWindow" at per screen/activity and inform applets +* Support scrolling for Latte Tasks plasmoid +* Independent multi-screen dynamic background and identify "busy" backgrounds +* Outline option for background +* plenty more fixes and improvements all over the place + #### Version 0.8.9 * fix: show notifications applet when in Latte (for plasma >= 5.16) diff --git a/README.md b/README.md index 938307041..9d686467d 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,13 @@ Installation ## Requirements -We recommend that you use at least **Plasma 5.12.0** +We recommend to use at least: + **Plasma >= 5.15.0** + **Qt >= 5.12** + +Minimum requirements: + **tools:** ``` bash From 6bc9949f9c224b4846491991f37038925d736d91 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 28 Jul 2019 18:01:51 +0300 Subject: [PATCH 11/55] update to version v0.9.0 --new major stable branch for v0.9.x --- CMakeLists.txt | 2 +- containment/package/metadata.desktop | 2 +- plasmoid/package/metadata.desktop | 2 +- shell/package/metadata.desktop | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ae7ffaa1b..9732b295e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ project(lattedock) cmake_minimum_required(VERSION 3.0 FATAL_ERROR) set(CMAKE_CXX_STANDARD 14) -set(VERSION 0.8.97) +set(VERSION 0.9.0) set(AUTHOR "Michail Vourlakos, Smith Ar") set(EMAIL "mvourlakos@gmail.com, audoban@openmailbox.org") set(WEBSITE "https://github.com/psifidotos/Latte-Dock") diff --git a/containment/package/metadata.desktop b/containment/package/metadata.desktop index 21b9f1ae6..87975f822 100644 --- a/containment/package/metadata.desktop +++ b/containment/package/metadata.desktop @@ -57,7 +57,7 @@ NoDisplay=true X-KDE-PluginInfo-Author=Michail Vourlakos, Smith Ar X-KDE-PluginInfo-Email=mvourlakos@gmail.com, audoban@openmailbox.org X-KDE-PluginInfo-Name=org.kde.latte.containment -X-KDE-PluginInfo-Version=0.8.97 +X-KDE-PluginInfo-Version=0.9.0 X-KDE-PluginInfo-Website=https://github.com/psifidotos/Latte-Dock X-KDE-PluginInfo-Category=X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-License=GPL diff --git a/plasmoid/package/metadata.desktop b/plasmoid/package/metadata.desktop index a77740ea6..941904324 100644 --- a/plasmoid/package/metadata.desktop +++ b/plasmoid/package/metadata.desktop @@ -47,7 +47,7 @@ X-Plasma-Provides=org.kde.plasma.multitasking X-KDE-PluginInfo-Author=Michail Vourlakos, Smith Ar X-KDE-PluginInfo-Email=mvourlakos@gmail.com, audoban@openmailbox.org X-KDE-PluginInfo-Name=org.kde.latte.plasmoid -X-KDE-PluginInfo-Version=0.8.97 +X-KDE-PluginInfo-Version=0.9.0 X-KDE-PluginInfo-Website=https://github.com/psifidotos/Latte-Dock X-KDE-PluginInfo-Category=Windows and Tasks X-KDE-PluginInfo-Depends=X-KDE-PluginInfo-License=GPL v2+ diff --git a/shell/package/metadata.desktop b/shell/package/metadata.desktop index 20a6fbf2e..873b38c49 100644 --- a/shell/package/metadata.desktop +++ b/shell/package/metadata.desktop @@ -83,5 +83,5 @@ X-KDE-PluginInfo-Author=Michail Vourlakos, Smith Ar X-KDE-PluginInfo-Email=mvourlakos@gmail.com, audoban@openmailbox.org X-KDE-PluginInfo-License=GPLv3+ X-KDE-PluginInfo-Name=org.kde.latte.shell -X-KDE-PluginInfo-Version=0.8.97 +X-KDE-PluginInfo-Version=0.9.0 X-KDE-PluginInfo-Website=https://github.com/psifidotos/Latte-Dock From 4ebf3e23297e1c629e7076104699f3de3a1c158c Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 28 Jul 2019 23:26:48 +0300 Subject: [PATCH 12/55] update progress badge properly --send repaint signals properly for BadgeText BUG:410318 FIXED-IN:0.9.1 --- declarativeimports/components/BadgeText.qml | 13 +++++++++---- .../package/contents/ui/task/ProgressOverlay.qml | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/declarativeimports/components/BadgeText.qml b/declarativeimports/components/BadgeText.qml index 5ad2fee11..2a06b5bc1 100644 --- a/declarativeimports/components/BadgeText.qml +++ b/declarativeimports/components/BadgeText.qml @@ -64,8 +64,13 @@ Rectangle { readonly property bool singleCharacter: (showNumber && numberValue<=9 && numberValue>=0)|| (showText && textValue.length===1) onProportionChanged: { - // console.log(previousProportion + " - "+proportion); - if ((proportion - 0.03 >= previousProportion) || (proportion===1)) { + if (proportion<0.03) { + previousProportion = 0; + } + + //console.log(previousProportion + " - "+proportion); + var currentStep = (proportion - previousProportion); + if ((currentStep >= 0.01) || (proportion>=1 && previousProportion !==1)) { // console.log("request repaint..."); previousProportion = proportion; repaint(); @@ -120,7 +125,7 @@ Rectangle { anchors.fill: canvas color: canvas.drawColor - visible: proportion === 100 && showNumber + visible: proportion === 1 && showNumber radius: parent.radius } @@ -178,7 +183,7 @@ Rectangle { return parent.borderColor } - return proportion === 100 ? parent.highlightedColor : parent.color + return proportion === 1 ? parent.highlightedColor : parent.color } color: "transparent" radius: parent.radius diff --git a/plasmoid/package/contents/ui/task/ProgressOverlay.qml b/plasmoid/package/contents/ui/task/ProgressOverlay.qml index db2961673..a4e9b1991 100644 --- a/plasmoid/package/contents/ui/task/ProgressOverlay.qml +++ b/plasmoid/package/contents/ui/task/ProgressOverlay.qml @@ -109,7 +109,7 @@ Item { } if (taskItem.badgeIndicator > 0 || (taskIcon.smartLauncherItem && taskIcon.smartLauncherItem.countVisible)) { - return 100; + return 1; } return 0; From 7521d8beb89c32aaf3ff2cd2d3ab6aaedb54e723 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 29 Jul 2019 15:58:44 +0300 Subject: [PATCH 13/55] forward pressed/released to underneath applets --there were cases that these signals were not sent to underneath applets BUG:410350 FIXED-IN:0.9.1 --- containment/package/contents/ui/applet/AppletItem.qml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/containment/package/contents/ui/applet/AppletItem.qml b/containment/package/contents/ui/applet/AppletItem.qml index b064fd698..834fae9b4 100644 --- a/containment/package/contents/ui/applet/AppletItem.qml +++ b/containment/package/contents/ui/applet/AppletItem.qml @@ -871,6 +871,12 @@ Item { mouse.accepted = false; } + //! these are needed in order for these events to be really forwarded underneath + //! otherwise there were applets that did not receive them e.g. lock/logout applet + //! when parabolic effect was used + onPressed: mouse.accepted = false; + onReleased: mouse.accepted = false; + onWheel: { if (isSeparator || !root.mouseWheelActions || blockWheel || (root.latteViewIsHidden || root.inSlidingIn || root.inSlidingOut)){ From 60e97ec0bea1bea7ef0db27f2dae2dadf02a8629 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 29 Jul 2019 21:54:25 +0300 Subject: [PATCH 14/55] fix blurred icons --revert back the PIXELIZATION workaround because it creates BLURRED icons even for sizes>=64px! BUG:410365 FIXED-IN:0.9.1 --- .../package/contents/ui/task/IconItem.qml | 30 +++++++------------ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/plasmoid/package/contents/ui/task/IconItem.qml b/plasmoid/package/contents/ui/task/IconItem.qml index 5fd957354..e21076988 100644 --- a/plasmoid/package/contents/ui/task/IconItem.qml +++ b/plasmoid/package/contents/ui/task/IconItem.qml @@ -153,14 +153,8 @@ Item{ anchors.centerIn: parent - //! HACK TO AVOID PIXELIZATION - //! WORKAROUND: When the parabolic effect is disabled zoom=1.0 and no - //! Shadows are enabled for Items then many task icons look pixelated. - //! I dont know how multiplying the width *1.0002 helps the situation - //! but it does. After adding any multipier e.g. *1.0002 the pixelated - //! icons are gone - width: Math.round(newTempSize) * 1.0002 - height: Math.round(width) * 1.0002 + width: Math.round(newTempSize) + height: Math.round(width) source: decoration smooth: root.zoomFactor === 1 ? true : false providesColors: indicators ? indicators.info.needsIconColors : false @@ -513,9 +507,8 @@ Item{ //! moved out of badgeVisualsLoader in order to avoid crashes //! when the latte view is removed Loader { - //! HACK TO AVOID PIXELIZATION - width: iconImageBuffer.width * 1.0002 - height: iconImageBuffer.height * 1.0002 + width: iconImageBuffer.width + height: iconImageBuffer.height anchors.centerIn: iconImageBuffer active: badgeVisualsLoader.active @@ -533,9 +526,8 @@ Item{ //! Effects Colorize{ id: stateColorizer - //! HACK TO AVOID PIXELIZATION - width: iconImageBuffer.width * 1.0002 - height: iconImageBuffer.height * 1.0002 + width: iconImageBuffer.width + height: iconImageBuffer.height anchors.centerIn: iconImageBuffer source: badgesLoader.active ? badgesLoader : iconImageBuffer @@ -550,9 +542,8 @@ Item{ BrightnessContrast{ id:hoveredImage - //! HACK TO AVOID PIXELIZATION - width: iconImageBuffer.width * 1.0002 - height: iconImageBuffer.height * 1.0002 + width: iconImageBuffer.width + height: iconImageBuffer.height anchors.centerIn: iconImageBuffer source: badgesLoader.active ? badgesLoader : iconImageBuffer @@ -569,9 +560,8 @@ Item{ BrightnessContrast { id: brightnessTaskEffect - //! HACK TO AVOID PIXELIZATION - width: iconImageBuffer.width * 1.0002 - height: iconImageBuffer.height * 1.0002 + width: iconImageBuffer.width + height: iconImageBuffer.height anchors.centerIn: iconImageBuffer source: badgesLoader.active ? badgesLoader : iconImageBuffer From 6121799346d698e179edbae3260c47ca1c8419f7 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 29 Jul 2019 23:45:14 +0300 Subject: [PATCH 15/55] avoid Tasks Pixelization --enable cached:true for Tasks effects in order to try to avoid pixelization in some cases when effects are enabled --- .../package/contents/ui/task/IconItem.qml | 30 +++++++++++++++++-- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/plasmoid/package/contents/ui/task/IconItem.qml b/plasmoid/package/contents/ui/task/IconItem.qml index e21076988..3c9383e41 100644 --- a/plasmoid/package/contents/ui/task/IconItem.qml +++ b/plasmoid/package/contents/ui/task/IconItem.qml @@ -515,6 +515,12 @@ Item{ sourceComponent: Colorize{ source: badgeVisualsLoader.item + //! HACK TO AVOID PIXELIZATION + //! WORKAROUND: When Effects are enabled e.g. BrightnessContrast, Colorize etc. + //! the icon appears pixelated. It is even most notable when zoomFactor === 1 + //! I dont know enabling cached=true helps, but it does. + cached: true + opacity: stateColorizer.opacity hue: stateColorizer.hue saturation: stateColorizer.saturation @@ -526,9 +532,15 @@ Item{ //! Effects Colorize{ id: stateColorizer + anchors.centerIn: iconImageBuffer width: iconImageBuffer.width height: iconImageBuffer.height - anchors.centerIn: iconImageBuffer + + //! HACK TO AVOID PIXELIZATION + //! WORKAROUND: When Effects are enabled e.g. BrightnessContrast, Colorize etc. + //! the icon appears pixelated. It is even most notable when zoomFactor === 1 + //! I dont know enabling cached=true helps, but it does. + cached: true source: badgesLoader.active ? badgesLoader : iconImageBuffer visible: !isSeparator @@ -542,9 +554,15 @@ Item{ BrightnessContrast{ id:hoveredImage + anchors.centerIn: iconImageBuffer width: iconImageBuffer.width height: iconImageBuffer.height - anchors.centerIn: iconImageBuffer + + //! HACK TO AVOID PIXELIZATION + //! WORKAROUND: When Effects are enabled e.g. BrightnessContrast, Colorize etc. + //! the icon appears pixelated. It is even most notable when zoomFactor === 1 + //! I dont know enabling cached=true helps, but it does. + cached: true source: badgesLoader.active ? badgesLoader : iconImageBuffer visible: !isSeparator @@ -560,9 +578,15 @@ Item{ BrightnessContrast { id: brightnessTaskEffect + anchors.centerIn: iconImageBuffer width: iconImageBuffer.width height: iconImageBuffer.height - anchors.centerIn: iconImageBuffer + + //! HACK TO AVOID PIXELIZATION + //! WORKAROUND: When Effects are enabled e.g. BrightnessContrast, Colorize etc. + //! the icon appears pixelated. It is even most notable when zoomFactor === 1 + //! I dont know enabling cached=true helps, but it does. + cached: true source: badgesLoader.active ? badgesLoader : iconImageBuffer From cdf230944eb6dc00f3f446d229acce3a498bf309 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 29 Jul 2019 23:51:55 +0300 Subject: [PATCH 16/55] fix configview.h reference BUG:410371 FIXED-IN:0.9.1 --- app/view/settings/primaryconfigview.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/view/settings/primaryconfigview.h b/app/view/settings/primaryconfigview.h index 0f0c8be26..bca345c63 100644 --- a/app/view/settings/primaryconfigview.h +++ b/app/view/settings/primaryconfigview.h @@ -22,7 +22,7 @@ #define PRIMARYCONFIGVIEW_H // local -#include "../../plasmaquick/configview.h" +#include "../../plasma/quick/configview.h" #include "../../wm/windowinfowrap.h" #include "../../../liblatte2/types.h" From 4501cb6eec3e807d23da134d20ad5187f58f0400 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 30 Jul 2019 16:29:42 +0300 Subject: [PATCH 17/55] fix "Disabled KWin edges" for !compositing BUG:410370 --- .../package/contents/ui/VisibilityManager.qml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/containment/package/contents/ui/VisibilityManager.qml b/containment/package/contents/ui/VisibilityManager.qml index 562380473..72dc3b3af 100644 --- a/containment/package/contents/ui/VisibilityManager.qml +++ b/containment/package/contents/ui/VisibilityManager.qml @@ -507,32 +507,34 @@ Item{ if (root.isVertical) { maskThickness = maskArea.width; } - } else if (!noCompositingEdit){ + } else if (!noCompositingEdit){ //! no compositing case - if (!latteView.visibility.isHidden || !latteView.visibility.supportsKWinEdges) { + var overridesHidden = latteView.visibility.isHidden && !latteView.visibility.supportsKWinEdges; + + if (!overridesHidden) { localX = latteView.effects.rect.x; localY = latteView.effects.rect.y; } else { if (plasmoid.location === PlasmaCore.Types.BottomEdge) { localX = latteView.effects.rect.x; - localY = latteView.effects.rect.y+latteView.effects.rect.height+thicknessAutoHidden; + localY = root.height - thicknessAutoHidden; } else if (plasmoid.location === PlasmaCore.Types.TopEdge) { localX = latteView.effects.rect.x; - localY = latteView.effects.rect.y - thicknessAutoHidden; + localY = 0; } else if (plasmoid.location === PlasmaCore.Types.LeftEdge) { - localX = latteView.effects.rect.x - thicknessAutoHidden; + localX = 0; localY = latteView.effects.rect.y; } else if (plasmoid.location === PlasmaCore.Types.RightEdge) { - localX = latteView.effects.rect.x + latteView.effects.rect.width + 1; + localX = root.width - thicknessAutoHidden; localY = latteView.effects.rect.y; } } if (root.isHorizontal) { - tempThickness = latteView.effects.rect.height; + tempThickness = overridesHidden ? thicknessAutoHidden : latteView.effects.rect.height; tempLength = latteView.effects.rect.width; } else { - tempThickness = latteView.effects.rect.width; + tempThickness = overridesHidden ? thicknessAutoHidden : latteView.effects.rect.width; tempLength = latteView.effects.rect.height; } } From 7644e67b3528aa945a2aacb2ab87f4f3b4adc7de Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 30 Jul 2019 16:47:39 +0300 Subject: [PATCH 18/55] update absolute geometry in !compositing slide-in --- .../package/contents/ui/VisibilityManager.qml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/containment/package/contents/ui/VisibilityManager.qml b/containment/package/contents/ui/VisibilityManager.qml index 72dc3b3af..1f9b107db 100644 --- a/containment/package/contents/ui/VisibilityManager.qml +++ b/containment/package/contents/ui/VisibilityManager.qml @@ -600,13 +600,9 @@ Item{ } //console.log("update geometry ::: "+tempGeometry); - if (!Latte.WindowSystem.compositingActive) { - latteView.localGeometry = latteView.effects.rect; - } else { - latteView.localGeometry = tempGeometry; - } - } + latteView.localGeometry = tempGeometry; + } } Loader{ @@ -745,6 +741,11 @@ Item{ } latteView.visibility.slideInFinished(); + + if (!Latte.WindowSystem.compositingActive) { + //! this is needed in order to update dock absolute geometry correctly in the end + updateMaskArea(); + } } function init() { From bab3e9126ef89987985afb5b69f63862550695e9 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 30 Jul 2019 17:07:20 +0300 Subject: [PATCH 19/55] fix published absolute geometry in !compositing --absolute geometry is the published area that the dock/panel occupies when it is shown. So it should not change when the dock becomes hidden. This patch fixes the case for the !compositing environment. --- containment/package/contents/ui/VisibilityManager.qml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/containment/package/contents/ui/VisibilityManager.qml b/containment/package/contents/ui/VisibilityManager.qml index 1f9b107db..3e5d72164 100644 --- a/containment/package/contents/ui/VisibilityManager.qml +++ b/containment/package/contents/ui/VisibilityManager.qml @@ -93,7 +93,7 @@ Item{ //! give some more space when items shadows are enabled and extremely big if (root.enableShadows && root.maxThickMargin < shadowMaxNeededMargin) { - return shadowMaxNeededMargin - root.maxThickMargin; + return shadowMaxNeededMargin - root.maxThickMargin; } return 0; @@ -507,7 +507,7 @@ Item{ if (root.isVertical) { maskThickness = maskArea.width; } - } else if (!noCompositingEdit){ + } else if (!noCompositingEdit){ //! no compositing case var overridesHidden = latteView.visibility.isHidden && !latteView.visibility.supportsKWinEdges; @@ -575,8 +575,7 @@ Item{ //the shadows size must be removed from the maskArea //before updating the localDockGeometry - if ((!latteView.behaveAsPlasmaPanel || root.editMode) - && Latte.WindowSystem.compositingActive) { + if (!latteView.behaveAsPlasmaPanel || root.editMode) { var fixedThickness = root.editMode ? root.iconSize + root.thickMargins : root.realPanelThickness; if (plasmoid.formFactor === PlasmaCore.Types.Vertical) { @@ -600,7 +599,6 @@ Item{ } //console.log("update geometry ::: "+tempGeometry); - latteView.localGeometry = tempGeometry; } } From 1000f628365f214ea7897bd6e872a480ca7f8187 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 30 Jul 2019 18:00:33 +0300 Subject: [PATCH 20/55] set minimum hide timer interval 50ms --when hide timer is set below 50ms. there are cases that does not let the view to be shown after a containmouse trigerring. By setting a minimum value for the timer to 50ms this is fixed. BUG:410370 --- app/view/visibilitymanager.cpp | 60 +++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/app/view/visibilitymanager.cpp b/app/view/visibilitymanager.cpp index 7e9b41b60..932458292 100644 --- a/app/view/visibilitymanager.cpp +++ b/app/view/visibilitymanager.cpp @@ -39,6 +39,10 @@ #include #include +//! Hide Timer can create cases that when it is low it does not allow the +//! view to be show. For example !compositing+kwin_edges+hide inteval<50ms +const int HIDEMINIMUMINTERVAL = 50; + namespace Latte { namespace ViewPart { @@ -272,27 +276,27 @@ QRect VisibilityManager::acceptableStruts() QRect calcs; switch (m_latteView->location()) { - case Plasma::Types::TopEdge: { - calcs = QRect(m_latteView->x(), m_latteView->y(), m_latteView->width(), m_latteView->normalThickness()); - break; - } + case Plasma::Types::TopEdge: { + calcs = QRect(m_latteView->x(), m_latteView->y(), m_latteView->width(), m_latteView->normalThickness()); + break; + } - case Plasma::Types::BottomEdge: { - int y = m_latteView->y() + m_latteView->height() - m_latteView->normalThickness(); - calcs = QRect(m_latteView->x(), y, m_latteView->width(), m_latteView->normalThickness()); - break; - } + case Plasma::Types::BottomEdge: { + int y = m_latteView->y() + m_latteView->height() - m_latteView->normalThickness(); + calcs = QRect(m_latteView->x(), y, m_latteView->width(), m_latteView->normalThickness()); + break; + } - case Plasma::Types::LeftEdge: { - calcs = QRect(m_latteView->x(), m_latteView->y(), m_latteView->normalThickness(), m_latteView->height()); - break; - } + case Plasma::Types::LeftEdge: { + calcs = QRect(m_latteView->x(), m_latteView->y(), m_latteView->normalThickness(), m_latteView->height()); + break; + } - case Plasma::Types::RightEdge: { - int x = m_latteView->x() + m_latteView->width() - m_latteView->normalThickness(); - calcs = QRect(x, m_latteView->y(), m_latteView->normalThickness(), m_latteView->height()); - break; - } + case Plasma::Types::RightEdge: { + int x = m_latteView->x() + m_latteView->width() - m_latteView->normalThickness(); + calcs = QRect(x, m_latteView->y(), m_latteView->normalThickness(), m_latteView->height()); + break; + } } return calcs; @@ -382,6 +386,10 @@ int VisibilityManager::timerShow() const void VisibilityManager::setTimerShow(int msec) { + if (m_timerShow.interval() == msec) { + return; + } + m_timerShow.setInterval(msec); emit timerShowChanged(); } @@ -393,7 +401,13 @@ int VisibilityManager::timerHide() const void VisibilityManager::setTimerHide(int msec) { - m_timerHide.setInterval(msec); + int interval = qMax(HIDEMINIMUMINTERVAL, msec); + + if (m_timerHide.interval() == interval) { + return; + } + + m_timerHide.setInterval(interval); emit timerHideChanged(); } @@ -581,7 +595,7 @@ void VisibilityManager::restoreConfig() auto config = m_latteView->containment()->config(); m_timerShow.setInterval(config.readEntry("timerShow", 0)); - m_timerHide.setInterval(config.readEntry("timerHide", 700)); + m_timerHide.setInterval(qMax(HIDEMINIMUMINTERVAL, config.readEntry("timerHide", 700))); emit timerShowChanged(); emit timerHideChanged(); @@ -694,9 +708,9 @@ void VisibilityManager::setEnableKWinEdges(bool enable) void VisibilityManager::updateKWinEdgesSupport() { if ((m_mode == Types::AutoHide - || m_mode == Types::DodgeActive - || m_mode == Types::DodgeAllWindows - || m_mode == Types::DodgeMaximized) + || m_mode == Types::DodgeActive + || m_mode == Types::DodgeAllWindows + || m_mode == Types::DodgeMaximized) && (!m_latteView->byPassWM()) ) { if (m_enableKWinEdgesFromUser) { createEdgeGhostWindow(); From 5bab4b04098cd77e6a6e78119fb5005a9bfe02b3 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 30 Jul 2019 18:31:11 +0300 Subject: [PATCH 21/55] wayland,show preview windows for grouped tasks BUG: 410408 --- .../package/contents/ui/task/TaskItem.qml | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/plasmoid/package/contents/ui/task/TaskItem.qml b/plasmoid/package/contents/ui/task/TaskItem.qml index 7cb07536e..f144a1d2a 100644 --- a/plasmoid/package/contents/ui/task/TaskItem.qml +++ b/plasmoid/package/contents/ui/task/TaskItem.qml @@ -787,7 +787,7 @@ MouseArea{ if(pressed && (!inBlockingAnimation || inAttentionAnimation) && !isSeparator){ if (modifierAccepted(mouse) && !root.disableAllWindowsFunctionality){ - if( !taskItem.isLauncher){ + if( !taskItem.isLauncher ){ if (root.modifierClickAction == Latte.Types.NewInstance) { tasksModel.requestNewInstance(modelIndex()); } else if (root.modifierClickAction == Latte.Types.Close) { @@ -806,7 +806,7 @@ MouseArea{ activateTask(); } } else if (mouse.button == Qt.MidButton && !root.disableAllWindowsFunctionality){ - if( !taskItem.isLauncher){ + if( !taskItem.isLauncher ){ if (root.middleClickAction == Latte.Types.NewInstance) { tasksModel.requestNewInstance(modelIndex()); } else if (root.middleClickAction == Latte.Types.Close) { @@ -825,20 +825,24 @@ MouseArea{ activateTask(); } } else if (mouse.button == Qt.LeftButton){ - if( !taskItem.isLauncher){ - if (root.leftClickAction === Latte.Types.PresentWindows && !(isGroupParent && !Latte.WindowSystem.compositingActive)) { + if( !taskItem.isLauncher ){ + if (root.leftClickAction === Latte.Types.PreviewWindows + || (Latte.WindowSystem.isPlatformWayland + && root.leftClickAction === Latte.Types.PresentWindows + && isGroupParent) + || !Latte.WindowSystem.compositingActive) { + if(windowsPreviewDlg.activeItem !== taskItem){ + showPreviewWindow(); + } else { + hidePreviewWindow(); + } + } else if (root.leftClickAction === Latte.Types.PresentWindows && !(isGroupParent && !Latte.WindowSystem.compositingActive)) { activateTask(); } else if (root.leftClickAction === Latte.Types.CycleThroughTasks) { if (isGroupParent) subWindows.activateNextTask(); else activateTask(); - } else if (root.leftClickAction === Latte.Types.PreviewWindows || !Latte.WindowSystem.compositingActive) { - if(windowsPreviewDlg.activeItem !== taskItem){ - showPreviewWindow(); - } else { - hidePreviewWindow(); - } } } else { activateTask(); From 43d1985d4e5ad67f7b33e290e029b3b5527b9066 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 30 Jul 2019 23:35:09 +0300 Subject: [PATCH 22/55] improve LeftClick::PreviewWindows --when the user clicks a single window now it is just activated instead of showing first the preview window showing only one instance BUG:410417 --- plasmoid/package/contents/ui/task/TaskItem.qml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plasmoid/package/contents/ui/task/TaskItem.qml b/plasmoid/package/contents/ui/task/TaskItem.qml index f144a1d2a..5565dca16 100644 --- a/plasmoid/package/contents/ui/task/TaskItem.qml +++ b/plasmoid/package/contents/ui/task/TaskItem.qml @@ -826,7 +826,7 @@ MouseArea{ } } else if (mouse.button == Qt.LeftButton){ if( !taskItem.isLauncher ){ - if (root.leftClickAction === Latte.Types.PreviewWindows + if ( (root.leftClickAction === Latte.Types.PreviewWindows && isGroupParent) || (Latte.WindowSystem.isPlatformWayland && root.leftClickAction === Latte.Types.PresentWindows && isGroupParent) @@ -836,7 +836,8 @@ MouseArea{ } else { hidePreviewWindow(); } - } else if (root.leftClickAction === Latte.Types.PresentWindows && !(isGroupParent && !Latte.WindowSystem.compositingActive)) { + } else if ( (root.leftClickAction === Latte.Types.PresentWindows && !(isGroupParent && !Latte.WindowSystem.compositingActive)) + || ((root.leftClickAction === Latte.Types.PreviewWindows && !isGroupParent)) ) { activateTask(); } else if (root.leftClickAction === Latte.Types.CycleThroughTasks) { if (isGroupParent) From e438e04511393ca96d77f4b495d21ef7441fe92e Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Wed, 31 Jul 2019 08:57:25 +0200 Subject: [PATCH 23/55] SVN_SILENT made messages (.desktop file) - always resolve ours In case of conflict in i18n, keep the version of the branch "ours" To resolve a particular conflict, "git checkout --ours path/to/file.desktop" --- app/latte-indicators.knsrc | 1 + app/latte-layouts.knsrc | 1 + app/lattedock.notifyrc | 9 +++++++++ app/org.kde.latte-dock.desktop.cmake | 3 +++ app/packageplugins/indicator/latte-indicator.desktop | 1 + .../indicator/latte-packagestructure-indicator.desktop | 1 + containment/metadata.desktop.cmake | 2 ++ containment/package/metadata.desktop | 2 ++ .../plasma-containmentactions-lattecontextmenu.desktop | 2 ++ indicators/default/metadata.desktop | 2 ++ indicators/org.kde.latte.plasma/metadata.desktop | 2 ++ plasmoid/metadata.desktop.cmake | 2 ++ plasmoid/package/metadata.desktop | 2 ++ shell/metadata.desktop.cmake | 3 +++ shell/package/metadata.desktop | 3 +++ 15 files changed, 36 insertions(+) diff --git a/app/latte-indicators.knsrc b/app/latte-indicators.knsrc index ae80e8053..3e0eace0f 100644 --- a/app/latte-indicators.knsrc +++ b/app/latte-indicators.knsrc @@ -6,6 +6,7 @@ Name[en_GB]=Latte Indicators Name[es]=Indicadores de Latte Name[fi]=Latte-ilmaisimet Name[gl]=Indicadores de Latte +Name[id]=Indikator Latte Name[it]=Indicatori Latte Name[ko]=Latte 표시기 Name[nl]=Indicatoren van Latte diff --git a/app/latte-layouts.knsrc b/app/latte-layouts.knsrc index 7118acc0e..051ab7cfe 100644 --- a/app/latte-layouts.knsrc +++ b/app/latte-layouts.knsrc @@ -11,6 +11,7 @@ Name[es]=Distribuciones de Latte Name[eu]=Latte diseinuak Name[fi]=Latte-asettelut Name[gl]=Disposicións de Latte +Name[id]=Tataletak Latte Name[it]=Disposizioni di Latte Name[ko]=Latte 레이아웃 Name[nl]=Latte-indelingen diff --git a/app/lattedock.notifyrc b/app/lattedock.notifyrc index af17653f6..c8a443e98 100644 --- a/app/lattedock.notifyrc +++ b/app/lattedock.notifyrc @@ -12,6 +12,7 @@ Name[es]=Latte Dock Name[eu]=Latte Dock Name[fi]=Latte-telakka Name[gl]=Doca Latte +Name[id]=Dock Latte Name[it]=Latte Dock Name[ko]=Latte 독 Name[nl]=Latte Dock @@ -38,6 +39,7 @@ Comment[es]=Latte Dock Comment[eu]=Latte Dock Comment[fi]=Latte-telakka Comment[gl]=Doca Latte. +Comment[id]=Dock Latte Comment[it]=Latte Dock Comment[ko]=Latte 독 Comment[nl]=Latte Dock @@ -62,6 +64,7 @@ Name[en_GB]=Imported successfully Name[es]=Importada exitosamente Name[fi]=Tuonti onnistui Name[gl]=Importouse correctamente +Name[id]=Berhasil diimpor Name[it]=Importata con successo Name[ko]=성공적으로 가져왔습니다 Name[nl]=Met succes geïmporteerd @@ -86,6 +89,7 @@ Name[en_GB]=Failed to import Name[es]=Error al importar Name[fi]=Tuonti epäonnistui Name[gl]=Non se puido importar +Name[id]=Gagal mengimpor Name[it]=Impossibile importare Name[ko]=가져오지 못했습니다 Name[nl]=Importeren is mislukt @@ -110,6 +114,7 @@ Name[en_GB]=Exported successfully Name[es]=Exportada exitosamente Name[fi]=Vienti onnistui Name[gl]=Exportouse correctamente +Name[id]=Berhasil diekspor Name[it]=Esportata correttamente Name[ko]=성공적으로 내보냈습니다 Name[nl]=Met succes geëxporteerd @@ -134,6 +139,7 @@ Name[en_GB]=Failed to export Name[es]=Error al exportar Name[fi]=Vienti epäonnistui Name[gl]=Non se puido exportar +Name[id]=Gagal mengekspor Name[it]=Impossibile esportare Name[ko]=내보내지 못했습니다 Name[nl]=Exporteren is mislukt @@ -158,6 +164,7 @@ Name[en_GB]=Removed successfully Name[es]=Eliminada exitosamente Name[fi]=Poistaminen onnistui Name[gl]=Retirouse correctamente +Name[id]=Berhasil dihapus Name[it]=Rimossa con successo Name[ko]=성공적으로 삭제했습니다 Name[nl]=Met succes verwijderd @@ -182,6 +189,7 @@ Name[en_GB]=Failed to remove Name[es]=Error al eliminar Name[fi]=Poistaminen epäonnistui Name[gl]=Non se puido retirar +Name[id]=Gagal menghapus Name[it]=Impossibile rimuovere Name[ko]=삭제할 수 없음 Name[nl]=Verwijderen is mislukt @@ -210,6 +218,7 @@ Name[es]=Cambiar a distribución Name[eu]=Aldatu diseinura Name[fi]=Vaihda asetteluun Name[gl]=Cambiar á disposición +Name[id]=Beralih ke tataletak Name[it]=Passa alla disposizione Name[ko]=레이아웃으로 전환 Name[nl]=Naar indeling omschakelen diff --git a/app/org.kde.latte-dock.desktop.cmake b/app/org.kde.latte-dock.desktop.cmake index 98bbcb867..ca11a6359 100644 --- a/app/org.kde.latte-dock.desktop.cmake +++ b/app/org.kde.latte-dock.desktop.cmake @@ -12,6 +12,7 @@ Name[es]=Latte Name[eu]=Latte Name[fi]=Latte Name[gl]=Latte +Name[id]=Latte Name[it]=Latte Name[ko]=Latte Name[nl]=Latte @@ -37,6 +38,7 @@ Comment[es]=Un dock para las masas Comment[eu]=Jendartearen kaia Comment[fi]=Telakka massoille Comment[gl]=Doca para as masas. +Comment[id]=Dock untuk mengumpulkan Comment[it]=Area di aggancio per le masse Comment[ko]=다수의 응용프로그램을 위한 독 Comment[nl]=Dock voor de massa @@ -62,6 +64,7 @@ GenericName[es]=Dock GenericName[eu]=Kaia GenericName[fi]=Telakka GenericName[gl]=Doca +GenericName[id]=Dok GenericName[it]=Aggancio GenericName[ko]=독 GenericName[nl]=Dock diff --git a/app/packageplugins/indicator/latte-indicator.desktop b/app/packageplugins/indicator/latte-indicator.desktop index 9680bc0bb..387ce8dcd 100644 --- a/app/packageplugins/indicator/latte-indicator.desktop +++ b/app/packageplugins/indicator/latte-indicator.desktop @@ -9,6 +9,7 @@ Comment[en_GB]=Latte indicator Comment[es]=Indicador Latte Comment[fi]=Latte-ilmaisin Comment[gl]=Indicador de Latte +Comment[id]=Indikator latte Comment[it]=Indicatore Latte Comment[ko]=Latte 표시기 Comment[nl]=Indicator van Latte diff --git a/app/packageplugins/indicator/latte-packagestructure-indicator.desktop b/app/packageplugins/indicator/latte-packagestructure-indicator.desktop index 0c418ea01..55c9a9fd8 100644 --- a/app/packageplugins/indicator/latte-packagestructure-indicator.desktop +++ b/app/packageplugins/indicator/latte-packagestructure-indicator.desktop @@ -6,6 +6,7 @@ Name[en_GB]=Indicator Name[es]=Indicador Name[fi]=Ilmaisin Name[gl]=Indicador +Name[id]=Indikator Name[it]=Indicatore Name[ko]=표시기 Name[nl]=Indicator diff --git a/containment/metadata.desktop.cmake b/containment/metadata.desktop.cmake index 6fd09156f..a255dda5b 100644 --- a/containment/metadata.desktop.cmake +++ b/containment/metadata.desktop.cmake @@ -13,6 +13,7 @@ Name[es]=Latte Name[eu]=Latte Name[fi]=Latte Name[gl]=Latte +Name[id]=Latte Name[it]=Latte Name[ko]=Latte Name[nl]=Latte @@ -37,6 +38,7 @@ Comment[es]=Contención proporcionada para Latte Dock Comment[eu]=Konfinamendua hornitu da Latte Dockentzako Comment[fi]=Latte-telakalla tarjottu sisällytys Comment[gl]=Contedor fornecido para a doca Latte. +Comment[id]=Kontainmen disediakan untuk Dock Latte Comment[it]=Contenitore fornito per Latte Dock Comment[ko]=Latte 독을 위해 제공된 컨테이너 Comment[nl]=Container geleverd voor de Latte Dock diff --git a/containment/package/metadata.desktop b/containment/package/metadata.desktop index 87975f822..e7935b551 100644 --- a/containment/package/metadata.desktop +++ b/containment/package/metadata.desktop @@ -13,6 +13,7 @@ Name[es]=Latte Name[eu]=Latte Name[fi]=Latte Name[gl]=Latte +Name[id]=Latte Name[it]=Latte Name[ko]=Latte Name[nl]=Latte @@ -37,6 +38,7 @@ Comment[es]=Contención proporcionada para Latte Dock Comment[eu]=Konfinamendua hornitu da Latte Dockentzako Comment[fi]=Latte-telakalla tarjottu sisällytys Comment[gl]=Contedor fornecido para a doca Latte. +Comment[id]=Kontainmen disediakan untuk Dock Latte Comment[it]=Contenitore fornito per Latte Dock Comment[ko]=Latte 독을 위해 제공된 컨테이너 Comment[nl]=Container geleverd voor de Latte Dock diff --git a/containmentactions/contextmenu/plasma-containmentactions-lattecontextmenu.desktop b/containmentactions/contextmenu/plasma-containmentactions-lattecontextmenu.desktop index 725801332..6ea92d2ec 100644 --- a/containmentactions/contextmenu/plasma-containmentactions-lattecontextmenu.desktop +++ b/containmentactions/contextmenu/plasma-containmentactions-lattecontextmenu.desktop @@ -10,6 +10,7 @@ Name[es]=Menú estándar de Latte Name[eu]=Latte menu estandarra Name[fi]=Latten vakiovalikko Name[gl]=Menú estándar de Latte +Name[id]=Menu Latte Standar Name[it]=Menu standard di Latte Name[ko]=표준 Latte 메뉴 Name[nl]=Standaard menu van Latte @@ -33,6 +34,7 @@ Comment[es]=Este es el menú de Latte que normalmente se muestra tras un clic de Comment[eu]=Eskuineko botoiaz klik eginda agertu ohi den latte menua Comment[fi]=Latte-valikko, joka tavallisesti näytetään hiiren oikealla painikkeella Comment[gl]=O menú de Latte que adoita mostrarse ao facer clic dereito +Comment[id]=Menu latte yang biasanya tampil saat klik-kanan Comment[it]=Il menu di Latte che normalmente viene mostrato al clic destro Comment[ko]=오른쪽 클릭 시 일반적으로 표시되는 Latte 메뉴 Comment[nl]=Het menu van latte dat normaal getoond wordt bij rechtsklikken diff --git a/indicators/default/metadata.desktop b/indicators/default/metadata.desktop index 4994f171b..0d59e7a48 100644 --- a/indicators/default/metadata.desktop +++ b/indicators/default/metadata.desktop @@ -12,6 +12,7 @@ Name[es]=Latte Name[eu]=Latte Name[fi]=Latte Name[gl]=Latte +Name[id]=Latte Name[it]=Latte Name[ko]=Latte Name[nl]=Latte @@ -32,6 +33,7 @@ Comment[en_GB]=Latte default indicator Comment[es]=Indicador por omisión de Latte Comment[fi]=Latte-oletusilmaisin Comment[gl]=Indicador predeterminado de Latte +Comment[id]=Indikator baku latte Comment[it]=Indicatore predefinito di Latte Comment[ko]=Latte 기본 표시기 Comment[nl]=Standaard indicator van Latte diff --git a/indicators/org.kde.latte.plasma/metadata.desktop b/indicators/org.kde.latte.plasma/metadata.desktop index 347b80c49..6a8b0b5e4 100644 --- a/indicators/org.kde.latte.plasma/metadata.desktop +++ b/indicators/org.kde.latte.plasma/metadata.desktop @@ -9,6 +9,7 @@ Name[es]=Plasma Name[fi]=Plasma Name[fr]=Plasma Name[gl]=Plasma +Name[id]=Plasma Name[it]=Plasma Name[ko]=Plasma Name[nl]=Plasma @@ -29,6 +30,7 @@ Comment[en_GB]=Latte Plasma style indicator Comment[es]=Estilo del indicador Plasma Latte Comment[fi]=Plasma-tyylin Latte-ilmaisin Comment[gl]=Indicador de estilo Plasma de Latte +Comment[id]=Indikator latte gaya Plasma Comment[it]=Indicatore stile di Plasma di Latte Comment[ko]=Latte Plasma 스타일 표시기 Comment[nl]=Plasma stijlindicator van Latte diff --git a/plasmoid/metadata.desktop.cmake b/plasmoid/metadata.desktop.cmake index db00dfb8d..4e61294b9 100644 --- a/plasmoid/metadata.desktop.cmake +++ b/plasmoid/metadata.desktop.cmake @@ -6,6 +6,7 @@ Name[en_GB]=Latte Tasks Name[es]=Tareas de Latte Name[fi]=Latte-tehtävät Name[gl]=Tarefas de Latte +Name[id]=Tugas-tugas Latte Name[it]=Processi di Latte Name[ko]=Latte 태스크 Name[nl]=Latte-taken @@ -25,6 +26,7 @@ Comment[en_GB]=Tasks plasmoid from Latte Dock Comment[es]=Plasmoide de tareas de Latte Dock Comment[fi]=Latte-telakan tehtäväsovelma Comment[gl]=Plasmoides de tarefas da doca Latte +Comment[id]=Plasmoid tugas-tugas dari Dock Latte Comment[it]=Plasmoide dei processi da Latte Dock Comment[ko]=Latte 독의 태스크 Plasmoid Comment[nl]=Plasmoid voor taken uit Latte Dock diff --git a/plasmoid/package/metadata.desktop b/plasmoid/package/metadata.desktop index 941904324..e9a5325da 100644 --- a/plasmoid/package/metadata.desktop +++ b/plasmoid/package/metadata.desktop @@ -6,6 +6,7 @@ Name[en_GB]=Latte Tasks Name[es]=Tareas de Latte Name[fi]=Latte-tehtävät Name[gl]=Tarefas de Latte +Name[id]=Tugas-tugas Latte Name[it]=Processi di Latte Name[ko]=Latte 태스크 Name[nl]=Latte-taken @@ -25,6 +26,7 @@ Comment[en_GB]=Tasks plasmoid from Latte Dock Comment[es]=Plasmoide de tareas de Latte Dock Comment[fi]=Latte-telakan tehtäväsovelma Comment[gl]=Plasmoides de tarefas da doca Latte +Comment[id]=Plasmoid tugas-tugas dari Dock Latte Comment[it]=Plasmoide dei processi da Latte Dock Comment[ko]=Latte 독의 태스크 Plasmoid Comment[nl]=Plasmoid voor taken uit Latte Dock diff --git a/shell/metadata.desktop.cmake b/shell/metadata.desktop.cmake index 3208e1f4a..3e5c2b029 100644 --- a/shell/metadata.desktop.cmake +++ b/shell/metadata.desktop.cmake @@ -12,6 +12,7 @@ Name[es]=Consola de Latte Name[eu]=Latte Shell-a Name[fi]=Latte-käyttöliittymä Name[gl]=Intérprete de ordes de Latte +Name[id]=Shell Latte Name[it]=shell Latte Name[ko]=Latte 셸 Name[nl]=Latte-shell @@ -36,6 +37,7 @@ Comment[es]=Shell proporcionada para Latte Dock Comment[eu]=Shell-a Latte Dockentzat Comment[fi]=Latte-telakalle tarjottu käyttöliittymä Comment[gl]=Intérprete de ordes fornecido para a doca Latte. +Comment[id]=Shell disediakan untuk Dock Latte Comment[it]=Shell fornita per Latte Dock Comment[ko]=Latte 독을 위해 제공된 셸 Comment[nl]=Shell geleverd voor de Latte Dock @@ -61,6 +63,7 @@ Keywords[es]=consola Keywords[eu]=shell Keywords[fi]=käyttöliittymä Keywords[gl]=intérprete de ordes +Keywords[id]=shell Keywords[it]=shell Keywords[ko]=셸 Keywords[nl]=shell diff --git a/shell/package/metadata.desktop b/shell/package/metadata.desktop index 873b38c49..c5a90e0d8 100644 --- a/shell/package/metadata.desktop +++ b/shell/package/metadata.desktop @@ -12,6 +12,7 @@ Name[es]=Consola de Latte Name[eu]=Latte Shell-a Name[fi]=Latte-käyttöliittymä Name[gl]=Intérprete de ordes de Latte +Name[id]=Shell Latte Name[it]=shell Latte Name[ko]=Latte 셸 Name[nl]=Latte-shell @@ -36,6 +37,7 @@ Comment[es]=Shell proporcionada para Latte Dock Comment[eu]=Shell-a Latte Dockentzat Comment[fi]=Latte-telakalle tarjottu käyttöliittymä Comment[gl]=Intérprete de ordes fornecido para a doca Latte. +Comment[id]=Shell disediakan untuk Dock Latte Comment[it]=Shell fornita per Latte Dock Comment[ko]=Latte 독을 위해 제공된 셸 Comment[nl]=Shell geleverd voor de Latte Dock @@ -61,6 +63,7 @@ Keywords[es]=consola Keywords[eu]=shell Keywords[fi]=käyttöliittymä Keywords[gl]=intérprete de ordes +Keywords[id]=shell Keywords[it]=shell Keywords[ko]=셸 Keywords[nl]=shell From e684924d7c86fb8ea0ecd0acb858096b391f9358 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Wed, 31 Jul 2019 16:06:46 +0300 Subject: [PATCH 24/55] improve more the isBusy background case --the new implementation supports and always darkish case when the isBusy background is drawn. So now we have the following possibilities: a)panel transparency<35 means BEST contrast with underlying desktop background b)panel transparency>=35 AND <70 means a DARKISH background c)panel transparency>=70 the user chosen plasma theme --- containment/package/contents/ui/PanelBox.qml | 12 ++++++---- .../package/contents/ui/colorizer/Manager.qml | 24 +++++++++++++++---- .../contents/ui/editmode/SettingsOverlay.qml | 15 ++++++++---- containment/package/contents/ui/main.qml | 6 +++-- 4 files changed, 42 insertions(+), 15 deletions(-) diff --git a/containment/package/contents/ui/PanelBox.qml b/containment/package/contents/ui/PanelBox.qml index 6887a660c..e881ae83d 100644 --- a/containment/package/contents/ui/PanelBox.qml +++ b/containment/package/contents/ui/PanelBox.qml @@ -503,13 +503,17 @@ Item{ Colorizer.CustomBackground { id: overlayedBackground anchors.fill: solidBackground + + readonly property bool busyBackground: root.forcePanelForBusyBackground + && (solidBackground.opacity === 0 || !solidBackground.paintInstantly) + readonly property bool coloredView: colorizerManager.mustBeShown && colorizerManager.applyTheme !== theme + opacity: { - if (root.forcePanelForBusyBackground - && (solidBackground.opacity === 0 || !solidBackground.paintInstantly)) { + if (busyBackground) { return plasmoid.configuration.panelTransparency / 100; } - if (colorizerManager.mustBeShown && colorizerManager.applyTheme !== theme) { + if (coloredView) { return midOpacity; } @@ -517,7 +521,7 @@ Item{ } backgroundColor: { - if (colorizerManager.mustBeShown && colorizerManager.applyTheme !== theme) { + if (busyBackground || coloredView) { return colorizerManager.backgroundColor; } diff --git a/containment/package/contents/ui/colorizer/Manager.qml b/containment/package/contents/ui/colorizer/Manager.qml index d8862fe62..7ab2fef2b 100644 --- a/containment/package/contents/ui/colorizer/Manager.qml +++ b/containment/package/contents/ui/colorizer/Manager.qml @@ -60,7 +60,8 @@ Loader{ readonly property bool editModeTextColorIsBright: ColorizerTools.colorBrightness(editModeTextColor) > 127.5 readonly property color editModeTextColor: latteView && latteView.layout ? latteView.layout.textColor : "white" - readonly property bool mustBeShown: (applyTheme && applyTheme !== theme) || (root.inConfigureAppletsMode && (root.themeColors === Latte.Types.SmartThemeColors)) + readonly property bool mustBeShown: (applyTheme && applyTheme !== theme) + || (root.inConfigureAppletsMode && (root.themeColors === Latte.Types.SmartThemeColors)) readonly property real currentBackgroundBrightness: item ? item.currentBrightness : -1000 @@ -102,10 +103,25 @@ Loader{ } if (root.themeColors === Latte.Types.SmartThemeColors) { - if (currentBackgroundBrightness > 127.5) { - return themeExtended.lightTheme; + //! Smart Colors Case + if (!root.forcePanelForBusyBackground) { + //! simple case that not a busy background is applied + return currentBackgroundBrightness > 127.5 ? themeExtended.lightTheme : themeExtended.darkTheme; } else { - return themeExtended.darkTheme; + //! Smart + Busy background case + var themeContrastedTextColor = currentBackgroundBrightness > 127.5 ? themeExtended.lightTheme : themeExtended.darkTheme; + var themeContrastedBackground = currentBackgroundBrightness > 127.5 ? themeExtended.darkTheme : themeExtended.lightTheme; + + if (root.panelTransparency < 35) { + //! textColor should be better to provide the needed contrast + return themeContrastedTextColor; + } else if (root.panelTransparency >= 35 && root.panelTransparency <= 70) { + //! provide a dark case scenario at all cases + return themeExtended.darkTheme; + } else { + //! default plasma theme shoud be better for panel transparency > 70 + return theme; + } } } } diff --git a/containment/package/contents/ui/editmode/SettingsOverlay.qml b/containment/package/contents/ui/editmode/SettingsOverlay.qml index 1e3b3857e..12bb9a08f 100644 --- a/containment/package/contents/ui/editmode/SettingsOverlay.qml +++ b/containment/package/contents/ui/editmode/SettingsOverlay.qml @@ -51,14 +51,19 @@ Item{ readonly property real textColorBrightness: ColorizerTools.colorBrightness(textColor) readonly property bool textColorIsDark: textColorBrightness < 127.5 - readonly property color textColor: { - if (imageTiler.opacity <= 0.4) { - return colorizerManager.applyColor; - } else { - return latteView && latteView.layout ? latteView.layout.textColor : "#D7E3FF"; + + readonly property color bestContrastedTextColor: { + if (imageTiler.opacity <= 0.4 && !root.inConfigureAppletsMode && themeExtended) { + return colorizerManager.currentBackgroundBrightness > 127.5 ? + themeExtended.lightTheme.textColor : + themeExtended.darkTheme.textColor; } + + return latteView && latteView.layout ? latteView.layout.textColor : "#D7E3FF"; } + readonly property color textColor: bestContrastedTextColor + layer.enabled: true layer.effect: DropShadow{ radius: settingsRoot.textShadow diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index 1abdd4516..5ec431acf 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -144,8 +144,10 @@ Item { && !(windowColors === Latte.Types.TouchingWindowColors && latteView.windowsTracker.currentScreen.activeWindowTouching) && !(windowColors === Latte.Types.ActiveWindowColors && selectedWindowsTracker.existsWindowActive) - property bool forcePanelForBusyBackground: userShowPanelBackground && root.forceTransparentPanel - && colorizerManager.mustBeShown && colorizerManager.backgroundIsBusy + property bool forcePanelForBusyBackground: userShowPanelBackground + && root.forceTransparentPanel + && (root.themeColors === Latte.Types.SmartThemeColors) + && colorizerManager.backgroundIsBusy property int themeColors: plasmoid.configuration.themeColors property int windowColors: plasmoid.configuration.windowColors From 59f1d72fa36d516978e78a525ab86de4f6ca89a1 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Wed, 31 Jul 2019 16:34:05 +0300 Subject: [PATCH 25/55] improve canBeDragged implementation --follow libtaskmanager case to support this --- app/wm/waylandinterface.cpp | 13 +++++++++++-- app/wm/xwindowinterface.cpp | 12 ++++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/app/wm/waylandinterface.cpp b/app/wm/waylandinterface.cpp index 7a547a7bf..b6b03b0c8 100644 --- a/app/wm/waylandinterface.cpp +++ b/app/wm/waylandinterface.cpp @@ -510,8 +510,17 @@ WindowId WaylandInterface::winIdFor(QString appId, QRect geometry) const bool WaylandInterface::windowCanBeDragged(WindowId wid) const { - WindowInfoWrap winfo = requestInfo(wid); - return (winfo.isValid() && !winfo.isMinimized() && !winfo.isPlasmaDesktop()); + auto w = windowFor(wid); + + if (w && isValidWindow(w)) { + WindowInfoWrap winfo = requestInfo(wid); + return (winfo.isValid() + && w->isMovable() + && !winfo.isMinimized() + && !winfo.isPlasmaDesktop()); + } + + return false; } void WaylandInterface::releaseMouseEventFor(WindowId wid) const diff --git a/app/wm/xwindowinterface.cpp b/app/wm/xwindowinterface.cpp index 114e73a4d..312dd2b93 100644 --- a/app/wm/xwindowinterface.cpp +++ b/app/wm/xwindowinterface.cpp @@ -396,8 +396,16 @@ QUrl XWindowInterface::windowUrl(WindowId wid) const bool XWindowInterface::windowCanBeDragged(WindowId wid) const { - WindowInfoWrap winfo = requestInfo(wid); - return (winfo.isValid() && !winfo.isMinimized() && !winfo.isPlasmaDesktop()); + KWindowInfo info(wid.value(), 0, NET::WM2AllowedActions); + if (info.valid()) { + WindowInfoWrap winfo = requestInfo(wid); + return (winfo.isValid() + && info.actionSupported(NET::ActionMove) + && !winfo.isMinimized() + && !winfo.isPlasmaDesktop()); + } + + return false; } void XWindowInterface::releaseMouseEventFor(WindowId wid) const From 42d94df47fe8341268c4616f05db74d07fbec7b2 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Wed, 31 Jul 2019 16:44:43 +0300 Subject: [PATCH 26/55] introduce windowCanBeMaximized --trying to avoid interacting with windows that DO NOT allow it --- app/wm/abstractwindowinterface.h | 1 + app/wm/tracker/lastactivewindow.cpp | 4 ++++ app/wm/waylandinterface.cpp | 17 ++++++++++++++++- app/wm/waylandinterface.h | 3 ++- app/wm/xwindowinterface.cpp | 20 ++++++++++++++++++++ app/wm/xwindowinterface.h | 1 + 6 files changed, 44 insertions(+), 2 deletions(-) diff --git a/app/wm/abstractwindowinterface.h b/app/wm/abstractwindowinterface.h index 3f1bf2481..b36077923 100644 --- a/app/wm/abstractwindowinterface.h +++ b/app/wm/abstractwindowinterface.h @@ -109,6 +109,7 @@ public: virtual void requestToggleMaximized(WindowId wid) const = 0; virtual bool windowCanBeDragged(WindowId wid) const = 0; + virtual bool windowCanBeMaximized(WindowId wid) const = 0; virtual QIcon iconFor(WindowId wid) const = 0; virtual WindowId winIdFor(QString appId, QRect geometry) const = 0; diff --git a/app/wm/tracker/lastactivewindow.cpp b/app/wm/tracker/lastactivewindow.cpp index e4a5eab0b..80ea445ae 100644 --- a/app/wm/tracker/lastactivewindow.cpp +++ b/app/wm/tracker/lastactivewindow.cpp @@ -391,6 +391,10 @@ void LastActiveWindow::requestClose() void LastActiveWindow::requestMove(Latte::View *fromView, int localX, int localY) { + if (!canBeDragged()) { + return; + } + QPoint globalPoint{fromView->x() + localX, fromView->y() + localY}; m_wm->requestMoveWindow(m_winId, globalPoint); diff --git a/app/wm/waylandinterface.cpp b/app/wm/waylandinterface.cpp index b6b03b0c8..b5da825ad 100644 --- a/app/wm/waylandinterface.cpp +++ b/app/wm/waylandinterface.cpp @@ -523,6 +523,21 @@ bool WaylandInterface::windowCanBeDragged(WindowId wid) const return false; } +bool WaylandInterface::windowCanBeMaximized(WindowId wid) const +{ + auto w = windowFor(wid); + + if (w && isValidWindow(w)) { + WindowInfoWrap winfo = requestInfo(wid); + return (winfo.isValid() + && w->isMaximizeable() + && !winfo.isMinimized() + && !winfo.isPlasmaDesktop()); + } + + return false; +} + void WaylandInterface::releaseMouseEventFor(WindowId wid) const { // this isnt really needed under wayland @@ -604,7 +619,7 @@ void WaylandInterface::requestToggleMaximized(WindowId wid) const { auto w = windowFor(wid); - if (w && isValidWindow(w)) { + if (w && isValidWindow(w) && windowCanBeMaximized(wid)) { #if KF5_VERSION_MINOR >= 52 if (!m_currentDesktop.isEmpty()) { w->requestEnterVirtualDesktop(m_currentDesktop); diff --git a/app/wm/waylandinterface.h b/app/wm/waylandinterface.h index 51068ddca..ee2fa10a9 100644 --- a/app/wm/waylandinterface.h +++ b/app/wm/waylandinterface.h @@ -86,7 +86,8 @@ public: void requestToggleMinimized(WindowId wid) const override; void requestToggleMaximized(WindowId wid) const override; - bool windowCanBeDragged(WindowId wid) const; + bool windowCanBeDragged(WindowId wid) const override; + bool windowCanBeMaximized(WindowId wid) const override; QIcon iconFor(WindowId wid) const; WindowId winIdFor(QString appId, QRect geometry) const override; diff --git a/app/wm/xwindowinterface.cpp b/app/wm/xwindowinterface.cpp index 312dd2b93..d9a93763d 100644 --- a/app/wm/xwindowinterface.cpp +++ b/app/wm/xwindowinterface.cpp @@ -397,6 +397,7 @@ QUrl XWindowInterface::windowUrl(WindowId wid) const bool XWindowInterface::windowCanBeDragged(WindowId wid) const { KWindowInfo info(wid.value(), 0, NET::WM2AllowedActions); + if (info.valid()) { WindowInfoWrap winfo = requestInfo(wid); return (winfo.isValid() @@ -408,6 +409,21 @@ bool XWindowInterface::windowCanBeDragged(WindowId wid) const return false; } +bool XWindowInterface::windowCanBeMaximized(WindowId wid) const +{ + KWindowInfo info(wid.value(), 0, NET::WM2AllowedActions); + + if (info.valid()) { + WindowInfoWrap winfo = requestInfo(wid); + return (winfo.isValid() + && !winfo.isMinimized() + && info.actionSupported(NET::ActionMax) + && !winfo.isPlasmaDesktop()); + } + + return false; +} + void XWindowInterface::releaseMouseEventFor(WindowId wid) const { auto connection = QX11Info::connection(); @@ -550,6 +566,10 @@ void XWindowInterface::requestToggleMinimized(WindowId wid) const void XWindowInterface::requestToggleMaximized(WindowId wid) const { + if (!windowCanBeMaximized(wid)) { + return; + } + WindowInfoWrap wInfo = requestInfo(wid); bool restore = wInfo.isMaxHoriz() && wInfo.isMaxVert(); diff --git a/app/wm/xwindowinterface.h b/app/wm/xwindowinterface.h index 4ad3e6b9c..a52ecbb61 100644 --- a/app/wm/xwindowinterface.h +++ b/app/wm/xwindowinterface.h @@ -71,6 +71,7 @@ public: void requestToggleMaximized(WindowId wid) const override; bool windowCanBeDragged(WindowId wid) const override; + bool windowCanBeMaximized(WindowId wid) const override; QIcon iconFor(WindowId wid) const override; WindowId winIdFor(QString appId, QRect geometry) const override; From 45456a5ab8a25a721d2cf9b4f1003eb504dfed43 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Thu, 1 Aug 2019 02:31:54 +0300 Subject: [PATCH 27/55] update wayland interfaces in desktop file --- app/org.kde.latte-dock.desktop.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/org.kde.latte-dock.desktop.cmake b/app/org.kde.latte-dock.desktop.cmake index ca11a6359..febf497ad 100644 --- a/app/org.kde.latte-dock.desktop.cmake +++ b/app/org.kde.latte-dock.desktop.cmake @@ -95,5 +95,5 @@ X-KDE-PluginInfo-Version=@VERSION@ X-KDE-PluginInfo-Website=@WEBSITE@ X-KDE-StartupNotify=false X-KDE-SubstituteUID=false -X-KDE-Wayland-Interfaces=org_kde_plasma_window_management +X-KDE-Wayland-Interfaces=org_kde_plasma_window_management,org_kde_kwin_keystate From cad13372d642ea7bdaa7207b15fa058173439e73 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Thu, 1 Aug 2019 18:18:40 +0300 Subject: [PATCH 28/55] support touching horizontal view and isbusy --trying to increase smartness for horizontal and vertical views. In multiple layouts environment a view can exist in cases that one or more of the sided views that is touching it is NOT transparent, it would be nice for those cases the top or bottom view to LOSE also its transparency in order to not look inconsistent. --- app/view/view.cpp | 31 +++++++++++++++++++ app/view/view.h | 15 +++++++++ .../package/contents/ui/VisibilityManager.qml | 29 +++++++++++++++++ 3 files changed, 75 insertions(+) diff --git a/app/view/view.cpp b/app/view/view.cpp index 4e31f5b7f..e70c66176 100644 --- a/app/view/view.cpp +++ b/app/view/view.cpp @@ -655,6 +655,37 @@ void View::setLatteTasksArePresent(bool present) emit latteTasksArePresentChanged(); } +bool View::touchingBottomViewAndIsBusy() const +{ + return m_touchingBottomViewAndIsBusy; +} + +void View::setTouchingBottomViewAndIsBusy(bool touchAndBusy) +{ + if (m_touchingBottomViewAndIsBusy == touchAndBusy) { + return; + } + + m_touchingBottomViewAndIsBusy = touchAndBusy; + + emit touchingBottomViewAndIsBusyChanged(); +} + +bool View::touchingTopViewAndIsBusy() const +{ + return m_touchingTopViewAndIsBusy; +} + +void View::setTouchingTopViewAndIsBusy(bool touchAndBusy) +{ + if (m_touchingTopViewAndIsBusy == touchAndBusy) { + return; + } + + m_touchingTopViewAndIsBusy = touchAndBusy; + emit touchingTopViewAndIsBusyChanged(); +} + void View::preferredViewForShortcutsChangedSlot(Latte::View *view) { if (view != this) { diff --git a/app/view/view.h b/app/view/view.h index 1ab23b301..0983f0e37 100644 --- a/app/view/view.h +++ b/app/view/view.h @@ -86,6 +86,10 @@ class View : public PlasmaQuick::ContainmentView Q_PROPERTY(bool latteTasksArePresent READ latteTasksArePresent WRITE setLatteTasksArePresent NOTIFY latteTasksArePresentChanged) Q_PROPERTY(bool onPrimary READ onPrimary WRITE setOnPrimary NOTIFY onPrimaryChanged) + //! values to be used from Smart surrounding Views + Q_PROPERTY(bool touchingBottomViewAndIsBusy READ touchingBottomViewAndIsBusy WRITE setTouchingBottomViewAndIsBusy NOTIFY touchingBottomViewAndIsBusyChanged) + Q_PROPERTY(bool touchingTopViewAndIsBusy READ touchingTopViewAndIsBusy WRITE setTouchingTopViewAndIsBusy NOTIFY touchingTopViewAndIsBusyChanged) + Q_PROPERTY(int alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged) Q_PROPERTY(int fontPixelSize READ fontPixelSize WRITE setFontPixelSize NOTIFY fontPixelSizeChanged) Q_PROPERTY(int x READ x NOTIFY xChanged) @@ -149,6 +153,12 @@ public: bool latteTasksArePresent() const; void setLatteTasksArePresent(bool present); + bool touchingBottomViewAndIsBusy() const; + void setTouchingBottomViewAndIsBusy(bool touchAndBusy); + + bool touchingTopViewAndIsBusy() const; + void setTouchingTopViewAndIsBusy(bool touchAndBusy); + float maxLength() const; void setMaxLength(float length); @@ -264,6 +274,8 @@ signals: void onPrimaryChanged(); void positionerChanged(); void screenGeometryChanged(); + void touchingBottomViewAndIsBusyChanged(); + void touchingTopViewAndIsBusyChanged(); void typeChanged(); void visibilityChanged(); void windowsTrackerChanged(); @@ -309,6 +321,9 @@ private: bool m_latteTasksArePresent{false}; bool m_onPrimary{true}; + bool m_touchingBottomViewAndIsBusy{false}; + bool m_touchingTopViewAndIsBusy{false}; + int m_fontPixelSize{ -1}; int m_editThickness{24}; int m_maxThickness{24}; diff --git a/containment/package/contents/ui/VisibilityManager.qml b/containment/package/contents/ui/VisibilityManager.qml index 3e5d72164..7edf09863 100644 --- a/containment/package/contents/ui/VisibilityManager.qml +++ b/containment/package/contents/ui/VisibilityManager.qml @@ -180,6 +180,34 @@ Item{ value: root.panelAlignment } + Binding{ + target: latteView + property: "touchingTopViewAndIsBusy" + when: latteView + value: { + var isTouchingTopScreenEdge = (latteView.y === latteView.screenGeometry.y); + var hasTopBorder = ((latteView.effects && (latteView.effects.enabledBorders & PlasmaCore.FrameSvg.TopBorder)) > 0); + + return root.isVertical && !isTouchingTopScreenEdge && !hasTopBorder && root.forcePanelForBusyBackground; + } + } + + Binding{ + target: latteView + property: "touchingBottomViewAndIsBusy" + when: latteView + value: { + var latteBottom = latteView.y + latteView.height; + var screenBottom = latteView.screenGeometry.y + latteView.screenGeometry.height; + var isTouchingBottomScreenEdge = (latteBottom === screenBottom); + + var hasBottomBorder = ((latteView.effects && (latteView.effects.enabledBorders & PlasmaCore.FrameSvg.BottomBorder)) > 0); + + return root.isVertical && !isTouchingBottomScreenEdge && !hasBottomBorder && root.forcePanelForBusyBackground; + } + } + + //! View::Effects bindings Binding{ target: latteView && latteView.effects ? latteView.effects : null property: "backgroundOpacity" @@ -240,6 +268,7 @@ Item{ } } + //! View::WindowsTracker bindings Binding{ target: latteView && latteView.windowsTracker ? latteView.windowsTracker : null property: "enabled" From 92a4fb054e8fcad93651e57921bc638ca7149dab Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Thu, 1 Aug 2019 23:56:09 +0300 Subject: [PATCH 29/55] improve smartness for Unity case layout --when a vertical view is in busy state and is touching also a horizontal view that is fully transparent in SMART mode then the visual result is not that good. In that case it is better to show the view background. The horizontal view background in that case can provide three different states: a) if the panel style for popups is activated then the horizontal view will follow the plasma original style b) if NOT [a] and solid background for touching windows is enabled then solid background will be offered c) if NOT [a] and NOT [b] then the isBusy state transparency will be offered --- app/view/view.cpp | 24 +++---- app/view/view.h | 20 +++--- .../windowstracker/currentscreentracker.cpp | 11 +++ .../windowstracker/currentscreentracker.h | 5 ++ app/wm/tracker/trackedviewinfo.cpp | 14 ++++ app/wm/tracker/trackedviewinfo.h | 8 ++- app/wm/tracker/windowstracker.cpp | 67 +++++++++++++++++++ app/wm/tracker/windowstracker.h | 9 +++ containment/package/contents/ui/PanelBox.qml | 3 +- .../package/contents/ui/VisibilityManager.qml | 4 +- .../package/contents/ui/colorizer/Manager.qml | 1 + containment/package/contents/ui/main.qml | 30 +++++++-- 12 files changed, 165 insertions(+), 31 deletions(-) diff --git a/app/view/view.cpp b/app/view/view.cpp index e70c66176..ebbd12998 100644 --- a/app/view/view.cpp +++ b/app/view/view.cpp @@ -655,35 +655,35 @@ void View::setLatteTasksArePresent(bool present) emit latteTasksArePresentChanged(); } -bool View::touchingBottomViewAndIsBusy() const +bool View::isTouchingBottomViewAndIsBusy() const { - return m_touchingBottomViewAndIsBusy; + return m_isTouchingBottomViewAndIsBusy; } -void View::setTouchingBottomViewAndIsBusy(bool touchAndBusy) +void View::setIsTouchingBottomViewAndIsBusy(bool touchAndBusy) { - if (m_touchingBottomViewAndIsBusy == touchAndBusy) { + if (m_isTouchingBottomViewAndIsBusy == touchAndBusy) { return; } - m_touchingBottomViewAndIsBusy = touchAndBusy; + m_isTouchingBottomViewAndIsBusy = touchAndBusy; - emit touchingBottomViewAndIsBusyChanged(); + emit isTouchingBottomViewAndIsBusyChanged(); } -bool View::touchingTopViewAndIsBusy() const +bool View::isTouchingTopViewAndIsBusy() const { - return m_touchingTopViewAndIsBusy; + return m_isTouchingTopViewAndIsBusy; } -void View::setTouchingTopViewAndIsBusy(bool touchAndBusy) +void View::setIsTouchingTopViewAndIsBusy(bool touchAndBusy) { - if (m_touchingTopViewAndIsBusy == touchAndBusy) { + if (m_isTouchingTopViewAndIsBusy == touchAndBusy) { return; } - m_touchingTopViewAndIsBusy = touchAndBusy; - emit touchingTopViewAndIsBusyChanged(); + m_isTouchingTopViewAndIsBusy = touchAndBusy; + emit isTouchingTopViewAndIsBusyChanged(); } void View::preferredViewForShortcutsChangedSlot(Latte::View *view) diff --git a/app/view/view.h b/app/view/view.h index 0983f0e37..f2aa8ae09 100644 --- a/app/view/view.h +++ b/app/view/view.h @@ -87,8 +87,8 @@ class View : public PlasmaQuick::ContainmentView Q_PROPERTY(bool onPrimary READ onPrimary WRITE setOnPrimary NOTIFY onPrimaryChanged) //! values to be used from Smart surrounding Views - Q_PROPERTY(bool touchingBottomViewAndIsBusy READ touchingBottomViewAndIsBusy WRITE setTouchingBottomViewAndIsBusy NOTIFY touchingBottomViewAndIsBusyChanged) - Q_PROPERTY(bool touchingTopViewAndIsBusy READ touchingTopViewAndIsBusy WRITE setTouchingTopViewAndIsBusy NOTIFY touchingTopViewAndIsBusyChanged) + Q_PROPERTY(bool isTouchingBottomViewAndIsBusy READ isTouchingBottomViewAndIsBusy WRITE setIsTouchingBottomViewAndIsBusy NOTIFY isTouchingBottomViewAndIsBusyChanged) + Q_PROPERTY(bool isTouchingTopViewAndIsBusy READ isTouchingTopViewAndIsBusy WRITE setIsTouchingTopViewAndIsBusy NOTIFY isTouchingTopViewAndIsBusyChanged) Q_PROPERTY(int alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged) Q_PROPERTY(int fontPixelSize READ fontPixelSize WRITE setFontPixelSize NOTIFY fontPixelSizeChanged) @@ -153,11 +153,11 @@ public: bool latteTasksArePresent() const; void setLatteTasksArePresent(bool present); - bool touchingBottomViewAndIsBusy() const; - void setTouchingBottomViewAndIsBusy(bool touchAndBusy); + bool isTouchingBottomViewAndIsBusy() const; + void setIsTouchingBottomViewAndIsBusy(bool touchAndBusy); - bool touchingTopViewAndIsBusy() const; - void setTouchingTopViewAndIsBusy(bool touchAndBusy); + bool isTouchingTopViewAndIsBusy() const; + void setIsTouchingTopViewAndIsBusy(bool touchAndBusy); float maxLength() const; void setMaxLength(float length); @@ -264,6 +264,8 @@ signals: void inEditModeChanged(); void indicatorChanged(); void isPreferredForShortcutsChanged(); + void isTouchingBottomViewAndIsBusyChanged(); + void isTouchingTopViewAndIsBusyChanged(); void latteTasksArePresentChanged(); void layoutChanged(); void localGeometryChanged(); @@ -274,8 +276,6 @@ signals: void onPrimaryChanged(); void positionerChanged(); void screenGeometryChanged(); - void touchingBottomViewAndIsBusyChanged(); - void touchingTopViewAndIsBusyChanged(); void typeChanged(); void visibilityChanged(); void windowsTrackerChanged(); @@ -321,8 +321,8 @@ private: bool m_latteTasksArePresent{false}; bool m_onPrimary{true}; - bool m_touchingBottomViewAndIsBusy{false}; - bool m_touchingTopViewAndIsBusy{false}; + bool m_isTouchingBottomViewAndIsBusy{false}; + bool m_isTouchingTopViewAndIsBusy{false}; int m_fontPixelSize{ -1}; int m_editThickness{24}; diff --git a/app/view/windowstracker/currentscreentracker.cpp b/app/view/windowstracker/currentscreentracker.cpp index de9464ccd..a970ce5d6 100644 --- a/app/view/windowstracker/currentscreentracker.cpp +++ b/app/view/windowstracker/currentscreentracker.cpp @@ -90,6 +90,12 @@ void CurrentScreenTracker::init() } }); + connect(m_wm->windowsTracker(), &WindowSystem::Tracker::Windows::isTouchingBusyVerticalViewChanged, this, [&](const Latte::View *view) { + if (m_latteView == view) { + emit isTouchingBusyVerticalViewChanged(); + } + }); + connect(m_wm->windowsTracker(), &WindowSystem::Tracker::Windows::activeWindowSchemeChanged, this, [&](const Latte::View *view) { if (m_latteView == view) { emit activeWindowSchemeChanged(); @@ -147,6 +153,11 @@ bool CurrentScreenTracker::existsWindowTouching() const return m_wm->windowsTracker()->existsWindowTouching(m_latteView); } +bool CurrentScreenTracker::isTouchingBusyVerticalView() const +{ + return m_wm->windowsTracker()->isTouchingBusyVerticalView(m_latteView); +} + WindowSystem::SchemeColors *CurrentScreenTracker::activeWindowScheme() const { return m_wm->windowsTracker()->activeWindowScheme(m_latteView); diff --git a/app/view/windowstracker/currentscreentracker.h b/app/view/windowstracker/currentscreentracker.h index a585ea188..e2ee72dae 100644 --- a/app/view/windowstracker/currentscreentracker.h +++ b/app/view/windowstracker/currentscreentracker.h @@ -53,6 +53,7 @@ class CurrentScreenTracker : public QObject { Q_PROPERTY(bool existsWindowActive READ existsWindowActive NOTIFY existsWindowActiveChanged) Q_PROPERTY(bool existsWindowMaximized READ existsWindowMaximized NOTIFY existsWindowMaximizedChanged) Q_PROPERTY(bool existsWindowTouching READ existsWindowTouching NOTIFY existsWindowTouchingChanged) + Q_PROPERTY(bool isTouchingBusyVerticalView READ isTouchingBusyVerticalView NOTIFY isTouchingBusyVerticalViewChanged) Q_PROPERTY(Latte::WindowSystem::SchemeColors *activeWindowScheme READ activeWindowScheme NOTIFY activeWindowSchemeChanged) Q_PROPERTY(Latte::WindowSystem::SchemeColors *touchingWindowScheme READ touchingWindowScheme NOTIFY touchingWindowSchemeChanged) @@ -68,6 +69,8 @@ public: bool existsWindowMaximized() const; bool existsWindowTouching() const; + bool isTouchingBusyVerticalView() const; + WindowSystem::SchemeColors *activeWindowScheme() const; WindowSystem::SchemeColors *touchingWindowScheme() const; @@ -83,6 +86,8 @@ signals: void existsWindowActiveChanged(); void existsWindowMaximizedChanged(); void existsWindowTouchingChanged(); + void isTouchingBusyVerticalViewChanged(); + void activeWindowSchemeChanged(); void touchingWindowSchemeChanged(); diff --git a/app/wm/tracker/trackedviewinfo.cpp b/app/wm/tracker/trackedviewinfo.cpp index 6a60213c3..693a66fd6 100644 --- a/app/wm/tracker/trackedviewinfo.cpp +++ b/app/wm/tracker/trackedviewinfo.cpp @@ -74,6 +74,20 @@ void TrackedViewInfo::setExistsWindowTouching(bool touching) m_existsWindowTouching = touching; } +bool TrackedViewInfo::isTouchingBusyVerticalView() const +{ + return m_isTouchingBusyVerticalView; +} + +void TrackedViewInfo::setIsTouchingBusyVerticalView(bool touching) +{ + if (m_isTouchingBusyVerticalView == touching) { + return; + } + + m_isTouchingBusyVerticalView = touching; +} + QRect TrackedViewInfo::availableScreenGeometry() const { return m_availableScreenGeometry; diff --git a/app/wm/tracker/trackedviewinfo.h b/app/wm/tracker/trackedviewinfo.h index ddaf3102d..6ddaa6ab9 100644 --- a/app/wm/tracker/trackedviewinfo.h +++ b/app/wm/tracker/trackedviewinfo.h @@ -56,6 +56,9 @@ public: bool existsWindowTouching() const; void setExistsWindowTouching(bool touching); + bool isTouchingBusyVerticalView() const; + void setIsTouchingBusyVerticalView(bool touching); + QRect availableScreenGeometry() const; void setAvailableScreenGeometry(QRect geometry); @@ -67,8 +70,9 @@ public: bool isTracking(const WindowInfoWrap &winfo) const override; private: - bool m_activeWindowTouching; - bool m_existsWindowTouching; + bool m_activeWindowTouching{false}; + bool m_existsWindowTouching{false}; + bool m_isTouchingBusyVerticalView{false}; QRect m_availableScreenGeometry; diff --git a/app/wm/tracker/windowstracker.cpp b/app/wm/tracker/windowstracker.cpp index 1955488a3..b863da8ac 100644 --- a/app/wm/tracker/windowstracker.cpp +++ b/app/wm/tracker/windowstracker.cpp @@ -42,6 +42,11 @@ Windows::Windows(AbstractWindowInterface *parent) { m_wm = parent; + m_extraViewHintsTimer.setInterval(600); + m_extraViewHintsTimer.setSingleShot(true); + + connect(&m_extraViewHintsTimer, &QTimer::timeout, this, &Windows::updateExtraViewHints); + init(); } @@ -143,6 +148,7 @@ void Windows::initViewHints(Latte::View *view) setExistsWindowActive(view, false); setExistsWindowTouching(view, false); setExistsWindowMaximized(view, false); + setIsTouchingBusyVerticalView(view, false); setActiveWindowScheme(view, nullptr); setTouchingWindowScheme(view, nullptr); } @@ -170,6 +176,9 @@ void Windows::addView(Latte::View *view) addRelevantLayout(view); }); + connect(view, &Latte::View::isTouchingBottomViewAndIsBusy, this, &Windows::updateExtraViewHints); + connect(view, &Latte::View::isTouchingTopViewAndIsBusy, this, &Windows::updateExtraViewHints); + updateAllHints(); emit informationAnnounced(view); @@ -369,6 +378,25 @@ void Windows::setExistsWindowTouching(Latte::View *view, bool windowTouching) emit existsWindowTouchingChanged(view); } +bool Windows::isTouchingBusyVerticalView(Latte::View *view) const +{ + if (!m_views.contains(view)) { + return false; + } + + return m_views[view]->isTouchingBusyVerticalView(); +} + +void Windows::setIsTouchingBusyVerticalView(Latte::View *view, bool viewTouching) +{ + if (!m_views.contains(view) || m_views[view]->isTouchingBusyVerticalView() == viewTouching) { + return; + } + + m_views[view]->setIsTouchingBusyVerticalView(viewTouching); + emit isTouchingBusyVerticalViewChanged(view); +} + SchemeColors *Windows::activeWindowScheme(Latte::View *view) const { if (!m_views.contains(view)) { @@ -720,6 +748,45 @@ void Windows::updateAllHints() for (const auto layout : m_layouts.keys()) { updateHints(layout); } + + if (!m_extraViewHintsTimer.isActive()) { + m_extraViewHintsTimer.start(); + } +} + +void Windows::updateExtraViewHints() +{ + for (const auto horView : m_views.keys()) { + if (!m_views.contains(horView) || !m_views[horView]->enabled() || !m_views[horView]->isTrackingCurrentActivity()) { + continue; + } + + if (horView->formFactor() == Plasma::Types::Horizontal) { + bool touchingBusyVerticalView{false}; + + for (const auto verView : m_views.keys()) { + if (!m_views.contains(verView) || !m_views[verView]->enabled() || !m_views[verView]->isTrackingCurrentActivity()) { + continue; + } + + bool sameScreen = (verView->positioner()->currentScreenId() == horView->positioner()->currentScreenId()); + + if (verView->formFactor() == Plasma::Types::Vertical && sameScreen) { + bool topTouch = verView->isTouchingTopViewAndIsBusy() && horView->location() == Plasma::Types::TopEdge; + bool bottomTouch = verView->isTouchingBottomViewAndIsBusy() && horView->location() == Plasma::Types::BottomEdge; + + if (topTouch || bottomTouch) { + touchingBusyVerticalView = true; + break; + } + } + } + + //qDebug() << " Touching Busy Vertical View :: " << horView->location() << " - " << horView->positioner()->currentScreenId() << " :: " << touchingBusyVerticalView; + + setIsTouchingBusyVerticalView(horView, touchingBusyVerticalView); + } + } } void Windows::updateHints(Latte::View *view) diff --git a/app/wm/tracker/windowstracker.h b/app/wm/tracker/windowstracker.h index c95e068a4..7b32478cd 100644 --- a/app/wm/tracker/windowstracker.h +++ b/app/wm/tracker/windowstracker.h @@ -28,6 +28,7 @@ #include #include +#include namespace Latte { class View; @@ -68,6 +69,7 @@ public: bool existsWindowActive(Latte::View *view) const; bool existsWindowMaximized(Latte::View *view) const; bool existsWindowTouching(Latte::View *view) const; + bool isTouchingBusyVerticalView(Latte::View *view) const; SchemeColors *activeWindowScheme(Latte::View *view) const; SchemeColors *touchingWindowScheme(Latte::View *view) const; LastActiveWindow *lastActiveWindow(Latte::View *view); @@ -98,6 +100,7 @@ signals: void existsWindowActiveChanged(const Latte::View *view); void existsWindowMaximizedChanged(const Latte::View *view); void existsWindowTouchingChanged(const Latte::View *view); + void isTouchingBusyVerticalViewChanged(const Latte::View *view); void activeWindowSchemeChanged(const Latte::View *view); void touchingWindowSchemeChanged(const Latte::View *view); void informationAnnounced(const Latte::View *view); @@ -122,6 +125,7 @@ private slots: void addRelevantLayout(Latte::View *view); void updateRelevantLayouts(); + void updateExtraViewHints(); private: void init(); @@ -140,6 +144,7 @@ private: void setExistsWindowActive(Latte::View *view, bool windowActive); void setExistsWindowMaximized(Latte::View *view, bool windowMaximized); void setExistsWindowTouching(Latte::View *view, bool windowTouching); + void setIsTouchingBusyVerticalView(Latte::View *view, bool viewTouching); void setActiveWindowScheme(Latte::View *view, WindowSystem::SchemeColors *scheme); void setTouchingWindowScheme(Latte::View *view, WindowSystem::SchemeColors *scheme); @@ -159,6 +164,10 @@ private: bool isTouchingViewEdge(Latte::View *view, const WindowInfoWrap &winfo); private: + //! a timer in order to not overload the views extra hints checking because it is not + //! really needed that often + QTimer m_extraViewHintsTimer; + AbstractWindowInterface *m_wm; QHash m_views; QHash m_layouts; diff --git a/containment/package/contents/ui/PanelBox.qml b/containment/package/contents/ui/PanelBox.qml index e881ae83d..a2c2e8357 100644 --- a/containment/package/contents/ui/PanelBox.qml +++ b/containment/package/contents/ui/PanelBox.qml @@ -366,7 +366,8 @@ Item{ //! When switching from overlaied background to regular one this must be done //! instantly otherwise the transition is not smooth - readonly property bool paintInstantly: root.hasExpandedApplet && root.plasmaBackgroundForPopups + readonly property bool paintInstantly: (root.hasExpandedApplet && root.plasmaBackgroundForPopups) + || root.plasmaStyleBusyForTouchingBusyVerticalView property rect efGeometry: Qt.rect(-1,-1,0,0) diff --git a/containment/package/contents/ui/VisibilityManager.qml b/containment/package/contents/ui/VisibilityManager.qml index 7edf09863..9aaeb2b68 100644 --- a/containment/package/contents/ui/VisibilityManager.qml +++ b/containment/package/contents/ui/VisibilityManager.qml @@ -182,7 +182,7 @@ Item{ Binding{ target: latteView - property: "touchingTopViewAndIsBusy" + property: "isTouchingTopViewAndIsBusy" when: latteView value: { var isTouchingTopScreenEdge = (latteView.y === latteView.screenGeometry.y); @@ -194,7 +194,7 @@ Item{ Binding{ target: latteView - property: "touchingBottomViewAndIsBusy" + property: "isTouchingBottomViewAndIsBusy" when: latteView value: { var latteBottom = latteView.y + latteView.height; diff --git a/containment/package/contents/ui/colorizer/Manager.qml b/containment/package/contents/ui/colorizer/Manager.qml index 7ab2fef2b..a165bb3a3 100644 --- a/containment/package/contents/ui/colorizer/Manager.qml +++ b/containment/package/contents/ui/colorizer/Manager.qml @@ -91,6 +91,7 @@ Loader{ if (themeExtended) { if (root.userShowPanelBackground && root.plasmaBackgroundForPopups && root.hasExpandedApplet /*for expanded popups when it is enabled*/ + || root.plasmaStyleBusyForTouchingBusyVerticalView || (root.themeColors === Latte.Types.SmartThemeColors /*for Smart theming that Windows colors are not used and the user wants solidness at some cases*/ && root.windowColors === Latte.Types.NoneWindowColors && root.forceSolidPanel) ) { diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index 5ec431acf..47af1713f 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -134,6 +134,8 @@ Item { && !(hasExpandedApplet && !plasmaBackgroundForPopups) && latteView.windowsTracker.currentScreen.existsWindowTouching) || (hasExpandedApplet && plasmaBackgroundForPopups) )) + || solidBusyForTouchingBusyVerticalView + || plasmaStyleBusyForTouchingBusyVerticalView || !Latte.WindowSystem.compositingActive property bool forceTransparentPanel: root.backgroundOnlyOnMaximized @@ -144,10 +146,30 @@ Item { && !(windowColors === Latte.Types.TouchingWindowColors && latteView.windowsTracker.currentScreen.activeWindowTouching) && !(windowColors === Latte.Types.ActiveWindowColors && selectedWindowsTracker.existsWindowActive) - property bool forcePanelForBusyBackground: userShowPanelBackground - && root.forceTransparentPanel - && (root.themeColors === Latte.Types.SmartThemeColors) - && colorizerManager.backgroundIsBusy + property bool forcePanelForBusyBackground: userShowPanelBackground && (root.themeColors === Latte.Types.SmartThemeColors) + && ( (root.forceTransparentPanel && colorizerManager.backgroundIsBusy) + || normalBusyForTouchingBusyVerticalView ) + + property bool normalBusyForTouchingBusyVerticalView: (latteView && latteView.windowsTracker /*is touching a vertical view that is in busy state and the user prefers isBusy transparency*/ + && latteView.windowsTracker.currentScreen.isTouchingBusyVerticalView + && root.themeColors === Latte.Types.SmartThemeColors + && plasmoid.configuration.backgroundOnlyOnMaximized + && !plasmoid.configuration.solidBackgroundForMaximized + && !plasmaBackgroundForPopups) + + property bool solidBusyForTouchingBusyVerticalView: (latteView && latteView.windowsTracker /*is touching a vertical view that is in busy state and the user prefers solidness*/ + && latteView.windowsTracker.currentScreen.isTouchingBusyVerticalView + && root.themeColors === Latte.Types.SmartThemeColors + && plasmoid.configuration.backgroundOnlyOnMaximized + && plasmoid.configuration.solidBackgroundForMaximized + && !plasmaBackgroundForPopups) + + property bool plasmaStyleBusyForTouchingBusyVerticalView: (latteView && latteView.windowsTracker /*is touching a vertical view that is in busy state and the user prefers solidness*/ + && latteView.windowsTracker.currentScreen.isTouchingBusyVerticalView + && root.themeColors === Latte.Types.SmartThemeColors + && plasmoid.configuration.backgroundOnlyOnMaximized + && plasmaBackgroundForPopups) + property int themeColors: plasmoid.configuration.themeColors property int windowColors: plasmoid.configuration.windowColors From 8058778a934e6babe625e8623f426e5c93d262b8 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sat, 3 Aug 2019 08:55:31 +0300 Subject: [PATCH 30/55] initialy support only one case for busyVerticals --- containment/package/contents/ui/main.qml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index 47af1713f..f25988bec 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -154,21 +154,23 @@ Item { && latteView.windowsTracker.currentScreen.isTouchingBusyVerticalView && root.themeColors === Latte.Types.SmartThemeColors && plasmoid.configuration.backgroundOnlyOnMaximized - && !plasmoid.configuration.solidBackgroundForMaximized - && !plasmaBackgroundForPopups) + /*&& !plasmoid.configuration.solidBackgroundForMaximized + && !plasmaBackgroundForPopups*/) - property bool solidBusyForTouchingBusyVerticalView: (latteView && latteView.windowsTracker /*is touching a vertical view that is in busy state and the user prefers solidness*/ - && latteView.windowsTracker.currentScreen.isTouchingBusyVerticalView + property bool solidBusyForTouchingBusyVerticalView: false //DISABLED, until to check if the normalBusyForTouchingBusyVerticalView is enough to catch and handle the case + /*(latteView && latteView.windowsTracker /*is touching a vertical view that is in busy state and the user prefers solidness*/ + /* && latteView.windowsTracker.currentScreen.isTouchingBusyVerticalView && root.themeColors === Latte.Types.SmartThemeColors && plasmoid.configuration.backgroundOnlyOnMaximized && plasmoid.configuration.solidBackgroundForMaximized - && !plasmaBackgroundForPopups) + && !plasmaBackgroundForPopups)*/ - property bool plasmaStyleBusyForTouchingBusyVerticalView: (latteView && latteView.windowsTracker /*is touching a vertical view that is in busy state and the user prefers solidness*/ - && latteView.windowsTracker.currentScreen.isTouchingBusyVerticalView + property bool plasmaStyleBusyForTouchingBusyVerticalView: false //DISABLED, until to check if the normalBusyForTouchingBusyVerticalView is enough to catch and handle the case + //(latteView && latteView.windowsTracker /*is touching a vertical view that is in busy state and the user prefers solidness*/ + /* && latteView.windowsTracker.currentScreen.isTouchingBusyVerticalView && root.themeColors === Latte.Types.SmartThemeColors && plasmoid.configuration.backgroundOnlyOnMaximized - && plasmaBackgroundForPopups) + && plasmaBackgroundForPopups)*/ property int themeColors: plasmoid.configuration.themeColors From ed3a42b8275a0dbe5b555476ff5841523650d1e7 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 4 Aug 2019 14:52:27 +0300 Subject: [PATCH 31/55] update Changelog for v0.9.1 --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72e31ae8a..58f37d689 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ #**CHANGELOG**# +#### Version 0.9.1 + +* improve: when preview windows left click action is used then for single windows is just activating them without triggering the preview window +* improve: consider the case when a horizontal and a vertical Latte dock/panel are touching each other and the vertical one is isBusy desktop background case, in such case the horizontal view is also changing to isBusy state +* fix: blurred icons for items size that should not be blurred e.g. 48px and >=64px +* fix: geometries calculation under !compositing environment +* fix: forward pressed/released event to applets even when parabolic effect is enabled. The issue was pretty obvious with lock/logout plasma applet +* fix: update progress badge properly +* fix: tasks icons pixelization when are dragged +* fix: wayland, show preview window for grouped tasks when clicked + + #### Version 0.9.0 * Smart Coloring From 6cc09eae4b5ffd2e0429089a7fbd75f88279cda0 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 4 Aug 2019 14:54:45 +0300 Subject: [PATCH 32/55] update to v0.9.1 --- CMakeLists.txt | 2 +- containment/package/metadata.desktop | 2 +- plasmoid/package/metadata.desktop | 2 +- shell/package/metadata.desktop | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9732b295e..e2f541c9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ project(lattedock) cmake_minimum_required(VERSION 3.0 FATAL_ERROR) set(CMAKE_CXX_STANDARD 14) -set(VERSION 0.9.0) +set(VERSION 0.9.1) set(AUTHOR "Michail Vourlakos, Smith Ar") set(EMAIL "mvourlakos@gmail.com, audoban@openmailbox.org") set(WEBSITE "https://github.com/psifidotos/Latte-Dock") diff --git a/containment/package/metadata.desktop b/containment/package/metadata.desktop index e7935b551..cf67f69e2 100644 --- a/containment/package/metadata.desktop +++ b/containment/package/metadata.desktop @@ -59,7 +59,7 @@ NoDisplay=true X-KDE-PluginInfo-Author=Michail Vourlakos, Smith Ar X-KDE-PluginInfo-Email=mvourlakos@gmail.com, audoban@openmailbox.org X-KDE-PluginInfo-Name=org.kde.latte.containment -X-KDE-PluginInfo-Version=0.9.0 +X-KDE-PluginInfo-Version=0.9.1 X-KDE-PluginInfo-Website=https://github.com/psifidotos/Latte-Dock X-KDE-PluginInfo-Category=X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-License=GPL diff --git a/plasmoid/package/metadata.desktop b/plasmoid/package/metadata.desktop index e9a5325da..c0e1cb8c7 100644 --- a/plasmoid/package/metadata.desktop +++ b/plasmoid/package/metadata.desktop @@ -49,7 +49,7 @@ X-Plasma-Provides=org.kde.plasma.multitasking X-KDE-PluginInfo-Author=Michail Vourlakos, Smith Ar X-KDE-PluginInfo-Email=mvourlakos@gmail.com, audoban@openmailbox.org X-KDE-PluginInfo-Name=org.kde.latte.plasmoid -X-KDE-PluginInfo-Version=0.9.0 +X-KDE-PluginInfo-Version=0.9.1 X-KDE-PluginInfo-Website=https://github.com/psifidotos/Latte-Dock X-KDE-PluginInfo-Category=Windows and Tasks X-KDE-PluginInfo-Depends=X-KDE-PluginInfo-License=GPL v2+ diff --git a/shell/package/metadata.desktop b/shell/package/metadata.desktop index c5a90e0d8..a0c382af4 100644 --- a/shell/package/metadata.desktop +++ b/shell/package/metadata.desktop @@ -86,5 +86,5 @@ X-KDE-PluginInfo-Author=Michail Vourlakos, Smith Ar X-KDE-PluginInfo-Email=mvourlakos@gmail.com, audoban@openmailbox.org X-KDE-PluginInfo-License=GPLv3+ X-KDE-PluginInfo-Name=org.kde.latte.shell -X-KDE-PluginInfo-Version=0.9.0 +X-KDE-PluginInfo-Version=0.9.1 X-KDE-PluginInfo-Website=https://github.com/psifidotos/Latte-Dock From 8a9224ed3c05b2df2b3e0d28308ba94ec109d7cb Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Wed, 7 Aug 2019 17:06:28 +0300 Subject: [PATCH 33/55] enable highlighting effect for plasma indicator BUG: 410695 --- indicators/org.kde.latte.plasma/package/ui/main.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indicators/org.kde.latte.plasma/package/ui/main.qml b/indicators/org.kde.latte.plasma/package/ui/main.qml index b5c7d650c..54c70a7c9 100644 --- a/indicators/org.kde.latte.plasma/package/ui/main.qml +++ b/indicators/org.kde.latte.plasma/package/ui/main.qml @@ -29,7 +29,7 @@ LatteComponents.IndicatorItem { needsMouseEventCoordinates: true providesClickedAnimation: clickedAnimationEnabled - providesHoveredAnimation: true + //providesHoveredAnimation: true providesFrontLayer: true svgImagePaths: ["widgets/tasks"] From bf66aa35a75d65c04f527db41dea2d92d57f18b3 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Thu, 8 Aug 2019 09:46:23 +0300 Subject: [PATCH 34/55] update struts when normalThickness value changes --the issue was pretty obvious when the user was using a top view with thickness < 24px. and a bottom view always visible. In that case the top view struts on startup did not decrease below at 24px. BUG:410707 --- app/view/visibilitymanager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/view/visibilitymanager.cpp b/app/view/visibilitymanager.cpp index 932458292..5259d996e 100644 --- a/app/view/visibilitymanager.cpp +++ b/app/view/visibilitymanager.cpp @@ -177,14 +177,17 @@ void VisibilityManager::setMode(Latte::Types::Visibility mode) updateStrutsBasedOnLayoutsAndActivities(); } + m_connections[base] = connect(m_latteView, &Latte::View::normalThicknessChanged, this, [&]() { + updateStrutsBasedOnLayoutsAndActivities(); + }); - m_connections[base] = connect(m_corona->layoutsManager(), &Layouts::Manager::currentLayoutNameChanged, this, [&]() { + m_connections[base+1] = connect(m_corona->layoutsManager(), &Layouts::Manager::currentLayoutNameChanged, this, [&]() { if (m_corona && m_corona->layoutsManager()->memoryUsage() == Types::MultipleLayouts) { updateStrutsBasedOnLayoutsAndActivities(true); } }); - m_connections[base+1] = connect(m_latteView, &Latte::View::activitiesChanged, this, [&]() { + m_connections[base+2] = connect(m_latteView, &Latte::View::activitiesChanged, this, [&]() { if (m_corona && m_corona->layoutsManager()->memoryUsage() == Types::MultipleLayouts) { updateStrutsBasedOnLayoutsAndActivities(true); } From 289429185b81653cd1fae2f98cd3131d86f3efe1 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Thu, 8 Aug 2019 16:36:53 +0300 Subject: [PATCH 35/55] hacky flag to keep Latte behavior for zoom=1 --if some users want to keep the Latte specific behavior when the zoom factor = 1 then it can just LOCK these applets BUG:410695 --- containment/package/contents/ui/applet/AppletItem.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/containment/package/contents/ui/applet/AppletItem.qml b/containment/package/contents/ui/applet/AppletItem.qml index 834fae9b4..8590a84e5 100644 --- a/containment/package/contents/ui/applet/AppletItem.qml +++ b/containment/package/contents/ui/applet/AppletItem.qml @@ -116,7 +116,7 @@ Item { ||((index === layoutsContainer.endLayout.beginIndex+layoutsContainer.endLayout.count-1)&&(layoutsContainer.endLayout.count>1))) readonly property bool acceptMouseEvents: applet && !isLattePlasmoid && !originalAppletBehavior && !appletItem.isSeparator && !communicator.parabolicEffectLocked - readonly property bool originalAppletBehavior: root.zoomFactor === 1 + readonly property bool originalAppletBehavior: (root.zoomFactor === 1 && !lockZoom /*hacky flag to keep Latte behavior*/) || (root.zoomFactor>1 && !canBeHovered) || (root.zoomFactor>1 && canBeHovered && lockZoom) From 47e8af0eabf4758cd5a05576ac9bdbf9e8a7af6a Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Thu, 8 Aug 2019 16:42:10 +0300 Subject: [PATCH 36/55] user can now change title tooltips at all times --previously the user when the zoom factor was 1.0 the title tooltips was disabled. BUT as it appers there are plenty of cases that title tooltips can be shown when zoom factor = 1.0 so the user it is better to choose if wants them or not. --- shell/package/contents/configuration/pages/BehaviorConfig.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/package/contents/configuration/pages/BehaviorConfig.qml b/shell/package/contents/configuration/pages/BehaviorConfig.qml index 486008f9a..b11cb3c27 100644 --- a/shell/package/contents/configuration/pages/BehaviorConfig.qml +++ b/shell/package/contents/configuration/pages/BehaviorConfig.qml @@ -674,7 +674,7 @@ PlasmaComponents.Page { text: i18n("Show title tooltips on hovering") tooltip: i18n("Show thinner tooltips produced by Latte for items.\nThese tooltips are not drawn when applets zoom effect is disabled"); checked: plasmoid.configuration.titleTooltips - enabled: plasmoid.configuration.zoomLevel > 0 + //enabled: plasmoid.configuration.zoomLevel > 0 onClicked: { plasmoid.configuration.titleTooltips = !plasmoid.configuration.titleTooltips; From f449e22943f5f08de90ecaeebd028f32e6551483 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Thu, 15 Aug 2019 13:06:25 +0300 Subject: [PATCH 37/55] dont hide icons/applets for software rendering --when qml software rendering is enabled the ShaderEffects do not work. Hiding sources in that case is hiding from the user tasks and applets with no visual feedback. Sources in that case should hide themeselves and give the user the minimum which is the original drawn contents. BUG:410920 FIXED-IN:0.9.2 --- containment/package/contents/ui/applet/ItemWrapper.qml | 7 +++---- .../package/contents/ui/applet/colorizer/Applet.qml | 3 +++ plasmoid/package/contents/ui/task/IconItem.qml | 4 +++- plasmoid/package/contents/ui/task/TaskItem.qml | 3 ++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/containment/package/contents/ui/applet/ItemWrapper.qml b/containment/package/contents/ui/applet/ItemWrapper.qml index 461411e30..c7ca8937a 100644 --- a/containment/package/contents/ui/applet/ItemWrapper.qml +++ b/containment/package/contents/ui/applet/ItemWrapper.qml @@ -95,7 +95,7 @@ Item{ } } - opacity: appletColorizer.mustBeShown ? 0 : 1 + opacity: appletColorizer.mustBeShown && appletColorizer.isCompiled ? 0 : 1 property bool disableScaleWidth: false property bool disableScaleHeight: false @@ -444,8 +444,7 @@ Item{ } - opacity: appletShadow.active ? 0 : 1 - + opacity: appletShadow.active && (appletShadow.item.status === ShaderEffect.Compiled) ? 0 : 1 anchors.centerIn: parent ///Secret MouseArea to be used by the folder widget @@ -562,7 +561,7 @@ Item{ || (root.forceTransparentPanel && plasmoid.configuration.shadows>0 && applet.pluginName !== root.plasmoidName)) /*on forced transparent state*/ onActiveChanged: { - if (active && !isSeparator) { + if (active && !isSeparator && item.status === ShaderEffect.Compiled) { wrapperContainer.opacity = 0; } else { wrapperContainer.opacity = 1; diff --git a/containment/package/contents/ui/applet/colorizer/Applet.qml b/containment/package/contents/ui/applet/colorizer/Applet.qml index 748ce69ee..6fb7061c8 100644 --- a/containment/package/contents/ui/applet/colorizer/Applet.qml +++ b/containment/package/contents/ui/applet/colorizer/Applet.qml @@ -24,6 +24,9 @@ import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.core 2.0 as PlasmaCore Item { + readonly property bool isCompiled: !colorizedAppletShadow.active + || (colorizedAppletShadow.active && colorizedAppletShadow.item.status === ShaderEffect.Compiled) + ColorOverlay { id: colorizer anchors.fill: parent diff --git a/plasmoid/package/contents/ui/task/IconItem.qml b/plasmoid/package/contents/ui/task/IconItem.qml index 3c9383e41..3e1ea2f0f 100644 --- a/plasmoid/package/contents/ui/task/IconItem.qml +++ b/plasmoid/package/contents/ui/task/IconItem.qml @@ -159,7 +159,9 @@ Item{ smooth: root.zoomFactor === 1 ? true : false providesColors: indicators ? indicators.info.needsIconColors : false - opacity: root.enableShadows ? 0 : 1 + opacity: root.enableShadows + && taskWithShadow.active + && (taskWithShadow.item.status === ShaderEffect.Compiled) ? 0 : 1 visible: !taskItem.isSeparator && !badgesLoader.active diff --git a/plasmoid/package/contents/ui/task/TaskItem.qml b/plasmoid/package/contents/ui/task/TaskItem.qml index 5565dca16..425b9758e 100644 --- a/plasmoid/package/contents/ui/task/TaskItem.qml +++ b/plasmoid/package/contents/ui/task/TaskItem.qml @@ -306,7 +306,8 @@ MouseArea{ id:separatorItem anchors.centerIn: parent - opacity: separatorShadow.active || forceHiddenState ? 0 : 0.4 + opacity: (separatorShadow.active && (separatorShadow.item.status === ShaderEffect.Compiled)) + || forceHiddenState ? 0 : 0.4 visible: taskItem.isSeparator width: root.vertical ? root.iconSize : (root.dragSource || root.editMode) ? 5+root.lengthMargins: 1 From 1bec03ec8a79e35ac093e467b659ba8f884f0035 Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Sat, 17 Aug 2019 08:39:22 +0200 Subject: [PATCH 38/55] SVN_SILENT made messages (.desktop file) - always resolve ours In case of conflict in i18n, keep the version of the branch "ours" To resolve a particular conflict, "git checkout --ours path/to/file.desktop" --- app/latte-indicators.knsrc | 1 + app/packageplugins/indicator/latte-indicator.desktop | 1 + .../indicator/latte-packagestructure-indicator.desktop | 1 + indicators/default/metadata.desktop | 1 + indicators/org.kde.latte.plasma/metadata.desktop | 1 + plasmoid/metadata.desktop.cmake | 2 ++ plasmoid/package/metadata.desktop | 2 ++ 7 files changed, 9 insertions(+) diff --git a/app/latte-indicators.knsrc b/app/latte-indicators.knsrc index 3e0eace0f..c803b7631 100644 --- a/app/latte-indicators.knsrc +++ b/app/latte-indicators.knsrc @@ -18,6 +18,7 @@ Name[ru]=Индикаторы Latte Name[sv]=Latte indikatorer Name[uk]=Індикатори Латте Name[x-test]=xxLatte Indicatorsxx +Name[zh_CN]=Latte 指示器 Name[zh_TW]=Latte 指示器 ProvidersUrl=https://download.kde.org/ocs/providers.xml diff --git a/app/packageplugins/indicator/latte-indicator.desktop b/app/packageplugins/indicator/latte-indicator.desktop index 387ce8dcd..2c8f5f933 100644 --- a/app/packageplugins/indicator/latte-indicator.desktop +++ b/app/packageplugins/indicator/latte-indicator.desktop @@ -21,6 +21,7 @@ Comment[ru]=Индикатор Latte Comment[sv]=Latte indikator Comment[uk]=Індикатор Латте Comment[x-test]=xxLatte indicatorxx +Comment[zh_CN]=Latte 任务指示器 Comment[zh_TW]=Latte 指示器 [PropertyDef::X-Latte-API] diff --git a/app/packageplugins/indicator/latte-packagestructure-indicator.desktop b/app/packageplugins/indicator/latte-packagestructure-indicator.desktop index 55c9a9fd8..9d6a6114b 100644 --- a/app/packageplugins/indicator/latte-packagestructure-indicator.desktop +++ b/app/packageplugins/indicator/latte-packagestructure-indicator.desktop @@ -18,6 +18,7 @@ Name[ru]=Индикатор Name[sv]=Indikator Name[uk]=Індикатор Name[x-test]=xxIndicatorxx +Name[zh_CN]=任务指示器 Name[zh_TW]=指示器 Type=Service X-KDE-ServiceTypes=KPackage/PackageStructure diff --git a/indicators/default/metadata.desktop b/indicators/default/metadata.desktop index 0d59e7a48..55f7ea32f 100644 --- a/indicators/default/metadata.desktop +++ b/indicators/default/metadata.desktop @@ -45,6 +45,7 @@ Comment[ru]=Индикатор Latte умолчанию Comment[sv]=Latte standardindikator Comment[uk]=Типовий індикатор Латте Comment[x-test]=xxLatte default indicatorxx +Comment[zh_CN]=Latte 默认任务指示器 Comment[zh_TW]=Latte 預設指示器 Encoding=UTF-8 diff --git a/indicators/org.kde.latte.plasma/metadata.desktop b/indicators/org.kde.latte.plasma/metadata.desktop index 6a8b0b5e4..5be765a0c 100644 --- a/indicators/org.kde.latte.plasma/metadata.desktop +++ b/indicators/org.kde.latte.plasma/metadata.desktop @@ -42,6 +42,7 @@ Comment[ru]=Индикатор Latte в стиле Plasma Comment[sv]=Latte Plasmastilindikator Comment[uk]=Індикатор стилю Плазми Латте Comment[x-test]=xxLatte Plasma style indicatorxx +Comment[zh_CN]=Latte Plasma 样式指示器 Comment[zh_TW]=Latte Plasma 樣式指示器 Encoding=UTF-8 diff --git a/plasmoid/metadata.desktop.cmake b/plasmoid/metadata.desktop.cmake index 4e61294b9..a8e2a03b2 100644 --- a/plasmoid/metadata.desktop.cmake +++ b/plasmoid/metadata.desktop.cmake @@ -18,6 +18,7 @@ Name[ru]=Процессы Latte Name[sv]=Latte aktiviteter Name[uk]=Завдання Латте Name[x-test]=xxLatte Tasksxx +Name[zh_CN]=Latte 任务管理器 Name[zh_TW]=Latte 任務 Comment=Tasks plasmoid from Latte Dock Comment[ca]=Plasmoide de tasques del Latte Dock @@ -38,6 +39,7 @@ Comment[ru]=Виджет процессов из Latte Dock Comment[sv]=Aktivitetsplasmoid för Latte dockningsfönster Comment[uk]=Плазмоїд завдань з панелі Латте Comment[x-test]=xxTasks plasmoid from Latte Dockxx +Comment[zh_CN]=Latte 停靠栏的任务管理 Plasma 部件 Comment[zh_TW]=來自 Latte Dock 的任務 Plasmoid Type=Service diff --git a/plasmoid/package/metadata.desktop b/plasmoid/package/metadata.desktop index c0e1cb8c7..f4d277b40 100644 --- a/plasmoid/package/metadata.desktop +++ b/plasmoid/package/metadata.desktop @@ -18,6 +18,7 @@ Name[ru]=Процессы Latte Name[sv]=Latte aktiviteter Name[uk]=Завдання Латте Name[x-test]=xxLatte Tasksxx +Name[zh_CN]=Latte 任务管理器 Name[zh_TW]=Latte 任務 Comment=Tasks plasmoid from Latte Dock Comment[ca]=Plasmoide de tasques del Latte Dock @@ -38,6 +39,7 @@ Comment[ru]=Виджет процессов из Latte Dock Comment[sv]=Aktivitetsplasmoid för Latte dockningsfönster Comment[uk]=Плазмоїд завдань з панелі Латте Comment[x-test]=xxTasks plasmoid from Latte Dockxx +Comment[zh_CN]=Latte 停靠栏的任务管理 Plasma 部件 Comment[zh_TW]=來自 Latte Dock 的任務 Plasmoid Type=Service From 3fb020624312ffa397e06d1e58b1c687a8c8ca50 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Thu, 22 Aug 2019 11:11:15 +0300 Subject: [PATCH 39/55] reverse scrolling for vds/activities switching --Latte should use the same workflow paradigm for switching vds and activities with the plasma pager approach. This commit complies with this. BUG:411086 FIXED-IN:0.9.2 --- .../package/contents/ui/layouts/EnvironmentActions.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/containment/package/contents/ui/layouts/EnvironmentActions.qml b/containment/package/contents/ui/layouts/EnvironmentActions.qml index 04a8663fe..05fb3081c 100644 --- a/containment/package/contents/ui/layouts/EnvironmentActions.qml +++ b/containment/package/contents/ui/layouts/EnvironmentActions.qml @@ -126,17 +126,17 @@ Loader { if (angle>10) { if (root.scrollAction === Latte.Types.ScrollDesktops) { - latteView.windowsTracker.switchToNextVirtualDesktop(); + latteView.windowsTracker.switchToPreviousVirtualDesktop(); } else if (root.scrollAction === Latte.Types.ScrollActivities) { - latteView.windowsTracker.switchToNextActivity(); + latteView.windowsTracker.switchToPreviousActivity(); } else if (tasksLoader.active) { tasksLoader.item.activateNextPrevTask(true); } } else if (angle<-10) { if (root.scrollAction === Latte.Types.ScrollDesktops) { - latteView.windowsTracker.switchToPreviousVirtualDesktop(); + latteView.windowsTracker.switchToNextVirtualDesktop(); } else if (root.scrollAction === Latte.Types.ScrollActivities) { - latteView.windowsTracker.switchToPreviousActivity(); + latteView.windowsTracker.switchToNextActivity(); } else if (tasksLoader.active) { tasksLoader.item.activateNextPrevTask(false); } From 784dfd1bf95506778bfc305d4ac91f654657eac6 Mon Sep 17 00:00:00 2001 From: Yuri Chornoivan Date: Sun, 18 Aug 2019 12:57:06 +0300 Subject: [PATCH 40/55] Try to fix build with Clang --- app/view/visibilitymanager.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/view/visibilitymanager.h b/app/view/visibilitymanager.h index 85812feab..d34a00ac6 100644 --- a/app/view/visibilitymanager.h +++ b/app/view/visibilitymanager.h @@ -21,6 +21,8 @@ #ifndef VISIBILITYMANAGER_H #define VISIBILITYMANAGER_H +#include + // local #include "../plasma/quick/containmentview.h" #include "../../liblatte2/types.h" From e643109d0fdddfff22a45b057789bae8a6622726 Mon Sep 17 00:00:00 2001 From: Yuri Chornoivan Date: Sun, 18 Aug 2019 13:04:57 +0300 Subject: [PATCH 41/55] Try to fix build with Clang (take 2) --- app/settings/delegates/persistentmenu.cpp | 2 +- app/settings/delegates/persistentmenu.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/settings/delegates/persistentmenu.cpp b/app/settings/delegates/persistentmenu.cpp index 89a1f190b..0cc3daba4 100644 --- a/app/settings/delegates/persistentmenu.cpp +++ b/app/settings/delegates/persistentmenu.cpp @@ -20,7 +20,7 @@ #include "persistentmenu.h" -PersistentMenu::PersistentMenu(QWidget *parent = 0) +PersistentMenu::PersistentMenu(QWidget *parent) : QMenu (parent), m_blockHide(false) { diff --git a/app/settings/delegates/persistentmenu.h b/app/settings/delegates/persistentmenu.h index faa3b9615..a122e8926 100644 --- a/app/settings/delegates/persistentmenu.h +++ b/app/settings/delegates/persistentmenu.h @@ -28,7 +28,7 @@ class PersistentMenu : public QMenu { Q_OBJECT public: - PersistentMenu(QWidget *parent); + PersistentMenu(QWidget *parent = nullptr); protected: void setVisible (bool visible) override; From 997fbdff76e742efb9f1e9d170856611803e0265 Mon Sep 17 00:00:00 2001 From: Yuri Chornoivan Date: Sun, 18 Aug 2019 14:02:25 +0300 Subject: [PATCH 42/55] Get rid of deprecated setHidden() --- app/main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/main.cpp b/app/main.cpp index bcabf19ca..3e8226d9a 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -113,32 +113,32 @@ int main(int argc, char **argv) //! START: Hidden options for Developer and Debugging usage QCommandLineOption graphicsOption(QStringList() << QStringLiteral("graphics")); graphicsOption.setDescription(QStringLiteral("Draw boxes around of the applets.")); - graphicsOption.setHidden(true); + graphicsOption.setFlags(QCommandLineOption::HiddenFromHelp); parser.addOption(graphicsOption); QCommandLineOption withWindowOption(QStringList() << QStringLiteral("with-window")); withWindowOption.setDescription(QStringLiteral("Open a window with much debug information")); - withWindowOption.setHidden(true); + withWindowOption.setFlags(QCommandLineOption::HiddenFromHelp); parser.addOption(withWindowOption); QCommandLineOption maskOption(QStringList() << QStringLiteral("mask")); maskOption.setDescription(QStringLiteral("Show messages of debugging for the mask (Only useful to devs).")); - maskOption.setHidden(true); + maskOption.setFlags(QCommandLineOption::HiddenFromHelp); parser.addOption(maskOption); QCommandLineOption timersOption(QStringList() << QStringLiteral("timers")); timersOption.setDescription(QStringLiteral("Show messages for debugging the timers (Only useful to devs).")); - timersOption.setHidden(true); + timersOption.setFlags(QCommandLineOption::HiddenFromHelp); parser.addOption(timersOption); QCommandLineOption spacersOption(QStringList() << QStringLiteral("spacers")); spacersOption.setDescription(QStringLiteral("Show visual indicators for debugging spacers (Only useful to devs).")); - spacersOption.setHidden(true); + spacersOption.setFlags(QCommandLineOption::HiddenFromHelp); parser.addOption(spacersOption); QCommandLineOption overloadedIconsOption(QStringList() << QStringLiteral("overloaded-icons")); overloadedIconsOption.setDescription(QStringLiteral("Show visual indicators for debugging overloaded applets icons (Only useful to devs).")); - overloadedIconsOption.setHidden(true); + overloadedIconsOption.setFlags(QCommandLineOption::HiddenFromHelp); parser.addOption(overloadedIconsOption); //! END: Hidden options From e4670ac17402622c298c0cc535e18c833f7000a3 Mon Sep 17 00:00:00 2001 From: Yuri Chornoivan Date: Sun, 18 Aug 2019 14:11:37 +0300 Subject: [PATCH 43/55] Fix project_license tag --- app/org.kde.latte-dock.appdata.xml.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/org.kde.latte-dock.appdata.xml.cmake b/app/org.kde.latte-dock.appdata.xml.cmake index b4a738c9b..ba6df3048 100644 --- a/app/org.kde.latte-dock.appdata.xml.cmake +++ b/app/org.kde.latte-dock.appdata.xml.cmake @@ -149,7 +149,7 @@ Michail Vourlakos, Johan Smith Agudelo Rodriguez Michail Vourlakos, Johan Smith Agudelo Rodriguez latte-dock - GPL-2.0-or-later + GPL-2.0+ CC0-1.0 From 2a85545db81662454e2881b0fa364e8ba5288096 Mon Sep 17 00:00:00 2001 From: Yuri Chornoivan Date: Sun, 18 Aug 2019 14:26:37 +0300 Subject: [PATCH 44/55] Fix project_license tag for plasmoid --- plasmoid/metadata.desktop.cmake | 2 +- plasmoid/package/metadata.desktop | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plasmoid/metadata.desktop.cmake b/plasmoid/metadata.desktop.cmake index a8e2a03b2..1585fa682 100644 --- a/plasmoid/metadata.desktop.cmake +++ b/plasmoid/metadata.desktop.cmake @@ -54,5 +54,5 @@ X-KDE-PluginInfo-Name=org.kde.latte.plasmoid X-KDE-PluginInfo-Version=@VERSION@ X-KDE-PluginInfo-Website=@WEBSITE@ X-KDE-PluginInfo-Category=Windows and Tasks -X-KDE-PluginInfo-Depends=X-KDE-PluginInfo-License=GPL v2+ +X-KDE-PluginInfo-License=GPL v2+ X-KDE-PluginInfo-EnabledByDefault=true diff --git a/plasmoid/package/metadata.desktop b/plasmoid/package/metadata.desktop index f4d277b40..4e1185e4d 100644 --- a/plasmoid/package/metadata.desktop +++ b/plasmoid/package/metadata.desktop @@ -54,5 +54,5 @@ X-KDE-PluginInfo-Name=org.kde.latte.plasmoid X-KDE-PluginInfo-Version=0.9.1 X-KDE-PluginInfo-Website=https://github.com/psifidotos/Latte-Dock X-KDE-PluginInfo-Category=Windows and Tasks -X-KDE-PluginInfo-Depends=X-KDE-PluginInfo-License=GPL v2+ +X-KDE-PluginInfo-License=GPL v2+ X-KDE-PluginInfo-EnabledByDefault=true From 15ab253efd118b4e481534e4c1912cfc09cf51c6 Mon Sep 17 00:00:00 2001 From: Yuri Chornoivan Date: Sun, 18 Aug 2019 19:59:09 +0300 Subject: [PATCH 45/55] Fix minor EBN issues --- app/layouts/synchronizer.cpp | 2 +- app/plasma/extended/theme.cpp | 2 +- app/view/contextmenu.cpp | 2 +- app/wm/tracker/windowstracker.cpp | 2 +- .../package/contents/ui/colorizer/Manager.qml | 2 +- .../package/ui/FrontLayer.qml | 2 +- liblatte2/extras.h | 19 +++++++++++++++++++ liblatte2/plasma/extended/backgroundcache.cpp | 2 +- .../package/contents/ui/task/IconItem.qml | 8 ++++---- 9 files changed, 30 insertions(+), 11 deletions(-) diff --git a/app/layouts/synchronizer.cpp b/app/layouts/synchronizer.cpp index 55c429a4f..49ab242d4 100644 --- a/app/layouts/synchronizer.cpp +++ b/app/layouts/synchronizer.cpp @@ -556,7 +556,7 @@ void Synchronizer::loadLayouts() for (const auto &layout : files) { if (layout.contains(Layout::AbstractLayout::MultipleLayoutsName)) { - //! IMPORTANT: DONT ADD MultipleLayouts hidden file in layouts list + //! IMPORTANT: DON'T ADD MultipleLayouts hidden file in layouts list continue; } diff --git a/app/plasma/extended/theme.cpp b/app/plasma/extended/theme.cpp index 1792e3fe5..2bc333307 100644 --- a/app/plasma/extended/theme.cpp +++ b/app/plasma/extended/theme.cpp @@ -371,7 +371,7 @@ int Theme::roundness(const QImage &svgImage, Plasma::Types::Location edge) } } - //! this needs investigation (the x2) I dont know if it is really needed + //! this needs investigation (the x2) I don't know if it is really needed //! but it gives me the impression that returns better results return round; ///**2*/; } diff --git a/app/view/contextmenu.cpp b/app/view/contextmenu.cpp index 81d7d57c1..4e313fb64 100644 --- a/app/view/contextmenu.cpp +++ b/app/view/contextmenu.cpp @@ -205,7 +205,7 @@ bool ContextMenu::mousePressEvent(QMouseEvent *event) }*/ //!plasma official code - //this is a workaround where Qt will fail to realise a mouse has been released + //this is a workaround where Qt will fail to realize a mouse has been released // this happens if a window which does not accept focus spawns a new window that takes focus and X grab // whilst the mouse is depressed diff --git a/app/wm/tracker/windowstracker.cpp b/app/wm/tracker/windowstracker.cpp index b863da8ac..3fc6cc1e8 100644 --- a/app/wm/tracker/windowstracker.cpp +++ b/app/wm/tracker/windowstracker.cpp @@ -211,7 +211,7 @@ void Windows::updateRelevantLayouts() { QList orphanedLayouts; - //! REMOVE Orphaned Relevant layouts that have been removed or they dont contain any Views anymore + //! REMOVE Orphaned Relevant layouts that have been removed or they don't contain any Views anymore for (QHash::iterator i=m_layouts.begin(); i!=m_layouts.end(); ++i) { bool hasView{false}; for (QHash::iterator j=m_views.begin(); j!=m_views.end(); ++j) { diff --git a/containment/package/contents/ui/colorizer/Manager.qml b/containment/package/contents/ui/colorizer/Manager.qml index a165bb3a3..669b9e76d 100644 --- a/containment/package/contents/ui/colorizer/Manager.qml +++ b/containment/package/contents/ui/colorizer/Manager.qml @@ -120,7 +120,7 @@ Loader{ //! provide a dark case scenario at all cases return themeExtended.darkTheme; } else { - //! default plasma theme shoud be better for panel transparency > 70 + //! default plasma theme should be better for panel transparency > 70 return theme; } } diff --git a/indicators/org.kde.latte.plasma/package/ui/FrontLayer.qml b/indicators/org.kde.latte.plasma/package/ui/FrontLayer.qml index 9e2977212..5c8bc97c1 100644 --- a/indicators/org.kde.latte.plasma/package/ui/FrontLayer.qml +++ b/indicators/org.kde.latte.plasma/package/ui/FrontLayer.qml @@ -111,7 +111,7 @@ Item { PropertyAnimation { target: clickedRectangle property: "width" - //! Dont animate above for length + //! Don't animate above for length to: maxLength * multiplier duration: 700 easing.type: Easing.Linear diff --git a/liblatte2/extras.h b/liblatte2/extras.h index 53756b56c..29f9c43eb 100644 --- a/liblatte2/extras.h +++ b/liblatte2/extras.h @@ -1,3 +1,22 @@ +/* +* Copyright 2018 Michail Vourlakos +* +* This file is part of Latte-Dock +* +* Latte-Dock is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* Latte-Dock is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + #ifndef EXTRAS_H #define EXTRAS_H diff --git a/liblatte2/plasma/extended/backgroundcache.cpp b/liblatte2/plasma/extended/backgroundcache.cpp index e7e06bd68..8aa3952ed 100644 --- a/liblatte2/plasma/extended/backgroundcache.cpp +++ b/liblatte2/plasma/extended/backgroundcache.cpp @@ -255,7 +255,7 @@ bool BackgroundCache::areaIsBusy(float bright1, float bright2) //! the code is doing the following. It is not needed to calculate these values //! for the entire image that would also be cpu costly. The function takes //! the location of the area in the image for which we are interested. -//! The area is splitted in ten different Tiles and for each one its brightness +//! The area is split in ten different Tiles and for each one its brightness //! is computed. The brightness average from these tiles provides the entire //! area brightness. In order to indicate if this area is busy or not we //! compare the minimum and the maximum values of brightness from these diff --git a/plasmoid/package/contents/ui/task/IconItem.qml b/plasmoid/package/contents/ui/task/IconItem.qml index 3e1ea2f0f..9b24856ef 100644 --- a/plasmoid/package/contents/ui/task/IconItem.qml +++ b/plasmoid/package/contents/ui/task/IconItem.qml @@ -520,7 +520,7 @@ Item{ //! HACK TO AVOID PIXELIZATION //! WORKAROUND: When Effects are enabled e.g. BrightnessContrast, Colorize etc. //! the icon appears pixelated. It is even most notable when zoomFactor === 1 - //! I dont know enabling cached=true helps, but it does. + //! I don't know enabling cached=true helps, but it does. cached: true opacity: stateColorizer.opacity @@ -541,7 +541,7 @@ Item{ //! HACK TO AVOID PIXELIZATION //! WORKAROUND: When Effects are enabled e.g. BrightnessContrast, Colorize etc. //! the icon appears pixelated. It is even most notable when zoomFactor === 1 - //! I dont know enabling cached=true helps, but it does. + //! I don't know enabling cached=true helps, but it does. cached: true source: badgesLoader.active ? badgesLoader : iconImageBuffer @@ -563,7 +563,7 @@ Item{ //! HACK TO AVOID PIXELIZATION //! WORKAROUND: When Effects are enabled e.g. BrightnessContrast, Colorize etc. //! the icon appears pixelated. It is even most notable when zoomFactor === 1 - //! I dont know enabling cached=true helps, but it does. + //! I don't know enabling cached=true helps, but it does. cached: true source: badgesLoader.active ? badgesLoader : iconImageBuffer @@ -587,7 +587,7 @@ Item{ //! HACK TO AVOID PIXELIZATION //! WORKAROUND: When Effects are enabled e.g. BrightnessContrast, Colorize etc. //! the icon appears pixelated. It is even most notable when zoomFactor === 1 - //! I dont know enabling cached=true helps, but it does. + //! I don't know enabling cached=true helps, but it does. cached: true source: badgesLoader.active ? badgesLoader : iconImageBuffer From 0994405f69934e925ad525cfeaf4e6ef503b955d Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 26 Aug 2019 00:15:36 +0300 Subject: [PATCH 46/55] send QEvent::Leave for view when dragging started --this way the applets in the view will be informed for mouse exited the view window --- app/view/view.cpp | 3 +++ app/view/visibilitymanager.cpp | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/view/view.cpp b/app/view/view.cpp index ebbd12998..4aeb31185 100644 --- a/app/view/view.cpp +++ b/app/view/view.cpp @@ -1292,6 +1292,9 @@ void View::restoreGrabItemBehavior() if (mouseGrabberItem()) { mouseGrabberItem()->ungrabMouse(); } + + setMouseGrabEnabled(true); + setMouseGrabEnabled(false); } bool View::isHighestPriorityView() { diff --git a/app/view/visibilitymanager.cpp b/app/view/visibilitymanager.cpp index 5259d996e..333b95c66 100644 --- a/app/view/visibilitymanager.cpp +++ b/app/view/visibilitymanager.cpp @@ -528,8 +528,9 @@ void VisibilityManager::applyActivitiesToHiddenWindows(const QStringList &activi void VisibilityManager::activeWindowDraggingStarted() { - setContainsMouse(false); - updateHiddenState(); + //! Send a fake QEvent::LEAVE to inform applets for mouse leaving the view + QHoverEvent e(QEvent::Leave, QPoint(-5,-5), m_latteView->geometry().center()); + QCoreApplication::instance()->sendEvent(m_latteView, &e); } void VisibilityManager::dodgeActive() From 153f5dab27a0728978551c55776e5ba1b7f0bc16 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 26 Aug 2019 01:22:22 +0300 Subject: [PATCH 47/55] remove obsolete draggingStarted signals/slots --draggingStarted signals/slots were used in order to handle the active window dragging from empty areas. The new approach ungrabs the mouse properly through View relevant function and at the same time sends a QEvent::Leave event to inform applets that the mouse has left the view. This is enough in order to remove any older draggingStarted workarounds and hacks. --- app/view/view.cpp | 45 ++++++++++++------- app/view/view.h | 11 +++-- app/view/visibilitymanager.cpp | 10 ----- app/view/visibilitymanager.h | 3 -- app/view/windowstracker/allscreenstracker.cpp | 7 --- app/view/windowstracker/allscreenstracker.h | 1 - .../windowstracker/currentscreentracker.cpp | 7 --- .../windowstracker/currentscreentracker.h | 3 -- app/view/windowstracker/windowstracker.cpp | 5 --- app/view/windowstracker/windowstracker.h | 1 - app/wm/abstractwindowinterface.h | 2 - app/wm/tracker/lastactivewindow.cpp | 14 ++---- app/wm/tracker/lastactivewindow.h | 2 - app/wm/waylandinterface.cpp | 5 --- app/wm/waylandinterface.h | 2 - app/wm/xwindowinterface.cpp | 22 --------- app/wm/xwindowinterface.h | 2 - .../ui/layouts/EnvironmentActions.qml | 15 +------ 18 files changed, 43 insertions(+), 114 deletions(-) diff --git a/app/view/view.cpp b/app/view/view.cpp index 4aeb31185..47511447e 100644 --- a/app/view/view.cpp +++ b/app/view/view.cpp @@ -96,6 +96,10 @@ View::View(Plasma::Corona *corona, QScreen *targetScreen, bool byPassWM) else m_positioner->setScreenToFollow(qGuiApp->primaryScreen()); + m_releaseGrabTimer.setInterval(400); + m_releaseGrabTimer.setSingleShot(true); + connect(&m_releaseGrabTimer, &QTimer::timeout, this, &View::releaseGrab); + connect(this, &View::containmentChanged , this, [ &, byPassWM]() { qDebug() << "dock view c++ containment changed 1..."; @@ -1215,6 +1219,32 @@ bool View::event(QEvent *e) return ContainmentView::event(e); } +//! release grab and restore mouse state +void View::unblockMouse(int x, int y) +{ + setMouseGrabEnabled(false); + + m_releaseGrab_x = x; + m_releaseGrab_y = y; + m_releaseGrabTimer.start(); +} + +void View::releaseGrab() +{ + //! ungrab mouse + if (mouseGrabberItem()) { + mouseGrabberItem()->ungrabMouse(); + } + + //! properly release grabbed mouse in order to inform all views + setMouseGrabEnabled(true); + setMouseGrabEnabled(false); + + //! Send a fake QEvent::Leave to inform applets for mouse leaving the view + QHoverEvent e(QEvent::Leave, QPoint(-5,-5), QPoint(m_releaseGrab_x, m_releaseGrab_y)); + QCoreApplication::instance()->sendEvent(this, &e); +} + void View::deactivateApplets() { if (!containment()) { @@ -1282,21 +1312,6 @@ QVariantList View::containmentActions() return actions; } -void View::disableGrabItemBehavior() -{ - setMouseGrabEnabled(false); -} - -void View::restoreGrabItemBehavior() -{ - if (mouseGrabberItem()) { - mouseGrabberItem()->ungrabMouse(); - } - - setMouseGrabEnabled(true); - setMouseGrabEnabled(false); -} - bool View::isHighestPriorityView() { if (m_layout) { return this == m_layout->highestPriorityView(); diff --git a/app/view/view.h b/app/view/view.h index f2aa8ae09..23a7a5ef0 100644 --- a/app/view/view.h +++ b/app/view/view.h @@ -206,6 +206,9 @@ public: KWayland::Client::PlasmaShellSurface *surface(); + //! release grab and restore mouse state + void unblockMouse(int x, int y); + void reconsiderScreen(); //! these are signals that create crashes, such a example is the availableScreenRectChanged from corona @@ -229,9 +232,6 @@ public slots: void updateAbsoluteGeometry(bool bypassChecks = false); - Q_INVOKABLE void disableGrabItemBehavior(); - Q_INVOKABLE void restoreGrabItemBehavior(); - Q_INVOKABLE bool isHighestPriorityView(); protected slots: @@ -293,6 +293,7 @@ private slots: void configViewCreatedFor(Latte::View *view); void hideWindowsForSlidingOut(); void preferredViewForShortcutsChangedSlot(Latte::View *view); + void releaseGrab(); void reloadSource(); void statusChanged(Plasma::Types::ItemStatus); @@ -345,6 +346,10 @@ private: QTimer m_visibleHackTimer1; QTimer m_visibleHackTimer2; + QTimer m_releaseGrabTimer; + int m_releaseGrab_x; + int m_releaseGrab_y; + Layout::GenericLayout *m_layout{nullptr}; QPointer m_configView; diff --git a/app/view/visibilitymanager.cpp b/app/view/visibilitymanager.cpp index 333b95c66..7762d9d94 100644 --- a/app/view/visibilitymanager.cpp +++ b/app/view/visibilitymanager.cpp @@ -72,9 +72,6 @@ VisibilityManager::VisibilityManager(PlasmaQuick::ContainmentView *view) updateStrutsBasedOnLayoutsAndActivities(); } }); - - connect(m_latteView->windowsTracker(), &WindowsTracker::activeWindowDraggingStarted, - this, &VisibilityManager::activeWindowDraggingStarted); } if (m_corona) { @@ -526,13 +523,6 @@ void VisibilityManager::applyActivitiesToHiddenWindows(const QStringList &activi } } -void VisibilityManager::activeWindowDraggingStarted() -{ - //! Send a fake QEvent::LEAVE to inform applets for mouse leaving the view - QHoverEvent e(QEvent::Leave, QPoint(-5,-5), m_latteView->geometry().center()); - QCoreApplication::instance()->sendEvent(m_latteView, &e); -} - void VisibilityManager::dodgeActive() { if (m_raiseTemporarily) diff --git a/app/view/visibilitymanager.h b/app/view/visibilitymanager.h index d34a00ac6..59efee2f6 100644 --- a/app/view/visibilitymanager.h +++ b/app/view/visibilitymanager.h @@ -101,9 +101,6 @@ public: bool supportsKWinEdges() const; - //! called for windowTracker to reset values - void activeWindowDraggingStarted(); - public slots: Q_INVOKABLE void hide(); Q_INVOKABLE void show(); diff --git a/app/view/windowstracker/allscreenstracker.cpp b/app/view/windowstracker/allscreenstracker.cpp index 881cc43d4..1cc7af8da 100644 --- a/app/view/windowstracker/allscreenstracker.cpp +++ b/app/view/windowstracker/allscreenstracker.cpp @@ -87,14 +87,7 @@ void AllScreensTracker::init() void AllScreensTracker::initSignalsForInformation() { - if (m_currentLastActiveWindow) { - disconnect(m_currentLastActiveWindow, &WindowSystem::Tracker::LastActiveWindow::draggingStarted, - this, &AllScreensTracker::activeWindowDraggingStarted); - } - m_currentLastActiveWindow = lastActiveWindow(); - connect(m_currentLastActiveWindow, &WindowSystem::Tracker::LastActiveWindow::draggingStarted, - this, &AllScreensTracker::activeWindowDraggingStarted); emit lastActiveWindowChanged(); emit activeWindowMaximizedChanged(); diff --git a/app/view/windowstracker/allscreenstracker.h b/app/view/windowstracker/allscreenstracker.h index 9939202f6..2544c641f 100644 --- a/app/view/windowstracker/allscreenstracker.h +++ b/app/view/windowstracker/allscreenstracker.h @@ -71,7 +71,6 @@ public slots: Q_INVOKABLE void requestMoveLastWindow(int localX, int localY); signals: - void activeWindowDraggingStarted(); void activeWindowMaximizedChanged(); void existsWindowActiveChanged(); void existsWindowMaximizedChanged(); diff --git a/app/view/windowstracker/currentscreentracker.cpp b/app/view/windowstracker/currentscreentracker.cpp index a970ce5d6..7e8fe79bf 100644 --- a/app/view/windowstracker/currentscreentracker.cpp +++ b/app/view/windowstracker/currentscreentracker.cpp @@ -111,13 +111,6 @@ void CurrentScreenTracker::init() void CurrentScreenTracker::initSignalsForInformation() { - if (!m_initialized) { - connect(lastActiveWindow(), &WindowSystem::Tracker::LastActiveWindow::draggingStarted, - this, &CurrentScreenTracker::activeWindowDraggingStarted); - - m_initialized = true; - } - emit lastActiveWindowChanged(); emit activeWindowMaximizedChanged(); emit activeWindowTouchingChanged(); diff --git a/app/view/windowstracker/currentscreentracker.h b/app/view/windowstracker/currentscreentracker.h index e2ee72dae..bc2050736 100644 --- a/app/view/windowstracker/currentscreentracker.h +++ b/app/view/windowstracker/currentscreentracker.h @@ -80,7 +80,6 @@ public slots: Q_INVOKABLE void requestMoveLastWindow(int localX, int localY); signals: - void activeWindowDraggingStarted(); void activeWindowMaximizedChanged(); void activeWindowTouchingChanged(); void existsWindowActiveChanged(); @@ -100,8 +99,6 @@ private: void init(); private: - bool m_initialized{false}; - Latte::View *m_latteView{nullptr}; WindowSystem::AbstractWindowInterface *m_wm{nullptr}; }; diff --git a/app/view/windowstracker/windowstracker.cpp b/app/view/windowstracker/windowstracker.cpp index 676804b27..39854e281 100644 --- a/app/view/windowstracker/windowstracker.cpp +++ b/app/view/windowstracker/windowstracker.cpp @@ -48,11 +48,6 @@ WindowsTracker::WindowsTracker(Latte::View *parent) } }); - connect(m_allScreensTracker, &TrackerPart::AllScreensTracker::activeWindowDraggingStarted, - this, &WindowsTracker::activeWindowDraggingStarted); - connect(m_currentScreenTracker, &TrackerPart::CurrentScreenTracker::activeWindowDraggingStarted, - this, &WindowsTracker::activeWindowDraggingStarted); - m_wm->windowsTracker()->addView(m_latteView); emit allScreensChanged(); diff --git a/app/view/windowstracker/windowstracker.h b/app/view/windowstracker/windowstracker.h index 6af233cb4..a969354ca 100644 --- a/app/view/windowstracker/windowstracker.h +++ b/app/view/windowstracker/windowstracker.h @@ -74,7 +74,6 @@ public slots: signals: void enabledChanged(); - void activeWindowDraggingStarted(); void allScreensChanged(); void currentScreenChanged(); diff --git a/app/wm/abstractwindowinterface.h b/app/wm/abstractwindowinterface.h index b36077923..8c5746a91 100644 --- a/app/wm/abstractwindowinterface.h +++ b/app/wm/abstractwindowinterface.h @@ -98,8 +98,6 @@ public: virtual void enableBlurBehind(QWindow &view) const = 0; virtual void setEdgeStateFor(QWindow *view, bool active) const = 0; - virtual void releaseMouseEventFor(WindowId wid) const = 0; - virtual void requestActivate(WindowId wid) const = 0; virtual void requestClose(WindowId wid) const = 0; virtual void requestMoveWindow(WindowId wid, QPoint from) const = 0; diff --git a/app/wm/tracker/lastactivewindow.cpp b/app/wm/tracker/lastactivewindow.cpp index 80ea445ae..9453e35fd 100644 --- a/app/wm/tracker/lastactivewindow.cpp +++ b/app/wm/tracker/lastactivewindow.cpp @@ -28,6 +28,7 @@ // Qt #include +#include #include #include @@ -391,23 +392,14 @@ void LastActiveWindow::requestClose() void LastActiveWindow::requestMove(Latte::View *fromView, int localX, int localY) { - if (!canBeDragged()) { + if (!fromView || !canBeDragged()) { return; } QPoint globalPoint{fromView->x() + localX, fromView->y() + localY}; - m_wm->requestMoveWindow(m_winId, globalPoint); - auto viewId = m_winId; - - //! This timer is needed because otherwise the mouse position - //! in the dragged window changes to TopLeft corner - QTimer::singleShot(250, this, [&, viewId]() { - m_wm->releaseMouseEventFor(viewId); - }); - - emit draggingStarted(); + fromView->unblockMouse(localX, localY); } void LastActiveWindow::requestToggleIsOnAllDesktops() diff --git a/app/wm/tracker/lastactivewindow.h b/app/wm/tracker/lastactivewindow.h index 8c09df447..58144438f 100644 --- a/app/wm/tracker/lastactivewindow.h +++ b/app/wm/tracker/lastactivewindow.h @@ -105,8 +105,6 @@ private slots: signals: - void draggingStarted(); - void iconChanged(); void isActiveChanged(); void isMinimizedChanged(); diff --git a/app/wm/waylandinterface.cpp b/app/wm/waylandinterface.cpp index b5da825ad..cb7ae923a 100644 --- a/app/wm/waylandinterface.cpp +++ b/app/wm/waylandinterface.cpp @@ -538,11 +538,6 @@ bool WaylandInterface::windowCanBeMaximized(WindowId wid) const return false; } -void WaylandInterface::releaseMouseEventFor(WindowId wid) const -{ - // this isnt really needed under wayland -} - void WaylandInterface::requestActivate(WindowId wid) const { auto w = windowFor(wid); diff --git a/app/wm/waylandinterface.h b/app/wm/waylandinterface.h index ee2fa10a9..47af0bec8 100644 --- a/app/wm/waylandinterface.h +++ b/app/wm/waylandinterface.h @@ -76,8 +76,6 @@ public: void slideWindow(QWindow &view, Slide location) const override; void enableBlurBehind(QWindow &view) const override; - void releaseMouseEventFor(WindowId wid) const override; - void requestActivate(WindowId wid) const override; void requestClose(WindowId wid) const override; void requestMoveWindow(WindowId wid, QPoint from) const override; diff --git a/app/wm/xwindowinterface.cpp b/app/wm/xwindowinterface.cpp index d9a93763d..1bce5f28d 100644 --- a/app/wm/xwindowinterface.cpp +++ b/app/wm/xwindowinterface.cpp @@ -424,28 +424,6 @@ bool XWindowInterface::windowCanBeMaximized(WindowId wid) const return false; } -void XWindowInterface::releaseMouseEventFor(WindowId wid) const -{ - auto connection = QX11Info::connection(); - - xcb_button_release_event_t releaseEvent; - memset(&releaseEvent, 0, sizeof(releaseEvent)); - - releaseEvent.response_type = XCB_BUTTON_RELEASE; - releaseEvent.event = wid.toInt(); - releaseEvent.child = XCB_WINDOW_NONE; - releaseEvent.root = QX11Info::appRootWindow(); - releaseEvent.event_x = -1; - releaseEvent.event_y = -1; - releaseEvent.root_x = -1; - releaseEvent.root_y = -1; - releaseEvent.detail = XCB_BUTTON_INDEX_1; - releaseEvent.state = XCB_BUTTON_MASK_1; - releaseEvent.time = XCB_CURRENT_TIME; - releaseEvent.same_screen = true; - xcb_send_event( connection, false, wid.toInt(), XCB_EVENT_MASK_BUTTON_RELEASE, reinterpret_cast(&releaseEvent)); -} - void XWindowInterface::requestActivate(WindowId wid) const { KWindowSystem::activateWindow(wid.toInt()); diff --git a/app/wm/xwindowinterface.h b/app/wm/xwindowinterface.h index a52ecbb61..d63cfd647 100644 --- a/app/wm/xwindowinterface.h +++ b/app/wm/xwindowinterface.h @@ -60,8 +60,6 @@ public: void slideWindow(QWindow &view, Slide location) const override; void enableBlurBehind(QWindow &view) const override; - void releaseMouseEventFor(WindowId wid) const override; - void requestActivate(WindowId wid) const override; void requestClose(WindowId wid) const override; void requestMoveWindow(WindowId wid, QPoint from) const override; diff --git a/containment/package/contents/ui/layouts/EnvironmentActions.qml b/containment/package/contents/ui/layouts/EnvironmentActions.qml index 05fb3081c..b071a5207 100644 --- a/containment/package/contents/ui/layouts/EnvironmentActions.qml +++ b/containment/package/contents/ui/layouts/EnvironmentActions.qml @@ -104,7 +104,6 @@ Loader { } dragWindowTimer.stop(); - restoreGrabberTimer.stop(); selectedWindowsTracker.lastActiveWindow.requestToggleMaximized(); } @@ -148,9 +147,9 @@ Loader { } function activateDragging(){ - latteView.disableGrabItemBehavior(); selectedWindowsTracker.requestMoveLastWindow(mainArea.mouseX, mainArea.mouseY); - restoreGrabberTimer.start(); + mainArea.lastPressX = -1; + mainArea.lastPressY = -1; } //! Timers @@ -164,16 +163,6 @@ Loader { } } - Timer { - id: restoreGrabberTimer - interval: 50 - onTriggered: { - latteView.restoreGrabItemBehavior(); - mainArea.lastPressX = -1; - mainArea.lastPressY = -1; - } - } - states:[ State { name: "bottom" From 551edf01fb7425f22f0be430717509c969a5fe81 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 26 Aug 2019 17:38:57 +0300 Subject: [PATCH 48/55] provide Progress information to indicators --as a test case, the Plasma indicator now supports the original plasma progress indicator of plasma taskmanagers --- .../contents/ui/applet/indicator/Bridge.qml | 3 ++ .../package/ui/BackLayer.qml | 24 +-------- .../org.kde.latte.plasma/package/ui/main.qml | 53 +++++++++++++++++++ .../package/contents/ui/task/IconItem.qml | 2 + plasmoid/package/contents/ui/task/Wrapper.qml | 3 ++ .../contents/ui/task/indicator/Bridge.qml | 3 ++ 6 files changed, 65 insertions(+), 23 deletions(-) diff --git a/containment/package/contents/ui/applet/indicator/Bridge.qml b/containment/package/contents/ui/applet/indicator/Bridge.qml index eccf1fc43..48435d3dd 100644 --- a/containment/package/contents/ui/applet/indicator/Bridge.qml +++ b/containment/package/contents/ui/applet/indicator/Bridge.qml @@ -66,6 +66,9 @@ Item{ readonly property bool animationsEnabled: root.animationsEnabled readonly property real durationTime: root.durationTime + readonly property bool progressVisible: false /*since 0.9.2*/ + readonly property real progress: 0 /*since 0.9.2*/ + readonly property bool usePlasmaTabsStyle: !indicators.enabledForApplets readonly property QtObject palette: colorizerManager.applyTheme diff --git a/indicators/org.kde.latte.plasma/package/ui/BackLayer.qml b/indicators/org.kde.latte.plasma/package/ui/BackLayer.qml index 0f61c8340..e95964803 100644 --- a/indicators/org.kde.latte.plasma/package/ui/BackLayer.qml +++ b/indicators/org.kde.latte.plasma/package/ui/BackLayer.qml @@ -56,32 +56,10 @@ PlasmaCore.FrameSvgItem { return "south-active-tab"; } else { - return taskPrefix(basePrefix); + return root.taskPrefix(basePrefix); } } - function taskPrefix(prefix) { - var effectivePrefix; - - if (plasmoid.location === PlasmaCore.Types.LeftEdge) { - effectivePrefix = "west-" + prefix; - } - - if (plasmoid.location === PlasmaCore.Types.TopEdge) { - effectivePrefix = "north-" + prefix; - } - - if (plasmoid.location === PlasmaCore.Types.RightEdge) { - effectivePrefix = "east-" + prefix; - } - - if (plasmoid.location === PlasmaCore.Types.BottomEdge) { - effectivePrefix = "south-" + prefix; - } - - return [effectivePrefix, prefix]; - } - states: [ State { name: "launcher" diff --git a/indicators/org.kde.latte.plasma/package/ui/main.qml b/indicators/org.kde.latte.plasma/package/ui/main.qml index 54c70a7c9..170619dac 100644 --- a/indicators/org.kde.latte.plasma/package/ui/main.qml +++ b/indicators/org.kde.latte.plasma/package/ui/main.qml @@ -52,6 +52,37 @@ LatteComponents.IndicatorItem { sourceComponent: BackLayer{} } + /* progress overlay for BackLayer*/ + /* it is not added in the BackLayer because the BackLayer is rotated in some cases*/ + Loader { + anchors.fill: parent + asynchronous: true + active: level.isBackground && indicator.progressVisible + sourceComponent: Item { + id: background + + Item { + anchors { + top: parent.top + left: parent.left + bottom: parent.bottom + } + + width: parent.width * (Math.min(indicator.progress, 100) / 100) + clip: true + + PlasmaCore.FrameSvgItem { + id: progressFrame + width: background.width + height: background.height + + imagePath: "widgets/tasks" + prefix: root.taskPrefix("progress").concat(root.taskPrefix("hover")) + } + } + } + } + //! Foreground Layer to draw arrows Loader{ id: frontLayer @@ -61,4 +92,26 @@ LatteComponents.IndicatorItem { sourceComponent: FrontLayer{} } + + function taskPrefix(prefix) { + var effectivePrefix; + + if (plasmoid.location === PlasmaCore.Types.LeftEdge) { + effectivePrefix = "west-" + prefix; + } + + if (plasmoid.location === PlasmaCore.Types.TopEdge) { + effectivePrefix = "north-" + prefix; + } + + if (plasmoid.location === PlasmaCore.Types.RightEdge) { + effectivePrefix = "east-" + prefix; + } + + if (plasmoid.location === PlasmaCore.Types.BottomEdge) { + effectivePrefix = "south-" + prefix; + } + + return [effectivePrefix, prefix]; + } } diff --git a/plasmoid/package/contents/ui/task/IconItem.qml b/plasmoid/package/contents/ui/task/IconItem.qml index 9b24856ef..b6b64349b 100644 --- a/plasmoid/package/contents/ui/task/IconItem.qml +++ b/plasmoid/package/contents/ui/task/IconItem.qml @@ -67,6 +67,8 @@ Item{ readonly property color backgroundColor: iconImageBuffer.backgroundColor readonly property color glowColor: iconImageBuffer.glowColor + readonly property bool progressVisible: smartLauncherItem && smartLauncherItem.progressVisible + readonly property real progress: smartLauncherItem && smartLauncherItem.progress property QtObject buffers: null property QtObject smartLauncherItem: null diff --git a/plasmoid/package/contents/ui/task/Wrapper.qml b/plasmoid/package/contents/ui/task/Wrapper.qml index 02cca92be..e85936313 100644 --- a/plasmoid/package/contents/ui/task/Wrapper.qml +++ b/plasmoid/package/contents/ui/task/Wrapper.qml @@ -104,6 +104,9 @@ Item{ property color backgroundColor: taskIconItem.backgroundColor property color glowColor: taskIconItem.glowColor + property bool progressVisible: taskIconItem.progressVisible + property real progress: taskIconItem.progress + property Item visualIconItem: taskIconItem.visualIconItem property Item titleTooltipVisualParent: taskIconItem.titleTooltipVisualParent property Item previewsTooltipVisualParent: taskIconItem.previewsTootipVisualParent diff --git a/plasmoid/package/contents/ui/task/indicator/Bridge.qml b/plasmoid/package/contents/ui/task/indicator/Bridge.qml index f3993ee00..f92e11c6e 100644 --- a/plasmoid/package/contents/ui/task/indicator/Bridge.qml +++ b/plasmoid/package/contents/ui/task/indicator/Bridge.qml @@ -69,6 +69,9 @@ Item { readonly property bool animationsEnabled: root.animationsEnabled readonly property real durationTime: root.durationTime + readonly property bool progressVisible: wrapper.progressVisible /*since 0.9.2*/ + readonly property real progress: wrapper.progress /*since 0.9.2*/ + readonly property bool usePlasmaTabsStyle: false readonly property variant svgs: indicators ? indicators.svgs : [] From 0ea41820d0c911b2a93c68f702a6bcbb1e8bf6b2 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 27 Aug 2019 15:11:33 +0300 Subject: [PATCH 49/55] autostart Latte earlier --this way Latte is given the time to publish its appmenu if available and normal applications should follow afterwards BUG:411341 FIXED-IN:0.9.2 --- app/org.kde.latte-dock.desktop.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/app/org.kde.latte-dock.desktop.cmake b/app/org.kde.latte-dock.desktop.cmake index febf497ad..f601985e7 100644 --- a/app/org.kde.latte-dock.desktop.cmake +++ b/app/org.kde.latte-dock.desktop.cmake @@ -95,5 +95,6 @@ X-KDE-PluginInfo-Version=@VERSION@ X-KDE-PluginInfo-Website=@WEBSITE@ X-KDE-StartupNotify=false X-KDE-SubstituteUID=false +X-KDE-autostart-phase=1 X-KDE-Wayland-Interfaces=org_kde_plasma_window_management,org_kde_kwin_keystate From 724a59eb23afb53ec86de4b7af18393db6738155 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 27 Aug 2019 15:46:49 +0300 Subject: [PATCH 50/55] add accelerated graphics checks all over the place --when qml uses software rendering checks should be added in order to not hide the visual elements. This is taking place now in a more concrete way and checked also that tasks with badges or not are still shown BUG:411037 FIXED-IN:0.9.2 --- .../contents/ui/applet/ItemWrapper.qml | 12 +++++++----- .../contents/ui/applet/ShortcutBadge.qml | 2 +- .../contents/ui/applet/colorizer/Applet.qml | 5 +---- .../contents/ui/editmode/SettingsOverlay.qml | 2 +- containment/package/contents/ui/main.qml | 6 ++++++ plasmoid/package/contents/ui/main.qml | 7 +++++++ .../package/contents/ui/task/IconItem.qml | 19 ++++++++++--------- .../contents/ui/task/ShortcutBadge.qml | 2 +- .../package/contents/ui/task/TaskItem.qml | 5 ++--- .../RemoveWindowFromGroupAnimation.qml | 2 +- 10 files changed, 37 insertions(+), 25 deletions(-) diff --git a/containment/package/contents/ui/applet/ItemWrapper.qml b/containment/package/contents/ui/applet/ItemWrapper.qml index c7ca8937a..c026b8b47 100644 --- a/containment/package/contents/ui/applet/ItemWrapper.qml +++ b/containment/package/contents/ui/applet/ItemWrapper.qml @@ -95,7 +95,7 @@ Item{ } } - opacity: appletColorizer.mustBeShown && appletColorizer.isCompiled ? 0 : 1 + opacity: appletColorizer.mustBeShown && graphicsSystem.isAccelerated ? 0 : 1 property bool disableScaleWidth: false property bool disableScaleHeight: false @@ -444,7 +444,7 @@ Item{ } - opacity: appletShadow.active && (appletShadow.item.status === ShaderEffect.Compiled) ? 0 : 1 + opacity: appletShadow.active ? 0 : 1 anchors.centerIn: parent ///Secret MouseArea to be used by the folder widget @@ -526,7 +526,7 @@ Item{ imagePath: root.universalSettings.splitterIconPath() } - layer.enabled: true + layer.enabled: graphicsSystem.isAccelerated layer.effect: DropShadow { radius: root.appShadowSize fast: true @@ -553,7 +553,9 @@ Item{ id: appletShadow anchors.fill: appletItem.appletWrapper - active: appletItem.applet && !appletColorizer.mustBeShown + active: appletItem.applet + && graphicsSystem.isAccelerated + && !appletColorizer.mustBeShown && (((plasmoid.configuration.shadows === 1 /*Locked Applets*/ && (!appletItem.canBeHovered || (appletItem.originalAppletBehavior && (applet.pluginName !== root.plasmoidName))) ) || (plasmoid.configuration.shadows === 2 /*All Applets*/ @@ -561,7 +563,7 @@ Item{ || (root.forceTransparentPanel && plasmoid.configuration.shadows>0 && applet.pluginName !== root.plasmoidName)) /*on forced transparent state*/ onActiveChanged: { - if (active && !isSeparator && item.status === ShaderEffect.Compiled) { + if (active && !isSeparator && graphicsSystem.isAccelerated) { wrapperContainer.opacity = 0; } else { wrapperContainer.opacity = 1; diff --git a/containment/package/contents/ui/applet/ShortcutBadge.qml b/containment/package/contents/ui/applet/ShortcutBadge.qml index 2c5392a4d..236ae9191 100644 --- a/containment/package/contents/ui/applet/ShortcutBadge.qml +++ b/containment/package/contents/ui/applet/ShortcutBadge.qml @@ -83,7 +83,7 @@ Loader{ sourceComponent: Item{ Loader{ anchors.fill: appletNumber - active: root.enableShadows + active: root.enableShadows && graphicsSystem.isAccelerated sourceComponent: DropShadow{ color: root.appShadowColor diff --git a/containment/package/contents/ui/applet/colorizer/Applet.qml b/containment/package/contents/ui/applet/colorizer/Applet.qml index 6fb7061c8..08db651d9 100644 --- a/containment/package/contents/ui/applet/colorizer/Applet.qml +++ b/containment/package/contents/ui/applet/colorizer/Applet.qml @@ -24,9 +24,6 @@ import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.core 2.0 as PlasmaCore Item { - readonly property bool isCompiled: !colorizedAppletShadow.active - || (colorizedAppletShadow.active && colorizedAppletShadow.item.status === ShaderEffect.Compiled) - ColorOverlay { id: colorizer anchors.fill: parent @@ -39,7 +36,7 @@ Item { id: colorizedAppletShadow anchors.fill: colorizer - active: (plasmoid.configuration.shadows >= 1) && (appletColorizer.opacity>0) + active: graphicsSystem.isAccelerated && (plasmoid.configuration.shadows >= 1) && (appletColorizer.opacity>0) sourceComponent: DropShadow{ anchors.fill: parent diff --git a/containment/package/contents/ui/editmode/SettingsOverlay.qml b/containment/package/contents/ui/editmode/SettingsOverlay.qml index 12bb9a08f..93dd3c930 100644 --- a/containment/package/contents/ui/editmode/SettingsOverlay.qml +++ b/containment/package/contents/ui/editmode/SettingsOverlay.qml @@ -64,7 +64,7 @@ Item{ readonly property color textColor: bestContrastedTextColor - layer.enabled: true + layer.enabled: graphicsSystem.isAccelerated layer.effect: DropShadow{ radius: settingsRoot.textShadow fast: true diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index f25988bec..3459ba619 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -1711,6 +1711,12 @@ Item { id: indicators } + ShaderEffect { + id: graphicsSystem + //! check if Software qml rendering is applied + readonly property bool isAccelerated: status === ShaderEffect.Compiled + } + ///////////////END components PlasmaCore.ColorScope{ diff --git a/plasmoid/package/contents/ui/main.qml b/plasmoid/package/contents/ui/main.qml index 412f727ab..1e4fc29bc 100644 --- a/plasmoid/package/contents/ui/main.qml +++ b/plasmoid/package/contents/ui/main.qml @@ -376,6 +376,13 @@ Item { id: colorScopePalette } + //! + ShaderEffect { + id: graphicsSystem + //! check if Software qml rendering is applied + readonly property bool isAccelerated: status === ShaderEffect.Compiled + } + Loader { id: indicatorsStandaloneLoader active: !latteView && !plasmoid.configuration.isInLatteDock diff --git a/plasmoid/package/contents/ui/task/IconItem.qml b/plasmoid/package/contents/ui/task/IconItem.qml index b6b64349b..1c915c21b 100644 --- a/plasmoid/package/contents/ui/task/IconItem.qml +++ b/plasmoid/package/contents/ui/task/IconItem.qml @@ -126,6 +126,8 @@ Item{ thickness: root.zoomFactor * (root.iconSize + root.thickMargins) + 1 } + //! + // KQuickControlAddons.QIconItem{ Item{ id: iconGraphic @@ -163,9 +165,8 @@ Item{ opacity: root.enableShadows && taskWithShadow.active - && (taskWithShadow.item.status === ShaderEffect.Compiled) ? 0 : 1 - visible: !taskItem.isSeparator && !badgesLoader.active - + && graphicsSystem.isAccelerated ? 0 : 1 + visible: !taskItem.isSeparator && (!badgesLoader.active || !graphicsSystem.isAccelerated) onValidChanged: { if (!valid && (source === decoration || source === "unknown")) { @@ -275,7 +276,7 @@ Item{ Loader{ id: taskWithShadow anchors.fill: iconImageBuffer - active: root.enableShadows && !taskItem.isSeparator + active: root.enableShadows && !taskItem.isSeparator && graphicsSystem.isAccelerated sourceComponent: DropShadow{ anchors.fill: parent @@ -293,7 +294,7 @@ Item{ Loader{ id: badgesLoader anchors.fill: iconImageBuffer - active: activateProgress > 0 + active: (activateProgress > 0) && graphicsSystem.isAccelerated asynchronous: true opacity: stateColorizer.opacity > 0 ? 0 : 1 @@ -455,7 +456,7 @@ Item{ Loader { id: badgeVisualsLoader anchors.fill: iconImageBuffer - active: badgesLoader.active + active: (badgesLoader.activateProgress > 0) readonly property int infoBadgeWidth: active ? publishedInfoBadgeWidth : 0 property int publishedInfoBadgeWidth: 0 @@ -471,7 +472,7 @@ Item{ opacity: badgesLoader.activateProgress visible: badgesLoader.showInfo || badgesLoader.showProgress - layer.enabled: root.enableShadows + layer.enabled: root.enableShadows && graphicsSystem.isAccelerated layer.effect: DropShadow { color: root.appShadowColor fast: true @@ -488,7 +489,7 @@ Item{ opacity: badgesLoader.activateProgress visible: badgesLoader.showAudio - layer.enabled: root.enableShadows + layer.enabled: root.enableShadows && graphicsSystem.isAccelerated layer.effect: DropShadow { color: root.appShadowColor fast: true @@ -515,7 +516,7 @@ Item{ height: iconImageBuffer.height anchors.centerIn: iconImageBuffer - active: badgeVisualsLoader.active + active: badgeVisualsLoader.active && graphicsSystem.isAccelerated sourceComponent: Colorize{ source: badgeVisualsLoader.item diff --git a/plasmoid/package/contents/ui/task/ShortcutBadge.qml b/plasmoid/package/contents/ui/task/ShortcutBadge.qml index 380422ac3..82649e715 100644 --- a/plasmoid/package/contents/ui/task/ShortcutBadge.qml +++ b/plasmoid/package/contents/ui/task/ShortcutBadge.qml @@ -44,7 +44,7 @@ Loader{ sourceComponent: Item{ Loader{ anchors.fill: taskNumber - active: root.enableShadows + active: root.enableShadows && graphicsSystem.isAccelerated sourceComponent: DropShadow{ color: root.appShadowColor diff --git a/plasmoid/package/contents/ui/task/TaskItem.qml b/plasmoid/package/contents/ui/task/TaskItem.qml index 425b9758e..323ed3c6f 100644 --- a/plasmoid/package/contents/ui/task/TaskItem.qml +++ b/plasmoid/package/contents/ui/task/TaskItem.qml @@ -306,8 +306,7 @@ MouseArea{ id:separatorItem anchors.centerIn: parent - opacity: (separatorShadow.active && (separatorShadow.item.status === ShaderEffect.Compiled)) - || forceHiddenState ? 0 : 0.4 + opacity: (separatorShadow.active) || forceHiddenState ? 0 : 0.4 visible: taskItem.isSeparator width: root.vertical ? root.iconSize : (root.dragSource || root.editMode) ? 5+root.lengthMargins: 1 @@ -397,7 +396,7 @@ MouseArea{ Loader{ id: separatorShadow anchors.fill: separatorItem - active: root.enableShadows && isSeparator + active: root.enableShadows && isSeparator && graphicsSystem.isAccelerated opacity: separatorItem.forceHiddenState ? 0 : 0.4 Behavior on opacity { diff --git a/plasmoid/package/contents/ui/task/animations/RemoveWindowFromGroupAnimation.qml b/plasmoid/package/contents/ui/task/animations/RemoveWindowFromGroupAnimation.qml index b5164b23f..0f845a970 100644 --- a/plasmoid/package/contents/ui/task/animations/RemoveWindowFromGroupAnimation.qml +++ b/plasmoid/package/contents/ui/task/animations/RemoveWindowFromGroupAnimation.qml @@ -89,7 +89,7 @@ Item{ Loader{ id: tempTaskShadow anchors.fill: tempRemoveIcon - active: root.enableShadows + active: root.enableShadows && graphicsSystem.isAccelerated sourceComponent: DropShadow{ anchors.fill: parent From 2866b6a3aadaf06506b4d24af30c40fd4584f553 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 27 Aug 2019 15:54:02 +0300 Subject: [PATCH 51/55] plasma theme colors for !accelerated graphics --fix also how accelerated graphics are identified by using GraphicsInfo api --- containment/package/contents/ui/colorizer/Manager.qml | 4 ++++ containment/package/contents/ui/main.qml | 8 ++++---- plasmoid/package/contents/ui/main.qml | 8 ++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/containment/package/contents/ui/colorizer/Manager.qml b/containment/package/contents/ui/colorizer/Manager.qml index 669b9e76d..41e2e6296 100644 --- a/containment/package/contents/ui/colorizer/Manager.qml +++ b/containment/package/contents/ui/colorizer/Manager.qml @@ -71,6 +71,10 @@ Loader{ && latteView.windowsTracker.currentScreen.touchingWindowScheme) property QtObject applyTheme: { + if (!graphicsSystem.isAccelerated) { + return theme; + } + if (latteView && latteView.windowsTracker && !root.hasExpandedApplet) { if (root.windowColors === Latte.Types.ActiveWindowColors && selectedWindowsTracker.activeWindowScheme) { return selectedWindowsTracker.activeWindowScheme; diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index 3459ba619..baf6edf52 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -import QtQuick 2.1 +import QtQuick 2.8 import QtQuick.Layouts 1.1 import QtQuick.Window 2.2 import QtGraphicalEffects 1.0 @@ -1711,10 +1711,10 @@ Item { id: indicators } - ShaderEffect { + Item { id: graphicsSystem - //! check if Software qml rendering is applied - readonly property bool isAccelerated: status === ShaderEffect.Compiled + readonly property bool isAccelerated: (GraphicsInfo.api !== GraphicsInfo.Software) + && (GraphicsInfo.api !== GraphicsInfo.Unknown) } ///////////////END components diff --git a/plasmoid/package/contents/ui/main.qml b/plasmoid/package/contents/ui/main.qml index 1e4fc29bc..815bf254a 100644 --- a/plasmoid/package/contents/ui/main.qml +++ b/plasmoid/package/contents/ui/main.qml @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -import QtQuick 2.0 +import QtQuick 2.8 import QtQuick.Layouts 1.1 import QtGraphicalEffects 1.0 @@ -377,10 +377,10 @@ Item { } //! - ShaderEffect { + Item { id: graphicsSystem - //! check if Software qml rendering is applied - readonly property bool isAccelerated: status === ShaderEffect.Compiled + readonly property bool isAccelerated: (GraphicsInfo.api !== GraphicsInfo.Software) + && (GraphicsInfo.api !== GraphicsInfo.Unknown) } Loader { From a885eaa1633d58b445cd336788c621325085b3a8 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 30 Aug 2019 01:49:59 +0300 Subject: [PATCH 52/55] dont show progress badge if user disabled it --- plasmoid/package/contents/ui/task/IconItem.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plasmoid/package/contents/ui/task/IconItem.qml b/plasmoid/package/contents/ui/task/IconItem.qml index 1c915c21b..79efafbba 100644 --- a/plasmoid/package/contents/ui/task/IconItem.qml +++ b/plasmoid/package/contents/ui/task/IconItem.qml @@ -301,7 +301,7 @@ Item{ property real activateProgress: showInfo || showProgress || showAudio ? 1 : 0 property bool showInfo: (root.showInfoBadge && taskIcon.smartLauncherItem && !taskItem.isSeparator - && (taskIcon.smartLauncherItem.countVisible || taskItem.badgeIndicator > 0)) + && (taskIcon.smartLauncherItem.countVisible || taskItem.badgeIndicator > 0) && !taskIcon.smartLauncherItem.progressVisible) property bool showProgress: root.showProgressBadge && taskIcon.smartLauncherItem && !taskItem.isSeparator && taskIcon.smartLauncherItem.progressVisible From 768a6b4b2a7f21a1a72363670ec69b98cbb71859 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 30 Aug 2019 02:23:50 +0300 Subject: [PATCH 53/55] indicators can now offset a bit icons --through level.requested options each indicator instance can request specific repositioning for each icon. Very good example for this is the Win7 style indicator --- .../package/contents/ui/applet/AppletItem.qml | 17 +++++++++++++++++ .../ui/applet/indicator/LevelOptions.qml | 5 +++++ declarativeimports/components/IndicatorItem.qml | 1 - plasmoid/package/contents/ui/task/TaskItem.qml | 17 +++++++++++++++++ plasmoid/package/contents/ui/task/Wrapper.qml | 3 +++ .../contents/ui/task/indicator/LevelOptions.qml | 5 +++++ 6 files changed, 47 insertions(+), 1 deletion(-) diff --git a/containment/package/contents/ui/applet/AppletItem.qml b/containment/package/contents/ui/applet/AppletItem.qml index 8590a84e5..72ed5856e 100644 --- a/containment/package/contents/ui/applet/AppletItem.qml +++ b/containment/package/contents/ui/applet/AppletItem.qml @@ -134,6 +134,10 @@ Item { property int spacersMaxSize: Math.max(0,Math.ceil(0.55 * root.iconSize) - root.lengthMargins) property int status: applet ? applet.status : -1 + //! are set by the indicator + property int iconOffsetX: 0 + property int iconOffsetY: 0 + property real computeWidth: root.isVertical ? wrapper.width : hiddenSpacerLeft.width+wrapper.width+hiddenSpacerRight.width @@ -660,8 +664,21 @@ Item { Indicator.Loader{ id: indicatorBackLayer level: Indicator.LevelOptions { + id: backLevelOptions isBackground: true bridge: indicatorBridge + + Binding { + target: appletItem + property: "iconOffsetX" + value: backLevelOptions.requested.iconOffsetX + } + + Binding { + target: appletItem + property: "iconOffsetY" + value: backLevelOptions.requested.iconOffsetY + } } } diff --git a/containment/package/contents/ui/applet/indicator/LevelOptions.qml b/containment/package/contents/ui/applet/indicator/LevelOptions.qml index 9d6f0c15e..3184c8176 100644 --- a/containment/package/contents/ui/applet/indicator/LevelOptions.qml +++ b/containment/package/contents/ui/applet/indicator/LevelOptions.qml @@ -30,6 +30,11 @@ Item { property bool isBackground: true property bool isForeground: false + readonly property Item requested: Item{ + property int iconOffsetX: 0 + property int iconOffsetY: 0 + } + property Item bridge onIsBackgroundChanged: { diff --git a/declarativeimports/components/IndicatorItem.qml b/declarativeimports/components/IndicatorItem.qml index efdae841a..4186bed2e 100644 --- a/declarativeimports/components/IndicatorItem.qml +++ b/declarativeimports/components/IndicatorItem.qml @@ -49,7 +49,6 @@ Item { //! e.g 0.06 -> 6% property real minLengthPadding: 0 - //! svg image paths either from plasma theme or local files relevant to indicator "ui" directory //! in order to reduce resources usage property var svgImagePaths: [] diff --git a/plasmoid/package/contents/ui/task/TaskItem.qml b/plasmoid/package/contents/ui/task/TaskItem.qml index 323ed3c6f..c5d22d310 100644 --- a/plasmoid/package/contents/ui/task/TaskItem.qml +++ b/plasmoid/package/contents/ui/task/TaskItem.qml @@ -138,6 +138,10 @@ MouseArea{ property int windowsCount: subWindows.windowsCount property int windowsMinimizedCount: subWindows.windowsMinimized + //! are set by the indicator + property int iconOffsetX: 0 + property int iconOffsetY: 0 + property string activity: tasksModel.activity readonly property var m: model @@ -441,8 +445,21 @@ MouseArea{ Indicator.Loader{ id: indicatorBackLayer level: Indicator.LevelOptions { + id: backLevelOptions isBackground: true bridge: indicatorBridge + + Binding { + target: taskItem + property: "iconOffsetX" + value: backLevelOptions.requested.iconOffsetX + } + + Binding { + target: taskItem + property: "iconOffsetY" + value: backLevelOptions.requested.iconOffsetY + } } } diff --git a/plasmoid/package/contents/ui/task/Wrapper.qml b/plasmoid/package/contents/ui/task/Wrapper.qml index e85936313..3c776206e 100644 --- a/plasmoid/package/contents/ui/task/Wrapper.qml +++ b/plasmoid/package/contents/ui/task/Wrapper.qml @@ -143,6 +143,9 @@ Item{ anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined + anchors.horizontalCenterOffset: taskItem.iconOffsetX + anchors.verticalCenterOffset: taskItem.iconOffsetY + width: wrapper.width height:wrapper.height } diff --git a/plasmoid/package/contents/ui/task/indicator/LevelOptions.qml b/plasmoid/package/contents/ui/task/indicator/LevelOptions.qml index 9d6f0c15e..3184c8176 100644 --- a/plasmoid/package/contents/ui/task/indicator/LevelOptions.qml +++ b/plasmoid/package/contents/ui/task/indicator/LevelOptions.qml @@ -30,6 +30,11 @@ Item { property bool isBackground: true property bool isForeground: false + readonly property Item requested: Item{ + property int iconOffsetX: 0 + property int iconOffsetY: 0 + } + property Item bridge onIsBackgroundChanged: { From edfd111d9a3212aefed6a89926e7128660856ba8 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 30 Aug 2019 02:44:33 +0300 Subject: [PATCH 54/55] use only exter.margins for separators --separators are only usings the external margins between items. In the past it was also consider the indicators internal padding. This is not needed and it was creating too big empty spaces with no real reason. --- containment/package/contents/ui/applet/HiddenSpacer.qml | 3 ++- plasmoid/package/contents/ui/task/HiddenSpacer.qml | 4 ++-- plasmoid/package/contents/ui/task/TaskItem.qml | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/containment/package/contents/ui/applet/HiddenSpacer.qml b/containment/package/contents/ui/applet/HiddenSpacer.qml index 8f44c2be2..4fa2e49c5 100644 --- a/containment/package/contents/ui/applet/HiddenSpacer.qml +++ b/containment/package/contents/ui/applet/HiddenSpacer.qml @@ -32,7 +32,8 @@ Item{ property bool neighbourSeparator: false; - property int separatorSpace: neighbourSeparator && !appletItem.isSeparator && !appletItem.latteApplet && root.zoomFactor>1 ? (2+root.lengthMargin) : 0 + property int separatorSpace: neighbourSeparator && !appletItem.isSeparator && root.parabolicEffectEnabled + && !appletItem.latteApplet ? (2.5+root.lengthExtMargin) : 0 property real nHiddenSize: { if (isSeparator || !communicator.lengthMarginsEnabled) { diff --git a/plasmoid/package/contents/ui/task/HiddenSpacer.qml b/plasmoid/package/contents/ui/task/HiddenSpacer.qml index 9615bdb38..9c9022ccc 100644 --- a/plasmoid/package/contents/ui/task/HiddenSpacer.qml +++ b/plasmoid/package/contents/ui/task/HiddenSpacer.qml @@ -45,9 +45,9 @@ Item{ //and it is used later on Behaviors in order to not break //the activity change animations from removal/additions of tasks //! && !root.inActivityChange (deprecated) in order to check if it is fixed - property int separatorSpace: neighbourSeparator && !isSeparator + property int separatorSpace: neighbourSeparator && !isSeparator && root.parabolicEffectEnabled && !(parabolicManager.hasInternalSeparator && root.dragSource) ? - (2+root.lengthMargin) : 0 + (2.5+root.lengthExtMargin) : 0 property bool rightSpacer: false diff --git a/plasmoid/package/contents/ui/task/TaskItem.qml b/plasmoid/package/contents/ui/task/TaskItem.qml index c5d22d310..595d44e82 100644 --- a/plasmoid/package/contents/ui/task/TaskItem.qml +++ b/plasmoid/package/contents/ui/task/TaskItem.qml @@ -50,7 +50,7 @@ MouseArea{ return 0; if (isSeparator) - return root.vertical ? root.iconSize + root.thickMargins : (root.dragSource || !root.parabolicEffectEnabled ? 5+root.lengthMargins : 0); + return root.vertical ? root.iconSize + root.thickMargins : (root.dragSource || !root.parabolicEffectEnabled ? 5+2*root.lengthExtMargin : 0); if (root.vertical) { return wrapper.width; @@ -68,7 +68,7 @@ MouseArea{ return 0; if (isSeparator) - return !root.vertical ? root.iconSize + root.thickMargins : (root.dragSource || !root.parabolicEffectEnabled ? 5+root.lengthMargins: 0); + return !root.vertical ? root.iconSize + root.thickMargins : (root.dragSource || !root.parabolicEffectEnabled ? 5+2*root.lengthExtMargin: 0); if (root.vertical) { return hiddenSpacerLeft.height + wrapper.height + hiddenSpacerRight.height; From 5a2c59601cee071afea2af9865c976c1916eda83 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 30 Aug 2019 15:03:13 +0300 Subject: [PATCH 55/55] Indicators:different margins for applets --indicators gained a way to set different margins for applets if they want to --- .../package/contents/ui/applet/AppletItem.qml | 2 +- .../contents/ui/applet/HiddenSpacer.qml | 6 +++- .../contents/ui/applet/ItemWrapper.qml | 7 +++-- .../contents/ui/applet/indicator/Loader.qml | 4 +-- .../contents/ui/indicators/Manager.qml | 28 +++++++++++++------ containment/package/contents/ui/main.qml | 17 +++++++++-- .../components/IndicatorItem.qml | 6 ++++ 7 files changed, 52 insertions(+), 18 deletions(-) diff --git a/containment/package/contents/ui/applet/AppletItem.qml b/containment/package/contents/ui/applet/AppletItem.qml index 72ed5856e..de2098622 100644 --- a/containment/package/contents/ui/applet/AppletItem.qml +++ b/containment/package/contents/ui/applet/AppletItem.qml @@ -131,7 +131,7 @@ Item { property int previousIndex: -1 property int sizeForFill: -1 //it is used in calculations for fillWidth,fillHeight applets - property int spacersMaxSize: Math.max(0,Math.ceil(0.55 * root.iconSize) - root.lengthMargins) + property int spacersMaxSize: Math.max(0,Math.ceil(0.55 * root.iconSize) - root.lengthAppletMargins) property int status: applet ? applet.status : -1 //! are set by the indicator diff --git a/containment/package/contents/ui/applet/HiddenSpacer.qml b/containment/package/contents/ui/applet/HiddenSpacer.qml index 4fa2e49c5..49feda4bb 100644 --- a/containment/package/contents/ui/applet/HiddenSpacer.qml +++ b/containment/package/contents/ui/applet/HiddenSpacer.qml @@ -33,7 +33,7 @@ Item{ property bool neighbourSeparator: false; property int separatorSpace: neighbourSeparator && !appletItem.isSeparator && root.parabolicEffectEnabled - && !appletItem.latteApplet ? (2.5+root.lengthExtMargin) : 0 + && !appletItem.latteApplet ? (2.5+root.lengthExtMargin) : subtrackedMargins property real nHiddenSize: { if (isSeparator || !communicator.lengthMarginsEnabled) { @@ -45,6 +45,10 @@ Item{ property bool rightSpacer: false + readonly property bool atEdgeForcingFittsLaw: !isSeparator && !root.parabolicEffectEnabled && root.inFullJustify && atScreenEdge && !isSquare + readonly property int subtrackedMargins: atEdgeForcingFittsLaw && ((startEdge && rightSpacer) || (endEdge && !rightSpacer )) ? + root.lengthAppletIntMargin + root.lengthExtMargin : 0 + property real nScale: 0 Behavior on nHiddenSize { diff --git a/containment/package/contents/ui/applet/ItemWrapper.qml b/containment/package/contents/ui/applet/ItemWrapper.qml index c026b8b47..d6fbc2e1d 100644 --- a/containment/package/contents/ui/applet/ItemWrapper.qml +++ b/containment/package/contents/ui/applet/ItemWrapper.qml @@ -117,12 +117,13 @@ Item{ property int marginWidth: root.isVertical ? root.thickMargins : - (root.inFullJustify && atScreenEdge ? 0 : localLengthMargins) //Fitt's Law + (root.inFullJustify && atScreenEdge ? edgeLengthMargins : localLengthMargins) //Fitt's Law property int marginHeight: root.isHorizontal ? root.thickMargins : - (root.inFullJustify && atScreenEdge ? 0 : localLengthMargins) //Fitt's Law + (root.inFullJustify && atScreenEdge ? edgeLengthMargins : localLengthMargins) //Fitt's Law - property int localLengthMargins: isSeparator || !communicator.lengthMarginsEnabled ? 0 : root.lengthMargins + property int localLengthMargins: isSeparator || !communicator.lengthMarginsEnabled ? 0 : root.lengthAppletMargins + property int edgeLengthMargins: isSeparator || !communicator.lengthMarginsEnabled || !isSquare ? 0 : root.lengthAppletMargins property real scaledWidth: zoomScaleWidth * (layoutWidth + marginWidth) property real scaledHeight: zoomScaleHeight * (layoutHeight + marginHeight) diff --git a/containment/package/contents/ui/applet/indicator/Loader.qml b/containment/package/contents/ui/applet/indicator/Loader.qml index 5c270dc46..91e8e7327 100644 --- a/containment/package/contents/ui/applet/indicator/Loader.qml +++ b/containment/package/contents/ui/applet/indicator/Loader.qml @@ -42,11 +42,11 @@ Loader { return indicators.indicatorComponent; } - width: root.isHorizontal && !(root.inFullJustify && atScreenEdge /*Fitt's Law*/) ? + width: root.isHorizontal && !(root.inFullJustify && atScreenEdge /*Fitt's Law*/ && !isSquare) ? appletItem.wrapperAlias.width - 2*appletItem.wrapperAlias.zoomScale*root.lengthExtMargin : appletItem.wrapperAlias.width - height: root.isVertical && !(root.inFullJustify && atScreenEdge /*Fitt's Law*/) ? + height: root.isVertical && !(root.inFullJustify && atScreenEdge /*Fitt's Law*/ && !isSquare) ? appletItem.wrapperAlias.height - 2*appletItem.wrapperAlias.zoomScale*root.lengthExtMargin : appletItem.wrapperAlias.height diff --git a/containment/package/contents/ui/indicators/Manager.qml b/containment/package/contents/ui/indicators/Manager.qml index d45838539..d44e2f910 100644 --- a/containment/package/contents/ui/indicators/Manager.qml +++ b/containment/package/contents/ui/indicators/Manager.qml @@ -37,27 +37,29 @@ Item{ readonly property real padding: Math.max(info.minLengthPadding, latteView && latteView.indicator ? latteView.indicator.padding : 0.08) readonly property string type: latteView && latteView.indicator ? latteView.indicator.type : "org.kde.latte.default" + readonly property bool infoLoaded: metricsLoader.active && metricsLoader.item + readonly property Component plasmaStyleComponent: latteView && latteView.indicator ? latteView.indicator.plasmaComponent : null readonly property Component indicatorComponent: latteView && latteView.indicator ? latteView.indicator.component : null readonly property Item info: Item{ - readonly property bool needsIconColors: metricsLoader.active && metricsLoader.item && metricsLoader.item.hasOwnProperty("needsIconColors") + readonly property bool needsIconColors: infoLoaded && metricsLoader.item.hasOwnProperty("needsIconColors") && metricsLoader.item.needsIconColors - readonly property bool needsMouseEventCoordinates: metricsLoader.active && metricsLoader.item && metricsLoader.item.hasOwnProperty("needsMouseEventCoordinates") + readonly property bool needsMouseEventCoordinates: infoLoaded && metricsLoader.item.hasOwnProperty("needsMouseEventCoordinates") && metricsLoader.item.needsMouseEventCoordinates - readonly property bool providesFrontLayer: metricsLoader.active && metricsLoader.item && metricsLoader.item.hasOwnProperty("providesFrontLayer") + readonly property bool providesFrontLayer: minfoLoaded && metricsLoader.item.hasOwnProperty("providesFrontLayer") && metricsLoader.item.providesFrontLayer - readonly property bool providesHoveredAnimation: metricsLoader.active && metricsLoader.item && metricsLoader.item.hasOwnProperty("providesHoveredAnimation") + readonly property bool providesHoveredAnimation: infoLoaded && metricsLoader.item.hasOwnProperty("providesHoveredAnimation") && metricsLoader.item.providesHoveredAnimation - readonly property bool providesClickedAnimation: metricsLoader.active && metricsLoader.item && metricsLoader.item.hasOwnProperty("providesClickedAnimation") + readonly property bool providesClickedAnimation: infoLoaded && metricsLoader.item.hasOwnProperty("providesClickedAnimation") && metricsLoader.item.providesClickedAnimation readonly property int extraMaskThickness: { - if (metricsLoader.active && metricsLoader.item && metricsLoader.item.hasOwnProperty("extraMaskThickness")) { + if (infoLoaded && metricsLoader.item.hasOwnProperty("extraMaskThickness")) { return metricsLoader.item.extraMaskThickness; } @@ -65,7 +67,7 @@ Item{ } readonly property real minThicknessPadding: { - if (metricsLoader.active && metricsLoader.item && metricsLoader.item.hasOwnProperty("minThicknessPadding")) { + if (infoLoaded && metricsLoader.item.hasOwnProperty("minThicknessPadding")) { return metricsLoader.item.minThicknessPadding; } @@ -73,14 +75,22 @@ Item{ } readonly property real minLengthPadding: { - if (metricsLoader.active && metricsLoader.item && metricsLoader.item.hasOwnProperty("minLengthPadding")) { + if (infoLoaded && metricsLoader.item.hasOwnProperty("minLengthPadding")) { return metricsLoader.item.minLengthPadding; } return 0; } - readonly property variant svgPaths: metricsLoader.active && metricsLoader.item && metricsLoader.item.hasOwnProperty("svgImagePaths") ? + readonly property real appletLengthPadding: { + if (infoLoaded && metricsLoader.item.hasOwnProperty("appletLengthPadding")) { + return metricsLoader.item.appletLengthPadding; + } + + return -1; + } + + readonly property variant svgPaths: infoLoaded && metricsLoader.item.hasOwnProperty("svgImagePaths") ? metricsLoader.item.svgImagePaths : [] onSvgPathsChanged: latteView.indicator.resources.setSvgImagePaths(svgPaths); diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index baf6edf52..94bf45ee0 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -377,6 +377,9 @@ Item { property real lengthIntMarginFactor: indicators.isEnabled ? indicators.padding : 0 property real lengthExtMarginFactor: plasmoid.configuration.lengthExtMargin / 100 + property int lengthAppletIntMargin: lengthAppletIntMarginFactor === -1 ? lengthIntMargin : lengthAppletIntMarginFactor * root.iconSize + property real lengthAppletIntMarginFactor: indicators.infoLoaded && !parabolicEffectEnabled ? indicators.info.appletLengthPadding : -1 + property real thickMarginFactor: { if (shrinkThickMargins) { return indicators.info.minThicknessPadding; @@ -398,11 +401,14 @@ Item { property int lengthMargin: lengthIntMargin + lengthExtMargin property int lengthMargins: 2 * lengthMargin + property int lengthAppletMargin: lengthAppletIntMargin + lengthExtMargin + property int lengthAppletMargins: 2 * lengthAppletIntMargin + property int widthMargins: root.isVertical ? thickMargins : lengthMargins property int heightMargins: root.isHorizontal ? thickMargins : lengthMargins - property int internalWidthMargins: root.isVertical ? thickMargins : 2 * lengthIntMargin - property int internalHeightMargins: root.isHorizontal ? thickMargins : 2 * lengthIntMargin + property int internalWidthMargins: root.isVertical ? thickMargins : 2 * lengthAppletMargin + property int internalHeightMargins: root.isHorizontal ? thickMargins : 2 * lengthAppletMargin ///FIXME: I can't remember why this is needed, maybe for the anchorings!!! In order for the Double Layout to not mess the anchorings... //property int layoutsContainer.mainLayoutPosition: !plasmoid.immutable ? Latte.Types.Center : (root.isVertical ? Latte.Types.Top : Latte.Types.Left) @@ -607,6 +613,13 @@ Item { } } + Behavior on lengthAppletIntMargin { + NumberAnimation { + duration: 0.8 * root.animationTime + easing.type: Easing.OutCubic + } + } + Behavior on lengthExtMargin { NumberAnimation { duration: 0.8 * root.animationTime diff --git a/declarativeimports/components/IndicatorItem.qml b/declarativeimports/components/IndicatorItem.qml index 4186bed2e..511bb435e 100644 --- a/declarativeimports/components/IndicatorItem.qml +++ b/declarativeimports/components/IndicatorItem.qml @@ -49,6 +49,12 @@ Item { //! e.g 0.06 -> 6% property real minLengthPadding: 0 + //! this indicator specifies a different padding value for applets. This value is a percentage, + //! -1, means disabled and the regular padding is used + //! 0.06 -> 6% + //! [since v0.9.2] + property real appletLengthPadding: -1 + //! svg image paths either from plasma theme or local files relevant to indicator "ui" directory //! in order to reduce resources usage property var svgImagePaths: []