Hello community,
here is the log from the commit of package applet-window-buttons for
openSUSE:Factory checked in at 2020-01-29 13:18:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/applet-window-buttons (Old)
and /work/SRC/openSUSE:Factory/.applet-window-buttons.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "applet-window-buttons"
Wed Jan 29 13:18:41 2020 rev:6 rq:768179 version:0.8.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/applet-window-buttons/applet-window-buttons.changes
2019-11-25 11:25:36.722091692 +0100
+++
/work/SRC/openSUSE:Factory/.applet-window-buttons.new.26092/applet-window-buttons.changes
2020-01-29 13:19:15.534196780 +0100
@@ -1,0 +2,22 @@
+Tue Jan 28 20:38:05 UTC 2020 - Cor Blom <[email protected]>
+
+- Update source URL
+
+-------------------------------------------------------------------
+Tue Jan 28 11:41:53 UTC 2020 - Cor Blom <[email protected]>
+
+- Update to version 0.8.0:
+ * fix which plasma theme colors are used for buttons when
+ Colors:Plasma Theme is chosen
+ * do not show buttons that the current window has disabled them,
+ for example a window is NOT Closable; Close button becomes hidden in such
case
+ * hide buttons when the last active maximized window is minimized
+ and there are no other shown windows
+ * improve configuration window texts
+ * create a new decoration only when it is really needed
+ * reduce filesystem trackers for scheme colors files
+ * use shared decoration between all buttons
+ * set an object name for the shared decoration in order to be
+ easily identified by KDecoration2 decorations
+
+-------------------------------------------------------------------
Old:
----
applet-window-buttons-0.7.0.tar.gz
New:
----
applet-window-buttons-0.8.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ applet-window-buttons.spec ++++++
--- /var/tmp/diff_new_pack.YvVOFN/_old 2020-01-29 13:19:16.886197471 +0100
+++ /var/tmp/diff_new_pack.YvVOFN/_new 2020-01-29 13:19:16.890197473 +0100
@@ -1,7 +1,7 @@
#
# spec file for package applet-window-buttons
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -20,13 +20,13 @@
%define qt5_version 5.9
Name: applet-window-buttons
-Version: 0.7.0
+Version: 0.8.0
Release: 0
Summary: Plasma 5 applet to show window buttons in panels
License: GPL-2.0-or-later
Group: System/GUI/KDE
URL: https://github.com/psifidotos/applet-window-buttons
-Source:
https://github.com/psifidotos/applet-window-buttons/archive/v%{version}/%{name}-%{version}.tar.gz
+Source:
https://github.com/psifidotos/applet-window-buttons/archive/%{version}/%{name}-%{version}.tar.gz
BuildRequires: extra-cmake-modules
BuildRequires: fdupes
BuildRequires: kconfig-devel >= %{kf5_version}
++++++ applet-window-buttons-0.7.0.tar.gz -> applet-window-buttons-0.8.0.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/applet-window-buttons-0.7.0/CHANGELOG.md
new/applet-window-buttons-0.8.0/CHANGELOG.md
--- old/applet-window-buttons-0.7.0/CHANGELOG.md 2019-11-24
08:12:31.000000000 +0100
+++ new/applet-window-buttons-0.8.0/CHANGELOG.md 2020-01-23
16:52:27.000000000 +0100
@@ -1,5 +1,16 @@
### CHANGELOG
+#### Version 0.8.0
+
+* fix which plasma theme colors are used for buttons when Colors:Plasma Theme
is chosen
+* do not show buttons that the current window has disabled them, for example a
window is NOT Closable; Close button becomes hidden in such case
+* hide buttons when the last active maximized window is minimized and there
are no other shown windows
+* improve configuration window texts
+* create a new decoration only when it is really needed
+* reduce filesystem trackers for scheme colors files
+* use shared decoration between all buttons
+* set an object name for the shared decoration in order to be easily
identified by KDecoration2 decorations
+
#### Version 0.7.0
* introduce a new Button Size percentage option and drop thickness margin in
order to set the buttons size
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/applet-window-buttons-0.7.0/CMakeLists.txt
new/applet-window-buttons-0.8.0/CMakeLists.txt
--- old/applet-window-buttons-0.7.0/CMakeLists.txt 2019-11-24
08:12:31.000000000 +0100
+++ new/applet-window-buttons-0.8.0/CMakeLists.txt 2020-01-23
16:52:27.000000000 +0100
@@ -2,7 +2,7 @@
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
set(CMAKE_CXX_STANDARD 14)
-set(VERSION 0.7.0)
+set(VERSION 0.8.0)
set(AUTHOR "Michail Vourlakos")
set(EMAIL "[email protected]")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/applet-window-buttons-0.7.0/INSTALLATION.md
new/applet-window-buttons-0.8.0/INSTALLATION.md
--- old/applet-window-buttons-0.7.0/INSTALLATION.md 2019-11-24
08:12:31.000000000 +0100
+++ new/applet-window-buttons-0.8.0/INSTALLATION.md 2020-01-23
16:52:27.000000000 +0100
@@ -1,22 +1,32 @@
Installation
============
-## Using installation script
+## Building from Source
+The provided `install.sh` script will build everything and install it for you.
Before running the installation script you have to install the dependencies
needed for compiling.
-**Before running the installation script you have to install the dependencies
needed for compiling.**
-
-
-### Ubuntu
+### Build Dependencies
+- Ubuntu:
```
sudo apt install g++ extra-cmake-modules qtbase5-dev qtdeclarative5-dev
libkf5declarative-dev libkf5plasma-dev libkdecorations2-dev gettext
```
### Building and Installing
-
-**Now you can run the installation script.**
+Once you have installed the dependencies listed above you can execute the
build and install script:
```
sh install.sh
```
+## Prebuilt Binaries
+
+- Ubuntu: You can install via a PPA on Ubuntu 18.04 (Bionic) or later
including KDE Neon.
+```
+sudo add-apt-repository ppa:krisives/applet-window-buttons
+sudo apt install applet-window-buttons
+```
+
+- openSUSE: install the package from the official repo
+```
+sudo zypper in applet-window-buttons
+```
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/applet-window-buttons-0.7.0/README.md
new/applet-window-buttons-0.8.0/README.md
--- old/applet-window-buttons-0.7.0/README.md 2019-11-24 08:12:31.000000000
+0100
+++ new/applet-window-buttons-0.8.0/README.md 2020-01-23 16:52:27.000000000
+0100
@@ -18,7 +18,7 @@
</p>
<p align="center">
-<img src="https://i.imgur.com/xsiKK7J.png" width="580"><br/>
+<img src="https://imgur.com/ZuL2cxG.png" width="580"><br/>
<i>Settings window</i>
</p>
@@ -36,4 +36,4 @@
# Install
-You can execute `sh install.sh` in the root directory as long as you have
installed the previous mentioned development packages
+You can execute `sh install.sh` in the root directory as long as you have
installed the previous mentioned development packages. For more details please
read [INSTALLATION.md](/INSTALLATION.md)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.7.0/libappletdecoration/CMakeLists.txt
new/applet-window-buttons-0.8.0/libappletdecoration/CMakeLists.txt
--- old/applet-window-buttons-0.7.0/libappletdecoration/CMakeLists.txt
2019-11-24 08:12:31.000000000 +0100
+++ new/applet-window-buttons-0.8.0/libappletdecoration/CMakeLists.txt
2020-01-23 16:52:27.000000000 +0100
@@ -23,6 +23,7 @@
previewbridge.cpp
previewclient.cpp
previewsettings.cpp
+ previewshareddecoration.cpp
schemecolors.cpp
schemesmodel.cpp
themeextended.cpp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.7.0/libappletdecoration/appletdecorationplugin.cpp
new/applet-window-buttons-0.8.0/libappletdecoration/appletdecorationplugin.cpp
---
old/applet-window-buttons-0.7.0/libappletdecoration/appletdecorationplugin.cpp
2019-11-24 08:12:31.000000000 +0100
+++
new/applet-window-buttons-0.8.0/libappletdecoration/appletdecorationplugin.cpp
2020-01-23 16:52:27.000000000 +0100
@@ -27,6 +27,7 @@
#include "previewclient.h"
#include "previewbutton.h"
#include "previewsettings.h"
+#include "previewshareddecoration.h"
#include "schemesmodel.h"
#include "themeextended.h"
#include "windowsystem.h"
@@ -52,6 +53,7 @@
qmlRegisterType<Decoration::Applet::PreviewButtonItem>(uri, 0, 1,
"Button");
qmlRegisterType<Decoration::Applet::DecorationsModel>(uri, 0, 1,
"DecorationsModel");
qmlRegisterType<Decoration::Applet::SchemesModel>(uri, 0, 1,
"ColorsModel");
+ qmlRegisterType<Decoration::Applet::SharedDecoration>(uri, 0, 1,
"SharedDecoration");
qmlRegisterType<Decoration::Applet::ExtendedTheme>(uri, 0, 1,
"PlasmaThemeExtended");
qmlRegisterType<Decoration::Applet::WindowSystem>(uri, 0, 1,
"WindowSystem");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.7.0/libappletdecoration/previewbridge.cpp
new/applet-window-buttons-0.8.0/libappletdecoration/previewbridge.cpp
--- old/applet-window-buttons-0.7.0/libappletdecoration/previewbridge.cpp
2019-11-24 08:12:31.000000000 +0100
+++ new/applet-window-buttons-0.8.0/libappletdecoration/previewbridge.cpp
2020-01-23 16:52:27.000000000 +0100
@@ -80,8 +80,9 @@
void PreviewBridge::update(KDecoration2::Decoration *decoration, const QRect
&geometry)
{
Q_UNUSED(geometry)
- auto it = std::find_if(m_previewButtons.constBegin(),
m_previewButtons.constEnd(), [decoration](PreviewButtonItem * item) {
- return item->decoration() == decoration;
+
+ auto it = std::find_if(m_previewButtons.constBegin(),
m_previewButtons.constEnd(), [decoration, geometry](PreviewButtonItem *item) {
+ return (item->decoration() == decoration) &&
(item->visualGeometry().contains(geometry.center()));
});
if (it != m_previewButtons.constEnd()) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.7.0/libappletdecoration/previewbutton.cpp
new/applet-window-buttons-0.8.0/libappletdecoration/previewbutton.cpp
--- old/applet-window-buttons-0.7.0/libappletdecoration/previewbutton.cpp
2019-11-24 08:12:31.000000000 +0100
+++ new/applet-window-buttons-0.8.0/libappletdecoration/previewbutton.cpp
2020-01-23 16:52:27.000000000 +0100
@@ -26,7 +26,7 @@
#include "padding.h"
#include "previewbridge.h"
#include "previewclient.h"
-#include "previewsettings.h"
+#include "previewshareddecoration.h"
#include <KDecoration2/Decoration>
#include <KDecoration2/DecoratedClient>
@@ -49,6 +49,8 @@
connect(this, &PreviewButtonItem::widthChanged, this,
&PreviewButtonItem::syncInternalGeometry);
connect(this, &PreviewButtonItem::heightChanged, this,
&PreviewButtonItem::syncInternalGeometry);
+ connect(this, &PreviewButtonItem::localXChanged, this,
&PreviewButtonItem::syncInternalGeometry);
+ connect(this, &PreviewButtonItem::localYChanged, this,
&PreviewButtonItem::syncInternalGeometry);
connect(m_padding, &Padding::leftChanged, this,
&PreviewButtonItem::syncInternalGeometry);
connect(m_padding, &Padding::rightChanged, this,
&PreviewButtonItem::syncInternalGeometry);
@@ -84,8 +86,8 @@
m_client->setActive(m_isActive);
//! update decoration
- if (m_decoration) {
- m_decoration->init();
+ if (m_sharedDecoration) {
+ m_sharedDecoration->initDecoration();
}
}
@@ -116,8 +118,8 @@
}
//! update decoration
- if (m_decoration) {
- m_decoration->init();
+ if (m_sharedDecoration) {
+ m_sharedDecoration->initDecoration();
}
}
@@ -145,8 +147,8 @@
}
//! update decoration
- if (m_decoration) {
- m_decoration->init();
+ if (m_sharedDecoration) {
+ m_sharedDecoration->initDecoration();
}
}
@@ -172,10 +174,11 @@
} else {
m_client->setKeepAbove(false);
}
- if (m_decoration) {
- m_decoration->init();
+
+ if (m_sharedDecoration) {
+ m_sharedDecoration->initDecoration();
}
- }
+ }
emit isKeepAboveChanged();
}
@@ -222,8 +225,8 @@
qDebug() << "buttons scheme update to:" << m_scheme;
//! update decoration
- if (m_decoration) {
- m_decoration->init();
+ if (m_sharedDecoration) {
+ m_sharedDecoration->initDecoration();
}
}
@@ -254,37 +257,69 @@
emit bridgeChanged();
}
-Settings *PreviewButtonItem::settings() const
+int PreviewButtonItem::typeAsInt() const
+{
+ return int(m_type);
+}
+
+int PreviewButtonItem::localX() const
{
- return m_settings.data();
+ return m_localX;
}
-void PreviewButtonItem::setSettings(Settings *settings)
+void PreviewButtonItem::setLocalX(int x)
{
- if (m_settings == settings) {
+ if (m_localX == x) {
return;
}
- m_settings = settings;
+ m_localX = x;
- if (m_decoration) {
- m_decoration->setSettings(m_settings->settings());
- m_decoration->init();
- }
+ emit localXChanged();
+}
- emit settingsChanged();
+int PreviewButtonItem::localY() const
+{
+ return m_localY;
}
-int PreviewButtonItem::typeAsInt() const
+void PreviewButtonItem::setLocalY(int y)
{
- return int(m_type);
+ if (m_localY == y) {
+ return;
+ }
+
+ m_localY = y;
+
+ emit localYChanged();
}
KDecoration2::Decoration *PreviewButtonItem::decoration() const
{
- return m_decoration;
+ if (!m_sharedDecoration) {
+ return nullptr;
+ }
+
+ return m_sharedDecoration->decoration();
}
+SharedDecoration *PreviewButtonItem::sharedDecoration() const
+{
+ return m_sharedDecoration;
+}
+
+void PreviewButtonItem::setSharedDecoration(SharedDecoration *sharedDecoration)
+{
+ if (m_sharedDecoration == sharedDecoration) {
+ return;
+ }
+
+ m_sharedDecoration = sharedDecoration;
+
+ connect(m_sharedDecoration,
&Decoration::Applet::SharedDecoration::decorationChanged, this,
&Decoration::Applet::PreviewButtonItem::createButton);
+
+ emit sharedDecorationChanged();
+}
void PreviewButtonItem::componentComplete()
{
@@ -294,17 +329,16 @@
void PreviewButtonItem::createButton()
{
- if (m_type == KDecoration2::DecorationButtonType::Custom || m_decoration
|| !m_settings || !m_bridge) {
+ if (m_type == KDecoration2::DecorationButtonType::Custom ||
!m_sharedDecoration || !m_sharedDecoration->decoration() || !m_bridge) {
return;
}
- m_decoration = m_bridge->createDecoration(this);
+ m_client = m_bridge->lastCreatedClient();
- if (!m_decoration) {
+ if (!m_client) {
return;
}
- m_client = m_bridge->lastCreatedClient();
m_client->setMinimizable(true);
m_client->setMaximizable(true);
@@ -325,32 +359,33 @@
m_client->setMaximizedHorizontally(false);
}
- m_decoration->setSettings(m_settings->settings());
- m_decoration->init();
+ if (m_button) {
+ m_button->deleteLater();
+ }
- m_button = m_bridge->createButton(m_decoration, m_type, this);
+ m_button = m_bridge->createButton(m_sharedDecoration->decoration(),
m_type, this);
syncInternalGeometry();
}
+QRect PreviewButtonItem::visualGeometry() const
+{
+ return m_visualGeometry;
+}
+
void PreviewButtonItem::syncInternalGeometry()
{
int iWidth = width() - m_padding->left() - m_padding->right();
int iHeight = height() - m_padding->top() - m_padding->bottom();
- int minSize = qMin(iWidth, iHeight);
-
- int x = m_padding->left() + ((iWidth / 2) - (minSize / 2));
- int y = m_padding->top() + ((iHeight / 2) - (minSize / 2));
-
- m_internalGeometry = QRect(x, y, minSize, minSize);
m_fullGeometry = QRect(0, 0, width(), height());
+ m_visualGeometry = QRect(m_localX + m_padding->left(), m_localY +
m_padding->top(), iWidth, iHeight);
if (!m_button) {
return;
}
- m_button->setGeometry(m_internalGeometry);
+ m_button->setGeometry(m_visualGeometry);
update();
}
@@ -361,7 +396,9 @@
return;
}
- m_button->paint(painter, m_internalGeometry);
+ painter->translate(-m_visualGeometry.x() + m_padding->left(),
-m_visualGeometry.y() + m_padding->top());
+
+ m_button->paint(painter, m_visualGeometry);
}
void PreviewButtonItem::mouseDoubleClickEvent(QMouseEvent *event)
@@ -379,17 +416,14 @@
return;
}
- //! this a workaround for DecorationButton::contains
- //! to accept the event as valid. For some reason
- //! the are coordinates that are not accepted even
- //! though they are valid
+ //! this a workaround in order to send proper coordinates
+ //! that confirm the button visual coordinates
QMouseEvent e(event->type(),
- m_button->geometry().center(),
+ m_visualGeometry.center(),
event->button(),
event->buttons(),
event->modifiers());
-
QCoreApplication::instance()->sendEvent(m_button, &e);
}
@@ -401,12 +435,10 @@
bool inItem {m_fullGeometry.contains(event->localPos().x(),
event->localPos().y())};
- //! this a workaround for DecorationButton::contains
- //! to accept the event as valid. For some reason
- //! the are coordinates that are not accepted even
- //! though they are valid
+ //! this a workaround in order to send proper coordinates
+ //! that confirm the button visual coordinates
QMouseEvent e(event->type(),
- inItem ? m_button->geometry().center() : QPoint(-5, -5),
+ inItem ? m_visualGeometry.center() : QPoint(-5, -5),
event->button(),
event->buttons(),
event->modifiers());
@@ -424,12 +456,10 @@
return;
}
- //! this a workaround for DecorationButton::contains
- //! to accept the event as valid. For some reason
- //! the are coordinates that are not accepted even
- //! though they are valid
+ //! this a workaround in order to send proper coordinates
+ //! that confirm the button visual coordinates
QMouseEvent e(event->type(),
- m_button->geometry().center(),
+ m_visualGeometry.center(),
event->button(),
event->buttons(),
event->modifiers());
@@ -443,13 +473,11 @@
return;
}
- //! this a workaround for DecorationButton::contains
- //! to accept the event as valid. For some reason
- //! the are coordinates that are not accepted even
- //! though they are valid
+ //! this a workaround in order to send proper coordinates
+ //! that confirm the button visual coordinates
QHoverEvent e(event->type(),
- m_button->geometry().center(),
- event->posF(),
+ m_visualGeometry.center(),
+ QPoint(m_visualGeometry.x() + event->posF().x(),
m_visualGeometry.y() + event->posF().y()),
event->modifiers());
QCoreApplication::instance()->sendEvent(m_button, &e);
@@ -461,18 +489,36 @@
return;
}
- //! this a workaround for DecorationButton::contains
- //! to accept the event as valid. For some reason
- //! the are coordinates that are not accepted even
- //! though they are valid
+ //! this a workaround in order to send proper coordinates
+ //! that confirm the button visual coordinates
QHoverEvent e(event->type(),
QPoint(-5, -5),
- m_button->geometry().center(),
+ m_visualGeometry.center(),
event->modifiers());
QCoreApplication::instance()->sendEvent(m_button, &e);
}
+void PreviewButtonItem::hoverMoveEvent(QHoverEvent *event)
+{
+ if (!m_button) {
+ return;
+ }
+
+ QPoint newPos (qBound((double)m_visualGeometry.left(),
m_visualGeometry.left() + event->posF().x(), (double)m_visualGeometry.right()),
+ qBound((double)m_visualGeometry.top(),
m_visualGeometry.top() + event->posF().x(), (double)m_visualGeometry.bottom()));
+
+ QPoint oldPos (qBound((double)m_visualGeometry.left(),
m_visualGeometry.left() + event->oldPosF().x(),
(double)m_visualGeometry.right()),
+ qBound((double)m_visualGeometry.top(),
m_visualGeometry.top() + event->oldPosF().x(),
(double)m_visualGeometry.bottom()));
+
+ //! this a workaround in order to send proper coordinates
+ //! that confirm the button visual coordinates
+ QHoverEvent e(event->type(), newPos, oldPos, event->modifiers());
+
+ QCoreApplication::instance()->sendEvent(m_button, &e);
+}
+
+
void PreviewButtonItem::focusOutEvent(QFocusEvent *event)
{
QCoreApplication::instance()->sendEvent(m_button, event);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.7.0/libappletdecoration/previewbutton.h
new/applet-window-buttons-0.8.0/libappletdecoration/previewbutton.h
--- old/applet-window-buttons-0.7.0/libappletdecoration/previewbutton.h
2019-11-24 08:12:31.000000000 +0100
+++ new/applet-window-buttons-0.8.0/libappletdecoration/previewbutton.h
2020-01-23 16:52:27.000000000 +0100
@@ -39,19 +39,24 @@
class Padding;
class PreviewBridge;
class PreviewClient;
-class Settings;
+class SharedDecoration;
class PreviewButtonItem : public QQuickPaintedItem
{
Q_OBJECT
Q_PROPERTY(Decoration::Applet::PreviewBridge *bridge READ bridge WRITE
setBridge NOTIFY bridgeChanged)
- Q_PROPERTY(Decoration::Applet::Settings *settings READ settings WRITE
setSettings NOTIFY settingsChanged)
+ Q_PROPERTY(Decoration::Applet::SharedDecoration *sharedDecoration READ
sharedDecoration WRITE setSharedDecoration NOTIFY sharedDecorationChanged)
Q_PROPERTY(bool isActive READ isActive WRITE setIsActive NOTIFY
isActiveChanged);
- Q_PROPERTY(bool isMaximized READ isMaximized WRITE setIsMaximized NOTIFY
isMaximizedChanged);
- Q_PROPERTY(bool isOnAllDesktops READ isOnAllDesktops WRITE
setIsOnAllDesktops NOTIFY isOnAllDesktopsChanged);
- Q_PROPERTY(bool isKeepAbove READ isKeepAbove WRITE setIsKeepAbove NOTIFY
isKeepAboveChanged);
+ Q_PROPERTY(bool isMaximized READ isMaximized WRITE setIsMaximized NOTIFY
isMaximizedChanged)
+ Q_PROPERTY(bool isOnAllDesktops READ isOnAllDesktops WRITE
setIsOnAllDesktops NOTIFY isOnAllDesktopsChanged)
+ Q_PROPERTY(bool isKeepAbove READ isKeepAbove WRITE setIsKeepAbove NOTIFY
isKeepAboveChanged)
+
+ Q_PROPERTY(int localX READ localX WRITE setLocalX NOTIFY localXChanged)
+ Q_PROPERTY(int localY READ localY WRITE setLocalY NOTIFY localYChanged)
+
Q_PROPERTY(int type READ typeAsInt WRITE setType NOTIFY typeChanged)
+
Q_PROPERTY(QString scheme READ scheme WRITE setScheme NOTIFY schemeChanged)
Q_PROPERTY(Decoration::Applet::Padding *padding READ padding NOTIFY
paddingChanged)
@@ -63,8 +68,8 @@
PreviewBridge *bridge() const;
void setBridge(PreviewBridge *bridge);
- Settings *settings() const;
- void setSettings(Settings *settings);
+ SharedDecoration *sharedDecoration() const;
+ void setSharedDecoration(SharedDecoration *sharedDecoration);
KDecoration2::Decoration *decoration() const;
@@ -80,6 +85,12 @@
bool isKeepAbove() const;
void setIsKeepAbove(bool keepabove);
+ int localX() const;
+ void setLocalX(int x);
+
+ int localY() const;
+ void setLocalY(int y);
+
KDecoration2::DecorationButtonType type() const;
int typeAsInt() const;
void setType(KDecoration2::DecorationButtonType type);
@@ -90,15 +101,19 @@
Padding *padding() const;
+ QRect visualGeometry() const;
+
Q_SIGNALS:
void bridgeChanged();
void isActiveChanged();
void isMaximizedChanged();
void isOnAllDesktopsChanged();
void isKeepAboveChanged();
+ void localXChanged();
+ void localYChanged();
void paddingChanged();
void schemeChanged();
- void settingsChanged();
+ void sharedDecorationChanged();
void typeChanged();
void clicked();
@@ -110,18 +125,21 @@
void mouseReleaseEvent(QMouseEvent *event) override;
void hoverEnterEvent(QHoverEvent *event) override;
void hoverLeaveEvent(QHoverEvent *event) override;
+ void hoverMoveEvent(QHoverEvent *event) override;
void focusOutEvent(QFocusEvent *event) override;
void componentComplete() override;
-private:
+private Q_SLOTS:
void createButton();
void syncInternalGeometry();
+private:
+
QPointer<Decoration::Applet::PreviewBridge> m_bridge;
QPointer<Decoration::Applet::PreviewClient> m_client;
- QPointer<Decoration::Applet::Settings> m_settings;
- QPointer<KDecoration2::Decoration> m_decoration;
+ QPointer<Decoration::Applet::SharedDecoration> m_sharedDecoration;
+
KDecoration2::DecorationButton *m_button = nullptr;
KDecoration2::DecorationButtonType m_type =
KDecoration2::DecorationButtonType::Custom;
@@ -130,9 +148,13 @@
bool m_isOnAllDesktops{false};
bool m_isKeepAbove{false};
+ int m_localX;
+ int m_localY;
+
QString m_scheme;
QRect m_internalGeometry;
QRect m_fullGeometry;
+ QRect m_visualGeometry;
Padding *m_padding;
};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.7.0/libappletdecoration/previewclient.cpp
new/applet-window-buttons-0.8.0/libappletdecoration/previewclient.cpp
--- old/applet-window-buttons-0.7.0/libappletdecoration/previewclient.cpp
2019-11-24 08:12:31.000000000 +0100
+++ new/applet-window-buttons-0.8.0/libappletdecoration/previewclient.cpp
2020-01-23 16:52:27.000000000 +0100
@@ -387,12 +387,12 @@
#if KDECORATION2_VERSION_MINOR >= 13
void PreviewClient::requestShowToolTip(const QString &text)
{
- qDebug() << "tooltip show requested with text:" << text;
+ //qDebug() << "tooltip show requested with text:" << text;
}
void PreviewClient::requestHideToolTip()
{
- qDebug() << "tooltip hide requested";
+ //qDebug() << "tooltip hide requested";
}
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.7.0/libappletdecoration/previewshareddecoration.cpp
new/applet-window-buttons-0.8.0/libappletdecoration/previewshareddecoration.cpp
---
old/applet-window-buttons-0.7.0/libappletdecoration/previewshareddecoration.cpp
1970-01-01 01:00:00.000000000 +0100
+++
new/applet-window-buttons-0.8.0/libappletdecoration/previewshareddecoration.cpp
2020-01-23 16:52:27.000000000 +0100
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2019 Michail Vourlakos <[email protected]>
+ *
+ * This file is part of the libappletdecoration library
+ *
+ * This program 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) version 3 or any later version
+ * accepted by the membership of KDE e.V. (or its successor approved
+ * by the membership of KDE e.V.), which shall act as a proxy
+ * defined in Section 14 of version 3 of the license.
+ *
+ * This program 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 "previewshareddecoration.h"
+
+#include "previewbridge.h"
+#include "previewbutton.h"
+#include "previewsettings.h"
+
+#include <KDecoration2/Decoration>
+
+namespace Decoration {
+namespace Applet {
+
+SharedDecoration::SharedDecoration(QObject *parent) :
+ QObject(parent)
+{
+ connect(this, &Decoration::Applet::SharedDecoration::bridgeChanged, this,
&Decoration::Applet::SharedDecoration::createDecoration);
+ connect(this, &Decoration::Applet::SharedDecoration::settingsChanged,
this, &Decoration::Applet::SharedDecoration::applySettings);
+}
+
+SharedDecoration::~SharedDecoration()
+{
+}
+
+PreviewBridge *SharedDecoration::bridge() const
+{
+ return m_bridge.data();
+}
+
+void SharedDecoration::setBridge(PreviewBridge *bridge)
+{
+ if (m_bridge == bridge) {
+ return;
+ }
+
+ if (m_bridge) {
+ connect(m_bridge, &Decoration::Applet::PreviewBridge::validChanged,
this, &Decoration::Applet::SharedDecoration::createDecoration);
+ }
+
+ m_bridge = bridge;
+
+ connect(m_bridge, &Decoration::Applet::PreviewBridge::validChanged, this,
&Decoration::Applet::SharedDecoration::createDecoration);
+
+ emit bridgeChanged();
+}
+
+KDecoration2::Decoration *SharedDecoration::decoration() const
+{
+ return m_decoration;
+}
+
+Settings *SharedDecoration::settings() const
+{
+ return m_settings.data();
+}
+
+void SharedDecoration::setSettings(Settings *settings)
+{
+ if (m_settings == settings) {
+ return;
+ }
+
+ m_settings = settings;
+
+ createDecoration();
+
+ emit settingsChanged();
+}
+
+void SharedDecoration::applySettings()
+{
+ if (!m_decoration || !m_settings) {
+ return;
+ }
+
+ m_decoration->setSettings(m_settings->settings());
+ m_decoration->init();
+}
+
+void SharedDecoration::createDecoration()
+{
+ if (!m_bridge || !m_settings) {
+ return;
+ }
+
+ bool newDecoration = (m_bridge->plugin() != m_lastPlugin ||
m_bridge->theme() != m_lastTheme);
+
+ if (m_decoration && newDecoration) {
+ m_decoration->deleteLater();
+ }
+
+ if (newDecoration) {
+ m_decoration = m_bridge->createDecoration(this);
+ }
+
+ if (m_decoration) {
+ m_decoration->setSettings(m_settings->settings());
+ m_decoration->init();
+ m_decoration->setObjectName("applet-window-buttons");
+ }
+
+ m_lastPlugin = m_bridge->plugin();
+ m_lastTheme = m_bridge->theme();
+
+ emit decorationChanged();
+}
+
+void SharedDecoration::initDecoration()
+{
+ if (m_decoration) {
+ m_decoration->init();
+ }
+}
+
+}
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.7.0/libappletdecoration/previewshareddecoration.h
new/applet-window-buttons-0.8.0/libappletdecoration/previewshareddecoration.h
---
old/applet-window-buttons-0.7.0/libappletdecoration/previewshareddecoration.h
1970-01-01 01:00:00.000000000 +0100
+++
new/applet-window-buttons-0.8.0/libappletdecoration/previewshareddecoration.h
2020-01-23 16:52:27.000000000 +0100
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2019 Michail Vourlakos <[email protected]>
+ *
+ * This file is part of the libappletdecoration library
+ *
+ * This program 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) version 3 or any later version
+ * accepted by the membership of KDE e.V. (or its successor approved
+ * by the membership of KDE e.V.), which shall act as a proxy
+ * defined in Section 14 of version 3 of the license.
+ *
+ * This program 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/>.
+ */
+
+#ifndef PREVIEWSHAREDDECORATION_H
+#define PREVIEWSHAREDDECORATION_H
+
+#include <QObject>
+
+#include "previewbridge.h"
+
+
+namespace KDecoration2 {
+class Decoration;
+}
+
+namespace Decoration {
+namespace Applet {
+
+class PreviewBridge;
+class PreviewButton;
+class Settings;
+
+class SharedDecoration : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(Decoration::Applet::PreviewBridge *bridge READ bridge WRITE
setBridge NOTIFY bridgeChanged)
+ Q_PROPERTY(Decoration::Applet::Settings *settings READ settings WRITE
setSettings NOTIFY settingsChanged)
+
+public:
+ explicit SharedDecoration(QObject *parent = nullptr);
+ virtual ~SharedDecoration();
+
+ PreviewBridge *bridge() const;
+ void setBridge(PreviewBridge *bridge);
+
+ Settings *settings() const;
+ void setSettings(Settings *settings);
+
+ KDecoration2::Decoration *decoration() const;
+
+ void initDecoration();
+
+public Q_SLOTS:
+ Q_INVOKABLE void createDecoration();
+
+Q_SIGNALS:
+ void bridgeChanged();
+ void decorationChanged();
+ void settingsChanged();
+
+private Q_SLOTS:
+ void applySettings();
+
+private:
+ QPointer<Decoration::Applet::PreviewBridge> m_bridge;
+ QPointer<KDecoration2::Decoration> m_decoration;
+ QPointer<Decoration::Applet::Settings> m_settings;
+
+ QString m_lastPlugin;
+ QString m_lastTheme;
+};
+
+}
+}
+
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.7.0/libappletdecoration/schemecolors.cpp
new/applet-window-buttons-0.8.0/libappletdecoration/schemecolors.cpp
--- old/applet-window-buttons-0.7.0/libappletdecoration/schemecolors.cpp
2019-11-24 08:12:31.000000000 +0100
+++ new/applet-window-buttons-0.8.0/libappletdecoration/schemecolors.cpp
2020-01-23 16:52:27.000000000 +0100
@@ -44,13 +44,15 @@
m_schemeName = schemeName(pSchemeFile);
//! track scheme file for changes
- KDirWatch::self()->addFile(m_schemeFile);
+
+ //! do not create so many trackers
+ /*KDirWatch::self()->addFile(m_schemeFile);
connect(KDirWatch::self(), &KDirWatch::dirty, this, [ & ](const
QString & path) {
if (path == m_schemeFile) {
updateScheme();
}
- });
+ });*/
}
updateScheme();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.7.0/libappletdecoration/schemecolors.h
new/applet-window-buttons-0.8.0/libappletdecoration/schemecolors.h
--- old/applet-window-buttons-0.7.0/libappletdecoration/schemecolors.h
2019-11-24 08:12:31.000000000 +0100
+++ new/applet-window-buttons-0.8.0/libappletdecoration/schemecolors.h
2020-01-23 16:52:27.000000000 +0100
@@ -79,7 +79,7 @@
void colorsChanged();
void schemeFileChanged();
-private slots:
+public slots:
void updateScheme();
private:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.7.0/libappletdecoration/themeextended.cpp
new/applet-window-buttons-0.8.0/libappletdecoration/themeextended.cpp
--- old/applet-window-buttons-0.7.0/libappletdecoration/themeextended.cpp
2019-11-24 08:12:31.000000000 +0100
+++ new/applet-window-buttons-0.8.0/libappletdecoration/themeextended.cpp
2020-01-23 16:52:27.000000000 +0100
@@ -113,11 +113,11 @@
KSharedConfigPtr defaultPtr =
KSharedConfig::openConfig(m_colorsSchemePath);
if (originalPtr && defaultPtr) {
- KConfigGroup originalViewGroup(originalPtr, "Colors:View");
+ KConfigGroup normalWindowGroup(originalPtr, "Colors:Window");
KConfigGroup defaultWMGroup(defaultPtr, "WM");
- defaultWMGroup.writeEntry("activeBackground",
originalViewGroup.readEntry("BackgroundNormal", QColor()));
- defaultWMGroup.writeEntry("activeForeground",
originalViewGroup.readEntry("ForegroundNormal", QColor()));
+ defaultWMGroup.writeEntry("activeBackground",
normalWindowGroup.readEntry("BackgroundNormal", QColor()));
+ defaultWMGroup.writeEntry("activeForeground",
normalWindowGroup.readEntry("ForegroundNormal", QColor()));
defaultWMGroup.sync();
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.7.0/package/contents/config/main.xml
new/applet-window-buttons-0.8.0/package/contents/config/main.xml
--- old/applet-window-buttons-0.7.0/package/contents/config/main.xml
2019-11-24 08:12:31.000000000 +0100
+++ new/applet-window-buttons-0.8.0/package/contents/config/main.xml
2020-01-23 16:52:27.000000000 +0100
@@ -55,7 +55,7 @@
<label>use the discovered decoration metrics in case there are any in
order to look consistent with window titlebars</label>
</entry>
<entry name="buttonSizePercentage" type="Int">
- <default>90</default>
+ <default>100</default>
<label>the buttons size relevant to panel thickness</label>
</entry>
<entry name="lengthFirstMargin" type="Int">
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.7.0/package/contents/ui/LatteWindowsTracker.qml
new/applet-window-buttons-0.8.0/package/contents/ui/LatteWindowsTracker.qml
--- old/applet-window-buttons-0.7.0/package/contents/ui/LatteWindowsTracker.qml
2019-11-24 08:12:31.000000000 +0100
+++ new/applet-window-buttons-0.8.0/package/contents/ui/LatteWindowsTracker.qml
2020-01-23 16:52:27.000000000 +0100
@@ -33,6 +33,12 @@
readonly property bool isActive:
selectedTracker.lastActiveWindow.isActive
readonly property bool isOnAllDesktops:
selectedTracker.lastActiveWindow.isOnAllDesktops
readonly property bool isKeepAbove:
selectedTracker.lastActiveWindow.isKeepAbove
+
+ readonly property bool isClosable:
selectedTracker.lastActiveWindow.hasOwnProperty("isClosable") ?
selectedTracker.lastActiveWindow.isClosable : true
+ readonly property bool isMinimizable:
selectedTracker.lastActiveWindow.hasOwnProperty("isMinimizable") ?
selectedTracker.lastActiveWindow.isMinimizable : true
+ readonly property bool isMaximizable:
selectedTracker.lastActiveWindow.hasOwnProperty("isMaximizable") ?
selectedTracker.lastActiveWindow.isMaximizable : true
+ readonly property bool isVirtualDesktopsChangeable:
selectedTracker.lastActiveWindow.hasOwnProperty("isVirtualDesktopsChangeable") ?
+
selectedTracker.lastActiveWindow.isVirtualDesktopsChangeable : true
}
function toggleMaximized() {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.7.0/package/contents/ui/PlasmaTasksModel.qml
new/applet-window-buttons-0.8.0/package/contents/ui/PlasmaTasksModel.qml
--- old/applet-window-buttons-0.7.0/package/contents/ui/PlasmaTasksModel.qml
2019-11-24 08:12:31.000000000 +0100
+++ new/applet-window-buttons-0.8.0/package/contents/ui/PlasmaTasksModel.qml
2020-01-23 16:52:27.000000000 +0100
@@ -68,6 +68,11 @@
readonly property bool isOnAllDesktops: IsOnAllVirtualDesktops
=== true ? true : false
readonly property bool isKeepAbove: IsKeepAbove === true ?
true : false
+ readonly property bool isClosable: IsClosable === true ? true
: false
+ readonly property bool isMinimizable: IsMinimizable === true ?
true : false
+ readonly property bool isMaximizable: IsMaximizable === true ?
true : false
+ readonly property bool isVirtualDesktopsChangeable:
IsVirtualDesktopsChangeable === true ? true : false
+
onIsActiveChanged: {
if (isActive) {
plasmaTasksItem.lastActiveTaskItem = task;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.7.0/package/contents/ui/config/ConfigGeneral.qml
new/applet-window-buttons-0.8.0/package/contents/ui/config/ConfigGeneral.qml
---
old/applet-window-buttons-0.7.0/package/contents/ui/config/ConfigGeneral.qml
2019-11-24 08:12:31.000000000 +0100
+++
new/applet-window-buttons-0.8.0/package/contents/ui/config/ConfigGeneral.qml
2020-01-23 16:52:27.000000000 +0100
@@ -79,6 +79,12 @@
borderSizesIndex: 0
}
+ AppletDecoration.SharedDecoration {
+ id: sharedDecorationItem
+ bridge: bridgeItem.bridge
+ settings: settingsItem
+ }
+
AppletDecoration.AuroraeTheme {
id: auroraeThemeEngine
theme: isEnabled ? currentTheme : ""
@@ -225,7 +231,8 @@
}
RadioButton{
id: activeMaximizedBtn
- text: i18n("Active window is maximized")
+ text: plasmoid.configuration.containmentType ===
AppletDecoration.Types.Latte ?
+ i18n("Last active window is maximized") :
i18n("Active window is maximized")
checked: root.visibility ===
AppletDecoration.Types.ActiveMaximizedWindow
exclusiveGroup: visibilityGroup
onCheckedChanged: {
@@ -297,7 +304,7 @@
CheckBox{
id: byScreenChk
- text: i18n("Show only windows from current screen")
+ text: i18n("Show only for windows in current screen")
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.7.0/package/contents/ui/config/OrderableListView.qml
new/applet-window-buttons-0.8.0/package/contents/ui/config/OrderableListView.qml
---
old/applet-window-buttons-0.7.0/package/contents/ui/config/OrderableListView.qml
2019-11-24 08:12:31.000000000 +0100
+++
new/applet-window-buttons-0.8.0/package/contents/ui/config/OrderableListView.qml
2020-01-23 16:52:27.000000000 +0100
@@ -30,6 +30,8 @@
radius: 4
anchors.margins: margin
+ signal coordinatesChanged();
+
property int orientation
property double itemWidth
property double itemHeight
@@ -68,7 +70,10 @@
return selectedScheme;
}
- Component.onCompleted: initButtons();
+ Component.onCompleted: {
+ initButtons();
+ coordinatesChanged();
+ }
function initButtons() {
if (!buttonsRecreator.running){
@@ -77,10 +82,14 @@
}
function initializeControlButtonsModel() {
+ sharedDecorationItem.createDecoration();
+
var buttonsList = buttonsStr.split('|');
ModelTools.initializeControlButtonsModel(buttonsList,tasksPreparedArray,
controlButtonsModel, false);
listView.splitterIndex =
ModelTools.indexOfSplitter(controlButtonsModel);
+
+ coordinatesTimer.start();
}
function buttonsListStr() {
@@ -150,6 +159,8 @@
move: Transition {
NumberAnimation { properties: "x"; duration: 75; easing.type:
Easing.Linear }
}
+
+ onWidthChanged: coordinatesTimer.start();
}
MouseArea {
@@ -269,17 +280,28 @@
opacity: listView.splitterIndex !==-1 &&
listView.splitterIndex<index ? 0.4 : 1
- width: listContent.iconHeight
- height: listContent.iconHeight
+ width: isButtonSplitter ? parent.width : listContent.iconHeight
+ height: isButtonSplitter ? parent.height :
listContent.iconHeight
bridge: bridgeItem.bridge
- settings: settingsItem
+ sharedDecoration: sharedDecorationItem
type: buttonType
isOnAllDesktops: false
isMaximized: false
scheme: appliedScheme
visible: buttonType !== AppletDecoration.Types.Custom
+
+ function updateCoordinates() {
+ var translated = cButton.mapToItem(listView, 0, 0);
+ cButton.localX = translated.x;
+ cButton.localY = translated.y;
+ }
+
+ Connections {
+ target: listContent
+ onCoordinatesChanged: cButton.updateCoordinates();
+ }
}
Rectangle{
@@ -407,7 +429,19 @@
Timer{
id: buttonsRecreator
interval: 200
- onTriggered: initializeControlButtonsModel();
+ onTriggered: {
+ initializeControlButtonsModel();
+ }
+ }
+
+ //! this timer is used in order to call the relative coordinates updater
at the end
+ //! of the buttons moving
+ Timer{
+ id: coordinatesTimer
+ interval: 350
+ onTriggered: {
+ listContent.coordinatesChanged();
+ }
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/applet-window-buttons-0.7.0/package/contents/ui/main.qml
new/applet-window-buttons-0.8.0/package/contents/ui/main.qml
--- old/applet-window-buttons-0.7.0/package/contents/ui/main.qml
2019-11-24 08:12:31.000000000 +0100
+++ new/applet-window-buttons-0.8.0/package/contents/ui/main.qml
2020-01-23 16:52:27.000000000 +0100
@@ -55,7 +55,8 @@
if (visibility === AppletDecoration.Types.ActiveWindow &&
!existsWindowActive) {
return true;
}
- if (visibility === AppletDecoration.Types.ActiveMaximizedWindow &&
(!isLastActiveWindowMaximized || !existsWindowActive)) {
+ if (visibility === AppletDecoration.Types.ActiveMaximizedWindow
+ && (!isLastActiveWindowMaximized || (inPlasmaPanel &&
!existsWindowActive))) {
return true;
}
if (visibility === AppletDecoration.Types.ShownWindowExists &&
!existsWindowShown) {
@@ -120,7 +121,16 @@
((root.width - auroraeThemeEngine.buttonHeight) / 2) -
1;
}
+ //! Latte padding
+ if (inLatte) {
+ if (plasmoid.formFactor === PlasmaCore.Types.Horizontal) {
+ return (root.height - (latteBridge.iconSize *
(plasmoid.configuration.buttonSizePercentage/100))) / 2;
+ } else {
+ return (root.width - (latteBridge.iconSize *
(plasmoid.configuration.buttonSizePercentage/100))) / 2;
+ }
+ }
+ //! Plasma panels code
if (plasmoid.formFactor === PlasmaCore.Types.Horizontal) {
return (root.height - (root.height *
(plasmoid.configuration.buttonSizePercentage/100))) / 2;
} else {
@@ -152,14 +162,22 @@
readonly property bool existsWindowShown: (windowInfoLoader.item &&
windowInfoLoader.item.existsWindowShown)
||
containmentIdentifierTimer.running
- readonly property bool isLastActiveWindowPinned: lastActiveTaskItem &&
lastActiveTaskItem.isOnAllDesktops
- readonly property bool isLastActiveWindowMaximized: lastActiveTaskItem &&
lastActiveTaskItem.isMaximized
- readonly property bool isLastActiveWindowKeepAbove: lastActiveTaskItem &&
lastActiveTaskItem.isKeepAbove
+ readonly property bool isLastActiveWindowPinned: lastActiveTaskItem &&
existsWindowShown && lastActiveTaskItem.isOnAllDesktops
+ readonly property bool isLastActiveWindowMaximized: lastActiveTaskItem &&
existsWindowShown && lastActiveTaskItem.isMaximized
+ readonly property bool isLastActiveWindowKeepAbove: lastActiveTaskItem &&
existsWindowShown && lastActiveTaskItem.isKeepAbove
+
+ readonly property bool isLastActiveWindowClosable: lastActiveTaskItem &&
existsWindowShown && lastActiveTaskItem.isClosable
+ readonly property bool isLastActiveWindowMaximizable: lastActiveTaskItem
&& existsWindowShown && lastActiveTaskItem.isMaximizable
+ readonly property bool isLastActiveWindowMinimizable: lastActiveTaskItem
&& existsWindowShown && lastActiveTaskItem.isMinimizable
+ readonly property bool isLastActiveWindowVirtualDesktopsChangeable:
lastActiveTaskItem && existsWindowShown &&
lastActiveTaskItem.isVirtualDesktopsChangeable
property bool hasDesktopsButton: false
property bool hasMaximizedButton: false
property bool hasKeepAboveButton: false
+ readonly property bool inPlasmaPanel: latteBridge === null
+ readonly property bool inLatte: latteBridge !== null
+
readonly property Item lastActiveTaskItem:
windowInfoLoader.item.lastActiveTaskItem
// END Window properties
@@ -316,6 +334,12 @@
borderSizesIndex: 0 // Normal
}
+ AppletDecoration.SharedDecoration {
+ id: sharedDecorationItem
+ bridge: bridgeItem.bridge
+ settings: settingsItem
+ }
+
AppletDecoration.DecorationsModel {
id: decorations
}
@@ -355,6 +379,8 @@
function initializeControlButtonsModel() {
console.log("recreating buttons");
+ sharedDecorationItem.createDecoration();
+
var buttonsList = buttonsStr.split('|');
ModelTools.initializeControlButtonsModel(buttonsList,
tasksPreparedArray, controlButtonsModel, true);
@@ -443,9 +469,10 @@
bridge: bridgeItem.bridge
- settings: settingsItem
+ sharedDecoration: sharedDecorationItem
scheme: root.currentScheme
type: buttonType
+
isActive: {
//! FIXME-TEST PERIOD: Disabled because it shows an error
from c++ theme when its value is changed
//! and breaks in some cases the buttons coloring through
the schemeFile
@@ -459,6 +486,24 @@
isMaximized: root.isLastActiveWindowMaximized
isKeepAbove: root.isLastActiveWindowKeepAbove
+ localX: x
+ localY: y
+
+ visible: {
+ if (type === AppletDecoration.Types.Close) {
+ return root.isLastActiveWindowClosable;
+ } else if (type === AppletDecoration.Types.Maximize) {
+ return root.isLastActiveWindowMaximizable;
+ } else if (type === AppletDecoration.Types.Minimize) {
+ return root.isLastActiveWindowMinimizable;
+ } else if (type === AppletDecoration.Types.OnAllDesktops) {
+ return root.isLastActiveWindowVirtualDesktopsChangeable;
+ }
+
+ return true;
+ }
+
+
readonly property int firstPadding: {
if (index === 0) {
//! first button
@@ -488,7 +533,7 @@
root.performActiveWindowAction(windowOperation);
}
- /* Rectangle{
+ /*Rectangle{
anchors.fill: parent
color: "transparent"
border.width: 1
@@ -504,7 +549,7 @@
color: "transparent"
border.width: 1
border.color: "blue"
- } */
+ }*/
}
}
@@ -558,6 +603,21 @@
buttonType: model.buttonType
auroraeTheme: auroraeThemeEngine
+
+ visible: {
+ if (buttonType === AppletDecoration.Types.Close) {
+ return root.isLastActiveWindowClosable;
+ } else if (buttonType === AppletDecoration.Types.Maximize) {
+ return root.isLastActiveWindowMaximizable;
+ } else if (buttonType === AppletDecoration.Types.Minimize) {
+ return root.isLastActiveWindowMinimizable;
+ } else if (buttonType ===
AppletDecoration.Types.OnAllDesktops) {
+ return root.isLastActiveWindowVirtualDesktopsChangeable;
+ }
+
+ return true;
+ }
+
onClicked: {
root.performActiveWindowAction(windowOperation);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/applet-window-buttons-0.7.0/package/metadata.desktop
new/applet-window-buttons-0.8.0/package/metadata.desktop
--- old/applet-window-buttons-0.7.0/package/metadata.desktop 2019-11-24
08:12:31.000000000 +0100
+++ new/applet-window-buttons-0.8.0/package/metadata.desktop 2020-01-23
16:52:27.000000000 +0100
@@ -15,7 +15,7 @@
[email protected]
X-KDE-PluginInfo-License=GPLv2
X-KDE-PluginInfo-Name=org.kde.windowbuttons
-X-KDE-PluginInfo-Version=0.7.0
+X-KDE-PluginInfo-Version=0.8.0
X-KDE-PluginInfo-Website=https://github.com/psifidotos/applet-window-buttons
X-KDE-ServiceTypes=Plasma/Applet