From 00ca23447844114d41bfc0d37cf8823202c082e8 Mon Sep 17 00:00:00 2001
From: Evan Boehs
Date: Wed, 28 Feb 2024 17:08:33 -0500
Subject: [PATCH] qt6 tar
---
CMakeLists.txt | 105 +++++++++----
README.md | 65 +++++++--
colors/CMakeLists.txt | 2 +-
kdecoration/CMakeLists.txt | 93 +++---------
kdecoration/config/lightlyconfigwidget.cpp | 22 +--
kdecoration/config/lightlyconfigwidget.h | 4 +-
.../config/lightlydecorationconfig.desktop | 2 +-
kdecoration/config/lightlydetectwidget.h | 4 +-
kdecoration/config/lightlyexceptiondialog.h | 2 +-
.../config/lightlyexceptionlistwidget.cpp | 2 +-
.../config/lightlyexceptionlistwidget.h | 2 +-
kdecoration/lightly.json | 106 +++++++++++++-
kdecoration/lightlybutton.cpp | 36 ++---
kdecoration/lightlydecoration.cpp | 62 ++++----
kdecoration/lightlydecoration.h | 18 +--
kdecoration/lightlysettingsprovider.cpp | 27 ++--
kdecoration/lightlysizegrip.cpp | 4 +-
kstyle/CMakeLists.txt | 110 ++++++--------
kstyle/animations/lightlytransitionwidget.cpp | 2 +-
kstyle/config/CMakeLists.txt | 49 +++----
kstyle/config/lightlystyleconfig.desktop | 138 ------------------
kstyle/config/lightlystyleconfigmodule.cpp | 16 +-
kstyle/config/lightlystyleconfigmodule.h | 2 +-
kstyle/config/main.cpp | 5 +-
kstyle/debug/lightlywidgetexplorer.cpp | 6 +-
kstyle/lightly.themerc | 2 +-
kstyle/lightlyblurhelper.cpp | 5 +-
kstyle/lightlyhelper.cpp | 24 ++-
kstyle/lightlyhelper.h | 2 +-
kstyle/lightlystyle.cpp | 14 +-
liblightlycommon/CMakeLists.txt | 17 ++-
31 files changed, 460 insertions(+), 488 deletions(-)
delete mode 100644 kstyle/config/lightlystyleconfig.desktop
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b3dfbd3b8..b30451c2a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,59 +1,112 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.16)
project(lightly)
-set(PROJECT_VERSION "0.43")
-set(PROJECT_VERSION_MAJOR 5)
+set(PROJECT_VERSION "6.80")
+set(PROJECT_VERSION_MAJOR 6)
-set(KF5_MIN_VERSION "5.78.0")
+
+set(KF6_MIN_VERSION "5.240.0")
+set(KDE_COMPILERSETTINGS_LEVEL "5.82")
+set(QT_MIN_VERSION "6.6.0")
include(GenerateExportHeader)
include(WriteBasicConfigVersionFile)
include(FeatureSummary)
+include(GNUInstallDirs)
+
+find_package(ECM ${KF6_MIN_VERSION} REQUIRED NO_MODULE)
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
+
+set(CMAKE_CXX_STANDARD 20)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
-find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_SOURCE_DIR}/cmake)
+include(CMakePackageConfigHelpers)
include(ECMInstallIcons)
-include(KDEInstallDirs)
-include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDEClangFormat)
+include(KDEGitCommitHooks)
include(GtkUpdateIconCache)
-option(WITH_DECORATIONS "Build Lightly window decorations for KWin" ON)
-if(WITH_DECORATIONS)
- find_package(KDecoration2 REQUIRED)
- add_subdirectory(kdecoration)
+if(WIN32 OR APPLE)
+ set(WITH_DECORATIONS OFF)
endif()
+set(QT_MAJOR_VERSION 6)
+include(KDEInstallDirs6)
+include(KDECMakeSettings)
+
+option(WITH_DECORATIONS "Build Lightly window decorations for KWin" ON)
+
+find_package(Qt6 ${QT_MIN_VERSION} REQUIRED CONFIG COMPONENTS Widgets DBus)
+find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS
+ CoreAddons
+ ColorScheme
+ Config
+ GuiAddons
+ I18n
+ IconThemes
+ WindowSystem)
+ if(NOT WIN32 AND NOT APPLE)
+ find_package(KF6KCMUtils ${KF6_MIN_VERSION})
+ set_package_properties(KF6KCMUtils PROPERTIES
+ TYPE REQUIRED
+ DESCRIPTION "Helps create configuration modules"
+ PURPOSE "KCMUtils used for the configuration modules or the decoration and Qt Style"
+ )
+ endif()
+
+find_package(Qt6 ${QT_MIN_VERSION} OPTIONAL_COMPONENTS Quick)
+ if(${Qt6Quick_FOUND})
+ find_package(KF6KirigamiPlatform ${KF6_MIN_VERSION} REQUIRED)
+ endif()
+
+find_package(KF6FrameworkIntegration ${KF6_MIN_VERSION} CONFIG )
+ set_package_properties(KF${QT_MAJOR_VERSION}FrameworkIntegration PROPERTIES
+ DESCRIPTION "KF6 Framework Integration"
+ URL "https://projects.kde.org/projects/frameworks/frameworkintegration"
+ TYPE OPTIONAL
+ PURPOSE "Required to use KStyle convenience functionalities in style")
+
+set(LIGHTLY_HAVE_KSTYLE ${KF6FrameworkIntegration_FOUND})
+set(LIGHTLY_HAVE_QTQUICK ${Qt6Quick_FOUND})
+
+
add_subdirectory(colors)
-add_subdirectory(liblightlycommon)
-add_subdirectory(kstyle)
-add_subdirectory(misc)
+add_subdirectory(kstyle kstyle6)
+add_subdirectory(liblightlycommon liblightlycommon6)
+#add_subdirectory(misc)
+ if(WITH_DECORATIONS)
+ find_package(KDecoration2 REQUIRED)
+ add_subdirectory(kdecoration)
+ endif()
+ki18n_install(po)
+
+# create a Config.cmake and a ConfigVersion.cmake file and install them
include(ECMSetupVersion)
ecm_setup_version(${PROJECT_VERSION} VARIABLE_PREFIX LIGHTLY
- PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/LightlyConfigVersion.cmake"
+ PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/LightlyConfigVersion.cmake"
)
-# create a Config.cmake and a ConfigVersion.cmake file and install them
-set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/Lightly")
+set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/Lightly")
-ecm_configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/LightlyConfig.cmake.in"
+configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/LightlyConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/LightlyConfig.cmake"
PATH_VARS KDE_INSTALL_FULL_DATADIR
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
- )
+ )
+
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/LightlyConfig.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/LightlyConfigVersion.cmake"
+ DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
+ COMPONENT Devel
+ )
# add clang-format target for all our real source files
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
-
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/LightlyConfig.cmake"
- "${CMAKE_CURRENT_BINARY_DIR}/LightlyConfigVersion.cmake"
- DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
- COMPONENT Devel
- )
+kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/README.md b/README.md
index 9970fb3af..579ef933a 100644
--- a/README.md
+++ b/README.md
@@ -2,24 +2,15 @@
-**This is a personal fork of Lightly where I merge pull requests sent to [Luwx/Lightly](https://github.com/Luwx/Lightly)**
-
-*Lightly* is a fork of breeze theme style that aims to be visually modern and minimalistic.
-
-# Notes about this fork
-
-- Do not open pull requests directly here unless they change/require some code that has diverged from upstream
-- If the pull request can sucessfully be merged into [Luwx/Lightly](https://github.com/Luwx/Lightly), please open it there and I will merge it here. My intention is not for this to be a permanent fork (hopefully Luwx comes back!)
-- Similarly, don't open issues here unless the issue was likely caused by some code here that's not in [Luwx/Lightly](https://github.com/Luwx/Lightly)
-
-These rules are because I don't want to diverge too far from upstream. It should be easy for Luwx to catch up.
-
-Thanks ❤️🐢
+*Lightly* is a fork of breeze theme style that aims to be visually modern and minimalistic.
## Development ⚠️
Lightly is a work in progress theme, there is still a lot to change, so expect bugs! Some applications may suddenly crash or flicker.
+If you have any feedback or encounter some bugs, feel free to open an issue or a pr.
+
+
## Screenshots

@@ -45,6 +36,45 @@ Most of these options are inherited from Breeze style, but Lightly has a few exc
The toolbar and menubar will follow the **titlebar** opacity. To configure the titlebar opacity, you will have to change the color scheme file directly in ~/.local/share/color-schemes. Open your desired color scheme and, in the ```[WM]``` section, add a fourth value to ```activeBackground``` and ```inactiveBackground```, like ```activeBackground=0,0,0,127``` where the last value is the alpha, that ranges from 0 (completely transparent) to 255 (totally opaque).
+## Installation
+
+### Installing Lightly from [chaotic-aur](https://aur.chaotic.cx/) on ArchLinux and its [derivatives](https://wiki.archlinux.org/title/Arch-based_distributions)
+ 1. Follow the instructions [here](https://aur.chaotic.cx/) on how to setup chaotic-aur
+ 2. run: ```sudo pacman -Syyu lightly-qt```
+
+### Installing Lightly from RPM repository on openSUSE Tumbleweed:
+
+1. Add "sputnik-look-and-feel" repository:
+```sudo zypper ar -ef https://download.opensuse.org/repositories/home:/sputnik:/look-and-feel/openSUSE_Tumbleweed/ sputnik-look-and-feel```
+2. Refresh repository list:
+```sudo zypper ref```
+3. You will be notified about received new repository key. And you will be asked if you want to accept the key. This repository is created on OBS. All builds are reproducible.
+Type "```a```" and press enter.
+4. Install Lightly:
+```sudo zypper in Lightly```
+
+### Fedora
+```
+sudo dnf install Lightly
+```
+
+### Fedora 32 RPM repository
+
+1. Create repo file:
+```
+echo "[sputnik-look-and-feel]
+name=Look And Feel (Fedora_32)
+type=rpm-md
+baseurl=https://download.opensuse.org/repositories/home:/sputnik:/look-and-feel/Fedora_32/
+gpgcheck=1
+gpgkey=https://download.opensuse.org/repositories/home:/sputnik:/look-and-feel/Fedora_32/repodata/repomd.xml.key
+enabled=1" | sudo tee -a /etc/yum.repos.d/sputnik-look-and-feel.repo
+```
+2. Install Lightly:
+```sudo dnf install Lightly```
+
+
+
## Manual installation
### Dependencies
@@ -80,15 +110,13 @@ sudo eopkg install extra-cmake-modules kdecoration-devel qt5-declarative-devel q
### Build and install
```
-git clone --single-branch --depth=1 https://github.com/boehs/Lightly.git
+git clone --single-branch --depth=1 https://github.com/Luwx/Lightly.git
cd Lightly && mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib -DBUILD_TESTING=OFF ..
make
sudo make install
```
-For RedHat-based distros (like Fedora and OpenSUSE), run `cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_LIBDIR=lib64 -DBUILD_TESTING=OFF ..` instead (#4)
-
### Uninstall
In the build folder:
@@ -99,3 +127,8 @@ sudo make uninstall
## Acknowledgments
Breeze authors and Kvantum developer Pedram Pourang.
+
+
+
+
+
diff --git a/colors/CMakeLists.txt b/colors/CMakeLists.txt
index fb93f0604..6e9f1a4ae 100644
--- a/colors/CMakeLists.txt
+++ b/colors/CMakeLists.txt
@@ -1,2 +1,2 @@
install(FILES Lightly.colors
- DESTINATION ${DATA_INSTALL_DIR}/color-schemes/)
+ DESTINATION ${KDE_INSTALL_DATADIR}/color-schemes/)
diff --git a/kdecoration/CMakeLists.txt b/kdecoration/CMakeLists.txt
index 7b1deef51..7c365c44f 100644
--- a/kdecoration/CMakeLists.txt
+++ b/kdecoration/CMakeLists.txt
@@ -1,30 +1,5 @@
add_definitions(-DTRANSLATION_DOMAIN="lightly_kwin_deco")
-find_package(KF5 REQUIRED COMPONENTS CoreAddons GuiAddons ConfigWidgets WindowSystem I18n IconThemes)
-find_package(Qt5 CONFIG REQUIRED COMPONENTS DBus)
-
-### XCB
-find_package(XCB COMPONENTS XCB)
-set_package_properties(XCB PROPERTIES
- DESCRIPTION "X protocol C-language Binding"
- URL "https://xcb.freedesktop.org"
- TYPE OPTIONAL
- PURPOSE "Required to pass style properties to native Windows on X11 Platform"
-)
-
-if(UNIX AND NOT APPLE)
-
- set(LIGHTLY_HAVE_X11 ${XCB_XCB_FOUND})
- if (XCB_XCB_FOUND)
- find_package(Qt5 REQUIRED CONFIG COMPONENTS X11Extras)
- endif()
-
-else()
-
- set(LIGHTLY_HAVE_X11 FALSE)
-
-endif()
-
################# configuration #################
configure_file(config-lightly.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-lightly.h )
@@ -39,59 +14,37 @@ set(lightlydecoration_SRCS
lightlydecoration.cpp
lightlyexceptionlist.cpp
lightlysettingsprovider.cpp
- lightlysizegrip.cpp)
-
-kconfig_add_kcfg_files(lightlydecoration_SRCS lightlysettings.kcfgc)
-
-### config classes
-### they are kept separately because they might move in a separate library in the future
-set(lightlydecoration_config_SRCS
- config/lightlyconfigwidget.cpp
- config/lightlydetectwidget.cpp
- config/lightlyexceptiondialog.cpp
- config/lightlyexceptionlistwidget.cpp
- config/lightlyexceptionmodel.cpp
- config/lightlyitemmodel.cpp
-)
-
-set(lightlydecoration_config_PART_FORMS
- config/ui/lightlyconfigurationui.ui
- config/ui/lightlydetectwidget.ui
- config/ui/lightlyexceptiondialog.ui
- config/ui/lightlyexceptionlistwidget.ui
+ lightlysizegrip.cpp
)
-
-ki18n_wrap_ui(lightlydecoration_config_PART_FORMS_HEADERS ${lightlydecoration_config_PART_FORMS})
-
### build library
+kconfig_add_kcfg_files(lightlydecoration_SRCS lightlysettings.kcfgc)
add_library(lightlydecoration MODULE
${lightlydecoration_SRCS}
${lightlydecoration_config_SRCS}
${lightlydecoration_config_PART_FORMS_HEADERS})
+set_target_properties(lightlydecoration PROPERTIES
+ OUTPUT_NAME org.kde.lightly
+)
+
target_link_libraries(lightlydecoration
- PUBLIC
- Qt5::Core
- Qt5::Gui
- Qt5::DBus
- PRIVATE
- lightlycommon5
+ PUBLIC
+ Qt::Core
+ Qt::Gui
+ Qt::DBus
KDecoration2::KDecoration
- KF5::ConfigCore
- KF5::CoreAddons
- KF5::ConfigWidgets
- KF5::GuiAddons
- KF5::I18n
- KF5::IconThemes
- KF5::WindowSystem)
-
-if(LIGHTLY_HAVE_X11)
- target_link_libraries(lightlydecoration
- PUBLIC
- Qt5::X11Extras
- XCB::XCB)
-endif()
+ PRIVATE
+ lightlycommon6
+ KF6::CoreAddons
+ KF6::ConfigWidgets
+ KF6::GuiAddons
+ KF6::I18n
+ KF6::IconThemes
+ KF6::WindowSystem
+ KF6::KCMUtils
+)
+install(TARGETS lightlydecoration DESTINATION ${KDE_INSTALL_PLUGINDIR}/${KDECORATION_PLUGIN_DIR})
+install(FILES config/lightlydecorationconfig.desktop DESTINATION ${KDE_INSTALL_DATADIR}/kservices6)
-install(TARGETS lightlydecoration DESTINATION ${PLUGIN_INSTALL_DIR}/org.kde.kdecoration2)
-install(FILES config/lightlydecorationconfig.desktop DESTINATION ${SERVICES_INSTALL_DIR})
+add_subdirectory(config)
diff --git a/kdecoration/config/lightlyconfigwidget.cpp b/kdecoration/config/lightlyconfigwidget.cpp
index 2f5852c1e..b014d65bc 100644
--- a/kdecoration/config/lightlyconfigwidget.cpp
+++ b/kdecoration/config/lightlyconfigwidget.cpp
@@ -36,14 +36,14 @@ namespace Lightly
{
//_________________________________________________________
- ConfigWidget::ConfigWidget( QWidget* parent, const QVariantList &args ):
- KCModule(parent, args),
- m_configuration( KSharedConfig::openConfig( QStringLiteral( "lightlyrc" ) ) ),
- m_changed( false )
+ ConfigWidget::ConfigWidget(QObject *parent, const KPluginMetaData &data, const QVariantList & /*args*/)
+ : KCModule(parent, data)
+ , m_configuration(KSharedConfig::openConfig(QStringLiteral("lightlyrc")))
+ , m_changed(false)
{
// configuration
- m_ui.setupUi( this );
+ m_ui.setupUi(widget());
// track ui changes
connect( m_ui.titleAlignment, SIGNAL(currentIndexChanged(int)), SLOT(updateChanged()) );
@@ -98,7 +98,7 @@ namespace Lightly
ExceptionList exceptions;
exceptions.readConfig( m_configuration );
m_ui.exceptions->setExceptions( exceptions.get() );
- setChanged( false );
+ setNeedsSave(false);
}
@@ -134,7 +134,7 @@ namespace Lightly
// sync configuration
m_configuration->sync();
- setChanged( false );
+ setNeedsSave( false );
// needed to tell kwin to reload when running from external kcmshell
{
@@ -205,14 +205,8 @@ namespace Lightly
// exceptions
else if( m_ui.exceptions->isChanged() ) modified = true;
- setChanged( modified );
+ setNeedsSave( modified );
}
- //_______________________________________________
- void ConfigWidget::setChanged( bool value )
- {
- emit changed( value );
- }
-
}
diff --git a/kdecoration/config/lightlyconfigwidget.h b/kdecoration/config/lightlyconfigwidget.h
index 348c414b3..ad9c02813 100644
--- a/kdecoration/config/lightlyconfigwidget.h
+++ b/kdecoration/config/lightlyconfigwidget.h
@@ -25,7 +25,7 @@
// IN THE SOFTWARE.
//////////////////////////////////////////////////////////////////////////////
-#include "ui_lightlyconfigurationui.h"
+#include "config/ui_lightlyconfigurationui.h"
#include "lightlyexceptionlistwidget.h"
#include "lightlysettings.h"
#include "lightly.h"
@@ -48,7 +48,7 @@ namespace Lightly
public:
//* constructor
- explicit ConfigWidget( QWidget*, const QVariantList& );
+ explicit ConfigWidget(QObject *parent, const KPluginMetaData &data, const QVariantList &args);
//* destructor
virtual ~ConfigWidget() = default;
diff --git a/kdecoration/config/lightlydecorationconfig.desktop b/kdecoration/config/lightlydecorationconfig.desktop
index 96011ac3a..2a3cdd760 100644
--- a/kdecoration/config/lightlydecorationconfig.desktop
+++ b/kdecoration/config/lightlydecorationconfig.desktop
@@ -1,5 +1,5 @@
[Desktop Entry]
-Exec=kcmshell5 lightlydecorationconfig
+Exec=kcmshell6 lightlydecorationconfig
Icon=preferences-system-windows
Type=Service
X-KDE-ServiceTypes=KCModule
diff --git a/kdecoration/config/lightlydetectwidget.h b/kdecoration/config/lightlydetectwidget.h
index 13122464f..1f009c4b3 100644
--- a/kdecoration/config/lightlydetectwidget.h
+++ b/kdecoration/config/lightlydetectwidget.h
@@ -31,7 +31,7 @@
//////////////////////////////////////////////////////////////////////////////
#include "lightlysettings.h"
-#include "ui_lightlydetectwidget.h"
+#include "config/ui_lightlydetectwidget.h"
#include
#include
@@ -40,7 +40,7 @@
#include
#include
-
+#include
namespace Lightly
{
diff --git a/kdecoration/config/lightlyexceptiondialog.h b/kdecoration/config/lightlyexceptiondialog.h
index bd7961dbd..d68f4d174 100644
--- a/kdecoration/config/lightlyexceptiondialog.h
+++ b/kdecoration/config/lightlyexceptiondialog.h
@@ -25,7 +25,7 @@
// IN THE SOFTWARE.
//////////////////////////////////////////////////////////////////////////////
-#include "ui_lightlyexceptiondialog.h"
+#include "config/ui_lightlyexceptiondialog.h"
#include "lightly.h"
#include
diff --git a/kdecoration/config/lightlyexceptionlistwidget.cpp b/kdecoration/config/lightlyexceptionlistwidget.cpp
index 2d2d82bfd..cedce531d 100644
--- a/kdecoration/config/lightlyexceptionlistwidget.cpp
+++ b/kdecoration/config/lightlyexceptionlistwidget.cpp
@@ -323,7 +323,7 @@ namespace Lightly
bool ExceptionListWidget::checkException( InternalSettingsPtr exception )
{
- while( exception->exceptionPattern().isEmpty() || !QRegExp( exception->exceptionPattern() ).isValid() )
+ while( exception->exceptionPattern().isEmpty() || !QRegularExpression( exception->exceptionPattern() ).isValid() )
{
QMessageBox::warning( this, i18n( "Warning - Lightly Settings" ), i18n("Regular Expression syntax is incorrect") );
diff --git a/kdecoration/config/lightlyexceptionlistwidget.h b/kdecoration/config/lightlyexceptionlistwidget.h
index 0777140e9..f075b11ed 100644
--- a/kdecoration/config/lightlyexceptionlistwidget.h
+++ b/kdecoration/config/lightlyexceptionlistwidget.h
@@ -25,7 +25,7 @@
// IN THE SOFTWARE.
//////////////////////////////////////////////////////////////////////////////
-#include "ui_lightlyexceptionlistwidget.h"
+#include "config/ui_lightlyexceptionlistwidget.h"
#include "lightlyexceptionmodel.h"
//* QDialog used to commit selected files
diff --git a/kdecoration/lightly.json b/kdecoration/lightly.json
index 1936967ad..cb8dcfa88 100644
--- a/kdecoration/lightly.json
+++ b/kdecoration/lightly.json
@@ -1,14 +1,110 @@
{
"KPlugin": {
+ "Description": "Window decoration using the Lightly visual style for the Plasma Desktop",
+ "Description[ar]": "زخرفة نوافذ تستخدم نمط «نسيم» المرئيّ لسطح مكتب «بلازما»",
+ "Description[az]": "Plazma Masaüstü üçün Lightly vizual üslubundan istifadə edən pəncərə dekorasiyası",
+ "Description[bg]": "Декорация на прозорци, използваща Lightly визуален стил за работнаta среда на Plasma",
+ "Description[ca@valencia]": "Decoració de les finestres que utilitza l'estil visual Lightly per a l'escriptori Plasma",
+ "Description[ca]": "Decoració de les finestres que usa l'estil visual Lightly per a l'escriptori Plasma",
+ "Description[cs]": "Dekorace oken pro pracovní plochu Plasma využívající styl Lightly",
+ "Description[da]": "Vinduesdekoration som bruger den visuelle stil Lightly til Plasma-skrivebordet",
+ "Description[de]": "Fensterdekoration im Lightly-Design für die Plasma-Arbeitsfläche",
+ "Description[el]": "Διακοσμήσεις παραθύρων με το στιλ του Lightly για την επιφάνεια εργασίας Plasma",
+ "Description[en_GB]": "Window decoration using the Lightly visual style for the Plasma Desktop",
+ "Description[eo]": "Fenestraĵa ornamo",
+ "Description[es]": "Decoración de ventanas que usa el estilo visual Lightly para el escritorio Plasma",
+ "Description[et]": "Plasma töölaua akende dekoratsioon Lightly'i visuaalse stiiliga",
+ "Description[eu]": "Leiho apainketa Plasma mahaigainerako Lightly ikus-estiloa erabiliz",
+ "Description[fi]": "Lightly-tyyliä käyttävä ikkunan kehys Plasma-työpöydälle",
+ "Description[fr]": "Décorations de fenêtres utilisant le style visuel Lightly pour le bureau Plasma",
+ "Description[gl]": "Decoración de xanelas que usa o estilo visual Lightly para o escritorio Plasma.",
+ "Description[hi]": "प्लाज़्मा डेस्कटॉप के लिए ब्रीज़ दृश्य शैली का उपयोग करके विंडो सजावट",
+ "Description[hu]": "A Lightly vizuális stílusát használó ablakdekoráció",
+ "Description[ia]": "Decoration de fenestra usante le stilo visual Lightly (Lightly) per le scriptorio de Plasma",
+ "Description[id]": "Dekorasi jendela menggunakan gaya visual Lightly untuk Desktop Plasma",
+ "Description[it]": "Decorazione per finestre che usa lo stile visuale di Brezza per il desktop Plasma",
+ "Description[ja]": "Plasma デスクトップのための Lightly スタイルを使用したウィンドウ装飾",
+ "Description[ka]": "ფანჯრების დეკორაცია Lightly-ის ვიზუალის სტილში, Plasma Desktop-სთვის",
+ "Description[ko]": "Plasma 데스크톱의 Lightly 시각 스타일을 사용하는 창 장식",
+ "Description[lt]": "Langų dekoracijos, naudojant Lightly vaizdinį stilių, skirtą Plasma darbalaukiui",
+ "Description[nb]": "Vinduspynt som bruker Lightly-stilen for Plasma-skrivebordet",
+ "Description[nl]": "Vensterdecoratie met gebruik van de visuele stijl Lightly voor het Plasma bureaublad",
+ "Description[nn]": "Vindaugspynt som brukar Lightly-stilen for Plasma-skrivebordet",
+ "Description[pa]": "ਪਲਾਜ਼ਮਾ ਡੈਸਕਟਾਪ ਲਈ ਬਰੀਜ਼ ਦਿੱਖ ਸਟਾਈਲ ਦੀ ਵਰਤੋਂ ਕਰਕੇ ਵਿੰਡੋ ਸਜਾਵਟ",
+ "Description[pl]": "Okna zgodne ze stylem Bryzy dla Pulpitu Plazmy",
+ "Description[pt]": "Decoração de janelas que usa o estilo visual Lightly para a Área de Trabalho Plasma",
+ "Description[pt_BR]": "Decoração de janelas que usa o estilo visual Lightly para o Plasma Desktop",
+ "Description[ro]": "Decorații de fereastră folosind stilul vizual Briză pentru biroul Plasma",
+ "Description[ru]": "Оформление окон Lightly",
+ "Description[sk]": "Dekorácia okien pomocou vizuálneho štýlu Vánok pre plochu Plasma",
+ "Description[sl]": "Okraski oken, ki uporabljajo vidni slog teme Sapica za namizje Plasma",
+ "Description[sr@ijekavian]": "Декорација прозора са Поветарцем као визуелним стилом за плазма површ.",
+ "Description[sr@ijekavianlatin]": "Dekoracija prozora sa Povetarcem kao vizuelnim stilom za plasma površ.",
+ "Description[sr@latin]": "Dekoracija prozora sa Povetarcem kao vizuelnim stilom za plasma površ.",
+ "Description[sr]": "Декорација прозора са Поветарцем као визуелним стилом за плазма површ.",
+ "Description[sv]": "Fönsterdekoration med den visuella stilen Lightly för Plasma skrivbord",
+ "Description[ta]": "பிரீஸ் பாங்கிலுள்ள பிளாஸ்மா பணிமேடைக்கான விளிம்புத்திட்டம்",
+ "Description[tg]": "Ороиши равзана бо истифодаи услуби намоёнии Насим барои мизи кории Plasma",
+ "Description[tr]": "Plasma Masaüstü için Esinti görsel biçemini kullanan pencere dekorasyonu",
+ "Description[uk]": "Обрамлення вікон з використанням візуального стилю Lightly для стільничного середовища Плазми",
+ "Description[x-test]": "xxWindow decoration using the Lightly visual style for the Plasma Desktopxx",
+ "Description[zh_CN]": "Lightly 微风视觉风格的 Plasma 桌面窗口装饰",
+ "Description[zh_TW]": "使用 Plasma 桌面 Lightly 視覺樣式的視窗裝飾",
"EnabledByDefault": true,
- "Id": "org.kde.lightly",
"Name": "Lightly",
- "ServiceTypes": [
- "org.kde.kdecoration2"
- ]
+ "Name[ar]": "نسيم",
+ "Name[az]": "Lightly",
+ "Name[bg]": "Lightly",
+ "Name[ca@valencia]": "Lightly",
+ "Name[ca]": "Lightly",
+ "Name[cs]": "Lightly",
+ "Name[da]": "Lightly",
+ "Name[de]": "Lightly",
+ "Name[el]": "Lightly",
+ "Name[en_GB]": "Lightly",
+ "Name[eo]": "Lightly",
+ "Name[es]": "Lightly",
+ "Name[et]": "Lightly",
+ "Name[eu]": "Lightly",
+ "Name[fi]": "Lightly",
+ "Name[fr]": "Lightly",
+ "Name[gl]": "Lightly",
+ "Name[hi]": "ब्रीज़",
+ "Name[hu]": "Lightly",
+ "Name[ia]": "Lightly (Lightly)",
+ "Name[id]": "Lightly",
+ "Name[it]": "Brezza",
+ "Name[ja]": "Lightly",
+ "Name[ka]": "Lightly",
+ "Name[ko]": "Lightly",
+ "Name[lt]": "Lightly",
+ "Name[nb]": "Lightly",
+ "Name[nl]": "Lightly",
+ "Name[nn]": "Lightly",
+ "Name[pa]": "ਬਰੀਜ਼",
+ "Name[pl]": "Bryza",
+ "Name[pt]": "Lightly",
+ "Name[pt_BR]": "Lightly",
+ "Name[ro]": "Briză",
+ "Name[ru]": "Lightly",
+ "Name[sk]": "Vánok",
+ "Name[sl]": "Sapica",
+ "Name[sr@ijekavian]": "Поветарац",
+ "Name[sr@ijekavianlatin]": "Povetarac",
+ "Name[sr@latin]": "Povetarac",
+ "Name[sr]": "Поветарац",
+ "Name[sv]": "Lightly",
+ "Name[ta]": "பிரீஸ்",
+ "Name[tg]": "Насим",
+ "Name[tr]": "Esinti",
+ "Name[uk]": "Lightly",
+ "Name[x-test]": "xxLightlyxx",
+ "Name[zh_CN]": "Lightly 微风",
+ "Name[zh_TW]": "Lightly"
},
+ "X-KDE-ConfigModule": "kcm_lightlydecoration",
"org.kde.kdecoration2": {
- "kcmodule": true,
+ "blur": false,
"recommendedBorderSize": "None"
}
}
diff --git a/kdecoration/lightlybutton.cpp b/kdecoration/lightlybutton.cpp
index 50da45cb2..a80f6dfcc 100644
--- a/kdecoration/lightlybutton.cpp
+++ b/kdecoration/lightlybutton.cpp
@@ -57,8 +57,8 @@ namespace Lightly
setIconSize(QSize( height, height ));
// connections
- connect(decoration->client().data(), SIGNAL(iconChanged(QIcon)), this, SLOT(update()));
- connect(decoration->settings().data(), &KDecoration2::DecorationSettings::reconfigured, this, &Button::reconfigure);
+ connect(decoration->client(), SIGNAL(iconChanged(QIcon)), this, SLOT(update()));
+ connect(decoration->settings().get(), &KDecoration2::DecorationSettings::reconfigured, this, &Button::reconfigure);
connect( this, &KDecoration2::DecorationButton::hoveredChanged, this, &Button::updateAnimationState );
reconfigure();
@@ -85,32 +85,32 @@ namespace Lightly
{
case DecorationButtonType::Close:
- b->setVisible( d->client().data()->isCloseable() );
- QObject::connect(d->client().data(), &KDecoration2::DecoratedClient::closeableChanged, b, &Lightly::Button::setVisible );
+ b->setVisible( d->client()->isCloseable() );
+ QObject::connect(d->client(), &KDecoration2::DecoratedClient::closeableChanged, b, &Lightly::Button::setVisible );
break;
case DecorationButtonType::Maximize:
- b->setVisible( d->client().data()->isMaximizeable() );
- QObject::connect(d->client().data(), &KDecoration2::DecoratedClient::maximizeableChanged, b, &Lightly::Button::setVisible );
+ b->setVisible( d->client()->isMaximizeable() );
+ QObject::connect(d->client(), &KDecoration2::DecoratedClient::maximizeableChanged, b, &Lightly::Button::setVisible );
break;
case DecorationButtonType::Minimize:
- b->setVisible( d->client().data()->isMinimizeable() );
- QObject::connect(d->client().data(), &KDecoration2::DecoratedClient::minimizeableChanged, b, &Lightly::Button::setVisible );
+ b->setVisible( d->client()->isMinimizeable() );
+ QObject::connect(d->client(), &KDecoration2::DecoratedClient::minimizeableChanged, b, &Lightly::Button::setVisible );
break;
case DecorationButtonType::ContextHelp:
- b->setVisible( d->client().data()->providesContextHelp() );
- QObject::connect(d->client().data(), &KDecoration2::DecoratedClient::providesContextHelpChanged, b, &Lightly::Button::setVisible );
+ b->setVisible( d->client()->providesContextHelp() );
+ QObject::connect(d->client(), &KDecoration2::DecoratedClient::providesContextHelpChanged, b, &Lightly::Button::setVisible );
break;
case DecorationButtonType::Shade:
- b->setVisible( d->client().data()->isShadeable() );
- QObject::connect(d->client().data(), &KDecoration2::DecoratedClient::shadeableChanged, b, &Lightly::Button::setVisible );
+ b->setVisible( d->client()->isShadeable() );
+ QObject::connect(d->client(), &KDecoration2::DecoratedClient::shadeableChanged, b, &Lightly::Button::setVisible );
break;
case DecorationButtonType::Menu:
- QObject::connect(d->client().data(), &KDecoration2::DecoratedClient::iconChanged, b, [b]() { b->update(); });
+ QObject::connect(d->client(), &KDecoration2::DecoratedClient::iconChanged, b, [b]() { b->update(); });
break;
default: break;
@@ -146,17 +146,17 @@ namespace Lightly
const QRectF iconRect( geometry().topLeft(), m_iconSize );
if (auto deco = qobject_cast(decoration())) {
const QPalette activePalette = KIconLoader::global()->customPalette();
- QPalette palette = decoration()->client().data()->palette();
- palette.setColor(QPalette::Foreground, deco->fontColor());
+ QPalette palette = decoration()->client()->palette();
+ palette.setColor(QPalette::WindowText, deco->fontColor());
KIconLoader::global()->setCustomPalette(palette);
- decoration()->client().data()->icon().paint(painter, iconRect.toRect());
+ decoration()->client()->icon().paint(painter, iconRect.toRect());
if (activePalette == QPalette()) {
KIconLoader::global()->resetPalette();
} else {
KIconLoader::global()->setCustomPalette(palette);
}
} else {
- decoration()->client().data()->icon().paint(painter, iconRect.toRect());
+ decoration()->client()->icon().paint(painter, iconRect.toRect());
}
} else {
@@ -418,7 +418,7 @@ namespace Lightly
}
- auto c = d->client().data();
+ auto c = d->client();
if( isPressed() ) {
if( type() == DecorationButtonType::Close ) return c->color( ColorGroup::Warning, ColorRole::Foreground );
diff --git a/kdecoration/lightlydecoration.cpp b/kdecoration/lightlydecoration.cpp
index 86dde696b..1e5bfbe58 100644
--- a/kdecoration/lightlydecoration.cpp
+++ b/kdecoration/lightlydecoration.cpp
@@ -58,8 +58,7 @@ K_PLUGIN_FACTORY_WITH_JSON(
"lightly.json",
registerPlugin();
registerPlugin();
- registerPlugin();
-)
+ )
namespace
{
@@ -155,7 +154,7 @@ namespace Lightly
static int g_shadowSizeEnum = InternalSettings::ShadowLarge;
static int g_shadowStrength = 255;
static QColor g_shadowColor = Qt::black;
- static QSharedPointer g_sShadow;
+ static std::shared_ptr g_sShadow;
//________________________________________________________________
Decoration::Decoration(QObject *parent, const QVariantList &args)
@@ -171,7 +170,7 @@ namespace Lightly
g_sDecoCount--;
if (g_sDecoCount == 0) {
// last deco destroyed, clean up shadow
- g_sShadow.clear();
+ g_sShadow.reset();
}
deleteSizeGrip();
@@ -192,7 +191,7 @@ namespace Lightly
QColor Decoration::titleBarColor() const
{
- auto c = client().data();
+ auto c = client();
if( hideTitleBar() ) return c->color( ColorGroup::Inactive, ColorRole::TitleBar );
else if( m_animation->state() == QAbstractAnimation::Running )
{
@@ -208,7 +207,7 @@ namespace Lightly
QColor Decoration::outlineColor() const
{
- auto c( client().data() );
+ auto c( client() );
if( !m_internalSettings->drawTitleBarSeparator() ) return QColor();
if( m_animation->state() == QAbstractAnimation::Running )
{
@@ -223,7 +222,7 @@ namespace Lightly
QColor Decoration::fontColor() const
{
- auto c = client().data();
+ auto c = client();
if( m_animation->state() == QAbstractAnimation::Running )
{
return KColorUtils::mix(
@@ -235,9 +234,9 @@ namespace Lightly
}
//________________________________________________________________
- void Decoration::init()
+ bool Decoration::init()
{
- auto c = client().data();
+ auto c = client();
// active state change animation
// It is important start and end value are of the same type, hence 0.0 and not just 0
@@ -252,21 +251,21 @@ namespace Lightly
updateTitleBar();
updateBlur();
auto s = settings();
- connect(s.data(), &KDecoration2::DecorationSettings::borderSizeChanged, this, &Decoration::recalculateBorders);
+ connect(s.get(), &KDecoration2::DecorationSettings::borderSizeChanged, this, &Decoration::recalculateBorders);
// a change in font might cause the borders to change
- connect(s.data(), &KDecoration2::DecorationSettings::fontChanged, this, &Decoration::recalculateBorders);
- connect(s.data(), &KDecoration2::DecorationSettings::spacingChanged, this, &Decoration::recalculateBorders);
+ connect(s.get(), &KDecoration2::DecorationSettings::fontChanged, this, &Decoration::recalculateBorders);
+ connect(s.get(), &KDecoration2::DecorationSettings::spacingChanged, this, &Decoration::recalculateBorders);
// buttons
- connect(s.data(), &KDecoration2::DecorationSettings::spacingChanged, this, &Decoration::updateButtonsGeometryDelayed);
- connect(s.data(), &KDecoration2::DecorationSettings::decorationButtonsLeftChanged, this, &Decoration::updateButtonsGeometryDelayed);
- connect(s.data(), &KDecoration2::DecorationSettings::decorationButtonsRightChanged, this, &Decoration::updateButtonsGeometryDelayed);
+ connect(s.get(), &KDecoration2::DecorationSettings::spacingChanged, this, &Decoration::updateButtonsGeometryDelayed);
+ connect(s.get(), &KDecoration2::DecorationSettings::decorationButtonsLeftChanged, this, &Decoration::updateButtonsGeometryDelayed);
+ connect(s.get(), &KDecoration2::DecorationSettings::decorationButtonsRightChanged, this, &Decoration::updateButtonsGeometryDelayed);
// full reconfiguration
- connect(s.data(), &KDecoration2::DecorationSettings::reconfigured, this, &Decoration::reconfigure);
- connect(s.data(), &KDecoration2::DecorationSettings::reconfigured, SettingsProvider::self(), &SettingsProvider::reconfigure, Qt::UniqueConnection );
- connect(s.data(), &KDecoration2::DecorationSettings::reconfigured, this, &Decoration::updateButtonsGeometryDelayed);
+ connect(s.get(), &KDecoration2::DecorationSettings::reconfigured, this, &Decoration::reconfigure);
+ connect(s.get(), &KDecoration2::DecorationSettings::reconfigured, SettingsProvider::self(), &SettingsProvider::reconfigure, Qt::UniqueConnection );
+ connect(s.get(), &KDecoration2::DecorationSettings::reconfigured, this, &Decoration::updateButtonsGeometryDelayed);
connect(c, &KDecoration2::DecoratedClient::adjacentScreenEdgesChanged, this, &Decoration::recalculateBorders);
connect(c, &KDecoration2::DecoratedClient::maximizedHorizontallyChanged, this, &Decoration::recalculateBorders);
@@ -294,12 +293,13 @@ namespace Lightly
createButtons();
createShadow();
+ return true;
}
//________________________________________________________________
void Decoration::updateBlur()
{
- auto c = client().data();
+ auto c = client();
const QColor titleBarColor = c->color( c->isActive() ? ColorGroup::Active : ColorGroup::Inactive, ColorRole::TitleBar );
// set opaque to false when non-maximized, regardless of color (prevents kornerbug)
@@ -316,7 +316,7 @@ namespace Lightly
//________________________________________________________________
void Decoration::calculateWindowAndTitleBarShapes(const bool windowShapeOnly)
{
- auto c = client().data();
+ auto c = client();
auto s = settings();
if (!windowShapeOnly || c->isShaded()) {
@@ -363,7 +363,7 @@ namespace Lightly
void Decoration::updateTitleBar()
{
auto s = settings();
- auto c = client().data();
+ auto c = client();
const bool maximized = isMaximized();
const int width = maximized ? c->width() : c->width() - 2*s->largeSpacing()*Metrics::TitleBar_SideMargin;
const int height = maximized ? borderTop() : borderTop() - s->smallSpacing()*Metrics::TitleBar_TopMargin;
@@ -378,7 +378,7 @@ namespace Lightly
if( m_internalSettings->animationsEnabled() )
{
- auto c = client().data();
+ auto c = client();
m_animation->setDirection( c->isActive() ? QAbstractAnimation::Forward : QAbstractAnimation::Backward );
if( m_animation->state() != QAbstractAnimation::Running ) m_animation->start();
@@ -392,7 +392,7 @@ namespace Lightly
//________________________________________________________________
void Decoration::updateSizeGripVisibility()
{
- auto c = client().data();
+ auto c = client();
if( m_sizeGrip )
{ m_sizeGrip->setVisible( c->isResizeable() && !isMaximized() && !c->isShaded() ); }
}
@@ -461,7 +461,7 @@ namespace Lightly
//________________________________________________________________
void Decoration::recalculateBorders()
{
- auto c = client().data();
+ auto c = client();
auto s = settings();
// left, right and bottom borders
@@ -547,7 +547,7 @@ namespace Lightly
if( isLeftEdge() )
{
// add offsets on the side buttons, to preserve padding, but satisfy Fitts law
- auto button = static_cast