diff --git a/.gitignore b/.gitignore index 526a6a4e..9dbbf339 100644 --- a/.gitignore +++ b/.gitignore @@ -1,31 +1,15 @@ -PlymouthVista/ -misc/libplasma/build +misc/defaulttooltip/build misc/uac-polkitagent/build misc/plymouth/plymouth-theme-smod/build kwin/decoration/build -plasma/sddm/login-sessions/build -plasma/aerothemeplasma-kcmloader/build -plasma/atpootb/build -plasma/plasmoids/src/systemtray_src/build -plasma/plasmoids/src/notifications_src/build plasma/plasmoids/src/volume_src/build plasma/plasmoids/src/sevenstart_src/build plasma/plasmoids/src/seventasks_src/build plasma/plasmoids/src/desktopcontainment/build +kwin/effects_cpp/kwin-effect-smodsnap-v2/build-kf6 kwin/effects_cpp/kde-effects-aeroglassblur/build -kwin/effects_cpp/kwin-effect-smodsnap-v2/build -kwin/effects_cpp/smodglow/build -kwin/effects_cpp/aeroglide/build -kwin/effects_cpp/startupfeedback/build -kwin/effects_cpp/minimize3d/build -kwin/effects_cpp/kde-effects-aeroglassblur/build-wl -kwin/effects_cpp/kwin-effect-smodsnap-v2/build-wl -kwin/effects_cpp/smodglow/build-wl -kwin/effects_cpp/aeroglide/build-wl -kwin/effects_cpp/startupfeedback/build-wl -kwin/effects_cpp/minimize3d/build-wl -kwin/effects_cpp/minimize3d +kwin/effects_cpp/smodglow/build-kf6 +kwin/effects_cpp/aeroglide/build-kf6 +kwin/effects_cpp/startupfeedback/build-kf6 +kwin/effects_cpp/minimize3d/build-kf6 experimental/ -build -repos -manifest diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 4abe8126..00000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,23 +0,0 @@ -image: "archlinux:latest" - -stages: - - build - -build-linux-x64: - stage: build - before_script: - - pacman-key --init - - pacman -Syu --needed --noconfirm ninja pkgconf cmake gcc gcc-libs glibc kcoreaddons kcrash kdbusaddons ki18n kirigami knotifications kwindowsystem polkit-qt6 qt6-base qt6-declarative extra-cmake-modules libplasma plasma-pa plasma-nm plasma-workspace kdoctools qt6-virtualkeyboard qt6-multimedia qt6-5compat qt6-wayland plasma-wayland-protocols plasma5support knotifyconfig - - ln -s /usr/share/wayland/wayland.xml /wayland.xml # Ugly hack to make the xml file visible to cmake during the build process - script: - - cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBEXECDIR=lib -B build . - - cmake --build build - - DESTDIR=out cmake --install build - artifacts: - untracked: false - when: on_success - access: all - expire_in: 6 mos - paths: - - out/ - diff --git a/.gitlab/issue_templates/Default.md b/.gitlab/issue_templates/Default.md deleted file mode 100644 index 6094c681..00000000 --- a/.gitlab/issue_templates/Default.md +++ /dev/null @@ -1,12 +0,0 @@ -## Description - -## Steps to reproduce (if possible) - -## Logs - -## Additional information - -## Checklist - -- [ ] I have looked through existing [issues](https://gitgud.io/wackyideas/aerothemeplasma/-/issues) (both open and resolved) -- [ ] I have read [CONTRIBUTING.md](https://gitgud.io/wackyideas/aerothemeplasma/-/blob/master/CONTRIBUTING.md?ref_type=heads) diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 38f1ac37..00000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -cmake_minimum_required(VERSION 3.16) -project(aerothemeplasma-desktop) - -set(KF6_MIN_VERSION "6.0.0") -find_package(ECM ${KF6_MIN_VERSION} REQUIRED NO_MODULE) -set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) - -set(PROJECT_VERSION "6.5.4") -set(PROJECT_VERSION_MAJOR 6) - -include(KDEInstallDirs) -include(KDECMakeSettings) -include(KDECompilerSettings NO_POLICY_SCOPE) -include(FeatureSummary) -find_package(KF6Config) -find_package(Plasma) - -add_subdirectory(plasma) -add_subdirectory(misc) - -install() - diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 112e7e27..00000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,22 +0,0 @@ -# Contributing - -## Creating issues - -Before making an issue, please take the time to look through already existing and closed issues on both the GitGud and GitHub repo, to prevent duplicate issues. If an issue becomes relevant again, feel free to make a post in the relevant issue thread and it'll be reopened. - -Things that are helpful when writing an issue: - -- Try to describe the problem as best as possible -- Is the issue consistently reproducible? If so, provide the steps to reproduce the issue -- If the problem is visual, try to record it or screenshot it -- Provide logs of `plasmashell`, `kwin_x11`, `kwin_wayland` etc. as the issue occurs. For more information regarding testing and logging, read [DOCUMENTATION.md](./DOCUMENTATION.md). -- Provide the following relevant specifications of your system: - - Linux distribution, version and CPU architecture - - Qt, KDE and KDE Frameworks versions - - Display server (X11 and/or Wayland) - - Monitor setup and monitor capabilities (Multimonitor, DPI, HDR, etc.) - - GPU drivers - -## Merge requests - -Merge requests should only be done on the [GitGud](https://gitgud.io/wackyideas/aerothemeplasma) repo as the GitHub repository is only a mirror. diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 76c6ce45..e69de29b 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -1,248 +0,0 @@ -# Documentation - -## Table of contents - -1. [Introduction](#intro) -2. [Frequently asked questions](#faq) -3. [List of components](#list-of-components) -4. [Development resources](#development) -5. [Current Wayland issues](#wayland) - - -## Introduction - -AeroThemePlasma is a project with a lot of moving parts, ranging from simple themes to entire codebases. This documentation aims to provide the following details: - -- Structure and list of components -- Usage guides -- Development resources - -Documentation is currently a WIP, so expect most things to not be present. - -## Frequently asked questions - -### Is this project intended to help Windows users migrate to Linux? - -No, not really. - -Ultimately, this project doesn't change the fact that the underlying operating system is still Linux, and ATP's workflow doesn't diverge greatly from the typical KDE & Linux workflow. The goal of AeroThemePlasma isn't to make a 1:1 Windows desktop replacement (even though it feels like that's the intention sometimes), and it's not particularly focused on getting Windows users to migrate. The primary goal of ATP is to keep Windows 7's Aero interface alive and adapt it for modern desktops on Linux. - -### Are we Wayland yet? - -Kinda. - -AeroThemePlasma should largely work on Wayland, save for some visual quirks that haven't been ironed out yet. There are certain issues that Wayland presents that makes development on it a bit cumbersome, as well as KWin lacking features that ATP relies on under X11. See [Current Wayland issues](#wayland) for specific details. - -### What about HiDPI? - -Currently AeroThemePlasma works best on 100% scaling, but work is slowly being made towards HiDPI support. However, there are some unavoidable issues with HiDPI that ATP can't get around unfortunately, such as [QTBUG-135833](https://bugreports.qt.io/browse/QTBUG-135833) and certain Wayland problems. - -### What distros are supported? - -Only Arch-based distributions are supported officially for AeroThemePlasma, and the installation scripts are written with Arch-based distributions in mind. Contributions related to supporting other distributions are welcome (in the form of providing dependencies, etc.), but I don't intend to maintain that support and keep it up to date. - -### Do you plan on recreating the file explorer (along with other Windows applications)? - -Most likely no. It's out of ATP's scope. [Sevulet](https://gitgud.io/snailatte/sevulet) is a set of projects that, among other things, features a solid file explorer recreation. Please support their work! - -## List of components - -- Plasma - - Color scheme - - [Global theme](docs/plasma/lookandfeel.md) - - [KCM loader](docs/plasma/kcmloader.md) - - Layout template - - [Plasmoids](docs/plasma/plasmoids.md) - - [SDDM theme](docs/plasma/sddm.md) - - Seven-Black Plasma style - - [Shell](docs/plasma/shell.md) -- KWin - - [SMOD KDecoration3 style](docs/kwin/smod.md) - - [Effects (JS)](docs/kwin/effectsjs.md) - - [Effects (C++)](docs/kwin/effectscpp.md) - - [Tabbox switcher](docs/kwin/tabbox.md) - - [Window snap outline](docs/kwin/outline.md) - - [SMOD Peek script](docs/kwin/smodpeekscript.md) -- Misc - - Cursor theme - - Icon theme - - KInfoCenter branding - - Kvantum theme - - [Libplasma modifications](docs/misc/libplasma.md) - - Mimetype modifications - - Segoe UI fontconfig - - Shortcuts - - Sound theme - - User Account Control Polkit modification - -## Development resources - -## Useful commands - -### Restarting KDE - -When developing most things related to ATP (and KDE in general), it's useful to be able to quickly restart either Plasmashell or KWin on demand. Add the following shorthand commands to `~/.bashrc`: - -```bash -alias restart-plasma='setsid plasmashell --replace' -alias restart-kwin_x11='setsid kwin_x11 --replace' -alias restart-kwin_wayland='setsid kwin_wayland --replace' -``` - -Which can then be used like any other command in the terminal: - -```bash -restart-plasma -``` - -Note however that restarting KWin when using Wayland **will restart the entire compositor, which may result in certain applications being killed**. - -### Starting a nested Wayland session within X11 - -A KWin Wayland session can be loaded within an X11 environment using the following command: - -```bash -dbus-run-session kwin_wayland --width 1366 --height 768 --xwayland "plasmashell" -``` - -This spawns a nested Wayland session with the resolution of 1366x768, while also running an instance of the desktop shell. - -### Get window information - -For X11-specific window properties, use `xprop`. KWin can also query windows using the following command (works on both X11 and Wayland): - -```bash -qdbus6 org.kde.KWin /KWin queryWindowInfo -``` - -### KWin effects - -A list of KWin effects can be printed out using DBus: - -```bash -qdbus6 org.kde.KWin /Effects activeEffects -qdbus6 org.kde.KWin /Effects listOfEffects -qdbus6 org.kde.KWin /Effects loadedEffects -``` - -To check an effect's state: - -```bash -qdbus6 org.kde.KWin /Effects isEffectLoaded your_effect_name -qdbus6 org.kde.KWin /Effects isEffectSupported your_effect_name -``` - -To change an effect's loaded state: - -```bash -qdbus6 org.kde.KWin /Effects loadEffect your_effect_name -qdbus6 org.kde.KWin /Effects unloadEffect your_effect_name -qdbus6 org.kde.KWin /Effects toggleEffect your_effect_name -``` - -## Testing - -### SDDM - -```bash -sddm-greeter-qt6 --test-mode --theme /path/to/sddm/theme -``` - -One thing to keep in mind when testing SDDM themes is that user resources (such as locally installed icon themes, files present in the home directory, etc.) are available only when testing like this. SDDM will fail to load any user resources in a real scenario. QML UI components may also look different in test mode. - -### Splash screen - -```bash -ksplashqml --test --window /path/to/global/theme -``` - -The `--test` parameter can be omitted for slightly more realistic results. - -### Lock screen - -```bash -/usr/lib/kscreenlocker_greet --testing -``` - -Runs the lock screen in testing mode, opening a lock screen window for every display. - -### Ctrl+Alt+Del screen - -```bash -/usr/lib/ksmserver-logout-greeter --windowed -``` - -### Qt test application - -```bash -kvantumpreview -style [qstyle] -``` - -Running without passing `-style` will simply load the application with the currently applied QStyle. - -### Testing notifications - -```bash -notify-send -a Dolphin -h string:desktop-entry:org.kde.dolphin "Lorem ipsum dolor sit amet" "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." -i org.kde.dolphin --action=inline-reply="Reply" --action="Test" -``` - -This will spawn a notification with a sufficiently long body, presenting as Dolphin, and provides actions in the form of regular actions and inline replies. - -In order to test thumbnail previews for notifications, one or more URLs need to be passed to the notification as well. This can't be done in the terminal (to my knowledge, at least), so some kind of scripting or the use of KNotification is required. - -## Logging - -### From the terminal - -Restarting Plasmashell or KWin as described above results in output being printed to `stdout` which is readable by the terminal emulator. By default, `kwin_wayland` doesn't output logs to `stdout`, and in that case it's difficult to get logs this way. - -As for KCMs, their respective logs can be retrieved by running System settings from the terminal: - -```bash -systemsettings -``` - -### Getting logs from KSystemLog - -Alternatively, logs can be retrieved graphically from systemd's journal by using [KSystemLog](https://apps.kde.org/ksystemlog/). - - -## Useful tools - -- [AeroGlassPane](https://gitgud.io/wackyideas/aero-glass-pane) - Useful for testing AeroGlassBlur and SMOD Decorations -- [Heaptrack](https://github.com/KDE/heaptrack) - Heap memory profiler, useful for detecting memory leaks and call stacks -- [KAppTemplate](https://apps.kde.org/kapptemplate/) - Templates for Qt and Plasma projects -- [KDebugSettings](https://apps.kde.org/kdebugsettings/) - Configures the verbosity of log output for KDE applications/services -- [Kirigami Gallery](https://apps.kde.org/kirigami2.gallery/) - Useful for viewing color groups and color sets -- [KSystemLog](https://apps.kde.org/ksystemlog/) - General logging application -- [msstyleEditor](https://github.com/nptr/msstyleEditor) - Useful for viewing and modifying msstyle themes on Windows -- [Plasma SDK](https://github.com/KDE/plasma-sdk) - Features several useful applications for Plasma development -- [Qt Creator](https://www.qt.io/product/development-tools) - IDE for Qt applications, useful for QtWidgets codebases and standalone KDE projects -- [RccExtended](https://github.com/zedxxx/rccextended) - Required for editing SMOD resource files -- [ResourceHacker](https://www.angusj.com/resourcehacker/) - Useful for viewing and extracting resources from Windows - -## External references - -- Color scheme ([KDE docs](https://docs.kde.org/stable5/en/plasma-workspace/kcontrol/colors/index.html), [video guide](https://www.youtube.com/watch?v=6VW--o7CEEA)) -- Cursor theme ([Freedesktop specification](https://www.freedesktop.org/wiki/Specifications/cursor-spec/)) -- Icon theme ([Freedesktop](https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html) [specification](https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html)) -- [KDE Developer Platform](https://develop.kde.org/) - Useful for pretty much everything involving ATP (Plasmoids, KWin effects, APIs, Plasma styles, etc.) -- Kvantum theme* ([Kvantum](https://raw.githubusercontent.com/tsujan/Kvantum/master/Kvantum/doc/Theme-Making.pdf) [documentation](https://raw.githubusercontent.com/tsujan/Kvantum/master/Kvantum/doc/Theme-Config.pdf)) -- MSStyles ([msstyleEditor](https://github.com/nptr/msstyleEditor), Windows Style Builder) -- [Qt Documentation](https://doc.qt.io/) - Essential for Qt development -- Sound theme ([Freedesktop specification](https://eode.pages.freedesktop.org/xdg-specs/sound-theme-spec/sound-theme-spec-latest.html)) - -*While Kvantum won't be discussed here, one important detail worth mentioning is that Kvantum does not respect KDE's color schemes for the most part and that this sometimes leads to unexpected visual results. Still, it's recommended to apply a KDE color scheme alongside Kvantum for maximum compatibility. - -## Current Wayland issues - -Some of these issues are fixable but not a lot of effort has been put into doing so, while some are inherent issues with Wayland that as of now cannot be easily fixed. This list will be updated accordingly if/when issues are resolved. - -1. Wayland cannot properly identify context menus and dropdown context menus (labelled as `popupMenu` and `dropdownMenu` respectively in the KWin effects API). As a result, context menus on Wayland will always fade in and out with the `fadingpopupsaero` effect. -2. Certain animation effects play for certain windows even though they shouldn't, this is usually caused by different window identification and/or the inability to identify such windows (As the first issue points out). Most of these can likely be fixed in the future. -3. SevenTasks uses window positioning to animate its jumplists which isn't smooth or reliable on Wayland, as client-side window positioning on Wayland is not supported as part of the protocol spec. (See [xx-zones](https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/264) for more insight on the state of window positioning on Wayland). This is arguably bad practice in any case and should be replaced with some kind of KWin effect that actually performs the sliding animation. -4. SevenTasks jumplists (and context menus in general) cannot steal mouse inputs from all other windows, which might potentially result in strange behavior. -5. SevenStart's blur region often lags behind or doesn't appear at all upon opening the menu. This can likely be fixed by restructuring SevenStart in some way, but not much time has been spent fixing this bug. -6. SevenStart's floating orb positioning fails only sometimes. Additionally, because Wayland doesn't allow client windows to raise themselves, in some cases the floating orb will appear permanently stuck underneath the panel and its child windows until the shell is restarted. -6. Aero Peek is not visible on Wayland, although the windows do properly fade in and out of view. This should most likely be replaced with a proper KWin effect that renders the Aero Peek windows in place of regular windows. -7. HiDPI is not properly supported for SMOD. See #252 for more details. This is an issue for both X11 and Wayland, but X11 has an easier workaround as KDecoration3 on X11 ignores DPI scaling entirely. diff --git a/INSTALL.md b/INSTALL.md old mode 100755 new mode 100644 index a37a101f..cba9f3ed --- a/INSTALL.md +++ b/INSTALL.md @@ -3,165 +3,196 @@ ## TABLE OF CONTENTS 1. [Prerequisites](#preq) -2. [Migration notice](#migration) -3. [Getting started](#started) -4. [Optional](#optional) -5. [GTK](#gtk) -6. [Uninstalling AeroThemePlasma (old)](#uninstall_old) +2. [Plasma components](#plasma) +3. [KWin components](#kwin) +4. [Miscellaneous components](#misc) +5. [Configuring AeroThemePlasma](#conf) ## Prerequisites -It's necessary to have KDE Plasma already installed on your system (plasma-workspace and plasma-desktop) in order to get all the Plasma-specific dependencies for AeroThemePlasma. - -Before installing AeroThemePlasma, it's important to know which display server you're running on (Wayland or X11). This can be checked using Plasma's Info Center page in the settings. It's recommended to run AeroThemePlasma on X11 for now, as it's generally the more stable and feature rich experience (certain restrictions on the Wayland session make some effects and features impossible to achieve, this should hopefully be addressed in the future). +**NOTE**: Dependencies for other disros besides Arch Linux have been provided by contributors and aren't updated frequently, which may result in incorrect or missing dependencies. ### Arch Linux Required packages: ```bash -pacman -S git cmake extra-cmake-modules ninja curl unzip qt6-virtualkeyboard qt6-multimedia qt6-5compat qt6-wayland plasma-wayland-protocols plasma5support kvantum sddm sddm-kcm base-devel plasma-nm plasma-pa plasma-workspace plasma-desktop kwin-x11 plasma-x11-session +pacman -S cmake extra-cmake-modules ninja qt6-virtualkeyboard qt6-multimedia qt6-5compat plasma-wayland-protocols plasma5support kvantum base-devel ``` -Since Plasma 6.4, the X11 session has been separated from the main codebase. On Arch Linux, additional dependencies for X11 include: - -- `kwin-x11` -- `plasma-x11-session` - KSysGuard has been officially deprecated by KDE, however an unofficial [port](https://github.com/zvova7890/ksysguard6) exists for Qt6, which can be installed using the [AUR](https://aur.archlinux.org/packages/ksysguard6-git) package on Arch-based distros. -### Note: Dependencies for other distros besides Arch Linux have been provided by contributors and aren't updated frequently, which may result in incorrect or missing dependencies. - ### Fedora KDE Required Packages: ```bash -dnf install plasma-workspace-devel unzip kvantum qt6-qtmultimedia-devel qt6-qt5compat-devel libplasma-devel qt6-qtbase-devel qt6-qtwayland-devel plasma-activities-devel kf6-kpackage-devel kf6-kglobalaccel-devel qt6-qtsvg-devel wayland-devel plasma-wayland-protocols kf6-ksvg-devel kf6-kcrash-devel kf6-kguiaddons-devel kf6-kcmutils-devel kf6-kio-devel kdecoration-devel kf6-ki18n-devel kf6-knotifications-devel kf6-kirigami-devel kf6-kiconthemes-devel cmake gmp-ecm-devel kf5-plasma-devel libepoxy-devel kwin-devel kf6-karchive kf6-karchive-devel plasma-wayland-protocols-devel qt6-qtbase-private-devel qt6-qtbase-devel kf6-knewstuff-devel kf6-knotifyconfig-devel kf6-attica-devel kf6-krunner-devel kf6-kdbusaddons-devel kf6-sonnet-devel plasma5support-devel plasma-activities-stats-devel polkit-qt6-1-devel qt-devel libdrm-devel kf6-kitemmodels-devel kf6-kstatusnotifieritem-devel kf6-frameworkintegration-devel +dnf install plasma-workspace-devel kvantum qt6-qtmultimedia-devel qt6-qt5compat-devel libplasma-devel qt6-qtbase-devel qt6-qtwayland-devel plasma-activities-devel kf6-kpackage-devel kf6-kglobalaccel-devel qt6-qtsvg-devel wayland-devel plasma-wayland-protocols kf6-ksvg-devel kf6-kcrash-devel kf6-kguiaddons-devel kf6-kcmutils-devel kf6-kio-devel kdecoration-devel kf6-ki18n-devel kf6-knotifications-devel kf6-kirigami-devel kf6-kiconthemes-devel cmake gmp-ecm-devel kf5-plasma-devel libepoxy-devel kwin-devel kf6-karchive kf6-karchive-devel plasma-wayland-protocols-devel qt6-qtbase-private-devel qt6-qtbase-devel kf6-knewstuff-devel kf6-knotifyconfig-devel kf6-attica-devel kf6-krunner-devel kf6-kdbusaddons-devel kf6-sonnet-devel plasma5support-devel plasma-activities-stats-devel polkit-qt6-1-devel ``` -On Fedora, additional dependencies for X11 include: +## Compiling -- `kwin-x11` -- `kwin-x11-devel` - -### openSUSE Leap / Tumbleweed - -Required packages: +To build the components that need to be compiled (KWin effects, Decoration theme, etc.), run `compile.sh`: ```bash -zypper install cmake make ninja gcc gcc-c++ gmp-ecm-devel kf6-extra-cmake-modules qt6-base-devel qt6-quick-devel qt6-svg-devel qt6-quickcontrols2-devel kf6-kwindowsystem-devel kf6-karchive-devel kf6-kirigami-devel kf6-kbookmarks-devel kf6-kcodecs-devel kf6-kcolorscheme-devel kf6-kcompletion-devel kf6-kconfig-devel kf6-kconfigwidgets-devel kf6-kcoreaddons-devel kf6-kguiaddons-devel kf6-ki18n-devel kf6-kio-devel kf6-kitemviews-devel kf6-kjobwidgets-devel kf6-kservice-devel kf6-kwidgetsaddons-devel kf6-kxmlgui-devel kf6-solid-devel kf6-kglobalaccel-devel kf6-kiconthemes-devel kf6-knotifications-devel kf6-kpackage-devel kf6-ksvg-devel plasma6-activities-devel plasma-wayland-protocols qt6-wayland-devel qt6-quicktest-devel qt6-gui-private-devel kdecoration6-devel kf6-kcmutils-devel qt6-uitools-devel kf6-kcrash-devel libepoxy-devel kwin6-devel kwin6-x11-devel kf6-qqc2-desktop-style-devel knotifications-devel kf6-kauth-devel libplasma6-devel plasma5support6-devel plasma6-activities-stats-devel plasma6-workspace-devel +$ chmod +x compile.sh && ./compile.sh ``` -In openSUSE, additional dependencies for X11 include: - -- `kwin6-x11-devel` - -### Ubuntu 25.10 +or ```bash -apt install build-essential cmake ninja-build curl libqt6virtualkeyboard6 libqt6multimedia6 libqt6core5compat6 libplasma5support6 libkdecorations3-dev libkf6colorscheme-dev libkf6i18n-dev libkf6iconthemes-dev libkf6kcmutils-dev libkirigami-dev libkf6kio-dev libkf6notifications-dev libkf6svg-dev libkf6crash-dev libkf6globalaccel-dev libplasma-dev libplasmaactivities-dev libxcb-composite0-dev libxcb-randr0-dev libxcb-shm0-dev libxcb-damage0-dev libepoxy-dev libqt6svg6-dev kwin-dev plasma-wayland-protocols libkf5qqc2desktopstyle-dev libkf6qqc2desktopstyle-dev libplasma5support-dev libkf6auth-dev libkf6newstuff-dev libkf6notifyconfig-dev libkf6attica-dev libkf6runner-dev libkf6dbusaddons-dev libkf6sonnet-dev libkf6xmlgui-dev libkf6coreaddons-dev libkf6widgetsaddons-dev libkf6guiaddons-dev qt6-base-dev qt6-5compat-dev qml-module-org-kde-qqc2desktopstyle libplasmaactivitiesstats-dev plasma-workspace-dev libkf6statusnotifieritem-dev qml-module-org-kde-kirigami-addons-sounds qml6-module-org-kde-kirigamiaddons-sounds +$ sh compile.sh ``` -On Ubuntu, additional dependencies for X11 include: +## Plasma components -- `kwin-x11` -- `kwin-x11-dev` +This section relates to the directories found in the `plasma` folder. -## Migration notice +### Install scripts -AeroThemePlasma has moved to an installation method based on CMake, meant to simplify the entire process, as well as make it easier for distro packaging in the future. The old install scripts are deprecated and no longer work. It's highly recommended to first uninstall the old instance of AeroThemePlasma following these steps: - -1. Run the uninstall script: +1. Run the following scripts: ```bash -$ bash migration-uninstall.sh +$ chmod +x install_plasmoids.sh && ./install_plasmoids.sh +$ chmod +x install_plasma_components.sh && ./install_plasma_components.sh # Requires authorization for SMOD resources and SDDM themes ``` -2. To undo the font rendering modifications, delete the `~/.config/fontconfig/fonts.conf` file provided by the previous versions of ATP. -3. Remove the line `QML_DISABLE_DISTANCEFIELD=1` from `/etc/environment` +### Manual -It's advisable to also consult [Uninstalling AeroThemePlasma (old)](#uninstall_old) for more details. +1. Move the `smod` folder to `~/.local/share`, or `/usr/share/` for a system-wide installation. This will install the resources required by many other components in this project. -## Getting started +2. Move the folders `desktoptheme`, `look-and-feel`, `plasmoids`, `layout-templates`, `shells` into `~/.local/share/plasma`. If the folder doesn't exist, create it. These folders contain the following: -### Arch Linux + - Plasma Style + - Global Theme (more accurately, just the lock screen) + - Plasmoids + - Plasma shell + - Preset panel layout that can be applied from Edit mode -*AUR packages coming soon* +3. Move `sddm-theme-mod` to `/usr/share/sddm/themes`. Optionally, to enable the Vista start screen, set `enableStartup=true` in `theme.conf.user` +4. Import and apply the color scheme through System Settings. -### From source +## KWin components -To download this repository, clone it with `git`: +### Install scripts + +1. Run the following script: ```bash -$ git clone https://gitgud.io/wackyideas/aerothemeplasma.git aerothemeplasma -$ cd aerothemeplasma +$ chmod +x install_kwin_components.sh && ./install_kwin_components.sh ``` -It's highly recommended to use git for downloading AeroThemePlasma as updating becomes much easier. +### Manual -Run the following script: +This section relates to the directories found in the `kwin` folder. -```sh -$ bash install.sh --ninja # Pass --ninja to reduce build times -``` +1. Move `effects`, `tabbox`, `outline`, `scripts` to `~/.local/share/kwin`. +2. In System Settings, apply the following settings: -This will clone every repository needed for AeroThemePlasma and build everything from source. +- In Window Behavior -> Titlebar Actions: + - Mouse wheel: Do nothing +- In Window Behavior -> Task Switcher: + - Main: Thumbnail Seven, Include "Show Desktop" entry + - Alternative: Flip Switch, Forward shortcut: Meta+Tab +- In Window Behavior -> KWin Scripts: + - Enable Minimize All, SMOD Peek +- In Window Behavior -> Desktop Effects, enable the following: + - Aero Glass Blur + - Aero Glide + - Desaturate Unresponsive Applications + - Fading Popups + - Login + - SMOD Glow + - SMOD Snap + - Squash + - SMOD Peek + - Dim Screen for Administrator Mode + - Animations for SevenTasks Thumbnails +- In Window Behavior -> Desktop Effects, **disable** the following: + - Background Contrast + - Blur + - Maximize + - Sliding Popups + - Dialog Parent + - Dim Inactive + - Logout -You can also run the install script like this: +## Miscellaneous components + +### Install scripts + +1. Run the following script: + +```bash +$ chmod +x install_misc_components.sh && ./install_misc_components.sh +``` + +This section relates to the directories found in the `misc` folder. + +1. Move the `Kvantum` folder (the one inside the `kvantum` folder) to `~/.config`, then in Kvantum Manager select the theme. +2. Unpack the sound archive and move the folders to `~/.local/share/sounds`, then select the sound theme in System Settings. +3. Unpack the icon archive and move the folder to `~/.local/share/icons`, then select the icon theme in System Settings. +4. Unpack the cursor archive and move the folder to `/usr/share/icons`, then follow [this](https://www.youtube.com/watch?v=Dj7co2R7RKw) guide to install the cursor theme. +5. Move the files located in `mimetype` into `~/.local/share/mime/packages` and then run `update-mime-database ~/.local/share/mime` to fix DLLs and EXE files sharing the same icons. +6. Segoe UI, Segoe UI Bold, Segoe UI Semibold and Segoe UI Italic are required for this theme and they should be installed as system-wide fonts. + +If SDDM fails to pick up on the cursor theme, go to System Settings -> Startup and Shutdown -> Login Screen (SDDM), and click on Apply Plasma Settings to enforce your current cursor theme, and other relevant settings. Do this _after_ installing everything else. If even that fails, change the default cursor theme in `/usr/share/icons/default/index.theme` to say `aero-drop`. + +### Plymouth theme + +Optionally, install [PlymouthVista](https://github.com/furkrn/PlymouthVista) which supports Windows 7 boot animations, and features a more detailed setup guide. + +## Polkit User Account Control modification + +# WARNING: + +## Installing random modifications to programs that deal with privilege escalation (giving sudo or root access to users) from unknown or untrustworthy sources is reckless and a giant security risk. Even though this modification to KDE's polkit authentication UI is purely cosmetic (and even hotfixes a [longstanding](https://bugs.kde.org/show_bug.cgi?id=448554) [issue](https://bugs.kde.org/show_bug.cgi?id=502763)), it's generally not recommended to modify sensitive applications such as this. If you don't know what you're doing, or do not trust the modified source code, do not install this particular component of AeroThemePlasma. + +1. Navigate to the `uac-polkitagent` folder, and run `install.sh` (or `install_ninja.sh` if you have Ninja installed): ```bash $ chmod +x install.sh && ./install.sh ``` -## NOTE - -The script relies on `LIBEXEC_DIR` in order to determine the location of `/usr/$LIBEXEC_DIR/plasma-dbus-run-session-if-needed`, needed for the Wayland session to properly start. By default, this is set to `lib`. If you're installing ATP on a distribution where this is different, such as Fedora, this needs to be set to the appropriate value for your specific distribution. For example, on Fedora, `LIBEXEC_DIR` should be `libexec`: +2. To remove the minimize and maximize buttons from the window, run `add_rule.sh` which will generate the appropriate KWin rule: ```bash -$ LIBEXEC_DIR=libexec bash install.sh --ninja +$ chmod +x add_rule.sh && ./add_rule.sh ``` -The script will ask for admin privileges for file installation. Do **NOT** run any of the provided install scripts with sudo/doas or as root. +## Configuring AeroThemePlasma -**It's highly recommended** to keep the generated build files, so uninstalling AeroThemePlasma and its dependencies can be done using `sudo make uninstall` or `sudo ninja uninstall` in each build directory. A backup of all `install_manifest.txt` files (that list all files that have been installed on the system) is stored in the `manifest` folder. +1. Apply the Global Theme after installing everything. Make sure to restart KDE Plasma and KWin as well, by restarting your session. +2. On a fresh KDE install, **remove** the default panel and add the "AeroThemePlasma Taskbar" panel using Edit mode. You can also manually configure the panel for a finer setup. +3. Right click on the desktop and open "Desktop and Wallpaper", and select "Desktop (Win7)" under Layout, and apply the changes. +4. Disable the following entries in the system tray settings: -### Updating AeroThemePlasma + - Power and Battery + - Networks + - Keyboard Layout + - Audio Volume -Update and do `git pull` on the cloned repository to get new changes: + And enable the following entries: -```bash -$ cd /path/to/aerothemeplasma -$ git pull -``` + - Battery + - Network Management + - Sound Mixer -Re-run the install script as described in [Getting started](#started). The script will automatically pull changes for all cloned repositories and rebuild them. In case something needs to be rebuilt completely, simply delete the repository folder causing the build error, and re-run the install script. +5. When updating KDE Plasma, usually through a full system upgrade, recompiling KWin effects and the DefaultToolTip component is necessary. +6. In System Settings -> Colors & Themes -> Colors, set "Accent color from color scheme" +7. In System Settings -> Session -> Desktop Session, uncheck the "Ask for confirmation" option. +8. In System Settings -> Keyboard -> Shortcuts, under KWin, disable the "Peek at Desktop" shortcut, and remap the "MinimizeAll" to Meta+D +9. In System Settings -> Colors & Themes -> Cursors -> Configure Launch Feedback, set Cursor feedback to "None" +10. In System Settings -> Fonts, configure the fonts as shown here: -When doing a full system upgrade, KWin effects and `libplasma` modifications tend to stop working. Re-running the install script after a full system upgrade is required for them to work again (assuming no breaking upstream changes happen). + -### Uninstalling AeroThemePlasma +The following steps are optional: -Uninstalling AeroThemePlasma can be done by running the following script: - -```bash -$ bash uninstall.sh -``` - -This will go through almost every build directory and run `sudo make uninstall` or `sudo ninja uninstall` in those directories. After this, the `libplasma` package should be reinstalled using your distro's package manager. - -```bash -# On Arch Linux -$ sudo pacman -Sy libplasma -``` - -### Fonts - -On Arch Linux, use [this script](https://gitgud.io/aeroshell/aeroshell-workspace/-/blob/Plasma/6.6/scripts/install_fonts_arch.sh) to extract fonts and install them as an Arch package from a valid Windows 7 ISO. A 32-bit Windows 7 ISO is recommended for faster download speeds. - -## Optional - -1. For Wine users it's recommended to install the [VistaVG Ultimate](https://www.deviantart.com/vishal-gupta/art/VistaVG-Ultimate-57715902) msstyles theme. -2. Add the following to `~/.bashrc` to get bash to look more like the command prompt on Windows: +10. To enable full font hinting just for Segoe UI, move the `fontconfig` folder to `~/.config`. This will enable full font hinting for Segoe UI while keeping slight font hinting for other fonts. Additionally, append `QML_DISABLE_DISTANCEFIELD=1` into `/etc/environment` in order for this to be properly applied. _While full font hinting makes the font rendering look sharper and somewhat closer to Windows 7's ClearType, on Linux this option causes noticeably faulty kerning. This has been a [prominent](https://github.com/OpenTTD/OpenTTD/issues/11765) [issue](https://gitlab.gnome.org/GNOME/pango/-/issues/656) [for](https://gitlab.gnome.org/GNOME/pango/-/issues/463) [several](https://gitlab.gnome.org/GNOME/pango/-/issues/404) [years](https://github.com/harfbuzz/harfbuzz/issues/2394) [now](https://www.phoronix.com/news/HarfBuzz-Hinting-Woe) and while the situation has improved from being unreadable to just being ugly, a complete solution for this doesn't seem to be coming anytime soon._ +11. For Wine users it's recommended to install the [VistaVG Ultimate](https://www.deviantart.com/vishal-gupta/art/VistaVG-Ultimate-57715902) msstyles theme. +12. To install custom branding at the Info Center, move `kcm-about-distrorc` from the `branding` folder to `~/.config/kdedefaults/`, then edit the file's `LogoPath` entry to point to the absolute path of `kcminfo.png`. +13. Add the following to `~/.bashrc` to get bash to look more like the command prompt on Windows: ```bash PS1='C:${PWD//\//\\\\}> ' @@ -169,161 +200,4 @@ PS1='C:${PWD//\//\\\\}> ' echo -e "Microsoft Windows [Version 6.1.7600]\nCopyright (c) 2009 Microsoft Corporation. All rights reserved.\n" ``` -3. In the terminal emulator of your choice (e.g Konsole), set the font to [TerminalVector](https://www.yohng.com/software/terminalvector.html), size 9pt. Disable smooth font rendering and bold text, reduce the line spacing and margins to 0px, set the cursor shape to underline, and enable cursor blinking. - -4. Install [PlymouthVista](https://github.com/furkrn/PlymouthVista) which supports Windows 7 boot animations, and features a more detailed setup guide. - -## GTK - -AeroThemePlasma officially doesn't have any kind of maintenance, development or support for GTK applications. Instead, check out -[Windows 7 Better](https://gitgud.io/Gamer95875/Windows-7-Better) by [Gamer95875](https://gitgud.io/Gamer95875), which is the recommended set of themes that works best with AeroThemePlasma. - -## Uninstalling AeroThemePlasma (old) - -### This section is meant for users migrating away from older versions of AeroThemePlasma (Before Plasma 6.6). - -AeroThemePlasma provides an uninstall script that undoes much of what's installed on the system. The script assumes that all of the CMake build files are still present in the repo, most importantly the `install_manifest.txt` files generated as a result of installing compiled parts of ATP. If these files are missing from the repo, they need to be regenerated by once again rerunning the necessary scripts like this: - -```bash -$ bash compile.sh --skip-libplasma [--wayland] [--ninja] -$ bash install_plasmoids.sh --skip-kpackages [--ninja] -``` - -Once this is done, the script is simply executed: - -```bash -$ bash uninstall.sh -``` - -This should be run outside of the AeroThemePlasma session, preferrably in a regular Plasma session. The script will ask for confirmation to uninstall components of the system. **Please check that none of the locations are ill-formed before accepting each prompt, especially those that require additional privileges to uninstall. In case this happens to you, report it as an issue ASAP.** - -Afterwards, `libplasma` and `polkit-kde-agent` should be reinstalled using your distro's package manager. For example, on Arch Linux: - -```bash -sudo pacman -Sy libplasma polkit-kde-agent -``` - -### Manual uninstallation - -The script performs the following steps in order to uninstall ATP. Uninstalling ATP should be done outside of the ATP session itself. Log into the Plasma session before performing any of these steps. - -### CMake - -- Perform `sudo make uninstall` or `sudo ninja uninstall` in the following directories if applicable: - -``` -kwin/decoration/build -plasma/sddm/login-sessions/build -plasma/aerothemeplasma-kcmloader/build -plasma/plasmoids/src/systemtray_src/build -plasma/plasmoids/src/notifications_src/build -plasma/plasmoids/src/volume_src/build -plasma/plasmoids/src/sevenstart_src/build -plasma/plasmoids/src/seventasks_src/build -plasma/plasmoids/src/desktopcontainment/build -kwin/effects_cpp/kde-effects-aeroglassblur/build -kwin/effects_cpp/kwin-effect-smodsnap-v2/build -kwin/effects_cpp/smodglow/build -kwin/effects_cpp/aeroglide/build -kwin/effects_cpp/startupfeedback/build - -# For Wayland builds -kwin/effects_cpp/kde-effects-aeroglassblur/build-wl -kwin/effects_cpp/kwin-effect-smodsnap-v2/build-wl -kwin/effects_cpp/smodglow/build-wl -kwin/effects_cpp/aeroglide/build-wl -kwin/effects_cpp/startupfeedback/build-wl -``` - -### Plasmoids - -- Perform `kpackagetool6 -t "Plasma/Applet" -r "plasmoid_id"` for each plasmoid, replacing `plasmoid_id` with the following: - -``` -io.gitgud.wackyideas.battery -io.gitgud.wackyideas.desktopcontainment -io.gitgud.wackyideas.digitalclocklite -io.gitgud.wackyideas.keyboardlayout -io.gitgud.wackyideas.networkmanagement -io.gitgud.wackyideas.panel -io.gitgud.wackyideas.SevenStart -io.gitgud.wackyideas.seventasks -io.gitgud.wackyideas.volume -io.gitgud.wackyideas.win7showdesktop -``` - -### Plasma components - -- Perform the following commands: - -```bash -kpackagetool6 -t "Plasma/LookAndFeel" -r "authui7" -kpackagetool6 -t "Plasma/LayoutTemplate" -r "io.gitgud.wackyideas.taskbar" -kpackagetool6 -t "Plasma/Theme" -r "Seven-Black" -kpackagetool6 -t "Plasma/Shell" -r "io.gitgud.wackyideas.desktop" -``` - -- Delete `~/.local/share/color-schemes/Aero.colors` -- Delete `~/.config/Kvantum/Windows7Aero` -- Delete the sound themes from `~/.local/share/sounds`: - -``` -'Windows 7' -'Windows 7 Afternoon' -'Windows 7 Calligraphy' -'Windows 7 Characters' -'Windows 7 Cityscape' -'Windows 7 Delta' -'Windows 7 Festival' -'Windows 7 Garden' -'Windows 7 Heritage' -'Windows 7 Landscape' -'Windows 7 Quirky' -'Windows 7 Raga' -'Windows 7 Savanna' -'Windows 7 Sonata' -``` - -- Delete the icon theme at `~/.local/share/icons/Windows 7 Aero` -- Delete the following files at `~/.local/share/mime/packages`: - -``` -application-vnd.microsoft.portable-executable.xml -application-x-ms-dll.xml -application-x-msdownload.xml -application-x-ms-ne-executable.xml -``` - -and run `update-mime-database ~/.local/share/mime` to refresh MIME associations - -### KWin components - -- Perform `kpackagetool6 -t "KWin/Effect" -r "effect_id"` for each effect, replacing `effect_id` with the following: - -``` -dimscreenaero -fadingpopupsaero -loginaero -seventasks-thumbnails -smodpeekeffect -squashaero -``` - -- Perform the following: - -```bash -kpackagetool6 -t "KWin/Script" -r "smodpeekscript" -kpackagetool6 -t "KWin/WindowSwitcher" -r "flip3d" -kpackagetool6 -t "KWin/WindowSwitcher" -r "thumbnail_seven" -``` - -- Delete the outline at `~/.local/share/kwin/outline` -- Delete the symlinks `~/.local/share/kwin-x11` and `~/.local/share/kwin-wayland` -- Delete the branding at `~/.config/kdedefaults/kcm-about-distrorc` and the logo (`~/.config/kdedefaults/kcminfo.png`) - -### Other components - -- Delete the cursor theme at `/usr/share/icons/aero-drop` -- Delete the SDDM theme at `/usr/share/sddm/themes/sddm-theme-mod` -- Delete the SMOD files at `/usr/share/smod` and `~/.local/share/smod` -- Delete `/opt/aerothemeplasma` +14. In the terminal emulator of your choice (e.g Konsole), set the font to [TerminalVector](https://www.yohng.com/software/terminalvector.html), size 9pt. Disable smooth font rendering and bold text, reduce the line spacing and margins to 0px, set the cursor shape to underline, and enable cursor blinking. diff --git a/README.md b/README.md index 7e619716..9c91dac5 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,22 @@ -# AeroThemePlasma +# AEROTHEMEPLASMA FOR KDE 6 + +## WARNING: This version is very early WIP and is not fully finished. Proceed with caution. ## Microsoft® Windows™ is a registered trademark of Microsoft® Corporation. This name is used for referential use only, and does not aim to usurp copyrights from Microsoft. Microsoft Ⓒ 2025 All rights reserved. All resources belong to Microsoft Corporation. ## Introduction This is a project which aims to recreate the look and feel of Windows 7 as much as possible on KDE Plasma, whilst adapting the design to fit in with modern features provided by KDE Plasma and Linux. +It is still in heavy development and testing. ATP has been tested on: -ATP is in constant development and testing, it has been tested on: - -- Arch Linux x64 and other Arch derivatives -- Plasma 6.6.0, KDE Frameworks 6.23.0, Qt 6.10.2 -- 96 DPI scaling, multi monitor -- X11, Wayland* +1. Arch Linux x64 and other Arch derivatives +2. Plasma 6.3.4, KDE Frameworks 6.12.0, Qt 6.9.0 +3. 96 DPI scaling, multi monitor +4. X11, Wayland* *AeroThemePlasma currently lacks full Wayland support, which may result in Wayland-specific issues. -## This software comes "as is" without warranty of any kind. It's always recommended to make backups of your system just in case. I am not responsible for broken systems, please proceed with caution. +## This release is meant for early adopters, debuggers and developers alike. This port lacks certain components which still need to be ported over to KDE Plasma 6. I am not responsible for broken systems, please proceed with caution. The Plasma 5 version of ATP is available as a tag in this repository, however it is unmaintained and no longer supported. @@ -23,8 +24,6 @@ If you find my work valuable consider donating: Buy Me a Coffee at ko-fi.com -[GitHub mirror](https://github.com/WackyIdeas/aerothemeplasma) - ## Installation See [INSTALL.md](./INSTALL.md) for a detailed installation guide. @@ -59,7 +58,6 @@ Huge thanks to everyone who helped out along the way by contributing, testing, p - [AngelBruni](https://github.com/angelbruni) for contributing several SVG textures, most notably the clock in DigitalClockLite Seven - [ricewind012](https://github.com/ricewind012/) for .bashrc Microsoft Windows header - [furkrn](https://gitgud.io/furkrn) for creating and maintaining the [Plymouth theme](https://github.com/furkrn/PlymouthVista) -- [IcyGuidance](https://gitgud.io/IcyGuidance) for designing the notification badges in SevenTasks ### Special Thanks @@ -77,7 +75,6 @@ Huge thanks to everyone who helped out along the way by contributing, testing, p - [WinXplorer](https://gitgud.io/catpswin56/winxplorer) by catpswin56 - [SMOD Themes](https://gitgud.io/catpswin56/smod-themes) by catpswin56, a collection of themes that can be used with the SMOD window decoration theme - [Ice2K.sys](https://toiletflusher.neocities.org/ice2k/) by 0penrc -- [Sevulet](https://gitgud.io/snailatte/sevulet) by [snailatte](https://gitgud.io/snailatte) ## Vista variant diff --git a/compile.sh b/compile.sh new file mode 100755 index 00000000..f85972c9 --- /dev/null +++ b/compile.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +CUR_DIR=$(pwd) +USE_SCRIPT="install_ninja.sh" + +if [[ -z "$(command -v cmake)" ]]; then + echo "CMake not found. Stopping." + exit +fi +if [[ -z "$(command -v ninja)" ]]; then + USE_SCRIPT="install.sh" + if [[ -z "$(command -v make)" ]]; then + echo "Neither Ninja or GNU Make were found. Stopping" + exit + fi +fi + +cd "$PWD/misc/defaulttooltip" +sh $USE_SCRIPT +cd "$CUR_DIR" +#echo "Compiling plasmoids..." + +#for filename in "$PWD/plasma/plasmoids/src/"*; do +# cd "$filename" +# echo "Compiling $(pwd)" +# sh $USE_SCRIPT +# echo "Done." +# cd "$CUR_DIR" +#done + +echo "Compiling SMOD decorations..." +cd "$PWD/kwin/decoration" +sh $USE_SCRIPT +cd "$CUR_DIR" +echo "Done." + +echo "Compiling KWin effects..." +for filename in "$PWD/kwin/effects_cpp/"*; do + cd "$filename" + echo "Compiling $(pwd)" + sh $USE_SCRIPT + echo "Done." + cd "$CUR_DIR" +done diff --git a/deprecated/compile.sh b/deprecated/compile.sh deleted file mode 100755 index 3c94f555..00000000 --- a/deprecated/compile.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash - -# You can pass the following arguments to this script: -# --ninja Uses Ninja for faster compilation -# --wayland Tells the KWin build scripts to compile the C++ effects for Wayland - -CUR_DIR=$(pwd) -USE_SCRIPT="install.sh" - -# Sanity check to see if the proper tools are installed. -if [[ -z "$(command -v cmake)" ]]; then - echo "CMake not found. Stopping." - exit -fi -if [[ -z "$(command -v ninja)" ]]; then - if [[ -z "$(command -v make)" ]]; then - echo "Neither Ninja or GNU Make were found. Stopping" - exit - fi -fi - -# Compiles the libplasma patches required for other components of ATP. -# Requires a restart to be applied. -cd "$PWD/misc/libplasma" -sh $USE_SCRIPT $@ -cd "$CUR_DIR" -#echo "Compiling plasmoids..." - -#for filename in "$PWD/plasma/plasmoids/src/"*; do -# cd "$filename" -# echo "Compiling $(pwd)" -# sh $USE_SCRIPT -# echo "Done." -# cd "$CUR_DIR" -#done - -# Compiles the window decoration theme engine. -echo "Compiling SMOD decorations..." -cd "$PWD/kwin/decoration" -sh $USE_SCRIPT $@ -cd "$CUR_DIR" -echo "Done." - -# Compiles the settings KCM loader used for development and quick access of certain settings pages. -echo "Compiling KCM loader..." -cd "$PWD/plasma/aerothemeplasma-kcmloader" -sh $USE_SCRIPT $@ -cd "$CUR_DIR" -echo "Done." - -# Compiles all the KWin C++ effects, going folder by folder. -echo "Compiling KWin effects..." -for filename in "$PWD/kwin/effects_cpp/"*; do - cd "$filename" - echo "Compiling $(pwd)" - sh $USE_SCRIPT $@ - echo "Done." - cd "$CUR_DIR" -done diff --git a/docs/kwin/effectscpp.md b/docs/kwin/effectscpp.md deleted file mode 100644 index 50865050..00000000 --- a/docs/kwin/effectscpp.md +++ /dev/null @@ -1,7 +0,0 @@ -# KWin C++ Effects list - -- Aero Glide (aeroglide) -- Passive cursor launch feedback (startupfeedback) -- SMOD Glow (smodglow) -- SMOD Snap (kwin-effect-smodsnap-v2) -- AeroGlassBlur (kde-effects-aeroglassblur) diff --git a/docs/kwin/effectsjs.md b/docs/kwin/effectsjs.md deleted file mode 100644 index 88c2d38b..00000000 --- a/docs/kwin/effectsjs.md +++ /dev/null @@ -1,8 +0,0 @@ -# KWin JS Effects List - -- SevenTasks thumbnail animations (seventasks-thumbnails) -- Dim Screen (dimscreen) -- Login (login) -- SMOD Peek Effect (smodpeekeffect) -- Squash minimize animation (squash) -- Fading popups (fadingpopups) diff --git a/docs/kwin/outline.md b/docs/kwin/outline.md deleted file mode 100644 index 28552519..00000000 --- a/docs/kwin/outline.md +++ /dev/null @@ -1,9 +0,0 @@ -# Outline - -## Details about the outline window - -The reflection texture is loaded from the standard SMOD directory, and it is rendered using [ShaderEffectSource](https://doc.qt.io/qt-6/qml-qtquick-shadereffectsource.html). This workaround is done because the outline that appears is not actually representative of the actual outline window belonging to the compositor. Instead, the visible outline is rendered using QML, hence the need for workarounds like this. The issues with this are: - -1. The reflection texture in general isn't consistent with the AeroGlassBlur -2. Performance is suboptimal and results in choppy animations and freezes in some cases -3. The underlying C++ code does not provide a way to expose the visible outline's window geometry, or ways to set a custom blur region to the underlying window, making it impossible to approach this in any other way for now. diff --git a/docs/kwin/smod.md b/docs/kwin/smod.md deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/kwin/smodpeekscript.md b/docs/kwin/smodpeekscript.md deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/kwin/tabbox.md b/docs/kwin/tabbox.md deleted file mode 100644 index 324f1bee..00000000 --- a/docs/kwin/tabbox.md +++ /dev/null @@ -1,8 +0,0 @@ -# Tabbox switchers (Alt+Tab switchers) - -1. Thumbnail Seven -2. Flipswitch (3D) - -## Notes about Thumbnail Seven - -- Thumbnail Seven replaces the default behavior of the "Show Desktop" entry with the built-in "MinimizeAll" KWin script by querying the item that's supposed to be activated and checking if it is the "Show Desktop" entry. This is done with a [DBus call](https://gitgud.io/wackyideas/aerothemeplasma/-/blob/master/kwin/tabbox/thumbnail_seven/contents/ui/main.qml?ref_type=heads#L28) from within the QML code itself. diff --git a/docs/misc/libplasma.md b/docs/misc/libplasma.md deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/plasma/kcmloader.md b/docs/plasma/kcmloader.md deleted file mode 100644 index d9903dcf..00000000 --- a/docs/plasma/kcmloader.md +++ /dev/null @@ -1,29 +0,0 @@ -# KCM Loader - -KCM Loader is a small application that can load arbitrary KCMs and open them as separate dialog windows using [KCMultiDialog](https://api.kde.org/frameworks/kcmutils/html/classKCMultiDialog.html). - -### Usage: - -KCM Loader takes two arguments: - -1. Relative path to a KCM's `.so` file. The path is relative to `/usr/lib/qt6/plugins/` -2. Icon name from the icon theme - -Example: - -```bash -aerothemeplasma-kcmloader org.kde.kdecoration3.kcm/kcm_smoddecoration.so application-x-theme -``` - -It's important to note that it isn't necessary to explicitly specify `kwin-x11` in the path when trying to load a KWin effect's KCM. KCM Loader will automatically load the X11 variant of the KCM if the application is executed in an X11 session. - -### Custom behaviors - -Upon loading a KCM with KCM Loader, it will pass a [KPluginMetaData](https://api.kde.org/frameworks/kcoreaddons/html/classKPluginMetaData.html) instance with a custom JSON object. Currently, the JSON object only has a boolean property `standalone` set to `true`, but in theory the JSON object could have any arbitrary data attached to it. Normally (or at least, based on experience), KCMs tend to ignore the `KPluginMetaData` object that's passed to them, but with this mechanism we can write KCMs that can respond differently based on the provided JSON information. - -The primary example of this mechanism in use is quick access to AeroGlassBlur's accent color page. Normally, it is accessed by opening the System settings, navigating to the KCM, and clicking on the link that opens the page. With KCM Loader, however, the KCM will read and recognize the `standalone` property from the JSON object, and automatically open the accent color page. - -### Future plans - -- Turn this into a generic C++ library that can be accessed from QML or other parts of C++ code -- Expand the custom behavior mechanism to allow for arbitrary data that KCMs can interpret diff --git a/docs/plasma/lookandfeel.md b/docs/plasma/lookandfeel.md deleted file mode 100644 index 3a4d394e..00000000 --- a/docs/plasma/lookandfeel.md +++ /dev/null @@ -1,14 +0,0 @@ -# Global Theme (Look and Feel) - -Components that are relevant to ATP: - -- Splash screen -- Logout screen - -## Splash screen details - -- The background image is loaded from ATP's SDDM theme (`/usr/share/sddm/themes/sddm-theme-mod/bgtexture.jpg`) - -## Logout screen details - -The logout screen has been repurposed into the Ctrl+Alt+Del screen, as the logout screen gets spawned when using the shortcut, and a logout screen wasn't a thing after Windows XP. diff --git a/docs/plasma/plasmoids.md b/docs/plasma/plasmoids.md deleted file mode 100644 index f742ad79..00000000 --- a/docs/plasma/plasmoids.md +++ /dev/null @@ -1,21 +0,0 @@ -# Plasmoids - -List of plasmoids: - -- Standalone, with C++ components: - - Desktop containment (io.gitgud.wackyideas.desktopcontainment) - - SevenStart (io.gitgud.wackyideas.SevenStart) - - SevenTasks (io.gitgud.wackyideas.seventasks) - - Volume Mixer (io.gitgud.wackyideas.volume) - -- Standalone, without C++ components: - - Network Manager (io.gitgud.wackyideas.networkmanagement) - - Show Desktop (Aero) (io.gitgud.wackyideas.win7showdesktop) - - Digital Clock Lite (Aero) (io.gitgud.wackyideas.digitalclocklite) - - Battery and Power (io.gitgud.wackyideas.battery) - - Keyboard Layout Switcher (io.gitgud.wackyideas.keyboardlayout) - -- Direct modifications of KDE Plasmoids: - - System Tray (org.kde.plasma.systemtray) - - Notifications (org.kde.plasma.notifications) - - Panel (org.kde.panel) diff --git a/docs/plasma/sddm.md b/docs/plasma/sddm.md deleted file mode 100644 index 49d38d8b..00000000 --- a/docs/plasma/sddm.md +++ /dev/null @@ -1,13 +0,0 @@ -# SDDM Theme details - -The SDDM theme features the following configuration options: - -- background - Background wallpaper -- branding - Branding logo -- forceUserSelect - Whether to always show the user selection page or not -- enableStartup - Play the Vista-style animation on the first time during boot -- playSound - Play the startup sound during boot - -The startup animation plays at the beginning as SDDM is loaded for the first time during boot, and won't start again until the computer reboots. The way this is achieved is by checking for the existence of the file `/tmp/sddm.startup`, and the animation is played if the file doesn't exist. As the animation gets played, the file is also subsequently created, preventing the animation from playing again in cases where the user logs out of their session back into SDDM. - -The sound effect that plays during startup gets the same treatment as described above. Note that the sound effect gets played on whatever (default) audio output Qt has access to during startup, which may lead to undesirable results. diff --git a/docs/plasma/shell.md b/docs/plasma/shell.md deleted file mode 100644 index e69de29b..00000000 diff --git a/install.sh b/install.sh deleted file mode 100644 index 9d9758a3..00000000 --- a/install.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/bash -CUR_DIR=${PWD} - -SU_CMD=sudo -USE_NINJA= -NINJA_PARAM= -if [[ "$*" == *"--ninja"* ]] -then - if [[ -z "$(command -v ninja)" ]]; then - echo "Attempted to build using Ninja, but Ninja was not found on the system. Falling back to GNU Make." - else - echo "Compiling using Ninja" - USE_NINJA="-G Ninja" - NINJA_PARAM="--ninja" - fi -fi - -if [[ -z "$(command -v $SU_CMD)" ]]; then - SU_CMD=doas - if [[ -z "$(command -v $SU_CMD)" ]]; then - echo "Neither sudo or doas were detected on the system." - exit - fi -fi - -if [ -z $LIBEXEC_DIR ]; then - LIBEXEC_DIR=lib -fi - -mkdir -p repos -mkdir -p manifest -cd repos - -# uac-polkit-agent -git clone https://gitgud.io/aeroshell/uac-polkit-agent.git uac-polkit-agent -cd uac-polkit-agent -git pull -cmake $USE_NINJA -DCMAKE_INSTALL_PREFIX=/usr -B build . || exit 1 -cmake --build build || exit 1 -$SU_CMD cmake --install build || exit 1 -cp build/install_manifest.txt "$CUR_DIR/manifest/uac-polkit-agent_install_manifest.txt" -cd "$CUR_DIR/repos" - -# SMOD -git clone https://gitgud.io/aeroshell/smod.git smod -cd smod -git pull -bash install.sh $NINJA_PARAM -cp build/install_manifest.txt "$CUR_DIR/manifest/smod_install_manifest.txt" -cp smodglow/build/install_manifest.txt "$CUR_DIR/manifest/smodglow_install_manifest.txt" -cp smodglow/build-wl/install_manifest.txt "$CUR_DIR/manifest/smodglow-x11_install_manifest.txt" -cd "$CUR_DIR/repos" - -# Aeroshell Workspace -git clone https://gitgud.io/aeroshell/aeroshell-workspace.git aeroshell-workspace -cd aeroshell-workspace -git pull -cmake $USE_NINJA -DCMAKE_INSTALL_PREFIX=/usr -B build . || exit 1 -cmake --build build || exit 1 -$SU_CMD cmake --install build || exit 1 -$SU_CMD update-mime-database "/usr/local/share/mime" -cp build/install_manifest.txt "$CUR_DIR/manifest/aeroshell-workspace_install_manifest.txt" -cd "$CUR_DIR/repos" - -# Aeroshell KWin -git clone https://gitgud.io/aeroshell/aeroshell-kwin-components.git aeroshell-kwin-components -cd aeroshell-kwin-components -git pull -cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DKWIN_BUILD_WAYLAND=ON -B build . || exit 1 -cmake --build build || exit 1 -$SU_CMD cmake --install build || exit 1 -cp build/install_manifest.txt "$CUR_DIR/manifest/aeroshell-kwin-components_install_manifest.txt" -cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DKWIN_BUILD_WAYLAND=OFF -DKWIN_INSTALL_MISC=OFF -B build_x11 . || exit 1 -cmake --build build_x11 || exit 1 -$SU_CMD cmake --install build_x11 || exit 1 -cp build_x11/install_manifest.txt "$CUR_DIR/manifest/aeroshell-kwin-components-x11_install_manifest.txt" -cd "$CUR_DIR/repos" - -# Aerothemeplasma icons -git clone https://gitgud.io/aeroshell/atp/aerothemeplasma-icons aerothemeplasma-icons -cd aerothemeplasma-icons -git pull -cmake $USE_NINJA -DCMAKE_INSTALL_PREFIX=/usr -B build . || exit 1 -cmake --build build || exit 1 -$SU_CMD cmake --install build || exit 1 -cp build/install_manifest.txt "$CUR_DIR/manifest/icons_install_manifest.txt" -cd "$CUR_DIR/repos" - -# Aerothemeplasma sounds -git clone https://gitgud.io/aeroshell/atp/aerothemeplasma-icons aerothemeplasma-sounds -cd aerothemeplasma-sounds -git pull -cmake $USE_NINJA -DCMAKE_INSTALL_PREFIX=/usr -B build . || exit 1 -cmake --build build || exit 1 -$SU_CMD cmake --install build || exit 1 -cp build/install_manifest.txt "$CUR_DIR/manifest/sounds_install_manifest.txt" -cd "$CUR_DIR/repos" - -# Aerothemeplasma -cd "$CUR_DIR" -cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBEXECDIR=$LIBEXEC_DIR -B build . || exit 1 -cmake --build build || exit 1 -$SU_CMD cmake --install build || exit 1 -cp build/install_manifest.txt "$CUR_DIR/manifest/aerothemeplasma_install_manifest.txt" -cd "$CUR_DIR/repos" - -# libplasma last -git clone https://gitgud.io/aeroshell/libplasma.git libplasma -cd libplasma -git pull -cmake $USE_NINJA -DCMAKE_INSTALL_PREFIX=/usr -B build . || exit 1 -cmake --build build || exit 1 -$SU_CMD cmake --install build || exit 1 -cp build/install_manifest.txt "$CUR_DIR/manifest/libplasma_install_manifest.txt" -cd "$CUR_DIR/repos" - -echo "Done." diff --git a/deprecated/install_kwin_components.sh b/install_kwin_components.sh old mode 100755 new mode 100644 similarity index 69% rename from deprecated/install_kwin_components.sh rename to install_kwin_components.sh index 7d083358..1a7f1b26 --- a/deprecated/install_kwin_components.sh +++ b/install_kwin_components.sh @@ -2,13 +2,11 @@ CUR_DIR=$(pwd) -# Sanity check to see if the proper tools are installed. if [[ -z "$(command -v kpackagetool6)" ]]; then echo "kpackagetool6 not found. Stopping." exit fi -# Function that installs/upgrades KDE packages. # install_component $filename "Plasma/Shell" function install_component { COMPONENT=$(basename "$1") @@ -24,10 +22,6 @@ function install_component { cd "$CUR_DIR" } -# Installs the SMOD folder which contains resources used by other ATP components. -echo -e "Installing SMOD resources..." -pkexec cp -r "$PWD/kwin/smod" "/usr/share/" - echo "Installing KWin effects (JS)..." for filename in "$PWD/kwin/effects/"*; do install_component "$filename" "KWin/Effect" @@ -52,13 +46,6 @@ KWIN_DIR="$HOME/.local/share/kwin" cp -r "$PWD/kwin/outline" "$KWIN_DIR" echo "Done." -# Use symlinks so the KWin components are visible under both Wayland and X11. -LOCAL_DIR="$HOME/.local/share" -cd "$LOCAL_DIR" -echo "Making kwin-x11 and kwin-wayland symlinks..." -ln -s kwin kwin-x11 -ln -s kwin kwin-wayland -echo "Done." diff --git a/deprecated/install_misc_components.sh b/install_misc_components.sh similarity index 77% rename from deprecated/install_misc_components.sh rename to install_misc_components.sh index 915a5afe..a477d983 100755 --- a/deprecated/install_misc_components.sh +++ b/install_misc_components.sh @@ -2,49 +2,41 @@ CUR_DIR=$(pwd) -# Sanity check to see if the proper tools are installed if [[ -z "$(command -v tar)" ]]; then echo "tar not found. Stopping." exit fi -if [[ -z "$(command -v unzip)" ]]; then - echo "unzip not found. Stopping." - exit -fi TMP_DIR="/tmp/atp" mkdir -p "$TMP_DIR" -# Installs the Kvantum theme. +# Kvantum echo "Installing Kvantum theme..." KV_DIR="$HOME/.config" cp -r "$PWD/misc/kvantum/Kvantum" "$KV_DIR" echo "Done." -# Installs the sound themes. +#Sounds echo "Unpacking sound themes..." SOUNDS_DIR="$HOME/.local/share/sounds" -mkdir -p "$SOUNDS_DIR" tar -xf "$PWD/misc/sounds/sounds.tar.gz" --directory "$SOUNDS_DIR" echo "Done." -# Installs the icon theme. +#Icons echo "Unpacking icon theme..." ICONS_DIR="$HOME/.local/share/icons" -mkdir -p "$ICONS_DIR" tar -xf "$PWD/misc/icons/Windows 7 Aero.tar.gz" --directory "$ICONS_DIR" echo "Done." -# Installs the cursor theme. Requires admin privileges as this theme gets installed globally so SDDM can use it. +#Cursors echo "Unpacking cursor theme..." CURSOR_DIR="/usr/share/icons" pkexec tar -xf "$PWD/misc/cursors/aero-drop.tar.gz" --directory "$CURSOR_DIR" echo "Done." -# Installs the modified mimetype associations. +#Mimetype echo "Installing mimetypes..." MIMETYPE_DIR="$HOME/.local/share/mime/packages" -mkdir -p "$MIMETYPE_DIR" for filename in "$PWD/misc/mimetype/"*; do cp -r "$filename" "$MIMETYPE_DIR" done @@ -52,14 +44,12 @@ update-mime-database "$HOME/.local/share/mime" echo "Done." -# Optional components -echo "Do you want to install a custom font configuration for Segoe UI fonts? (Recommended) (y/N)" +#Optional +echo "Do you want to install a custom font configuration for Segoe UI fonts? (y/N)" read answer FONTCONF_DIR="$HOME/.config" if [ "$answer" != "${answer#[Yy]}" ] ;then - - # Installs custom fontconfig to tweak Segoe UI. if test -f "$FONTCONF_DIR/fontconfig/fonts.conf"; then echo "Backing up fonts.conf to fonts.conf.old" cp -r "$FONTCONF_DIR/fontconfig/fonts.conf" "$FONTCONF_DIR/fontconfig/fonts.conf.old" @@ -67,22 +57,18 @@ if [ "$answer" != "${answer#[Yy]}" ] ;then echo "Installing custom font configuration..." cp -r "$PWD/misc/fontconfig/" "$FONTCONF_DIR" - # Defines QML_DISABLE_DISTANCEFIELD environment variable which generally enhances the font rendering. HAS_VAR=$(grep "QML_DISABLE_DISTANCEFIELD" /etc/environment) echo "Adding QML_DISABLE_DISTANCEFIELD=1 to /etc/environment" if [[ -n "$HAS_VAR" ]]; then echo "Variable already added, skipping..." else - pkexec sh -c "echo \"QML_DISABLE_DISTANCEFIELD=1\" >> /etc/environment" + pkexec echo "QML_DISABLE_DISTANCEFIELD=1" >> /etc/environment fi fi echo "Done." - -# Installs custom branding for the system settings info page. echo "Do you want to install custom branding for Info Center? (y/N)" read answer BRANDING_DIR="$HOME/.config/kdedefaults" -mkdir -p "$BRANDING_DIR" if [ "$answer" != "${answer#[Yy]}" ] ;then for filename in "$PWD/misc/branding/"*; do @@ -92,7 +78,6 @@ if [ "$answer" != "${answer#[Yy]}" ] ;then fi echo "Done." -# Installs the terminal font. echo "Do you want to install the command prompt font (Terminal Vector)? (y/N)" read answer if [ "$answer" != "${answer#[Yy]}" ] ;then @@ -102,7 +87,6 @@ if [ "$answer" != "${answer#[Yy]}" ] ;then fi echo "Done." -# Installs the Plymouth theme. echo "Do you want to install the Plymouth theme? (y/N)" read answer if [ "$answer" != "${answer#[Yy]}" ] ;then @@ -116,7 +100,7 @@ if [ "$answer" != "${answer#[Yy]}" ] ;then chmod +x ./compile.sh chmod +x ./install.sh ./compile.sh - pkexec --keep-cwd ./install.sh + pkexec ./install.sh echo "For more details, check out the project at https://github.com/furkrn/PlymouthVista" fi fi diff --git a/deprecated/install_plasma_components.sh b/install_plasma_components.sh old mode 100755 new mode 100644 similarity index 69% rename from deprecated/install_plasma_components.sh rename to install_plasma_components.sh index 380dc795..d8b714b3 --- a/deprecated/install_plasma_components.sh +++ b/install_plasma_components.sh @@ -2,15 +2,10 @@ CUR_DIR=$(pwd) -# Sanity check to see if the proper tools are installed. if [[ -z "$(command -v kpackagetool6)" ]]; then echo "kpackagetool6 not found. Stopping." exit fi -if [[ -z "$(command -v cmake)" ]]; then - echo "CMake not found. Stopping." - exit -fi if [[ -z "$(command -v tar)" ]]; then echo "tar not found. Stopping." exit @@ -20,7 +15,6 @@ if [[ -z "$(command -v sddmthemeinstaller)" ]]; then exit fi -# Function that installs/upgrades KDE packages. # install_component $filename "Plasma/Shell" function install_component { COMPONENT=$(basename "$1") @@ -36,29 +30,30 @@ function install_component { cd "$CUR_DIR" } +#killall plasmashell -# Installs the Global Theme (Look and feel). +# LNF install_component "$PWD/plasma/look-and-feel/authui7" "Plasma/LookAndFeel" # Layout template install_component "$PWD/plasma/layout-templates/io.gitgud.wackyideas.taskbar" "Plasma/LayoutTemplate" # Plasma Style install_component "$PWD/plasma/desktoptheme/Seven-Black" "Plasma/Theme" # Shell -install_component "$PWD/plasma/shells/io.gitgud.wackyideas.desktop" "Plasma/Shell" +install_component "$PWD/plasma/shells/org.kde.plasma.desktop" "Plasma/Shell" -# Installs the color scheme. +# Color scheme echo -e "Installing color scheme..." COLOR_DIR="$HOME/.local/share/color-schemes" mkdir -p "$COLOR_DIR" -cp "$PWD/plasma/color_scheme/Aero.colors" "$COLOR_DIR" -#plasma-apply-colorscheme Aero +cp "$PWD/plasma/color_scheme/AeroColorScheme1.colors" "$COLOR_DIR" +#plasma-apply-colorscheme AeroColorScheme1 -# Installs the SDDM theme, as well as the SDDM entries required for ATP. -echo -e "Installing login manager entries..." -cd "plasma/sddm/login-sessions" -sh install.sh +# SMOD +echo -e "Installing SMOD resources..." +pkexec cp -r "$PWD/plasma/smod" "/usr/share/" +# SDDM echo -e "Installing SDDM theme..." -cd "$CUR_DIR/plasma/sddm" +cd "plasma/sddm" tar -zcvf "sddm-theme-mod.tar.gz" "sddm-theme-mod" sddmthemeinstaller -i "sddm-theme-mod.tar.gz" rm "sddm-theme-mod.tar.gz" diff --git a/deprecated/install_plasmoids.sh b/install_plasmoids.sh similarity index 77% rename from deprecated/install_plasmoids.sh rename to install_plasmoids.sh index 43316c5f..755f6794 100755 --- a/deprecated/install_plasmoids.sh +++ b/install_plasmoids.sh @@ -1,13 +1,8 @@ #!/bin/bash -# You can pass the following arguments to this script: -# --ninja Uses Ninja for faster compilation -# --no-compile Skips compilation entirely - CUR_DIR=$(pwd) -USE_SCRIPT="install.sh" +USE_SCRIPT="install_ninja.sh" -# Sanity check to see if the proper tools are installed. if [[ -z "$(command -v kpackagetool6)" ]]; then echo "kpackagetool6 not found. Stopping." exit @@ -18,15 +13,13 @@ if [[ -z "$(command -v cmake)" ]]; then exit fi if [[ -z "$(command -v ninja)" ]]; then + USE_SCRIPT="install.sh" if [[ -z "$(command -v make)" ]]; then echo "Neither Ninja or GNU Make were found. Stopping" exit fi fi -# Skips the build process of plasmoids that have C++ components -# Most of the time, recompiling isn't needed as most changes are done -# on the QML side. if [[ $1 == '--no-compile' ]]; then echo "Skipping compilation..." else @@ -35,13 +28,12 @@ else for filename in "$PWD/plasma/plasmoids/src/"*; do cd "$filename" echo "Compiling $(pwd)" - sh $USE_SCRIPT $@ + sh $USE_SCRIPT echo "Done." cd "$CUR_DIR" done fi -# Installs or upgrades plasmoids using kpackagetool6 function install_plasmoid { PLASMOID=$(basename "$1") if [[ $PLASMOID == 'src' ]]; then diff --git a/kwin/decoration/.git-blame-ignore-revs b/kwin/decoration/.git-blame-ignore-revs new file mode 100644 index 00000000..a0b83bef --- /dev/null +++ b/kwin/decoration/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# clang-format +32149dc002ae574ed41f111bf52712b1765b906b diff --git a/kwin/decoration/.gitignore b/kwin/decoration/.gitignore new file mode 100644 index 00000000..96d3dbbf --- /dev/null +++ b/kwin/decoration/.gitignore @@ -0,0 +1,7 @@ +build +.clang-format +/compile_commands.json +.clangd +.idea +/cmake-build* +.cache diff --git a/kwin/decoration/.gitlab-ci.yml b/kwin/decoration/.gitlab-ci.yml new file mode 100644 index 00000000..457f5471 --- /dev/null +++ b/kwin/decoration/.gitlab-ci.yml @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: None +# SPDX-License-Identifier: CC0-1.0 + +include: + - project: sysadmin/ci-utilities + file: + - /gitlab-templates/linux.yml + - /gitlab-templates/freebsd.yml + - /gitlab-templates/linux-qt6.yml + - /gitlab-templates/windows.yml + - /gitlab-templates/freebsd-qt6.yml + - /gitlab-templates/windows-qt6.yml diff --git a/kwin/decoration/.kde-ci.yml b/kwin/decoration/.kde-ci.yml new file mode 100644 index 00000000..5e979da7 --- /dev/null +++ b/kwin/decoration/.kde-ci.yml @@ -0,0 +1,41 @@ +# SPDX-FileCopyrightText: None +# SPDX-License-Identifier: CC0-1.0 + +Dependencies: +- 'on': ['Linux/Qt5', 'FreeBSD/Qt5', 'Windows/Qt5'] + 'require': + 'frameworks/extra-cmake-modules': '@latest' + 'frameworks/kconfig': '@latest' + 'frameworks/kconfigwidgets': '@latest' + 'frameworks/kcoreaddons': '@latest' + 'frameworks/kguiaddons': '@latest' + 'frameworks/ki18n': '@latest' + 'frameworks/kiconthemes': '@latest' + 'frameworks/kirigami': '@latest' + 'frameworks/kwindowsystem': '@latest' + +- 'on': ['Linux/Qt5', 'FreeBSD/Qt5'] + 'require': + 'frameworks/frameworkintegration': '@latest' + 'frameworks/kcmutils': '@latest' + +- 'on': ['Linux/Qt6', 'FreeBSD/Qt6', 'Windows/Qt6'] + 'require': + 'frameworks/extra-cmake-modules': '@latest-kf6' + 'frameworks/kconfig': '@latest-kf6' + 'frameworks/kcoreaddons': '@latest-kf6' + 'frameworks/kguiaddons': '@latest-kf6' + 'frameworks/ki18n': '@latest-kf6' + 'frameworks/kiconthemes': '@latest-kf6' + 'frameworks/kirigami': '@latest-kf6' + 'frameworks/kwindowsystem': '@latest-kf6' + 'frameworks/kcolorscheme': '@latest-kf6' + +- 'on': ['Linux/Qt6', 'FreeBSD/Qt6'] + 'require': + 'plasma/kdecoration': '@same' + 'frameworks/frameworkintegration': '@latest-kf6' + 'frameworks/kcmutils': '@latest-kf6' + +Options: + require-passing-tests-on: [ 'Linux', 'FreeBSD'] diff --git a/kwin/decoration/AUTHORS b/kwin/decoration/AUTHORS new file mode 100644 index 00000000..38e41513 --- /dev/null +++ b/kwin/decoration/AUTHORS @@ -0,0 +1,6 @@ +Cursors: + Ken Vermette + +Kstyle: + Hugo Pereira Da Costa - Developer + Andrew Lake - Designer diff --git a/kwin/decoration/BreezeConfig.cmake.in b/kwin/decoration/BreezeConfig.cmake.in new file mode 100644 index 00000000..84d54bdc --- /dev/null +++ b/kwin/decoration/BreezeConfig.cmake.in @@ -0,0 +1,11 @@ +@PACKAGE_INIT@ + +set(BREEZE_WITH_KDECORATION @WITH_DECORATIONS@) +if(${BREEZE_WITH_KDECORATION}) + set(BREEZE_KDECORATION_PLUGIN_ID "org.kde.breeze") +else() + set(BREEZE_KDECORATION_PLUGIN_ID "") +endif() + +set(BREEZE_STYLE_NAME "breeze") +set(BREEZE_COLOR_INSTALL_ROOT "@PACKAGE_KDE_INSTALL_FULL_DATADIR@/color-schemes/") diff --git a/kwin/decoration/CMakeLists.txt b/kwin/decoration/CMakeLists.txt new file mode 100644 index 00000000..b017d36f --- /dev/null +++ b/kwin/decoration/CMakeLists.txt @@ -0,0 +1,173 @@ +cmake_minimum_required(VERSION 3.16) +project(breeze) +set(PROJECT_VERSION "6.3.80") +set(PROJECT_VERSION_MAJOR 6) + +set(KF5_MIN_VERSION "5.102.0") +set(KF6_MIN_VERSION "6.10.0") +set(KDE_COMPILERSETTINGS_LEVEL "5.82") +set(QT5_MIN_VERSION "5.15.2") +set(QT_MIN_VERSION "6.7.0") + +include(GenerateExportHeader) +include(WriteBasicConfigVersionFile) +include(FeatureSummary) +include(GNUInstallDirs) + +find_package(ECM ${KF5_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) + +# We need this because we can't include KDECMakeSettings here, because that +# would need KDEInstallDirs, which we can only include in the qt{5,6} builds +# to get the correct installation dirs for each Qt version. +option(BUILD_TESTING "Build the testing tree." ON) +if(BUILD_TESTING) + enable_testing() +endif() + +include(CMakePackageConfigHelpers) +include(ECMInstallIcons) +include(ECMGenerateHeaders) +include(ECMGeneratePkgConfigFile) +include(KDECompilerSettings NO_POLICY_SCOPE) +include(KDEClangFormat) +include(KDEGitCommitHooks) +include(GtkUpdateIconCache) + +option(BUILD_QT5 "Build Qt5 style" OFF) +option(BUILD_QT6 "Build with Qt6" ON) + +set(QT_NO_CREATE_VERSIONLESS_TARGETS ON) +set(QT_NO_CREATE_VERSIONLESS_FUNCTIONS ON) + +# For KDE CI only. As the current infrastructure doesn't allow us to set CMAKE options per build variant +if($ENV{CI_JOB_NAME_SLUG} MATCHES "qt5") + set(BUILD_QT5 ON) + set(BUILD_QT6 OFF) +elseif($ENV{CI_JOB_NAME_SLUG} MATCHES "qt6") + set(BUILD_QT5 OFF) + set(BUILD_QT6 ON) +endif() + +if(WIN32 OR APPLE) + set(WITH_DECORATIONS OFF) +endif() + +function(build_Qt5) + set(QT_MAJOR_VERSION 5) + include(KDEInstallDirs5) + include(KDECMakeSettings) + + find_package(Qt5 ${QT5_MIN_VERSION} REQUIRED CONFIG COMPONENTS Widgets DBus) + find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS + CoreAddons + Config + ConfigWidgets + GuiAddons + IconThemes + WindowSystem) + + find_package(Qt5 ${QT5_MIN_VERSION} OPTIONAL_COMPONENTS Quick) + if(${Qt5Quick_FOUND}) + find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Kirigami2) + endif() + + find_package(KF5FrameworkIntegration ${KF5_MIN_VERSION} CONFIG ) + set_package_properties(KF${QT_MAJOR_VERSION}FrameworkIntegration PROPERTIES + DESCRIPTION "KF${QT_MAJOR_VERSION} Framework Integration" + URL "https://projects.kde.org/projects/frameworks/frameworkintegration" + TYPE OPTIONAL + PURPOSE "Required to use KStyle convenience functionalities in style") + + find_package(Qt5 ${QT5_MIN_VERSION} OPTIONAL_COMPONENTS X11Extras) + set_package_properties(KF${QT_MAJOR_VERSION}FrameworkIntegration PROPERTIES + DESCRIPTION "KF${QT_MAJOR_VERSION} Framework Integration" + URL "https://projects.kde.org/projects/frameworks/frameworkintegration" + TYPE OPTIONAL + PURPOSE "Required to use KStyle convenience functionalities in style") + + set(BREEZE_HAVE_KSTYLE ${KF5FrameworkIntegration_FOUND}) + set(BREEZE_HAVE_QTQUICK ${Qt5Quick_FOUND}) + + add_subdirectory(kstyle kstyle5) + add_subdirectory(libbreezecommon libbreezecommon5) + + unset(QUERY_EXECUTABLE CACHE) +endfunction() +if(BUILD_QT5) + build_Qt5() +endif() + +function(build_Qt6) + set(QT_MAJOR_VERSION 6) + include(KDEInstallDirs6) + include(KDECMakeSettings) + + option(WITH_DECORATIONS "Build Breeze window decorations for KWin" ON) + option(WITH_WALLPAPERS "Install Breeze default wallpapers" OFF) + + 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(BREEZE_HAVE_QTQUICK ${Qt6Quick_FOUND}) + + # https://bugreports.qt.io/browse/QTBUG-114706 + add_library(Qt::Core ALIAS Qt6::Core) + add_library(Qt::Gui ALIAS Qt6::Gui) + add_library(Qt::OpenGL ALIAS Qt6::OpenGL) + add_library(Qt::Network ALIAS Qt6::Network) + if(Qt6_VERSION_MINOR GREATER 6) + add_library(Qt::PlatformModuleInternal ALIAS Qt6::PlatformModuleInternal) + endif() + + add_subdirectory(libbreezecommon libbreezecommon6) + + if(WITH_DECORATIONS) + find_package(KDecoration3 REQUIRED) + add_subdirectory(kdecoration) + endif() + + ki18n_install(po) + + unset(QUERY_EXECUTABLE CACHE) +endfunction() +if(BUILD_QT6) + build_Qt6() +endif() + +# 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}) +kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT) + +feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/kwin/decoration/README.md b/kwin/decoration/README.md new file mode 100644 index 00000000..0f073d06 --- /dev/null +++ b/kwin/decoration/README.md @@ -0,0 +1,52 @@ +# Compiling instructions + +``` +mkdir build && cd build +cmake -DCMAKE_INSTALL_PREFIX=/usr .. +make +sudo make install + +``` + +# Breeze + +Breeze is the default style for [Plasma](https://kde.org/plasma-desktop/). This repository contains some parts of Breeze such as the cursors, wallpapers, and the application style. + +## Components + +This repository contains many parts of Breeze, such as: + +* Color schemes, located under [/colors](/colors). +* Cursors, located under [/cursors](/cursor). +* Window decorations, located under [/kdecoration](/kdecoration). +* Application style, located under [/kstyle](/kstyle). +* Wallpapers, located under [/wallpapers](/wallpapers). + +### See Also + +If you can't find what you're looking for, it may exist in another repository instead: + +* [Breeze Icons](https://invent.kde.org/frameworks/breeze-icons) contains the icon set used in Plasma. +* [Plasma Framework](https://invent.kde.org/frameworks/plasma-framework/-/tree/master/src/desktoptheme) includes the [Plasma Style](https://develop.kde.org/docs/plasma/theme/) that affects the visuals for the Plasma panel and widgets. +* [Plasma Workspace Wallpapers](https://invent.kde.org/plasma/plasma-workspace-wallpapers) contains the rest of the default wallpapers shipped with Plasma. +* [Breeze for GTK](https://invent.kde.org/plasma/breeze-gtk) is the Breeze [GTK](https://gtk.org/) theme. +* [QQC2 Desktop Style](https://invent.kde.org/frameworks/qqc2-desktop-style) is the default [Qt Quick Controls](https://doc.qt.io/qt-6/qtquickcontrols-index.html) style for desktop KDE applications. It draws controls in QtQuick-based apps using the current application style. If you're using KDE apps on Plasma or another Linux desktop, you're most likely using it. +* [Breeze Style for QQC2](https://invent.kde.org/plasma/qqc2-breeze-style) is a Qt Quick Controls style that mimics the visual styling of Breeze specifically. If you're using KDE apps on Android or Plasma Mobile, you're most likely using it. + +## Building + +The easiest way to make changes and test Breeze during development is to [build it with kdesrc-build](https://community.kde.org/Get_Involved/development/Build_software_with_kdesrc-build). + +When building Breeze manually, keep in mind that the Qt5 and Qt6 versions will be built by default. To control which versions are built, use the `BUILD_QT5` and `BUILD_QT6` CMake variables. + +## Contributing + +Like other projects in the KDE ecosystem, contributions are welcome from all. This repository is managed in [KDE Invent](https://invent.kde.org/plasma/breeze), our GitLab instance. + +* Want to contribute code? See the [GitLab wiki page](https://community.kde.org/Infrastructure/GitLab) for a tutorial on how to send a merge request. +* Reporting a bug? Please submit it on the [KDE Bugtracking System](https://bugs.kde.org/enter_bug.cgi?format=guided&product=breeze). Please do not use the Issues +tab to report bugs. +* Is there a part of Breeze that's not translated? See the [Getting Involved in Translation wiki page](https://community.kde.org/Get_Involved/translation) to see how +you can help translate! + +If you get stuck or need help with anything at all, head over to the [KDE New Contributors room](https://go.kde.org/matrix/#/#kde-welcome:kde.org) on Matrix. For questions about Breeze, please ask in the [KDE Development room](https://go.kde.org/matrix/#/#kde-devel:kde.org). See [Matrix](https://community.kde.org/Matrix) for more details. diff --git a/kwin/decoration/cmake/GtkUpdateIconCache.cmake b/kwin/decoration/cmake/GtkUpdateIconCache.cmake new file mode 100644 index 00000000..c0b98b9f --- /dev/null +++ b/kwin/decoration/cmake/GtkUpdateIconCache.cmake @@ -0,0 +1,17 @@ +# SPDX-FileCopyrightText: 2015 Volker Krause +# +# SPDX-License-Identifier: BSD-3-Clause + + +find_program(GTK_UPDATE_ICON_CACHE_EXECUTABLE NAMES gtk-update-icon-cache) + +macro(gtk_update_icon_cache _dir) + if (GTK_UPDATE_ICON_CACHE_EXECUTABLE) + install(CODE " + set(DESTDIR_VALUE \"\$ENV{DESTDIR}\") + if (NOT DESTDIR_VALUE) + execute_process(COMMAND ${GTK_UPDATE_ICON_CACHE_EXECUTABLE} -q -i . WORKING_DIRECTORY ${_dir}) + endif() + ") + endif() +endmacro() diff --git a/kwin/decoration/install.sh b/kwin/decoration/install.sh new file mode 100644 index 00000000..5f2464b5 --- /dev/null +++ b/kwin/decoration/install.sh @@ -0,0 +1,7 @@ +#!/bin/bash +rm -rf build +mkdir build +cd build +cmake -DCMAKE_INSTALL_PREFIX=/usr .. +make +sudo make install diff --git a/plasma/atpootb/install.sh b/kwin/decoration/install_ninja.sh similarity index 62% rename from plasma/atpootb/install.sh rename to kwin/decoration/install_ninja.sh index b21dc0bc..6f76d4ea 100644 --- a/plasma/atpootb/install.sh +++ b/kwin/decoration/install_ninja.sh @@ -1,6 +1,7 @@ #!/bin/bash - -mkdir -p build +rm -rf build +mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX=/usr -G Ninja .. ninja +sudo ninja install diff --git a/kwin/decoration/kdecoration/CMakeLists.txt b/kwin/decoration/kdecoration/CMakeLists.txt new file mode 100644 index 00000000..58258abb --- /dev/null +++ b/kwin/decoration/kdecoration/CMakeLists.txt @@ -0,0 +1,108 @@ +add_definitions(-DTRANSLATION_DOMAIN="smod_deco") + +################# includes ################# +include_directories(${CMAKE_SOURCE_DIR}/libbreezecommon) +include_directories(${CMAKE_BINARY_DIR}/libbreezecommon) + +################# newt target ################# +### plugin classes +set(breezedecoration_SRCS + breezebutton.cpp + breezedecoration.cpp + breezesettingsprovider.cpp + breezeexceptionlist.cpp + frametexture.cpp + sizingmargins.cpp + smod/smodbutton.cpp + smod/smoddecoration.cpp +) + +### build library +kconfig_add_kcfg_files(breezedecoration_SRCS breezesettings.kcfgc) +add_library(smoddecoration SHARED + ${breezedecoration_SRCS} + ${breezedecoration_config_PART_FORMS_HEADERS}) + +set_target_properties(smoddecoration PROPERTIES + OUTPUT_NAME org.smod.smod + PREFIX "" +) + +target_compile_definitions(smoddecoration PRIVATE MYSHAREDLIB_LIBRARY) + +#set_property(TARGET kwin4_effect_smodwindowbuttons PROPERTY POSITION_INDEPENDENT_CODE ON) + +set_target_properties(smoddecoration PROPERTIES POSITION_INDEPENDENT_CODE TRUE) +set_target_properties(smoddecoration PROPERTIES ENABLE_EXPORTS TRUE) + +add_compile_options(-fPIC) + +target_link_libraries(smoddecoration + PRIVATE + breezecommon6 + Qt6::Widgets + Qt6::DBus + KF6::CoreAddons + KF6::ConfigGui + KF6::GuiAddons + KF6::I18n + KF6::IconThemes + KDecoration3::KDecoration +) + +install(TARGETS smoddecoration DESTINATION ${KDE_INSTALL_PLUGINDIR}/${KDECORATION_PLUGIN_DIR}) + +add_subdirectory(config) + +set(smod_HEADERS + breeze.h + breezebutton.h + breezedecoration.h + breezeexceptionlist.h + breezesettingsprovider.h + sizingmargins.h +) + +kconfig_add_kcfg_files(smod_HEADERS breezesettings.kcfgc) + +ecm_generate_headers(smod_CamelCase_HEADERS + HEADER_NAMES + Breeze + BreezeButton + BreezeDecoration + BreezeExceptionList + BreezeSettingsProvider + SizingMargins + + REQUIRED_HEADERS + smod_HEADERS +) + +ecm_generate_pkgconfig_file( + BASE_NAME "smoddecoration" + LIB_NAME ":org.smod.smod.so" + INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR} + LIB_INSTALL_DIR ${KDE_INSTALL_PLUGINDIR}/org.kde.kdecoration3 + FILENAME_VAR pkgconfig_filename +) + +install( + FILES + ${smod_HEADERS} + ${breezedecoration_config_PART_FORMS_HEADERS} + ${smod_CamelCase_HEADERS} + + DESTINATION + ${CMAKE_INSTALL_INCLUDEDIR}/SMOD/Decoration + + COMPONENT + Devel +) + +install( + FILES + ${pkgconfig_filename} + + DESTINATION + ${CMAKE_INSTALL_LIBDIR}/pkgconfig +) diff --git a/kwin/decoration/kdecoration/Messages.sh b/kwin/decoration/kdecoration/Messages.sh new file mode 100644 index 00000000..4f38b6d2 --- /dev/null +++ b/kwin/decoration/kdecoration/Messages.sh @@ -0,0 +1,4 @@ +#!bin/sh +$EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp +$XGETTEXT `find . -name \*.cc -o -name \*.cpp -o -name \*.h` -o $podir/breeze_kwin_deco.pot +rm -f rc.cpp diff --git a/kwin/decoration/kdecoration/breeze.h b/kwin/decoration/kdecoration/breeze.h new file mode 100644 index 00000000..5c5492f7 --- /dev/null +++ b/kwin/decoration/kdecoration/breeze.h @@ -0,0 +1,56 @@ +/* + * SPDX-FileCopyrightText: 2014 Hugo Pereira Da Costa + * + * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL + */ + +#pragma once + +#include "breezesettings.h" + +#include +#include + +namespace Breeze +{ +//* convenience typedefs +using InternalSettingsPtr = QSharedPointer; +using InternalSettingsList = QList; +using InternalSettingsListIterator = QListIterator; + +//* metrics +namespace Metrics +{ +//* corner radius, in units of small spacing +static constexpr qreal Frame_FrameRadius = 2; + +//* titlebar metrics, in units of small spacing +static constexpr int TitleBar_TopMargin = 2; +static constexpr int TitleBar_BottomMargin = 2; +static constexpr int TitleBar_SideMargin = 2; +static constexpr int TitleBar_ButtonSpacing = 2; + +// shadow dimensions (pixels) +static constexpr int Shadow_Overlap = 3; + +// frame intensities (called bias in KColorUtilities::Mix) +static constexpr qreal Bias_Default = 0.25; +} + +//* standard pen widths +namespace PenWidth +{ +/* Using 1 instead of slightly more than 1 causes symbols drawn with + * pen strokes to look skewed. The exact amount added does not matter + * as long as it isn't too visible. + */ +// The standard pen stroke width for symbols. +static constexpr qreal Symbol = 1.01; +} + +//* exception +enum ExceptionMask { + None = 0, + BorderSize = 1 << 4, +}; +} diff --git a/kwin/decoration/kdecoration/breezebutton.cpp b/kwin/decoration/kdecoration/breezebutton.cpp new file mode 100644 index 00000000..651b1c1c --- /dev/null +++ b/kwin/decoration/kdecoration/breezebutton.cpp @@ -0,0 +1,408 @@ +/* + * SPDX-FileCopyrightText: 2014 Martin Gräßlin + * SPDX-FileCopyrightText: 2014 Hugo Pereira Da Costa + * + * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL + */ +#include "breezebutton.h" + +#include +#include +#include + +#include +#include +#include + +namespace Breeze +{ +using KDecoration3::ColorGroup; +using KDecoration3::ColorRole; +using KDecoration3::DecorationButtonType; + +//__________________________________________________________________ +Button::Button(DecorationButtonType type, Decoration *decoration, QObject *parent) + : DecorationButton(type, decoration, parent) + , m_animation(new QVariantAnimation(this)) + , m_hoverProgress(0.0) +{ + // setup animation + // It is important start and end value are of the same type, hence 0.0 and not just 0 + m_animation->setStartValue(0.0); + m_animation->setEndValue(1.0); + m_animation->setEasingCurve(QEasingCurve::InOutQuad); + connect(m_animation, &QVariantAnimation::valueChanged, this, [this](const QVariant &value) { + setOpacity(value.toReal()); + }); + + + updateGeometry(); + + // connections + connect(decoration->window(), SIGNAL(iconChanged(QIcon)), this, SLOT(update())); + connect(decoration->settings().get(), &KDecoration3::DecorationSettings::reconfigured, this, &Button::reconfigure); + connect(this, &KDecoration3::DecorationButton::hoveredChanged, this, &Button::updateAnimationState); + + connect(this, &Button::buttonHoverStatus, decoration, &Decoration::buttonHoverStatus); + + reconfigure(); +} +void Button::updateGeometry() +{ + auto d = qobject_cast(decoration()); + QRect buttonRect = d->buttonRect(type()); + setGeometry(buttonRect); + setIconSize(buttonRect.size()); +} + +//__________________________________________________________________ +Button::Button(QObject *parent, const QVariantList &args) + : Button(args.at(0).value(), args.at(1).value(), parent) +{ + m_flag = FlagStandalone; + //! icon size must return to !valid because it was altered from the default constructor, + //! in Standalone mode the button is not using the decoration metrics but its geometry + m_iconSize = QSize(-1, -1); +} + +void Button::smodPaintGlow(QPainter *painter, const QRectF &repaintArea) +{ + return; +} + +//__________________________________________________________________ +Button *Button::create(DecorationButtonType type, KDecoration3::Decoration *decoration, QObject *parent) +{ + if (auto d = qobject_cast(decoration)) { + Button *b = new Button(type, d, parent); + const auto c = d->window(); + switch (type) { + case DecorationButtonType::Close: + //b->setVisible(c->isCloseable()); + //QObject::connect(c, &KDecoration3::DecoratedWindow::closeableChanged, b, &Breeze::Button::setVisible); + b->setVisible(true); + break; + + case DecorationButtonType::Maximize: + b->setVisible(c->isMaximizeable() || c->isMinimizeable()); + b->setEnabled(c->isMaximizeable()); + QObject::connect(c, &KDecoration3::DecoratedWindow::maximizeableChanged, b, + [b](bool maximizeable) { + auto d = qobject_cast(b->decoration()); + const auto c = d->window(); + + if (!c) + { + return; + } + + b->setVisible(c->isMaximizeable() || c->isMinimizeable()); + b->setEnabled(maximizeable); + }); + //b->setVisible(c->isMaximizeable()); + //QObject::connect(c, &KDecoration3::DecoratedWindow::maximizeableChanged, b, &Breeze::Button::setVisible); + break; + + case DecorationButtonType::Minimize: + //b->setVisible(c->isMinimizeable()); + //QObject::connect(c, &KDecoration3::DecoratedWindow::minimizeableChanged, b, &Breeze::Button::setVisible); + b->setVisible(c->isMinimizeable() || c->isMaximizeable()); + b->setEnabled(c->isMinimizeable()); + QObject::connect(c, &KDecoration3::DecoratedWindow::minimizeableChanged, b, + [b](bool minimizeable) { + auto d = qobject_cast(b->decoration()); + const auto c = d->window(); + + if (!c) + { + return; + } + + b->setVisible(c->isMinimizeable() || c->isMaximizeable()); + b->setEnabled(minimizeable); + }); + break; + + case DecorationButtonType::ContextHelp: + b->setVisible(c->providesContextHelp()); + QObject::connect(c, &KDecoration3::DecoratedWindow::providesContextHelpChanged, b, &Breeze::Button::setVisible); + break; + + case DecorationButtonType::Shade: + b->setVisible(c->isShadeable()); + QObject::connect(c, &KDecoration3::DecoratedWindow::shadeableChanged, b, &Breeze::Button::setVisible); + break; + + case DecorationButtonType::Menu: + QObject::connect(c, &KDecoration3::DecoratedWindow::iconChanged, b, [b]() { + b->update(); + }); + break; + + default: + break; + } + + return b; + } + + return nullptr; +} + +//__________________________________________________________________ +void Button::paint(QPainter *painter, const QRectF &repaintRegion) +{ + smodPaint(painter, repaintRegion); + return; +} + +//__________________________________________________________________ +void Button::drawIcon(QPainter *painter) const +{ + painter->setRenderHints(QPainter::Antialiasing); + + painter->translate(geometry().topLeft()); + + const qreal width(m_iconSize.width()); + painter->scale(width / 20, width / 20); + painter->translate(1, 1); + + // render background + const QColor backgroundColor(this->backgroundColor()); + if (backgroundColor.isValid()) { + painter->setPen(Qt::NoPen); + painter->setBrush(backgroundColor); + painter->drawEllipse(QRectF(0, 0, 18, 18)); + } + + // render mark + const QColor foregroundColor(this->foregroundColor()); + if (foregroundColor.isValid()) { + // setup painter + QPen pen(foregroundColor); + pen.setCapStyle(Qt::RoundCap); + pen.setJoinStyle(Qt::MiterJoin); + pen.setWidthF(PenWidth::Symbol * qMax((qreal)1.0, 20 / width)); + + painter->setPen(pen); + painter->setBrush(Qt::NoBrush); + + switch (type()) { + case DecorationButtonType::Close: { + painter->drawLine(QPointF(5, 5), QPointF(13, 13)); + painter->drawLine(13, 5, 5, 13); + break; + } + + case DecorationButtonType::Maximize: { + if (isChecked()) { + pen.setJoinStyle(Qt::RoundJoin); + painter->setPen(pen); + + painter->drawPolygon(QVector{QPointF(4, 9), QPointF(9, 4), QPointF(14, 9), QPointF(9, 14)}); + + } else { + painter->drawPolyline(QVector{QPointF(4, 11), QPointF(9, 6), QPointF(14, 11)}); + } + break; + } + + case DecorationButtonType::Minimize: { + painter->drawPolyline(QVector{QPointF(4, 7), QPointF(9, 12), QPointF(14, 7)}); + break; + } + + case DecorationButtonType::OnAllDesktops: { + painter->setPen(Qt::NoPen); + painter->setBrush(foregroundColor); + + if (isChecked()) { + // outer ring + painter->drawEllipse(QRectF(3, 3, 12, 12)); + + // center dot + QColor backgroundColor(this->backgroundColor()); + auto d = qobject_cast(decoration()); + if (!backgroundColor.isValid() && d) { + backgroundColor = d->titleBarColor(); + } + + if (backgroundColor.isValid()) { + painter->setBrush(backgroundColor); + painter->drawEllipse(QRectF(8, 8, 2, 2)); + } + + } else { + painter->drawPolygon(QVector{QPointF(6.5, 8.5), QPointF(12, 3), QPointF(15, 6), QPointF(9.5, 11.5)}); + + painter->setPen(pen); + painter->drawLine(QPointF(5.5, 7.5), QPointF(10.5, 12.5)); + painter->drawLine(QPointF(12, 6), QPointF(4.5, 13.5)); + } + break; + } + + case DecorationButtonType::Shade: { + if (isChecked()) { + painter->drawLine(QPointF(4, 5.5), QPointF(14, 5.5)); + painter->drawPolyline(QVector{QPointF(4, 8), QPointF(9, 13), QPointF(14, 8)}); + + } else { + painter->drawLine(QPointF(4, 5.5), QPointF(14, 5.5)); + painter->drawPolyline(QVector{QPointF(4, 13), QPointF(9, 8), QPointF(14, 13)}); + } + + break; + } + + case DecorationButtonType::KeepBelow: { + painter->drawPolyline(QVector{QPointF(4, 5), QPointF(9, 10), QPointF(14, 5)}); + + painter->drawPolyline(QVector{QPointF(4, 9), QPointF(9, 14), QPointF(14, 9)}); + break; + } + + case DecorationButtonType::KeepAbove: { + painter->drawPolyline(QVector{QPointF(4, 9), QPointF(9, 4), QPointF(14, 9)}); + + painter->drawPolyline(QVector{QPointF(4, 13), QPointF(9, 8), QPointF(14, 13)}); + break; + } + + case DecorationButtonType::ApplicationMenu: { + painter->drawRect(QRectF(3.5, 4.5, 11, 1)); + painter->drawRect(QRectF(3.5, 8.5, 11, 1)); + painter->drawRect(QRectF(3.5, 12.5, 11, 1)); + break; + } + + case DecorationButtonType::ContextHelp: { + QPainterPath path; + path.moveTo(5, 6); + path.arcTo(QRectF(5, 3.5, 8, 5), 180, -180); + path.cubicTo(QPointF(12.5, 9.5), QPointF(9, 7.5), QPointF(9, 11.5)); + painter->drawPath(path); + + painter->drawRect(QRectF(9, 15, 0.5, 0.5)); + + break; + } + + default: + break; + } + } +} + +//__________________________________________________________________ +QColor Button::foregroundColor() const +{ + auto d = qobject_cast(decoration()); + if (!d) { + return QColor(); + + } else if (isPressed()) { + return d->titleBarColor(); + + } else if (type() == DecorationButtonType::Close && d->internalSettings()->outlineCloseButton()) { + return d->titleBarColor(); + + } else if ((type() == DecorationButtonType::KeepBelow || type() == DecorationButtonType::KeepAbove || type() == DecorationButtonType::Shade) + && isChecked()) { + return d->titleBarColor(); + + } else if (m_animation->state() == QAbstractAnimation::Running) { + return KColorUtils::mix(d->fontColor(), d->titleBarColor(), m_opacity); + + } else if (isHovered()) { + return d->titleBarColor(); + + } else { + return d->fontColor(); + } +} + +//__________________________________________________________________ +QColor Button::backgroundColor() const +{ + auto d = qobject_cast(decoration()); + if (!d) { + return QColor(); + } + + auto c = d->window(); + QColor redColor(c->color(ColorGroup::Warning, ColorRole::Foreground)); + + if (isPressed()) { + if (type() == DecorationButtonType::Close) { + return redColor.darker(); + } else { + return KColorUtils::mix(d->titleBarColor(), d->fontColor(), 0.3); + } + + } else if ((type() == DecorationButtonType::KeepBelow || type() == DecorationButtonType::KeepAbove || type() == DecorationButtonType::Shade) + && isChecked()) { + return d->fontColor(); + + } else if (m_animation->state() == QAbstractAnimation::Running) { + if (type() == DecorationButtonType::Close) { + if (d->internalSettings()->outlineCloseButton()) { + return c->isActive() ? KColorUtils::mix(redColor, redColor.lighter(), m_opacity) : KColorUtils::mix(redColor.lighter(), redColor, m_opacity); + + } else { + QColor color(redColor.lighter()); + color.setAlpha(color.alpha() * m_opacity); + return color; + } + + } else { + QColor color(d->fontColor()); + color.setAlpha(color.alpha() * m_opacity); + return color; + } + + } else if (isHovered()) { + if (type() == DecorationButtonType::Close) { + return c->isActive() ? redColor.lighter() : redColor; + } else { + return d->fontColor(); + } + + } else if (type() == DecorationButtonType::Close && d->internalSettings()->outlineCloseButton()) { + return c->isActive() ? redColor : d->fontColor(); + + } else { + return QColor(); + } +} + +//________________________________________________________________ +void Button::reconfigure() +{ + // animation + auto d = qobject_cast(decoration()); + if (d) { + m_animation->setDuration(d->animationsDuration()); + } + + if (type() == DecorationButtonType::Menu) + { + setVisible(!d->hideIcon()); + } +} + +//__________________________________________________________________ +void Button::updateAnimationState(bool hovered) +{ + auto d = qobject_cast(decoration()); + if (!(d && d->animationsDuration() > 0)) { + return; + } + + m_animation->setDirection(hovered ? QAbstractAnimation::Forward : QAbstractAnimation::Backward); + if (m_animation->state() != QAbstractAnimation::Running) { + m_animation->start(); + } +} + +} // namespace diff --git a/kwin/decoration/kdecoration/breezebutton.h b/kwin/decoration/kdecoration/breezebutton.h new file mode 100644 index 00000000..b74ed705 --- /dev/null +++ b/kwin/decoration/kdecoration/breezebutton.h @@ -0,0 +1,160 @@ +/* + * SPDX-FileCopyrightText: 2014 Martin Gräßlin + * SPDX-FileCopyrightText: 2014 Hugo Pereira Da Costa + * + * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL + */ + +#pragma once + +#include "breezedecoration.h" +#include + +#include +#include +#include +#include +#include +#include + + +class QVariantAnimation; + +namespace Breeze +{ + +class Button : public KDecoration3::DecorationButton +{ + Q_OBJECT + Q_PROPERTY(qreal hoverProgress READ hoverProgress WRITE setHoverProgress); + +public: + //* constructor + explicit Button(QObject *parent, const QVariantList &args); + + //* destructor + virtual ~Button() = default; + + //* button creation + static Button *create(KDecoration3::DecorationButtonType type, KDecoration3::Decoration *decoration, QObject *parent); + + //* render + virtual void paint(QPainter *painter, const QRectF &repaintRegion) override; + + //* flag + enum Flag { + FlagNone, + FlagStandalone, + FlagFirstInList, + FlagLastInList, + }; + + //* flag + void setFlag(Flag value) + { + m_flag = value; + } + + //* standalone buttons + bool isStandAlone() const + { + return m_flag == FlagStandalone; + } + + //* offset + void setOffset(const QPointF &value) + { + m_offset = value; + } + + //* horizontal offset, for rendering + void setHorizontalOffset(qreal value) + { + m_offset.setX(value); + } + + //* vertical offset, for rendering + void setVerticalOffset(qreal value) + { + m_offset.setY(value); + } + + //* set icon size + void setIconSize(const QSize &value) + { + m_iconSize = value; + } + + //*@name active state change animation + //@{ + void setOpacity(qreal value) + { + if (m_opacity == value) { + return; + } + m_opacity = value; + update(); + } + + qreal opacity() const + { + return m_opacity; + } + + //@} + + qreal hoverProgress() const; + void setHoverProgress(qreal hoverProgress); + + void smodPaintGlow(QPainter *painter, const QRectF &repaintArea); + void updateGeometry(); +signals: + void buttonHoverStatus(KDecoration3::DecorationButtonType button, bool hovered, QPoint pos); + +protected: + void hoverEnterEvent(QHoverEvent *event) override; + void hoverLeaveEvent(QHoverEvent *event) override; + +private Q_SLOTS: + + //* apply configuration changes + void reconfigure(); + + //* animation state + void updateAnimationState(bool); + +private: + //* private constructor + explicit Button(KDecoration3::DecorationButtonType type, Decoration *decoration, QObject *parent = nullptr); + + //* draw button icon + void drawIcon(QPainter *) const; + + void startHoverAnimation(qreal endValue); + void smodPaint(QPainter *painter, const QRectF &repaintRegion); + + //*@name colors + //@{ + QColor foregroundColor() const; + QColor backgroundColor() const; + //@} + + Flag m_flag = FlagNone; + + //* active state change animation + QVariantAnimation *m_animation; + + //* vertical offset (for rendering) + QPointF m_offset; + + //* icon size + QSize m_iconSize; + + //* active state change opacity + qreal m_opacity = 0; + + QPointer m_hoverAnimation; + qreal m_hoverProgress; +}; + +} // namespace diff --git a/kwin/decoration/kdecoration/breezedecoration.cpp b/kwin/decoration/kdecoration/breezedecoration.cpp new file mode 100644 index 00000000..fcb4beed --- /dev/null +++ b/kwin/decoration/kdecoration/breezedecoration.cpp @@ -0,0 +1,551 @@ +/* + * SPDX-FileCopyrightText: 2014 Martin Gräßlin + * SPDX-FileCopyrightText: 2014 Hugo Pereira Da Costa + * SPDX-FileCopyrightText: 2018 Vlad Zahorodnii + * SPDX-FileCopyrightText: 2021 Paul McAuley + * + * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL + */ + +#include "breezedecoration.h" + +#include "breezesettingsprovider.h" + +#include "breezebutton.h" + +#include "breezeboxshadowrenderer.h" + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "smod/smod.h" + +K_PLUGIN_FACTORY_WITH_JSON(BreezeDecoFactory, "smod.json", registerPlugin(); registerPlugin();) + +namespace Breeze +{ +using KDecoration3::ColorGroup; +using KDecoration3::ColorRole; + +static SizingMargins g_sizingmargins; +static QString g_themeName = "Aero"; +static int g_shadowStrength = 255; +static QColor g_shadowColor = Qt::black; +static int g_lastBorderSize; + +//________________________________________________________________ +void Decoration::setOpacity(qreal value) +{ + if (m_opacity == value) { + return; + } + m_opacity = value; + update(); +} +QString Decoration::themeName() +{ + return SMOD::currentlyRegisteredPath; +} +QPixmap Decoration::minimize_glow() +{ + return QPixmap(QStringLiteral(":/effects/smodglow/textures/minimize")); +} +QPixmap Decoration::maximize_glow() +{ + return QPixmap(QStringLiteral(":/effects/smodglow/textures/maximize")); +} +QPixmap Decoration::close_glow() +{ + return QPixmap(QStringLiteral(":/effects/smodglow/textures/close")); +} +bool Decoration::glowEnabled() +{ + if(g_sizingmargins.loaded()) + return g_sizingmargins.commonSizing().enable_glow; + else return false; +} + +//________________________________________________________________ +QColor Decoration::titleBarColor() const +{ + return QColor(Qt::transparent); + + const auto c = window(); + if (hideTitleBar()) { + return c->color(ColorGroup::Inactive, ColorRole::TitleBar); + } else if (m_animation->state() == QAbstractAnimation::Running) { + return KColorUtils::mix(c->color(ColorGroup::Inactive, ColorRole::TitleBar), c->color(ColorGroup::Active, ColorRole::TitleBar), m_opacity); + } else { + return c->color(c->isActive() ? ColorGroup::Active : ColorGroup::Inactive, ColorRole::TitleBar); + } +} + +//________________________________________________________________ +QColor Decoration::fontColor() const +{ + const auto c = window(); + if (m_animation->state() == QAbstractAnimation::Running) { + return KColorUtils::mix(c->color(ColorGroup::Inactive, ColorRole::Foreground), c->color(ColorGroup::Active, ColorRole::Foreground), m_opacity); + } else { + return c->color(c->isActive() ? ColorGroup::Active : ColorGroup::Inactive, ColorRole::Foreground); + } +} + +//________________________________________________________________ +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +bool Decoration::init() +#else +void Decoration::init() +#endif +{ + reconfigure(); + SMOD::registerResource(m_internalSettings->decorationTheme()); + + g_sizingmargins.loadSizingMargins(); + const auto c = window(); + // active state change animation + // It is important start and end value are of the same type, hence 0.0 and not just 0 + m_animation->setStartValue(0.0); + m_animation->setEndValue(1.0); + // Linear to have the same easing as Breeze animations + m_animation->setEasingCurve(QEasingCurve::Linear); + connect(m_animation, &QVariantAnimation::valueChanged, this, [this](const QVariant &value) { + setOpacity(value.toReal()); + }); + + m_shadowAnimation->setStartValue(0.0); + m_shadowAnimation->setEndValue(1.0); + m_shadowAnimation->setEasingCurve(QEasingCurve::OutCubic); + connect(m_shadowAnimation, &QVariantAnimation::valueChanged, this, [this](const QVariant &value) { + m_shadowOpacity = value.toReal(); + updateShadow(); + }); + + // use DBus connection to update on breeze configuration change + auto dbus = QDBusConnection::sessionBus(); + dbus.connect(QString(), + QStringLiteral("/KGlobalSettings"), + QStringLiteral("org.kde.KGlobalSettings"), + QStringLiteral("notifyChange"), + this, + SLOT(reconfigure())); + + dbus.connect(QStringLiteral("org.kde.KWin"), + QStringLiteral("/org/kde/KWin"), + QStringLiteral("org.kde.KWin.TabletModeManager"), + QStringLiteral("tabletModeChanged"), + QStringLiteral("b"), + this, + SLOT(onTabletModeChanged(bool))); + + auto message = QDBusMessage::createMethodCall(QStringLiteral("org.kde.KWin"), + QStringLiteral("/org/kde/KWin"), + QStringLiteral("org.freedesktop.DBus.Properties"), + QStringLiteral("Get")); + message.setArguments({QStringLiteral("org.kde.KWin.TabletModeManager"), QStringLiteral("tabletMode")}); + auto call = new QDBusPendingCallWatcher(dbus.asyncCall(message), this); + connect(call, &QDBusPendingCallWatcher::finished, this, [this, call]() { + QDBusPendingReply reply = *call; + if (!reply.isError()) { + onTabletModeChanged(reply.value().toBool()); + } + + call->deleteLater(); + }); + + updateTitleBar(); + auto s = settings(); + connect(s.get(), &KDecoration3::DecorationSettings::borderSizeChanged, this, &Decoration::recalculateBorders); + + // a change in font might cause the borders to change + connect(s.get(), &KDecoration3::DecorationSettings::fontChanged, this, &Decoration::recalculateBorders); + connect(s.get(), &KDecoration3::DecorationSettings::spacingChanged, this, &Decoration::recalculateBorders); + + // buttons + connect(s.get(), &KDecoration3::DecorationSettings::spacingChanged, this, &Decoration::updateButtonsGeometryDelayed); + connect(s.get(), &KDecoration3::DecorationSettings::decorationButtonsLeftChanged, this, &Decoration::updateButtonsGeometryDelayed); + connect(s.get(), &KDecoration3::DecorationSettings::decorationButtonsRightChanged, this, &Decoration::updateButtonsGeometryDelayed); + + // full reconfiguration + connect(s.get(), &KDecoration3::DecorationSettings::reconfigured, this, &Decoration::reconfigure); + connect(s.get(), &KDecoration3::DecorationSettings::reconfigured, SettingsProvider::self(), &SettingsProvider::reconfigure, Qt::UniqueConnection); + connect(s.get(), &KDecoration3::DecorationSettings::reconfigured, this, &Decoration::updateButtonsGeometryDelayed); + + connect(c, &KDecoration3::DecoratedWindow::adjacentScreenEdgesChanged, this, &Decoration::recalculateBorders); + connect(c, &KDecoration3::DecoratedWindow::maximizedHorizontallyChanged, this, &Decoration::recalculateBorders); + connect(c, &KDecoration3::DecoratedWindow::maximizedVerticallyChanged, this, &Decoration::recalculateBorders); + connect(c, &KDecoration3::DecoratedWindow::shadedChanged, this, &Decoration::recalculateBorders); + connect(c, &KDecoration3::DecoratedWindow::captionChanged, this, [this]() { + // update the caption area + update(titleBar()); + update(); // Prevents rendering artifacts with the text glow + }); + + connect(c, &KDecoration3::DecoratedWindow::activeChanged, this, &Decoration::updateAnimationState); + connect(c, &KDecoration3::DecoratedWindow::widthChanged, this, &Decoration::updateTitleBar); + connect(c, &KDecoration3::DecoratedWindow::maximizedChanged, this, &Decoration::updateTitleBar); + //connect(c, &KDecoration3::DecoratedWindow::maximizedChanged, this, &Decoration::setOpaque); + + connect(c, &KDecoration3::DecoratedWindow::widthChanged, this, &Decoration::updateButtonsGeometry); + connect(c, &KDecoration3::DecoratedWindow::maximizedChanged, this, &Decoration::updateButtonsGeometry); + connect(c, &KDecoration3::DecoratedWindow::adjacentScreenEdgesChanged, this, &Decoration::updateButtonsGeometry); + connect(c, &KDecoration3::DecoratedWindow::shadedChanged, this, &Decoration::updateButtonsGeometry); + + connect(c, &KDecoration3::DecoratedWindow::widthChanged, this, &Decoration::updateBlur); + connect(c, &KDecoration3::DecoratedWindow::heightChanged, this, &Decoration::updateBlur); + connect(c, &KDecoration3::DecoratedWindow::maximizedChanged, this, &Decoration::updateBlur); + connect(c, &KDecoration3::DecoratedWindow::shadedChanged, this, &Decoration::updateBlur); + + createButtons(); + updateShadow(); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return true; +#endif +} + +//________________________________________________________________ +void Decoration::updateTitleBar() +{ + // The titlebar rect has margins around it so the window can be resized by dragging a decoration edge. + auto s = settings(); + const auto c = window(); + const bool maximized = isMaximized(); + const int width = maximized ? c->width() : c->width() - 2 * s->smallSpacing() * Metrics::TitleBar_SideMargin; + const int height = maximized ? borderTop() : borderTop() - s->smallSpacing() * Metrics::TitleBar_TopMargin; + const int x = maximized ? 0 : s->smallSpacing() * Metrics::TitleBar_SideMargin; + const int y = maximized ? 0 : s->smallSpacing() * Metrics::TitleBar_TopMargin; + setTitleBar(QRect(x, y, width, height)); +} + +//________________________________________________________________ +void Decoration::updateAnimationState() +{ + if (m_shadowAnimation->duration() > 0) { + const auto c = window(); + m_shadowAnimation->setDirection(c->isActive() ? QAbstractAnimation::Forward : QAbstractAnimation::Backward); + m_shadowAnimation->setEasingCurve(c->isActive() ? QEasingCurve::OutCubic : QEasingCurve::InCubic); + if (m_shadowAnimation->state() != QAbstractAnimation::Running) { + m_shadowAnimation->start(); + } + + } else { + updateShadow(); + } + + if (m_animation->duration() > 0) { + const auto c = window(); + m_animation->setDirection(c->isActive() ? QAbstractAnimation::Forward : QAbstractAnimation::Backward); + if (m_animation->state() != QAbstractAnimation::Running) { + m_animation->start(); + } + + } else { + update(); + } +} + + +//________________________________________________________________ +void Decoration::reconfigure() +{ + + m_internalSettings = SettingsProvider::self()->internalSettings(this); + + SMOD::registerResource(m_internalSettings->decorationTheme()); + g_sizingmargins.loadSizingMargins(); + setScaledCornerRadius(); + + KSharedConfig::Ptr config = KSharedConfig::openConfig(); + const KConfigGroup cg(config, QStringLiteral("KDE")); + + m_animation->setDuration(0); + // Syncing anis between client and decoration is troublesome, so we're not using + // any animations right now. + // m_animation->setDuration( cg.readEntry("AnimationDurationFactor", 1.0f) * 100.0f ); + + // But the shadow is fine to animate like this! + m_shadowAnimation->setDuration(cg.readEntry("AnimationDurationFactor", 1.0f) * 100.0f); + + // borders + recalculateBorders(); + + // shadow + updateShadow(); + + updateButtonsGeometryDelayed(); + update(); + + { + // Reload smodglow + QDBusMessage message = QDBusMessage::createMethodCall("org.kde.KWin", "/Effects", "", "reconfigureEffect"); + QList args; + args.append("smodglow"); + message.setArguments(args); + bool result = QDBusConnection::sessionBus().send(message); + } + +} + +//________________________________________________________________ +void Decoration::recalculateBorders() +{ + const auto c = window(); + auto s = settings(); + + // left, right and bottom borders + auto margins_l= sizingMargins().frameLeftSizing(); + auto margins_r= sizingMargins().frameRightSizing(); + auto margins_b= sizingMargins().frameBottomSizing(); + int left = isMaximized() ? 0 : margins_l.width; + int right = isMaximized() ? 0 : margins_r.width; + int bottom = (c->isShaded() || isMaximized()) ? 0 : margins_b.height; + + // Increase titlebar height if the font is too large for the configured size + QString testString = "Message Box qd"; + QFontMetrics fm(s->font()); + auto bounds = fm.boundingRect(testString); + auto margins = sizingMargins().commonSizing(); + int limitedHeight = qMax(titlebarHeight(), bounds.height()); + int top = (isMaximized() ? limitedHeight+margins.titlebar_padding_maximized : limitedHeight+margins.titlebar_padding_normal) + 1; + if (hideTitleBar()) top = bottom; + + // Hide inner borders + auto t_m = sizingMargins().topSide(); + auto l_m = sizingMargins().leftSide(); + auto r_m = sizingMargins().rightSide(); + auto b_m = sizingMargins().bottomSide(); + + if (hideInnerBorder()) + { + left = left < l_m.margin_right ? 0 : left - l_m.margin_right; + right = right < r_m.margin_left ? 0 : right - r_m.margin_left; + top = top < t_m.margin_bottom ? 0 : top - t_m.margin_bottom; + bottom = bottom < b_m.margin_top ? 0 : bottom - b_m.margin_top; + } + + left = qMax(0, left); + right = qMax(0, right); + top = qMax(0, top); + bottom = qMax(0, bottom); + + setBorders(QMargins(left, top, right, bottom)); + + // extended sizes + const int extSize = s->largeSpacing(); + int extSides = 0; + int extBottom = 0; + if (hasNoBorders()) { + if (!isMaximizedHorizontally()) { + extSides = extSize; + } + if (!isMaximizedVertically()) { + extBottom = extSize; + } + + } else if (hasNoSideBorders() && !isMaximizedHorizontally()) { + extSides = extSize; + } + + setResizeOnlyBorders(QMargins(extSides, 0, extSides, extBottom)); + + // TODO is this needed? + updateBlur(); +} + +//________________________________________________________________ +void Decoration::createButtons() +{ + m_leftButtons = new KDecoration3::DecorationButtonGroup(KDecoration3::DecorationButtonGroup::Position::Left, this, &Button::create); + m_rightButtons = new KDecoration3::DecorationButtonGroup(KDecoration3::DecorationButtonGroup::Position::Right, this, &Button::create); + updateButtonsGeometry(); +} + +//________________________________________________________________ +void Decoration::updateButtonsGeometryDelayed() +{ + QTimer::singleShot(0, this, &Decoration::updateButtonsGeometry); +} + +//________________________________________________________________ +void Decoration::updateButtonsGeometry() +{ + const auto s = settings(); + + // left buttons + if (!m_leftButtons->buttons().isEmpty()) { + const int vPadding = isMaximized() ? 0 : s->smallSpacing() * Metrics::TitleBar_TopMargin; + const int hPadding = 0; //s->smallSpacing() * Metrics::TitleBar_SideMargin; + m_leftButtons->setPos(QPointF(hPadding + borderLeft(), vPadding)); + } + + if (!m_rightButtons->buttons().isEmpty()) { + const int vPadding = isMaximized() ? -1 : 1; + const int lessPadding = g_sizingmargins.frameRightSizing().inset; + auto r_m = sizingMargins().rightSide(); + m_rightButtons->setPos(QPointF( + size().width() - m_rightButtons->geometry().width() - borderRight() - (isMaximized() ? 2 : 0) + lessPadding - ((hideInnerBorder() && !isMaximized()) ? r_m.margin_left : 0), vPadding)); + + m_rightButtons->setSpacing(g_sizingmargins.commonSizing().caption_button_spacing); + } + foreach (QPointer button, m_rightButtons->buttons()) { + static_cast