Hello community,
here is the log from the commit of package applet-window-buttons for
openSUSE:Factory checked in at 2019-07-13 13:50:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/applet-window-buttons (Old)
and /work/SRC/openSUSE:Factory/.applet-window-buttons.new.4615 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "applet-window-buttons"
Sat Jul 13 13:50:38 2019 rev:3 rq:714931 version:0.5.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/applet-window-buttons/applet-window-buttons.changes
2019-07-01 10:44:20.697474529 +0200
+++
/work/SRC/openSUSE:Factory/.applet-window-buttons.new.4615/applet-window-buttons.changes
2019-07-13 14:01:03.758885801 +0200
@@ -1,0 +2,10 @@
+Fri Jul 12 21:49:19 UTC 2019 - Cor Blom <[email protected]>
+
+- Update to version 0.5.0:
+ * provide a relevant background for window buttons in configuration
+ window to fix contrast issues
+ * support new Latte v0.9 Communicator API
+ * support new Latte v0.9 Windows Tracking interface when in Latte
+ dock/panel
+
+-------------------------------------------------------------------
Old:
----
applet-window-buttons-0.4.tar.gz
New:
----
applet-window-buttons-0.5.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ applet-window-buttons.spec ++++++
--- /var/tmp/diff_new_pack.zEvmLc/_old 2019-07-13 14:01:04.250885651 +0200
+++ /var/tmp/diff_new_pack.zEvmLc/_new 2019-07-13 14:01:04.254885649 +0200
@@ -20,7 +20,7 @@
%define qt5_version 5.9
Name: applet-window-buttons
-Version: 0.4
+Version: 0.5.0
Release: 0
Summary: Plasma 5 applet to show window buttons in panels
License: GPL-2.0-or-later
++++++ applet-window-buttons-0.4.tar.gz -> applet-window-buttons-0.5.0.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/applet-window-buttons-0.4/CHANGELOG.md
new/applet-window-buttons-0.5.0/CHANGELOG.md
--- old/applet-window-buttons-0.4/CHANGELOG.md 2019-05-14 18:25:39.000000000
+0200
+++ new/applet-window-buttons-0.5.0/CHANGELOG.md 2019-07-12
21:51:03.000000000 +0200
@@ -1,6 +1,13 @@
### CHANGELOG
+#### Version 0.5.0
+
+* provide a relevant background for window buttons in configuration window to
fix contrast issues
+* support new Latte v0.9 Communicator API
+* support new Latte v0.9 Windows Tracking interface when in Latte dock/panel
+
#### Version 0.4
+
* add new KeepAbove button support (community contribution)
* merge different versions into a single one. One version for all Plasma
versions >= 5.12
* close ComboBoxes after clicking
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/applet-window-buttons-0.4/CMakeLists.txt
new/applet-window-buttons-0.5.0/CMakeLists.txt
--- old/applet-window-buttons-0.4/CMakeLists.txt 2019-05-14
18:25:39.000000000 +0200
+++ new/applet-window-buttons-0.5.0/CMakeLists.txt 2019-07-12
21:51:03.000000000 +0200
@@ -2,7 +2,7 @@
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
set(CMAKE_CXX_STANDARD 14)
-set(VERSION 0.2.0)
+set(VERSION 0.5.0)
set(AUTHOR "Michail Vourlakos")
set(EMAIL "[email protected]")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.4/libappletdecoration/CMakeLists.txt
new/applet-window-buttons-0.5.0/libappletdecoration/CMakeLists.txt
--- old/applet-window-buttons-0.4/libappletdecoration/CMakeLists.txt
2019-05-14 18:25:39.000000000 +0200
+++ new/applet-window-buttons-0.5.0/libappletdecoration/CMakeLists.txt
2019-07-12 21:51:03.000000000 +0200
@@ -12,8 +12,9 @@
set(appletdecoration_SRCS
appletdecorationplugin.cpp
- buttonsmodel.cpp
auroraetheme.cpp
+ buttonsmodel.cpp
+ commontools.cpp
decorationsmodel.cpp
decorationpalette.cpp
environment.cpp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.4/libappletdecoration/auroraetheme.cpp
new/applet-window-buttons-0.5.0/libappletdecoration/auroraetheme.cpp
--- old/applet-window-buttons-0.4/libappletdecoration/auroraetheme.cpp
2019-05-14 18:25:39.000000000 +0200
+++ new/applet-window-buttons-0.5.0/libappletdecoration/auroraetheme.cpp
2019-07-12 21:51:03.000000000 +0200
@@ -19,14 +19,18 @@
#include "auroraetheme.h"
+#include "commontools.h"
+
+#include <QDebug>
#include <QDir>
#include <QFileInfo>
+#include <QRgb>
#include <KConfigGroup>
+#include <KDirWatch>
#include <KSharedConfig>
-#include <QDebug>
-#include <KDirWatch>
+#include <Plasma/Svg>
namespace Decoration {
namespace Applet {
@@ -113,6 +117,11 @@
return m_themeType;
}
+QColor AuroraeTheme::titleBackgroundColor() const
+{
+ return m_titleBackgroundColor;
+}
+
void AuroraeTheme::auroraeRCChanged(const QString &filename)
{
if (!filename.endsWith(s_auroraerc)) {
@@ -126,18 +135,7 @@
{
const QString separator("__");
const QString name = themeName.section(separator, -1, -1);
- QString path;
-
- QString localThemePath = QDir::homePath() +
"/.local/share/aurorae/themes/" + name;
- QString globalThemePath = "/usr/share/aurorae/themes/" + name;
-
- if (QDir(localThemePath).exists()) {
- path = localThemePath;
- } else if (QDir(globalThemePath).exists()) {
- path = globalThemePath;
- } else {
- path = "";
- }
+ QString path = AppletDecoration::standardPath("aurorae/themes/"+name);
if (QFileInfo(path + "/close.svg").exists()) {
m_themeType = "svg";
@@ -182,8 +180,43 @@
m_buttonHeight = layoutGroup.readEntry("ButtonHeight", 24);
m_buttonSpacing = layoutGroup.readEntry("ButtonSpacing", 2);
+ parseThemeImages();
+
emit settingsChanged();
}
+void AuroraeTheme::parseThemeImages()
+{
+ QString origBackgroundFilePath = m_themePath + "/decoration."+m_themeType;
+
+ if (!QFileInfo(origBackgroundFilePath).exists()) {
+ qDebug() << "Aurorare decoration file was not found for theme: " <<
m_themeName;
+ return;
+ }
+
+ Plasma::Svg *svg = new Plasma::Svg(this);
+ svg->setImagePath(origBackgroundFilePath);
+ svg->resize(50,50);
+ QImage img = svg->image(QSize(50,50), "decoration-top");
+
+ int maxOpacity = -1;
+
+ for (int y=49; y>=0; --y) {
+ QRgb *line = (QRgb *)img.scanLine(y);
+ for (int x=0; x<50; ++x) {
+ QRgb pix = line[x];
+ int opacity = qAlpha(pix);
+
+ //! the equality returns better results for more aurorae themes
+ if (maxOpacity<=opacity) {
+ maxOpacity = opacity;
+ m_titleBackgroundColor = QColor(qRed(pix), qGreen(pix),
qBlue(pix));
+ }
+ }
+ }
+
+ svg->deleteLater();
+}
+
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.4/libappletdecoration/auroraetheme.h
new/applet-window-buttons-0.5.0/libappletdecoration/auroraetheme.h
--- old/applet-window-buttons-0.4/libappletdecoration/auroraetheme.h
2019-05-14 18:25:39.000000000 +0200
+++ new/applet-window-buttons-0.5.0/libappletdecoration/auroraetheme.h
2019-07-12 21:51:03.000000000 +0200
@@ -20,6 +20,7 @@
#ifndef AURORAETHEME_H
#define AURORAETHEME_H
+#include <QColor>
#include <QObject>
#include "types.h"
@@ -42,6 +43,8 @@
Q_PROPERTY(float buttonRatio READ buttonRatio NOTIFY settingsChanged)
+ Q_PROPERTY(QColor titleBackgroundColor READ titleBackgroundColor NOTIFY
settingsChanged)
+
public:
explicit AuroraeTheme(QObject *parent = nullptr);
~AuroraeTheme() override;;
@@ -60,11 +63,14 @@
float buttonRatio() const;
+ QColor titleBackgroundColor() const;
+
signals:
void settingsChanged();
void themeChanged();
private slots:
+ void parseThemeImages();
void auroraeRCChanged(const QString &filename);
private:
@@ -83,6 +89,8 @@
QString m_themeName;
QString m_themePath;
QString m_themeType;
+
+ QColor m_titleBackgroundColor;
};
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.4/libappletdecoration/commontools.cpp
new/applet-window-buttons-0.5.0/libappletdecoration/commontools.cpp
--- old/applet-window-buttons-0.4/libappletdecoration/commontools.cpp
1970-01-01 01:00:00.000000000 +0100
+++ new/applet-window-buttons-0.5.0/libappletdecoration/commontools.cpp
2019-07-12 21:51:03.000000000 +0200
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2018 Michail Vourlakos <[email protected]>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "commontools.h"
+
+// Qt
+#include <QFileInfo>
+#include <QStandardPaths>
+
+namespace AppletDecoration {
+
+QString standardPath(QString subPath, bool localfirst)
+{
+ QStringList paths =
QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
+
+ 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;
+ }
+ }
+ }
+
+ //! in any case that above fails
+ if (QFileInfo("/usr/share/"+subPath).exists()) {
+ return "/usr/share/"+subPath;
+ }
+
+ return "";
+}
+
+QStringList standardPaths(bool localfirst)
+{
+ QStringList paths =
QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation);
+
+ if (localfirst) {
+ return paths;
+ } else {
+ QStringList reversed;
+
+ for (int i=paths.count()-1; i>=0; i--) {
+ reversed << paths[i];
+ }
+
+ return reversed;
+ }
+}
+
+QStringList standardPathsFor(QString subPath, bool localfirst)
+{
+ QStringList paths = standardPaths(localfirst);
+
+ QString separator = subPath.startsWith("/") ? "" : "/";
+
+ for (int i=0; i<paths.count(); ++i) {
+ paths[i] = paths[i] + separator + subPath;
+ }
+
+ return paths;
+}
+
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.4/libappletdecoration/commontools.h
new/applet-window-buttons-0.5.0/libappletdecoration/commontools.h
--- old/applet-window-buttons-0.4/libappletdecoration/commontools.h
1970-01-01 01:00:00.000000000 +0100
+++ new/applet-window-buttons-0.5.0/libappletdecoration/commontools.h
2019-07-12 21:51:03.000000000 +0200
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2019 Michail Vourlakos <[email protected]>
+ *
+ * This file is part of the libappletdecoration library
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <QString>
+#include <QStringList>
+
+namespace AppletDecoration {
+
+//! returns the standard path found that contains the subPath
+//! local paths have higher priority by default
+QString standardPath(QString subPath, bool localFirst = true);
+
+QStringList standardPaths(bool localfirst = true);
+QStringList standardPathsFor(QString subPath, bool localfirst = true);
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.4/libappletdecoration/previewclient.h
new/applet-window-buttons-0.5.0/libappletdecoration/previewclient.h
--- old/applet-window-buttons-0.4/libappletdecoration/previewclient.h
2019-05-14 18:25:39.000000000 +0200
+++ new/applet-window-buttons-0.5.0/libappletdecoration/previewclient.h
2019-07-12 21:51:03.000000000 +0200
@@ -118,7 +118,7 @@
void requestShowApplicationMenu(const QRect &rect, int actionId) override;
void requestToggleOnAllDesktops() override;
- void showApplicationMenu(int actionId);
+ void showApplicationMenu(int actionId) override;
void setCaption(const QString &caption);
void setActive(bool active);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.4/libappletdecoration/previewsettings.h
new/applet-window-buttons-0.5.0/libappletdecoration/previewsettings.h
--- old/applet-window-buttons-0.4/libappletdecoration/previewsettings.h
2019-05-14 18:25:39.000000000 +0200
+++ new/applet-window-buttons-0.5.0/libappletdecoration/previewsettings.h
2019-07-12 21:51:03.000000000 +0200
@@ -106,7 +106,7 @@
}
void setBorderSizesIndex(int index);
- QFont font() const {
+ QFont font() const override{
return m_font;
}
void setFont(const QFont &font);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.4/libappletdecoration/schemecolors.cpp
new/applet-window-buttons-0.5.0/libappletdecoration/schemecolors.cpp
--- old/applet-window-buttons-0.4/libappletdecoration/schemecolors.cpp
2019-05-14 18:25:39.000000000 +0200
+++ new/applet-window-buttons-0.5.0/libappletdecoration/schemecolors.cpp
2019-07-12 21:51:03.000000000 +0200
@@ -20,6 +20,8 @@
#include "schemecolors.h"
+#include "commontools.h"
+
#include <QDebug>
#include <QDir>
#include <QFileInfo>
@@ -164,16 +166,7 @@
//! remove all whitespaces and "-" from scheme in order to access
correctly its file
QString schemeNameSimplified = tempScheme.simplified().remove("
").remove("-");
- QString localSchemePath = QDir::homePath() +
"/.local/share/color-schemes/" + schemeNameSimplified + ".colors";
- QString globalSchemePath = "/usr/share/color-schemes/" +
schemeNameSimplified + ".colors";
-
- if (QFileInfo(localSchemePath).exists()) {
- return localSchemePath;
- } else if (QFileInfo(globalSchemePath).exists()) {
- return globalSchemePath;
- }
-
- return "";
+ return AppletDecoration::standardPath("color-schemes/" +
schemeNameSimplified + ".colors");
}
QString SchemeColors::schemeName(QString originalFile)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.4/libappletdecoration/schemesmodel.cpp
new/applet-window-buttons-0.5.0/libappletdecoration/schemesmodel.cpp
--- old/applet-window-buttons-0.4/libappletdecoration/schemesmodel.cpp
2019-05-14 18:25:39.000000000 +0200
+++ new/applet-window-buttons-0.5.0/libappletdecoration/schemesmodel.cpp
2019-07-12 21:51:03.000000000 +0200
@@ -20,6 +20,7 @@
#include "schemesmodel.h"
+#include "commontools.h"
#include "schemecolors.h"
#include <QDebug>
@@ -84,6 +85,15 @@
return roles;
}
+QColor SchemesModel::backgroundOf(const int &index) const
+{
+ if (index>=0 && index<m_schemes.count()) {
+ return m_schemes[index]->backgroundColor();
+ }
+
+ return QColor("transparent");
+}
+
void SchemesModel::initSchemes()
{
qDeleteAll(m_schemes);
@@ -92,23 +102,20 @@
QString currentSchemePath = SchemeColors::possibleSchemeFile("kdeglobals");
insertSchemeInList(currentSchemePath);
- QString userPath = QDir::homePath() + "/.local/share/color-schemes";
- QDir directory(userPath);
- QStringList localSchemes = directory.entryList(QStringList() << "*.colors"
<< "*.COLORS", QDir::Files);
-
- foreach (QString filename, localSchemes) {
- QString fullPath = userPath + "/" + filename;
- insertSchemeInList(fullPath);
- }
+ QStringList standardPaths =
AppletDecoration::standardPathsFor("color-schemes");
+
+ QStringList registeredSchemes;
- QString globalPath = "/usr/share/color-schemes";
- directory.setPath(globalPath);
- QStringList globalSchemes = directory.entryList(QStringList() <<
"*.colors" << "*.COLORS", QDir::Files);
-
- foreach (QString filename, globalSchemes) {
- if (!localSchemes.contains(filename)) {
- QString fullPath = globalPath + "/" + filename;
- insertSchemeInList(fullPath);
+ for(auto path : standardPaths) {
+ QDir directory(path);
+ QStringList tempSchemes = directory.entryList(QStringList() <<
"*.colors" << "*.COLORS", QDir::Files);
+
+ foreach (QString filename, tempSchemes) {
+ if (!registeredSchemes.contains(filename)) {
+ QString fullPath = path + "/" + filename;
+ insertSchemeInList(fullPath);
+ registeredSchemes << filename;
+ }
}
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.4/libappletdecoration/schemesmodel.h
new/applet-window-buttons-0.5.0/libappletdecoration/schemesmodel.h
--- old/applet-window-buttons-0.4/libappletdecoration/schemesmodel.h
2019-05-14 18:25:39.000000000 +0200
+++ new/applet-window-buttons-0.5.0/libappletdecoration/schemesmodel.h
2019-07-12 21:51:03.000000000 +0200
@@ -41,6 +41,7 @@
QHash< int, QByteArray > roleNames() const override;
Q_INVOKABLE int indexOf(QString file);
+ Q_INVOKABLE QColor backgroundOf(const int &index) const;
private slots:
void initSchemes();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.4/package/contents/ui/LatteWindowsTracker.qml
new/applet-window-buttons-0.5.0/package/contents/ui/LatteWindowsTracker.qml
--- old/applet-window-buttons-0.4/package/contents/ui/LatteWindowsTracker.qml
1970-01-01 01:00:00.000000000 +0100
+++ new/applet-window-buttons-0.5.0/package/contents/ui/LatteWindowsTracker.qml
2019-07-12 21:51:03.000000000 +0200
@@ -0,0 +1,57 @@
+/*
+* Copyright 2019 Michail Vourlakos <[email protected]>
+*
+* This file is part of applet-window-title
+*
+* 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 <http://www.gnu.org/licenses/>.
+*/
+
+import QtQuick 2.7
+
+Item {
+ id: latteWindowsTracker
+ readonly property bool existsWindowActive:
selectedTracker.lastActiveWindow.isValid && !activeTaskItem.isMinimized
+
+ readonly property QtObject selectedTracker:
plasmoid.configuration.filterByScreen ?
latteBridge.windowsTracker.currentScreen : latteBridge.windowsTracker.allScreens
+
+ readonly property Item activeTaskItem: Item {
+ readonly property string title:
selectedTracker.lastActiveWindow.display
+ readonly property bool isMinimized:
selectedTracker.lastActiveWindow.isMinimized
+ readonly property bool isMaximized:
selectedTracker.lastActiveWindow.isMaximized
+ readonly property bool isActive:
selectedTracker.lastActiveWindow.isActive
+ readonly property bool isOnAllDesktops:
selectedTracker.lastActiveWindow.isOnAllDesktops
+ readonly property bool isKeepAbove:
selectedTracker.lastActiveWindow.isKeepAbove
+ }
+
+ function toggleMaximized() {
+ selectedTracker.lastActiveWindow.requestToggleMaximized();
+ }
+
+ function toggleMinimized() {
+ selectedTracker.lastActiveWindow.requestToggleMinimized();
+ }
+
+ function toggleClose() {
+ selectedTracker.lastActiveWindow.requestClose();
+ }
+
+ function togglePinToAllDesktops() {
+ selectedTracker.lastActiveWindow.requestToggleIsOnAllDesktops();
+ }
+
+ function toggleKeepAbove(){
+ selectedTracker.lastActiveWindow.requestToggleKeepAbove();
+ }
+}
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.4/package/contents/ui/PlasmaTasksModel.qml
new/applet-window-buttons-0.5.0/package/contents/ui/PlasmaTasksModel.qml
--- old/applet-window-buttons-0.4/package/contents/ui/PlasmaTasksModel.qml
1970-01-01 01:00:00.000000000 +0100
+++ new/applet-window-buttons-0.5.0/package/contents/ui/PlasmaTasksModel.qml
2019-07-12 21:51:03.000000000 +0200
@@ -0,0 +1,101 @@
+/*
+* Copyright 2018 Michail Vourlakos <[email protected]>
+*
+* This file is part of applet-window-buttons
+*
+* 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 <http://www.gnu.org/licenses/>.
+*/
+
+import QtQuick 2.7
+import QtQml.Models 2.2
+
+import org.kde.plasma.plasmoid 2.0
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.taskmanager 0.1 as TaskManager
+
+Item {
+ id: plasmaTasksItem
+
+ readonly property bool existsWindowActive: root.activeTaskItem &&
tasksRepeater.count > 0 && activeTaskItem.isActive
+ property Item activeTaskItem: null
+
+ // To get current activity name
+ TaskManager.ActivityInfo {
+ id: activityInfo
+ }
+
+ // To get virtual desktop name
+ TaskManager.VirtualDesktopInfo {
+ id: virtualDesktopInfo
+ }
+
+ TaskManager.TasksModel {
+ id: tasksModel
+ sortMode: TaskManager.TasksModel.SortVirtualDesktop
+ groupMode: TaskManager.TasksModel.GroupDisabled
+ screenGeometry: plasmoid.screenGeometry
+ activity: activityInfo.currentActivity
+ virtualDesktop: virtualDesktopInfo.currentDesktop
+
+ filterByScreen: plasmoid.configuration.filterByScreen
+ filterByVirtualDesktop: true
+ filterByActivity: true
+ }
+
+ Repeater{
+ id: tasksRepeater
+ model:DelegateModel {
+ model: tasksModel
+ delegate: Item{
+ id: task
+ readonly property string title: display
+ readonly property bool isMinimized: IsMinimized === true ?
true : false
+ readonly property bool isMaximized: IsMaximized === true ?
true : false
+ readonly property bool isActive: IsActive === true ? true :
false
+ readonly property bool isOnAllDesktops: IsOnAllVirtualDesktops
=== true ? true : false
+ readonly property bool isKeepAbove: IsKeepAbove === true ?
true : false
+
+ onIsActiveChanged: {
+ if (isActive) {
+ plasmaTasksItem.activeTaskItem = task;
+ }
+ }
+ }
+ }
+ }
+
+ function toggleMaximized() {
+ tasksModel.requestToggleMaximized(tasksModel.activeTask);
+ }
+
+ function toggleMinimized() {
+ tasksModel.requestToggleMinimized(tasksModel.activeTask);
+ }
+
+ function toggleClose() {
+ tasksModel.requestClose(tasksModel.activeTask);
+ }
+
+ function togglePinToAllDesktops() {
+ if (root.plasma515) {
+ tasksModel.requestVirtualDesktops(tasksModel.activeTask, 0);
+ } else {
+ tasksModel.requestVirtualDesktop(tasksModel.activeTask, 0);
+ }
+ }
+
+ function toggleKeepAbove(){
+ tasksModel.requestToggleKeepAbove(tasksModel.activeTask);
+ }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.4/package/contents/ui/config/ConfigGeneral.qml
new/applet-window-buttons-0.5.0/package/contents/ui/config/ConfigGeneral.qml
--- old/applet-window-buttons-0.4/package/contents/ui/config/ConfigGeneral.qml
2019-05-14 18:25:39.000000000 +0200
+++
new/applet-window-buttons-0.5.0/package/contents/ui/config/ConfigGeneral.qml
2019-07-12 21:51:03.000000000 +0200
@@ -132,6 +132,7 @@
}
ColorsComboBox{
+ id:colorsCmbBox
Layout.minimumWidth: 250
Layout.preferredWidth: 0.3 * root.width
Layout.maximumWidth: 380
@@ -160,6 +161,9 @@
itemHeight: 36
buttonsStr: root.currentButtons
orientation: ListView.Horizontal
+ color: !auroraeThemeEngine.isEnabled ? schemesBackgroundColor
: auroraeThemeEngine.titleBackgroundColor
+
+ readonly property color schemesBackgroundColor:
colorsModel.backgroundOf(colorsCmbBox.currentIndex)
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.4/package/contents/ui/config/OrderableListView.qml
new/applet-window-buttons-0.5.0/package/contents/ui/config/OrderableListView.qml
---
old/applet-window-buttons-0.4/package/contents/ui/config/OrderableListView.qml
2019-05-14 18:25:39.000000000 +0200
+++
new/applet-window-buttons-0.5.0/package/contents/ui/config/OrderableListView.qml
2019-07-12 21:51:03.000000000 +0200
@@ -25,8 +25,10 @@
import "../../code/tools.js" as ModelTools
-Item {
+Rectangle {
id: listContent
+ radius: 4
+ anchors.margins: margin
property int orientation
property double itemWidth
@@ -42,7 +44,8 @@
property string buttonsStr
- width: (itemWidth+listView.spacing) * (orientation == ListView.Vertical ?
1 : controlButtonsModel.count)
+
+ width: (itemWidth+listView.spacing) * (orientation == ListView.Vertical ?
1 : controlButtonsModel.count) + 2 * margin
height: (itemHeight+listView.spacing) * (orientation ==
ListView.Horizontal ? 1 : controlButtonsModel.count)
signal modelOrderChanged()
@@ -97,6 +100,7 @@
ListView {
id: listView
anchors.fill: parent
+ anchors.leftMargin: parent.margin
spacing: 2
model: controlButtonsModel
orientation: listContent.orientation
@@ -119,6 +123,7 @@
id: loc
anchors.fill: parent
pressAndHoldInterval: 200
+ cursorShape: Qt.DragMoveCursor
property int initButton: -1 // Original button in model
property int initIndex: -1 // Original position in model
@@ -182,7 +187,7 @@
}
Rectangle{
- height: parent.height
+ height: parent.height - listContent.margin
width: 4
border.width: 1
anchors.horizontalCenter: parent.horizontalCenter
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.4/package/contents/ui/main.qml
new/applet-window-buttons-0.5.0/package/contents/ui/main.qml
--- old/applet-window-buttons-0.4/package/contents/ui/main.qml 2019-05-14
18:25:39.000000000 +0200
+++ new/applet-window-buttons-0.5.0/package/contents/ui/main.qml
2019-07-12 21:51:03.000000000 +0200
@@ -18,12 +18,10 @@
*/
import QtQuick 2.7
-import QtQml.Models 2.2
import QtQuick.Layouts 1.1
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
-import org.kde.taskmanager 0.1 as TaskManager
import org.kde.appletdecoration 0.1 as AppletDecoration
@@ -129,7 +127,7 @@
// START window properties
//! make sure that on startup it will always be shown
- readonly property bool existsWindowActive: (activeTaskItem &&
tasksRepeater.count > 0 && activeTaskItem.isActive)
+ readonly property bool existsWindowActive: (windowInfoLoader.item &&
windowInfoLoader.item.existsWindowActive)
||
containmentIdentifierTimer.running
readonly property bool isActiveWindowPinned: activeTaskItem &&
existsWindowActive && activeTaskItem.isOnAllDesktops
readonly property bool isActiveWindowMaximized: activeTaskItem &&
existsWindowActive && activeTaskItem.isMaximized
@@ -139,7 +137,7 @@
property bool hasMaximizedButton: false
property bool hasKeepAboveButton: false
- property Item activeTaskItem
+ readonly property Item activeTaskItem: windowInfoLoader.item.activeTaskItem
// END Window properties
// START decoration properties
@@ -158,6 +156,7 @@
if (latteBridge) {
plasmoid.configuration.containmentType =
AppletDecoration.Types.Latte;
latteBridge.actions.setProperty(plasmoid.id,
"latteSideColoringEnabled", false);
+ latteBridge.actions.setProperty(plasmoid.id,
"windowsTrackingEnabled", true);
}
}
//END Latte Dock Communicator
@@ -232,50 +231,26 @@
id: controlButtonsModel
}
- // To get current activity name
- TaskManager.ActivityInfo {
- id: activityInfo
- }
-
- // To get virtual desktop name
- TaskManager.VirtualDesktopInfo {
- id: virtualDesktopInfo
- }
-
- TaskManager.TasksModel {
- id: tasksModel
- sortMode: TaskManager.TasksModel.SortVirtualDesktop
- groupMode: TaskManager.TasksModel.GroupDisabled
- screenGeometry: plasmoid.screenGeometry
- activity: activityInfo.currentActivity
- virtualDesktop: virtualDesktopInfo.currentDesktop
-
- filterByScreen: plasmoid.configuration.filterByScreen
- filterByVirtualDesktop: true
- filterByActivity: true
- }
-
- Repeater{
- id: tasksRepeater
- model:DelegateModel {
- model: tasksModel
- delegate: Item{
- id: task
- readonly property string title: display
- readonly property bool isMinimized: IsMinimized === true ?
true : false
- readonly property bool isMaximized: IsMaximized === true ?
true : false
- readonly property bool isActive: IsActive === true ? true :
false
- readonly property bool isOnAllDesktops: IsOnAllVirtualDesktops
=== true ? true : false
- readonly property bool isKeepAbove: IsKeepAbove === true ?
true : false
-
- onIsActiveChanged: {
- if (isActive) {
- root.activeTaskItem = task;
- }
- }
- }
+ //!
+ Loader {
+ id: windowInfoLoader
+ sourceComponent: latteBridge
+ && latteBridge.windowsTracker
+ &&
latteBridge.windowsTracker.currentScreen.lastActiveWindow
+ &&
latteBridge.windowsTracker.allScreens.lastActiveWindow ? latteTrackerComponent
: plasmaTasksModel
+
+ Component{
+ id: latteTrackerComponent
+ LatteWindowsTracker{}
+ }
+
+ Component{
+ id: plasmaTasksModel
+ PlasmaTasksModel{}
}
}
+ //!
+
///Decoration Items
AppletDecoration.Bridge {
@@ -341,42 +316,18 @@
function performActiveWindowAction(windowOperation) {
if (windowOperation === AppletDecoration.Types.ActionClose) {
- toggleClose();
+ windowInfoLoader.item.toggleClose();
} else if (windowOperation === AppletDecoration.Types.ToggleMaximize) {
- toggleMaximized();
+ windowInfoLoader.item.toggleMaximized();
} else if (windowOperation === AppletDecoration.Types.ToggleMinimize) {
- toggleMinimized();
+ windowInfoLoader.item.toggleMinimized();
} else if (windowOperation ===
AppletDecoration.Types.TogglePinToAllDesktops) {
- togglePinToAllDesktops();
+ windowInfoLoader.item.togglePinToAllDesktops();
} else if (windowOperation === AppletDecoration.Types.ToggleKeepAbove){
- toggleKeepAbove();
+ windowInfoLoader.item.toggleKeepAbove();
}
}
- function toggleMaximized() {
- tasksModel.requestToggleMaximized(tasksModel.activeTask);
- }
-
- function toggleMinimized() {
- tasksModel.requestToggleMinimized(tasksModel.activeTask);
- }
-
- function toggleClose() {
- tasksModel.requestClose(tasksModel.activeTask);
- }
-
- function togglePinToAllDesktops() {
- if (root.plasma515) {
- tasksModel.requestVirtualDesktops(tasksModel.activeTask, 0);
- } else {
- tasksModel.requestVirtualDesktop(tasksModel.activeTask, 0);
- }
- }
-
- function toggleKeepAbove(){
- tasksModel.requestToggleKeepAbove(tasksModel.activeTask);
- }
-
///START Visual Items
Grid {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/applet-window-buttons-0.4/package/metadata.desktop
new/applet-window-buttons-0.5.0/package/metadata.desktop
--- old/applet-window-buttons-0.4/package/metadata.desktop 2019-05-14
18:25:39.000000000 +0200
+++ new/applet-window-buttons-0.5.0/package/metadata.desktop 2019-07-12
21:51:03.000000000 +0200
@@ -15,7 +15,7 @@
[email protected]
X-KDE-PluginInfo-License=GPLv2
X-KDE-PluginInfo-Name=org.kde.windowbuttons
-X-KDE-PluginInfo-Version=0.4
+X-KDE-PluginInfo-Version=0.5.0
X-KDE-PluginInfo-Website=https://github.com/psifidotos/applet-window-buttons
X-KDE-ServiceTypes=Plasma/Applet