├── VERSION ├── kstyle ├── darkly.json ├── config │ ├── sc-apps-darkly-settings.svgz │ ├── Messages.sh │ ├── CMakeLists.txt │ ├── darklystyleconfigmodule.h │ ├── darklystyleconfig.h │ ├── main.cpp │ ├── darklystyleconfigmodule.cpp │ └── darklystyleconfig.json ├── darklystyleconfigdata.kcfgc ├── darkly.themerc ├── darklyaddeventfilter.cpp ├── animations │ ├── darklyanimation.cpp │ ├── darklybaseengine.cpp │ ├── darklybusyindicatordata.cpp │ ├── darklygenericdata.cpp │ ├── darklyanimationdata.cpp │ ├── darklyenabledata.h │ ├── darklyspinboxengine.cpp │ ├── darklytransitiondata.cpp │ ├── darklyenabledata.cpp │ ├── darklystackedwidgetengine.cpp │ ├── darklyanimation.h │ ├── darklywidgetstatedata.h │ ├── darklydialengine.cpp │ ├── darklyheaderviewengine.cpp │ ├── darklyspinboxdata.cpp │ ├── darklystackedwidgetdata.h │ ├── darklydialdata.h │ ├── darklybusyindicatordata.h │ ├── darklytoolboxengine.cpp │ ├── darklydialengine.h │ ├── darklystackedwidgetengine.h │ ├── darklygenericdata.h │ ├── darklybaseengine.h │ ├── darklywidgetstatedata.cpp │ ├── darklybusyindicatorengine.h │ ├── darklytabbarengine.cpp │ ├── darklyheaderviewengine.h │ ├── darklydialdata.cpp │ ├── darklytoolboxengine.h │ ├── darklyanimationdata.h │ ├── darklyspinboxengine.h │ └── darklytabbarengine.h ├── config-darkly.h.cmake ├── darklystyleplugin.cpp ├── darklyaddeventfilter.h ├── darklypropertynames.h ├── darklystyleplugin.h ├── darklypropertynames.cpp ├── darklytoolsareamanager.h ├── darklymnemonics.h ├── debug │ └── darklywidgetexplorer.h ├── darklymnemonics.cpp └── darklyblurhelper.h ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── new_feafure.yml │ └── bug_report.yml ├── assets │ ├── docker │ │ ├── kubuntu │ │ │ └── Dockerfile │ │ └── kde-neon │ │ │ └── Dockerfile │ └── pkgbuild │ │ └── PKGBUILD ├── workflows │ ├── release.yml │ ├── archlinux.yml │ ├── flatpak.yml │ ├── opensuse-tw.yml │ ├── neon.yml │ ├── debian14.yml │ ├── kubuntu.yml │ └── fedora.yml └── FUNDING.yml ├── colors ├── ExtraDesktop.sh ├── CMakeLists.txt └── Darkly.colors ├── .gitignore ├── kdecoration ├── darklysettings.kcfgc ├── Messages.sh ├── config │ ├── kcm_darklydecoration.cpp │ ├── CMakeLists.txt │ ├── darklyitemmodel.cpp │ ├── darklyexceptionmodel.h │ ├── darklyconfigwidget.h │ ├── ui │ │ └── darklyexceptionlistwidget.ui │ ├── darklyexceptiondialog.h │ ├── darklyexceptionmodel.cpp │ ├── darklyitemmodel.h │ ├── darklyexceptionlistwidget.h │ ├── darklydetectwidget.h │ └── kcm_darklydecoration.json ├── CMakeLists.txt ├── config-darkly.h.cmake ├── darklysettingsprovider.h ├── darkly.h └── darklyexceptionlist.h ├── AUTHORS ├── libdarklycommon ├── CMakeLists.txt └── darklyboxshadowrenderer.h ├── DarklyConfig.cmake.in ├── flake.lock ├── cmake ├── GtkUpdateIconCache.cmake ├── CPackConfig.cmake.in └── CPackLists.cmake ├── org.kde.KStyle.Darkly6.json ├── org.kde.KStyle.Darkly5.json ├── flake.nix ├── uninstall.sh └── nix └── package.nix /VERSION: -------------------------------------------------------------------------------- 1 | 0.5.30 2 | -------------------------------------------------------------------------------- /kstyle/darkly.json: -------------------------------------------------------------------------------- 1 | { "Keys": [ "Darkly" ] } 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | -------------------------------------------------------------------------------- /colors/ExtraDesktop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | find -name \*.colors -print 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | build/ 3 | .clang-format 4 | 5 | result* 6 | -------------------------------------------------------------------------------- /colors/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install(FILES Darkly.colors 2 | DESTINATION ${KDE_INSTALL_DATADIR}/color-schemes/) 3 | -------------------------------------------------------------------------------- /kstyle/config/sc-apps-darkly-settings.svgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bali10050/Darkly/HEAD/kstyle/config/sc-apps-darkly-settings.svgz -------------------------------------------------------------------------------- /kstyle/darklystyleconfigdata.kcfgc: -------------------------------------------------------------------------------- 1 | File=darkly.kcfg 2 | ClassName=StyleConfigData 3 | NameSpace=Darkly 4 | Singleton=true 5 | Mutators=true 6 | GlobalEnums=true 7 | -------------------------------------------------------------------------------- /kstyle/darkly.themerc: -------------------------------------------------------------------------------- 1 | [Misc] 2 | Name=Darkly 3 | ConfigPage=kstyle_config/darklystyleconfig 4 | Comment=Widget style for Qt Applications 5 | [KDE] 6 | WidgetStyle=Darkly 7 | -------------------------------------------------------------------------------- /kdecoration/darklysettings.kcfgc: -------------------------------------------------------------------------------- 1 | File=darklysettingsdata.kcfg 2 | ClassName=InternalSettings 3 | NameSpace=Darkly 4 | Singleton=false 5 | Mutators=true 6 | GlobalEnums=true 7 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Cursors: 2 | Ken Vermette 3 | 4 | Kstyle: 5 | Hugo Pereira Da Costa - Developer 6 | Andrew Lake - Designer 7 | -------------------------------------------------------------------------------- /kdecoration/Messages.sh: -------------------------------------------------------------------------------- 1 | #!bin/sh 2 | $EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp 3 | $XGETTEXT `find . -name \*.cc -o -name \*.cpp -o -name \*.h` -o $podir/darkly_kwin_deco.pot 4 | rm -f rc.cpp 5 | -------------------------------------------------------------------------------- /kstyle/config/Messages.sh: -------------------------------------------------------------------------------- 1 | #!bin/sh 2 | $EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp 3 | $XGETTEXT `find . -name \*.cc -o -name \*.cpp -o -name \*.h` -o $podir/darkly_style_config.pot 4 | rm -f rc.cpp 5 | -------------------------------------------------------------------------------- /kdecoration/config/kcm_darklydecoration.cpp: -------------------------------------------------------------------------------- 1 | #include "darklyconfigwidget.h" 2 | #include 3 | 4 | K_PLUGIN_CLASS_WITH_JSON(Darkly::ConfigWidget, "kcm_darklydecoration.json") 5 | 6 | #include "kcm_darklydecoration.moc" 7 | -------------------------------------------------------------------------------- /.github/assets/docker/kubuntu/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:25.10 2 | MAINTAINER DeltaCopy 3 | USER root 4 | RUN apt-get update && \ 5 | apt-get dist-upgrade -y --allow-downgrades && \ 6 | apt-get install -y -qq console-setup- curl checkinstall git build-essential cmake kubuntu-desktop 7 | 8 | -------------------------------------------------------------------------------- /libdarklycommon/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(darklycommon${QT_MAJOR_VERSION} OBJECT darklyboxshadowrenderer.cpp) 2 | 3 | set_target_properties(darklycommon${QT_MAJOR_VERSION} PROPERTIES POSITION_INDEPENDENT_CODE TRUE) 4 | 5 | target_link_libraries(darklycommon${QT_MAJOR_VERSION} 6 | PUBLIC 7 | Qt${QT_MAJOR_VERSION}::Core 8 | Qt${QT_MAJOR_VERSION}::Gui) 9 | -------------------------------------------------------------------------------- /DarklyConfig.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | set(DARKLY_WITH_KDECORATION @WITH_DECORATIONS@) 4 | if(${DARKLY_WITH_KDECORATION}) 5 | set(DARKLY_KDECORATION_PLUGIN_ID "org.kde.darkly") 6 | else() 7 | set(DARKLY_KDECORATION_PLUGIN_ID "") 8 | endif() 9 | 10 | set(DARKLY_STYLE_NAME "darkly") 11 | #set(DARKLY_COLOR_INSTALL_ROOT "@PACKAGE_KDE_INSTALL_FULL_DATADIR@/color-schemes/") 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/new_feafure.yml: -------------------------------------------------------------------------------- 1 | name: New Feature Report 2 | description: File a new feature report. 3 | title: "[Feature Request]: " 4 | labels: ["feature-request"] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | Thanks for taking the time to fill out this new feature report! 10 | - type: textarea 11 | id: what-new-feat-info 12 | attributes: 13 | label: Describe the new feature 14 | description: A clear and concise description of the new feature. 15 | placeholder: "Adding clear information helps describe what new feature you would like added, if applicable add screenshots" 16 | validations: 17 | required: true 18 | -------------------------------------------------------------------------------- /flake.lock: -------------------------------------------------------------------------------- 1 | { 2 | "nodes": { 3 | "nixpkgs": { 4 | "locked": { 5 | "lastModified": 1743095683, 6 | "narHash": "sha256-gWd4urRoLRe8GLVC/3rYRae1h+xfQzt09xOfb0PaHSk=", 7 | "owner": "NixOS", 8 | "repo": "nixpkgs", 9 | "rev": "5e5402ecbcb27af32284d4a62553c019a3a49ea6", 10 | "type": "github" 11 | }, 12 | "original": { 13 | "owner": "NixOS", 14 | "ref": "nixos-unstable", 15 | "repo": "nixpkgs", 16 | "type": "github" 17 | } 18 | }, 19 | "root": { 20 | "inputs": { 21 | "nixpkgs": "nixpkgs" 22 | } 23 | } 24 | }, 25 | "root": "root", 26 | "version": 7 27 | } 28 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Publish release 2 | on: workflow_call 3 | jobs: 4 | publish: 5 | runs-on: ubuntu-24.04 6 | steps: 7 | - uses: actions/checkout@v5 8 | - name: Get version 9 | uses: actions/download-artifact@v5 10 | with: 11 | name: VERSION 12 | - name: Set version 13 | run: echo "VERSION=$(cat VERSION | xargs)" >> "$GITHUB_ENV" 14 | - name: Download artifacts 15 | uses: actions/download-artifact@v5 16 | with: 17 | pattern: darkly-${{ env.VERSION }}* 18 | merge-multiple: true 19 | - name: Release 20 | uses: softprops/action-gh-release@v2.4.2 21 | if: startsWith(github.ref, 'refs/tags/') 22 | with: 23 | files: darkly-${{ env.VERSION }}* 24 | -------------------------------------------------------------------------------- /.github/assets/docker/kde-neon/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM invent-registry.kde.org/neon/docker-images/plasma:user 2 | MAINTAINER DeltaCopy 3 | USER root 4 | RUN apt-get update && \ 5 | apt-get dist-upgrade -y --allow-downgrades && \ 6 | apt-get install -y -qq checkinstall git build-essential cmake kf6-extra-cmake-modules \ 7 | kf6-frameworkintegration-dev kf6-kcmutils-dev kf6-kcolorscheme-dev kf6-kconfig-dev \ 8 | kf6-kconfigwidgets-dev kf6-kcoreaddons-dev kf6-kguiaddons-dev kf6-ki18n-dev \ 9 | kf6-kiconthemes-dev kf6-kirigami2-dev kf6-kpackage-dev kf6-kservice-dev \ 10 | kf6-kwindowsystem-dev kirigami2-dev kwayland-dev libx11-dev \ 11 | libkdecorations3-dev libplasma-dev qt6-base-dev qt6-declarative-dev \ 12 | gettext qt6-svg-dev extra-cmake-modules qt3d5-dev && \ 13 | userdel neon 14 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: e 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | polar: # Replace with a single Polar username 14 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 15 | -------------------------------------------------------------------------------- /cmake/GtkUpdateIconCache.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2015 Volker Krause 2 | # 3 | # Distributed under the OSI-approved BSD License (the "License"); 4 | # see accompanying file COPYING-CMAKE-SCRIPTS for details. 5 | # 6 | # This software is distributed WITHOUT ANY WARRANTY; without even the 7 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 8 | # See the License for more information. 9 | 10 | find_program(GTK_UPDATE_ICON_CACHE_EXECUTABLE NAMES gtk-update-icon-cache) 11 | 12 | macro(gtk_update_icon_cache _dir) 13 | if (GTK_UPDATE_ICON_CACHE_EXECUTABLE) 14 | install(CODE " 15 | set(DESTDIR_VALUE \"\$ENV{DESTDIR}\") 16 | if (NOT DESTDIR_VALUE) 17 | execute_process(COMMAND ${GTK_UPDATE_ICON_CACHE_EXECUTABLE} -q -i . WORKING_DIRECTORY ${_dir}) 18 | endif() 19 | ") 20 | endif() 21 | endmacro() 22 | -------------------------------------------------------------------------------- /org.kde.KStyle.Darkly6.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "org.kde.KStyle.Darkly", 3 | "branch": "6.9", 4 | "runtime": "org.kde.Platform", 5 | "build-extension": true, 6 | "sdk": "org.kde.Sdk", 7 | "runtime-version": "6.9", 8 | "appstream-compose": false, 9 | "separate-locales": false, 10 | "modules": [ 11 | { 12 | "name": "Darkly", 13 | "buildsystem": "cmake", 14 | "builddir": true, 15 | "config-opts": [ 16 | "-DQT_PLUGINS_DIR=/usr/share/runtime/lib/plugins/Darkly", 17 | "-DCMAKE_INSTALL_PREFIX=/usr/share/runtime/lib/plugins/Darkly", 18 | "-DBUILD_QT6=ON", 19 | "-DBUILD_QT5=OFF", 20 | "-DWITH_DECORATIONS=OFF", 21 | "-DFOR_FLATPAK=ON" 22 | ], 23 | "sources": [ 24 | { 25 | "type": "git", 26 | "url": "https://github.com/Bali10050/Darkly", 27 | "branch": "main" 28 | } 29 | ] 30 | } 31 | ] 32 | } 33 | -------------------------------------------------------------------------------- /org.kde.KStyle.Darkly5.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "org.kde.KStyle.Darkly", 3 | "branch": "5.15-24.08", 4 | "runtime": "org.kde.Platform", 5 | "build-extension": true, 6 | "sdk": "org.kde.Sdk", 7 | "runtime-version": "5.15-24.08", 8 | "appstream-compose": false, 9 | "separate-locales": false, 10 | "modules": [ 11 | { 12 | "name": "Darkly", 13 | "buildsystem": "cmake", 14 | "builddir": true, 15 | "config-opts": [ 16 | "-DQT_PLUGINS_DIR=/usr/share/runtime/lib/plugins/Darkly", 17 | "-DCMAKE_INSTALL_PREFIX=/usr/share/runtime/lib/plugins/Darkly", 18 | "-DBUILD_QT6=OFF", 19 | "-DBUILD_QT5=ON", 20 | "-DWITH_DECORATIONS=OFF", 21 | "-DFOR_FLATPAK=ON" 22 | ], 23 | "sources": [ 24 | { 25 | "type": "git", 26 | "url": "https://github.com/Bali10050/Darkly", 27 | "branch": "main" 28 | } 29 | ] 30 | } 31 | ] 32 | } 33 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | description = "Fork of breeze theme style that aims to be visually modern and minimalistic"; 3 | 4 | inputs = { 5 | nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 6 | }; 7 | 8 | outputs = 9 | { 10 | nixpkgs, 11 | ... 12 | }: 13 | let 14 | inherit (nixpkgs) lib; 15 | systems = [ 16 | "aarch64-linux" 17 | "x86_64-linux" 18 | ]; 19 | perSystem = 20 | f: 21 | lib.genAttrs systems ( 22 | system: 23 | f { 24 | pkgs = import nixpkgs { inherit system; }; 25 | } 26 | ); 27 | in 28 | { 29 | packages = perSystem ( 30 | { pkgs }: 31 | rec { 32 | default = darkly-qt6; 33 | darkly-qt6 = pkgs.kdePackages.callPackage ./nix/package.nix { }; 34 | darkly-qt5 = pkgs.libsForQt5.callPackage ./nix/package.nix { qtPackages = pkgs.libsForQt5; }; 35 | } 36 | ); 37 | 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /kdecoration/config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ##### config classes ææææææ 2 | 3 | set(darklydecoration_config_SRCS 4 | ../darklyexceptionlist.cpp 5 | darklyconfigwidget.cpp 6 | darklydetectwidget.cpp 7 | darklyexceptiondialog.cpp 8 | darklyexceptionlistwidget.cpp 9 | darklyexceptionmodel.cpp 10 | darklyitemmodel.cpp 11 | ) 12 | ki18n_wrap_ui(darklydecoration_config_SRCS 13 | ui/darklyconfigurationui.ui 14 | ui/darklydetectwidget.ui 15 | ui/darklyexceptiondialog.ui 16 | ui/darklyexceptionlistwidget.ui 17 | ) 18 | 19 | kcoreaddons_add_plugin(kcm_darklydecoration SOURCES kcm_darklydecoration.cpp ${darklydecoration_config_SRCS} INSTALL_NAMESPACE "${KDECORATION_KCM_PLUGIN_DIR}") 20 | kconfig_add_kcfg_files(kcm_darklydecoration ../darklysettings.kcfgc) 21 | target_include_directories(kcm_darklydecoration PRIVATE ${CMAKE_SOURCE_DIR}/kdecoration ${CMAKE_BINARY_DIR}/kdecoration/) 22 | target_link_libraries(kcm_darklydecoration 23 | PUBLIC 24 | Qt6::Core 25 | Qt6::Gui 26 | Qt6::DBus 27 | KDecoration3::KDecoration 28 | PRIVATE 29 | KF6::CoreAddons 30 | KF6::ConfigWidgets 31 | KF6::GuiAddons 32 | KF6::I18n 33 | KF6::IconThemes 34 | KF6::WindowSystem 35 | KF6::KCMUtils 36 | ) 37 | kcmutils_generate_desktop_file(kcm_darklydecoration) 38 | -------------------------------------------------------------------------------- /kstyle/darklyaddeventfilter.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 18 | *************************************************************************/ 19 | 20 | #include "darklyaddeventfilter.h" 21 | -------------------------------------------------------------------------------- /kstyle/animations/darklyanimation.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 18 | *************************************************************************/ 19 | 20 | #include "darklyanimation.h" 21 | -------------------------------------------------------------------------------- /kstyle/animations/darklybaseengine.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 18 | *************************************************************************/ 19 | 20 | #include "darklybaseengine.h" 21 | -------------------------------------------------------------------------------- /kstyle/animations/darklybusyindicatordata.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 18 | *************************************************************************/ 19 | 20 | #include "darklybusyindicatordata.h" 21 | -------------------------------------------------------------------------------- /kdecoration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_definitions(-DTRANSLATION_DOMAIN="darkly_kwin_deco") 2 | 3 | ################# configuration ################# 4 | configure_file(config-darkly.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-darkly.h ) 5 | 6 | ################# includes ################# 7 | include_directories(${CMAKE_SOURCE_DIR}/libdarklycommon) 8 | include_directories(${CMAKE_BINARY_DIR}/libdarklycommon) 9 | 10 | ################# newt target ################# 11 | ### plugin classes 12 | set(darklydecoration_SRCS 13 | darklybutton.cpp 14 | darklydecoration.cpp 15 | darklyexceptionlist.cpp 16 | darklysettingsprovider.cpp 17 | ) 18 | ### build library 19 | kconfig_add_kcfg_files(darklydecoration_SRCS darklysettings.kcfgc) 20 | add_library(darklydecoration MODULE 21 | ${darklydecoration_SRCS} 22 | ${darklydecoration_config_SRCS} 23 | ${darklydecoration_config_PART_FORMS_HEADERS}) 24 | 25 | set_target_properties(darklydecoration PROPERTIES 26 | OUTPUT_NAME org.kde.darkly 27 | ) 28 | 29 | target_link_libraries(darklydecoration 30 | PUBLIC 31 | Qt6::DBus 32 | KDecoration3::KDecoration 33 | PRIVATE 34 | darklycommon6 35 | KF6::CoreAddons 36 | KF6::ConfigWidgets 37 | KF6::GuiAddons 38 | KF6::I18n 39 | KF6::IconThemes 40 | KF6::WindowSystem 41 | KF6::KCMUtils 42 | ) 43 | install(TARGETS darklydecoration DESTINATION ${KDE_INSTALL_PLUGINDIR}/${KDECORATION_PLUGIN_DIR}) 44 | install(FILES config/darklydecorationconfig.desktop DESTINATION ${KDE_INSTALL_DATADIR}/kservices6) 45 | add_subdirectory(config) 46 | -------------------------------------------------------------------------------- /kdecoration/config-darkly.h.cmake: -------------------------------------------------------------------------------- 1 | /* config-darkly.h. Generated by cmake from config-darkly.h.cmake */ 2 | 3 | /************************************************************************* 4 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 2 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * This program is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program; if not, write to the * 18 | * Free Software Foundation, Inc., * 19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 20 | *************************************************************************/ 21 | 22 | #ifndef config_darkly_h 23 | #define config_darkly_h 24 | 25 | /* Define to 1 if XCB libraries are found */ 26 | #cmakedefine01 DARKLY_HAVE_X11 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /kstyle/config/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ### configuration plugin 2 | add_definitions(-DTRANSLATION_DOMAIN=\"darkly_style_config\") 3 | set(kstyle_darkly_config_PART_SRCS darklystyleconfig.cpp) 4 | 5 | set(kstyle_darkly_config_PART_SRCS ${kstyle_darkly_config_PART_SRCS} darklystyleconfigmodule.cpp) 6 | 7 | kconfig_add_kcfg_files(kstyle_darkly_config_PART_SRCS ../darklystyleconfigdata.kcfgc) 8 | set(kstyle_darkly_config_PART_FORMS ui/darklystyleconfig.ui) 9 | ki18n_wrap_ui(kstyle_darkly_config_PART_FORMS_HEADERS ${kstyle_darkly_config_PART_FORMS}) 10 | 11 | kcoreaddons_add_plugin(darklystyleconfig SOURCES 12 | ${kstyle_darkly_config_PART_SRCS} 13 | ${kstyle_darkly_config_PART_FORMS_HEADERS} 14 | INSTALL_NAMESPACE "kstyle_config" 15 | ) 16 | 17 | target_link_libraries(darklystyleconfig Qt6::Core Qt6::Gui Qt6::Widgets Qt6::DBus) 18 | target_link_libraries(darklystyleconfig KF6::CoreAddons KF6::ConfigCore KF6::ConfigWidgets KF6::I18n) 19 | if(QT_MAJOR_VERSION STREQUAL "6") 20 | target_link_libraries(darklystyleconfig KF6::KCMUtils) 21 | endif() 22 | kcmutils_generate_desktop_file(darklystyleconfig) 23 | 24 | set(darkly_settings_SOURCES main.cpp) 25 | add_executable(darkly-settings ${darkly_settings_SOURCES} ) 26 | target_link_libraries(darkly-settings Qt6::Core Qt6::Gui Qt6::Widgets ) 27 | target_link_libraries(darkly-settings KF6::I18n KF6::KCMUtils KF6::CoreAddons) 28 | 29 | set_target_properties(darkly-settings PROPERTIES OUTPUT_NAME darkly-settings${QT_MAJOR_VERSION}) 30 | 31 | install(TARGETS darkly-settings ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) 32 | 33 | # icon 34 | ecm_install_icons(ICONS sc-apps-darkly-settings.svgz 35 | DESTINATION ${KDE_INSTALL_ICONDIR} 36 | THEME hicolor ) 37 | 38 | 39 | -------------------------------------------------------------------------------- /uninstall.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | styles=( 4 | "lightly" 5 | "Lightly" 6 | "Darkly" 7 | "darkly" 8 | ) 9 | 10 | test $(whoami) != "root" && echo "[ERROR]: This script needs sudo access to remove files." && exit 1 11 | 12 | for style in ${styles[@]}; do 13 | rm /usr/lib/lib${style}common5.so* 14 | rm /usr/lib64/lib${style}common5.so* 15 | rm /usr/lib/qt5/plugins/styles/${style}5.so* 16 | rm /usr/lib64/qt5/plugins/styles/${style}5.so* 17 | rm /usr/share/color-schemes/${style}.colors 18 | rm /usr/lib/qt6/plugins/styles/${style}6.so* 19 | rm /usr/lib64/qt6/plugins/styles/${style}6.so* 20 | rm /usr/share/kstyle/themes/${style}.themerc 21 | rm /usr/lib/qt6/plugins/kstyle_config/${style}styleconfig.so* 22 | rm /usr/lib64/qt6/plugins/kstyle_config/${style}styleconfig.so* 23 | rm /usr/share/applications/${style}styleconfig.desktop 24 | rm /usr/bin/${style}-settings6 25 | rm /usr/share/icons/hicolor/scalable/apps/${style}-settings.svgz 26 | rm /usr/lib/lib${style}common6.so* 27 | rm /usr/lib64/lib${style}common6.so* 28 | rm /usr/lib/qt6/plugins/org.kde.kdecoration3/org.kde.${style}.so* 29 | rm /usr/lib64/qt6/plugins/org.kde.kdecoration3/org.kde.${style}.so* 30 | rm /usr/share/kservices6/${style}decorationconfig.desktop 31 | rm /usr/lib/qt6/plugins/org.kde.kdecoration3.kcm/kcm_${style}decoration.so* 32 | rm /usr/lib64/qt6/plugins/org.kde.kdecoration3.kcm/kcm_${style}decoration.so* 33 | rm /usr/share/applications/kcm_${style}decoration.desktop 34 | rm /usr/lib/cmake/${style}/${style}Config.cmake 35 | rm /usr/lib64/cmake/${style}/${style}Config.cmake 36 | rm -r /usr/lib/cmake/${style} 37 | rm -r /usr/lib64/cmake/${style} 38 | done 39 | 40 | 41 | -------------------------------------------------------------------------------- /nix/package.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | stdenv, 4 | cmake, 5 | kdePackages, 6 | qtPackages ? kdePackages, 7 | }: 8 | let 9 | inherit (builtins) baseNameOf; 10 | inherit (lib.sources) cleanSourceWith cleanSource; 11 | inherit (lib.strings) hasSuffix; 12 | qtMajorVersion = lib.versions.major qtPackages.qtbase.version; 13 | in 14 | stdenv.mkDerivation (finalAttrs: { 15 | pname = "darkly-qt${qtMajorVersion}"; 16 | version = lib.removeSuffix "\n" (builtins.readFile ../VERSION); 17 | 18 | src = cleanSourceWith { 19 | filter = 20 | name: _type: 21 | let 22 | baseName = baseNameOf (toString name); 23 | in 24 | !(hasSuffix ".nix" baseName); 25 | src = cleanSource ../.; 26 | }; 27 | 28 | buildInputs = 29 | with qtPackages; 30 | [ 31 | qtbase 32 | kcmutils 33 | kcoreaddons 34 | kiconthemes 35 | kwindowsystem 36 | ] 37 | ++ lib.optionals (qtMajorVersion == "5") [ 38 | kirigami2 39 | ] 40 | ++ lib.optionals (qtMajorVersion == "6") [ 41 | kcolorscheme 42 | kdecoration 43 | kirigami 44 | ]; 45 | 46 | nativeBuildInputs = [ 47 | cmake 48 | qtPackages.wrapQtAppsHook 49 | qtPackages.extra-cmake-modules 50 | ]; 51 | 52 | cmakeFlags = map (v: lib.cmakeBool "BUILD_QT${v}" (v == qtMajorVersion)) [ 53 | "5" 54 | "6" 55 | ]; 56 | 57 | outputs = [ 58 | "out" 59 | "dev" 60 | ]; 61 | 62 | meta = with lib; { 63 | description = "Fork of the Darkly breeze theme style that aims to be visually modern and minimalistic"; 64 | mainProgram = "darkly-settings6"; 65 | homepage = "https://github.com/Bali10050/Darkly"; 66 | license = licenses.gpl2Plus; 67 | platforms = platforms.all; 68 | }; 69 | }) 70 | -------------------------------------------------------------------------------- /kstyle/animations/darklygenericdata.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 18 | *************************************************************************/ 19 | 20 | #include "darklygenericdata.h" 21 | 22 | #include 23 | 24 | namespace Darkly 25 | { 26 | 27 | //______________________________________________ 28 | GenericData::GenericData(QObject *parent, QWidget *target, int duration) 29 | : AnimationData(parent, target) 30 | , _animation(new Animation(duration, this)) 31 | , _opacity(0) 32 | { 33 | setupAnimation(_animation, "opacity"); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /cmake/CPackConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # This file will be configured to contain variables for CPack. These variables 2 | # should be set in the CMake list file of the project before CPack module is 3 | # included. Example variables are: 4 | # CPACK_GENERATOR - Generator used to create package 5 | # CPACK_INSTALL_CMAKE_PROJECTS - For each project (path, name, component) 6 | # CPACK_CMAKE_GENERATOR - CMake Generator used for the projects 7 | # CPACK_INSTALL_COMMANDS - Extra commands to install components 8 | # CPACK_INSTALL_DIRECTORIES - Extra directories to install 9 | # CPACK_PACKAGE_DESCRIPTION_FILE - Description file for the package 10 | # CPACK_PACKAGE_DESCRIPTION_SUMMARY - Summary of the package 11 | # CPACK_PACKAGE_EXECUTABLES - List of pairs of executables and labels 12 | # CPACK_PACKAGE_FILE_NAME - Name of the package generated 13 | # CPACK_PACKAGE_ICON - Icon used for the package 14 | # CPACK_PACKAGE_INSTALL_DIRECTORY - Name of directory for the installer 15 | # CPACK_PACKAGE_NAME - Package project name 16 | # CPACK_PACKAGE_VENDOR - Package project vendor 17 | # CPACK_PACKAGE_VERSION - Package project version 18 | # CPACK_PACKAGE_VERSION_MAJOR - Package project version (major) 19 | # CPACK_PACKAGE_VERSION_MINOR - Package project version (minor) 20 | # CPACK_PACKAGE_VERSION_PATCH - Package project version (patch) 21 | 22 | # There are certain generator specific ones 23 | 24 | # NSIS Generator: 25 | # CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Name of the registry key for the installer 26 | # CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra commands used during uninstall 27 | # CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra commands used during install 28 | 29 | @_CPACK_OTHER_VARIABLES_@ 30 | -------------------------------------------------------------------------------- /kstyle/config-darkly.h.cmake: -------------------------------------------------------------------------------- 1 | /* config-darkly.h. Generated by cmake from config-darkly.h.cmake */ 2 | 3 | /************************************************************************* 4 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 2 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * This program is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program; if not, write to the * 18 | * Free Software Foundation, Inc., * 19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 20 | *************************************************************************/ 21 | 22 | #ifndef config_darkly_h 23 | #define config_darkly_h 24 | 25 | /* Define to 1 if QtQuick is available */ 26 | #cmakedefine01 DARKLY_HAVE_QTQUICK 27 | 28 | /* Define to 1 if FrameworkIntegration/Kstyle libraries are found */ 29 | #cmakedefine01 DARKLY_HAVE_KSTYLE 30 | 31 | /* Define to 1 if XCB libraries are found */ 32 | #cmakedefine01 DARKLY_HAVE_X11 33 | 34 | #cmakedefine01 DARKLY_HAVE_KWAYLAND 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /kstyle/darklystyleplugin.cpp: -------------------------------------------------------------------------------- 1 | 2 | /************************************************************************* 3 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 19 | *************************************************************************/ 20 | 21 | #include "darklystyleplugin.h" 22 | #include "darklystyle.h" 23 | 24 | #include 25 | 26 | namespace Darkly 27 | { 28 | 29 | //_________________________________________________ 30 | QStyle *StylePlugin::create(const QString &key) 31 | { 32 | if (key.toLower() == QStringLiteral("darkly")) { 33 | return new Style; 34 | } 35 | return nullptr; 36 | } 37 | 38 | //_________________________________________________ 39 | QStringList StylePlugin::keys() const 40 | { 41 | return QStringList(QStringLiteral("Darkly")); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /cmake/CPackLists.cmake: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16) 2 | 3 | set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}") 4 | set(CPACK_OUTPUT_FILE_PREFIX "${PROJECT_SOURCE_DIR}/packages") 5 | set(CPACK_VERBATIM_VARIABLES YES) 6 | 7 | set(SourceIgnoreFiles 8 | ".cache" 9 | ".clang-format" 10 | ".clangd" 11 | ".git/" 12 | ".gitea/" 13 | ".github/" 14 | ".gitignore" 15 | ".idea" 16 | "CMakeCache.txt" 17 | "CMakeFiles/" 18 | "CPackConfig.cmake$" 19 | "CPackSourceConfig.cmake" 20 | "CTestTestfile.cmake" 21 | "Makefile" 22 | "_CPack_Packages/" 23 | "build/" 24 | "cmake-build*" 25 | "cmake_install.cmake" 26 | "dist/" 27 | "packages/" 28 | ) 29 | 30 | # Escape any '.' and '/' characters 31 | string(REPLACE "." "\\\." SourceIgnoreFiles "${SourceIgnoreFiles}") 32 | string(REPLACE "/" "\\\/" SourceIgnoreFiles "${SourceIgnoreFiles}") 33 | 34 | # Override install prefix for package target 35 | set(CMAKE_INSTALL_PREFIX ".") 36 | string(REGEX REPLACE "^/(.*)" "\\1" 37 | CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" 38 | ) 39 | 40 | if(BUILD_RPMS) 41 | set(CPACK_SET_DESTDIR OFF) 42 | set(CMAKE_INSTALL_PREFIX "/usr") 43 | set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 44 | set(CPACK_RPM_FILE_NAME "${PROJECT_NAME}-${CPACK_PACKAGE_VERSION}.x86_64") 45 | endif() 46 | if(BUILD_DEBS) 47 | set(CPACK_SET_DESTDIR OFF) 48 | set(CMAKE_INSTALL_PREFIX "/usr") 49 | set(CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") 50 | set(CPACK_DEBIAN_FILE_NAME "${PROJECT_NAME}-${CPACK_PACKAGE_VERSION}_amd64") 51 | set(CPACK_DEBIAN_PACKAGE_MAINTAINER "DeltaCopy") 52 | set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64") 53 | endif() 54 | 55 | include(CPack) 56 | 57 | add_custom_target(spackages 58 | COMMAND "${CMAKE_COMMAND}" 59 | --build "${CMAKE_BINARY_DIR}" 60 | --target package_source 61 | VERBATIM 62 | USES_TERMINAL 63 | ) 64 | 65 | # vim: ts=4:sw=4:sts=4:et:syntax=cmake 66 | -------------------------------------------------------------------------------- /kstyle/darklyaddeventfilter.h: -------------------------------------------------------------------------------- 1 | #ifndef darklyaddeventfilter_h 2 | #define darklyaddeventfilter_h 3 | 4 | /************************************************************************* 5 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 21 | *************************************************************************/ 22 | 23 | #include 24 | #include 25 | 26 | namespace Darkly 27 | { 28 | 29 | class AddEventFilter : public QObject 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | //* constructor 35 | AddEventFilter() 36 | : QObject() 37 | { 38 | } 39 | 40 | //* event filter 41 | /** blocks all AddChild events */ 42 | bool eventFilter(QObject *, QEvent *event) override 43 | { 44 | return event->type() == QEvent::ChildAdded; 45 | } 46 | }; 47 | 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /kstyle/animations/darklyanimationdata.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 18 | *************************************************************************/ 19 | 20 | #include "darklyanimationdata.h" 21 | 22 | namespace Darkly 23 | { 24 | 25 | const qreal AnimationData::OpacityInvalid = -1; 26 | int AnimationData::_steps = 0; 27 | 28 | //_________________________________________________________________________________ 29 | void AnimationData::setupAnimation(const Animation::Pointer &animation, const QByteArray &property) 30 | { 31 | // setup animation 32 | animation.data()->setStartValue(0.0); 33 | animation.data()->setEndValue(1.0); 34 | animation.data()->setTargetObject(this); 35 | animation.data()->setPropertyName(property); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /kstyle/animations/darklyenabledata.h: -------------------------------------------------------------------------------- 1 | #ifndef darklyenable_data_h 2 | #define darklyenable_data_h 3 | 4 | /************************************************************************* 5 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 21 | *************************************************************************/ 22 | 23 | #include "darklywidgetstatedata.h" 24 | 25 | namespace Darkly 26 | { 27 | 28 | //* Enable data 29 | class EnableData : public WidgetStateData 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | //* constructor 35 | EnableData(QObject *parent, QWidget *target, int duration, bool state = true) 36 | : WidgetStateData(parent, target, duration, state) 37 | { 38 | target->installEventFilter(this); 39 | } 40 | 41 | //* event filter 42 | bool eventFilter(QObject *, QEvent *) override; 43 | }; 44 | 45 | } 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /kstyle/config/darklystyleconfigmodule.h: -------------------------------------------------------------------------------- 1 | #ifndef darklystyleconfigmodule_h 2 | #define darklystyleconfigmodule_h 3 | 4 | /************************************************************************* 5 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 21 | *************************************************************************/ 22 | 23 | #include "darklystyleconfig.h" 24 | 25 | #include 26 | 27 | namespace Darkly 28 | { 29 | 30 | //* configuration module 31 | class ConfigurationModule : public KCModule 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | ConfigurationModule(QObject *parent, const KPluginMetaData &data); 37 | 38 | public Q_SLOTS: 39 | 40 | void defaults() override; 41 | void load() override; 42 | void save() override; 43 | 44 | private: 45 | //* configuration 46 | StyleConfig *m_config; 47 | }; 48 | 49 | } 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /kstyle/darklypropertynames.h: -------------------------------------------------------------------------------- 1 | #ifndef darklypropertynames_h 2 | #define darklypropertynames_h 3 | 4 | /************************************************************************* 5 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 21 | *************************************************************************/ 22 | 23 | namespace Darkly 24 | { 25 | 26 | struct PropertyNames { 27 | static const char noAnimations[]; 28 | static const char noWindowGrab[]; 29 | static const char netWMForceShadow[]; 30 | static const char netWMSkipShadow[]; 31 | static const char sidePanelView[]; 32 | static const char toolButtonAlignment[]; 33 | static const char menuTitle[]; 34 | static const char alteredBackground[]; 35 | static const char bordersSides[]; 36 | static const char forceFrame[]; 37 | static const char noSeparator[]; 38 | }; 39 | 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /kstyle/darklystyleplugin.h: -------------------------------------------------------------------------------- 1 | #ifndef darklystyleplugin_h 2 | #define darklystyleplugin_h 3 | 4 | /************************************************************************* 5 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 21 | *************************************************************************/ 22 | 23 | #include 24 | 25 | namespace Darkly 26 | { 27 | 28 | class StylePlugin : public QStylePlugin 29 | { 30 | Q_OBJECT 31 | 32 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "darkly.json") 33 | 34 | public: 35 | //* constructor 36 | explicit StylePlugin(QObject *parent = nullptr) 37 | : QStylePlugin(parent) 38 | { 39 | } 40 | 41 | //* returns list of valid keys 42 | QStringList keys() const; 43 | 44 | //* create style 45 | QStyle *create(const QString &) override; 46 | }; 47 | 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /kstyle/animations/darklyspinboxengine.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 18 | *************************************************************************/ 19 | 20 | #include "darklyspinboxengine.h" 21 | 22 | #include 23 | 24 | namespace Darkly 25 | { 26 | 27 | //____________________________________________________________ 28 | bool SpinBoxEngine::registerWidget(QWidget *widget) 29 | { 30 | if (!widget) 31 | return false; 32 | 33 | // create new data class 34 | if (!_data.contains(widget)) 35 | _data.insert(widget, new SpinBoxData(this, widget, duration()), enabled()); 36 | 37 | // connect destruction signal 38 | connect(widget, SIGNAL(destroyed(QObject *)), this, SLOT(unregisterWidget(QObject *)), Qt::UniqueConnection); 39 | return true; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /kstyle/animations/darklytransitiondata.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // darklytransitiondata.cpp 3 | // data container for generic transitions 4 | // ------------------- 5 | // 6 | // Copyright (c) 2009 Hugo Pereira Da Costa 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to 10 | // deal in the Software without restriction, including without limitation the 11 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 12 | // sell copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 24 | // IN THE SOFTWARE. 25 | ////////////////////////////////////////////////////////////////////////////// 26 | 27 | #include "darklytransitiondata.h" 28 | 29 | namespace Darkly 30 | { 31 | 32 | //_________________________________________________________________ 33 | TransitionData::TransitionData(QObject *parent, QWidget *target, int duration) 34 | : QObject(parent) 35 | , _transition(new TransitionWidget(target, duration)) 36 | { 37 | _transition.data()->hide(); 38 | } 39 | 40 | //_________________________________________________________________ 41 | TransitionData::~TransitionData() 42 | { 43 | if (_transition) 44 | _transition.data()->deleteLater(); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /.github/assets/pkgbuild/PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: DeltaCopy <7x0bb03yq@mozmail.com> 2 | # Description: Builds Darkly from https://github.com/Bali10050/Darkly 3 | # Used inside Github Action workflow archlinux-ci 4 | 5 | # basic info 6 | dev="Bali10050" 7 | pkgname="darkly" 8 | pkgver= # change this to match the name of the release tag you want to build from 9 | pkgrel=1 10 | pkgdesc="Bali10050's fork of Darkly (A modern style for qt applications)" 11 | url="https://github.com/$dev/Darkly" 12 | arch=('x86_64' 'aarch64') 13 | license=("GPL-2.0-or-later") 14 | pkgdir="$srcdir/fakeinstall_kf6" 15 | build_dir="build_kf6" 16 | 17 | makedepends=( 18 | 'cmake' 19 | 'extra-cmake-modules' 20 | 'git' 21 | ) 22 | 23 | options=(!emptydirs !debug) 24 | 25 | source=( 26 | "${pkgname}.git::git+${url}.git#tag=v${pkgver//_/-}" 27 | ) 28 | 29 | # KF6/QT6 30 | depends_kf6=( 31 | 'kdecoration' 32 | 'qt6-declarative' 33 | 'kcoreaddons' 34 | 'kcmutils' 35 | 'kcolorscheme' 36 | 'kconfig' 37 | 'kguiaddons' 38 | 'kiconthemes' 39 | 'kwindowsystem' 40 | ) 41 | 42 | # KF5/QT5 for backward compatibility 43 | depends_kf5=( 44 | 'kcmutils5' 45 | 'frameworkintegration5' 46 | 'kconfigwidgets5' 47 | 'kiconthemes5' 48 | 'kirigami2' 49 | 'kwindowsystem5' 50 | ) 51 | 52 | depends=("${depends_kf6[@]}" "${depends_kf5[@]}") 53 | 54 | conflicts=( 55 | lightly-kf6 56 | lightly-qt 57 | lightly-qt6 58 | lightly-qt6-bin 59 | ) 60 | 61 | pkgver() { 62 | cd "$srcdir/$pkgname.git" 63 | git describe --tags --long --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' 64 | } 65 | 66 | prepare() { 67 | cd "$srcdir/$pkgname.git" 68 | } 69 | 70 | build() ( 71 | local cmake_options=( 72 | -B $build_dir 73 | -S "$pkgname.git" 74 | -DBUILD_TESTING=OFF 75 | -Wno-dev 76 | ) 77 | 78 | cmake "${cmake_options[@]}" 79 | 80 | cmake --build $build_dir -j $(nproc) 81 | ) 82 | 83 | package() ( 84 | install -dm755 "$pkgdir.git" 85 | DESTDIR="$pkgdir" cmake --install $build_dir 86 | rm -rf "$pkgdir/usr/lib/cmake" 87 | ) 88 | -------------------------------------------------------------------------------- /kdecoration/darklysettingsprovider.h: -------------------------------------------------------------------------------- 1 | #ifndef darklysettingsprovider_h 2 | #define darklysettingsprovider_h 3 | /* 4 | * Copyright 2014 Hugo Pereira Da Costa 5 | * 6 | * This program is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU General Public License as 8 | * published by the Free Software Foundation; either version 2 of 9 | * the License or (at your option) version 3 or any later version 10 | * accepted by the membership of KDE e.V. (or its successor approved 11 | * by the membership of KDE e.V.), which shall act as a proxy 12 | * defined in Section 14 of version 3 of the license. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | #pragma once 24 | #include "darkly.h" 25 | #include "darklydecoration.h" 26 | #include "darklysettings.h" 27 | 28 | #include 29 | 30 | #include 31 | 32 | namespace Darkly 33 | { 34 | 35 | class SettingsProvider : public QObject 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | //* destructor 41 | ~SettingsProvider(); 42 | 43 | //* singleton 44 | static SettingsProvider *self(); 45 | 46 | //* internal settings for given decoration 47 | InternalSettingsPtr internalSettings(Decoration *) const; 48 | 49 | public Q_SLOTS: 50 | 51 | //* reconfigure 52 | void reconfigure(); 53 | 54 | private: 55 | //* constructor 56 | SettingsProvider(); 57 | 58 | //* default configuration 59 | InternalSettingsPtr m_defaultSettings; 60 | 61 | //* exceptions 62 | InternalSettingsList m_exceptions; 63 | 64 | //* config object 65 | KSharedConfigPtr m_config; 66 | 67 | //* singleton 68 | static SettingsProvider *s_self; 69 | }; 70 | 71 | } 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /kstyle/animations/darklyenabledata.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 18 | *************************************************************************/ 19 | 20 | #include "darklyenabledata.h" 21 | 22 | namespace Darkly 23 | { 24 | 25 | //______________________________________________ 26 | bool EnableData::eventFilter(QObject *object, QEvent *event) 27 | { 28 | if (!enabled()) 29 | return WidgetStateData::eventFilter(object, event); 30 | 31 | // check event type 32 | switch (event->type()) { 33 | // enter event 34 | case QEvent::EnabledChange: { 35 | if (QWidget *widget = qobject_cast(object)) { 36 | updateState(widget->isEnabled()); 37 | } 38 | break; 39 | } 40 | 41 | default: 42 | break; 43 | } 44 | 45 | return WidgetStateData::eventFilter(object, event); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /kstyle/animations/darklystackedwidgetengine.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // darklystackedwidgetengine.cpp 3 | // stores event filters and maps widgets to animations 4 | // ------------------- 5 | // 6 | // Copyright (c) 2009 Hugo Pereira Da Costa 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to 10 | // deal in the Software without restriction, including without limitation the 11 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 12 | // sell copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 24 | // IN THE SOFTWARE. 25 | ////////////////////////////////////////////////////////////////////////////// 26 | 27 | #include "darklystackedwidgetengine.h" 28 | 29 | namespace Darkly 30 | { 31 | 32 | //____________________________________________________________ 33 | bool StackedWidgetEngine::registerWidget(QStackedWidget *widget) 34 | { 35 | if (!widget) 36 | return false; 37 | if (!_data.contains(widget)) { 38 | _data.insert(widget, new StackedWidgetData(this, widget, duration()), enabled()); 39 | } 40 | 41 | // connect destruction signal 42 | disconnect(widget, SIGNAL(destroyed(QObject *)), this, SLOT(unregisterWidget(QObject *))); 43 | connect(widget, SIGNAL(destroyed(QObject *)), this, SLOT(unregisterWidget(QObject *))); 44 | 45 | return true; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /kstyle/darklypropertynames.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 18 | *************************************************************************/ 19 | 20 | #include "darklypropertynames.h" 21 | 22 | namespace Darkly 23 | { 24 | 25 | const char PropertyNames::noAnimations[] = "_kde_no_animations"; 26 | const char PropertyNames::noWindowGrab[] = "_kde_no_window_grab"; 27 | const char PropertyNames::netWMForceShadow[] = "_KDE_NET_WM_FORCE_SHADOW"; 28 | const char PropertyNames::netWMSkipShadow[] = "_KDE_NET_WM_SKIP_SHADOW"; 29 | const char PropertyNames::sidePanelView[] = "_kde_side_panel_view"; 30 | const char PropertyNames::toolButtonAlignment[] = "_kde_toolButton_alignment"; 31 | const char PropertyNames::menuTitle[] = "_darkly_toolButton_menutitle"; 32 | const char PropertyNames::alteredBackground[] = "_darkly_altered_background"; 33 | const char PropertyNames::forceFrame[] = "_breeze_force_frame"; 34 | const char PropertyNames::bordersSides[] = "_breeze_borders_sides"; 35 | const char PropertyNames::noSeparator[] = "_darkly_no_separator"; 36 | } 37 | -------------------------------------------------------------------------------- /kstyle/animations/darklyanimation.h: -------------------------------------------------------------------------------- 1 | #ifndef darklyanimation_h 2 | #define darklyanimation_h 3 | /************************************************************************* 4 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 5 | * * 6 | * This program is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 2 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * This program is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program; if not, write to the * 18 | * Free Software Foundation, Inc., * 19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 20 | *************************************************************************/ 21 | 22 | #include "darkly.h" 23 | 24 | #include 25 | #include 26 | 27 | namespace Darkly 28 | { 29 | 30 | class Animation : public QPropertyAnimation 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | //* convenience 36 | using Pointer = WeakPointer; 37 | 38 | //* constructor 39 | Animation(int duration, QObject *parent) 40 | : QPropertyAnimation(parent) 41 | { 42 | setDuration(duration); 43 | setEasingCurve(QEasingCurve::InQuint); 44 | } 45 | 46 | //* true if running 47 | bool isRunning() const 48 | { 49 | return state() == Animation::Running; 50 | } 51 | 52 | //* restart 53 | void restart() 54 | { 55 | if (isRunning()) 56 | stop(); 57 | start(); 58 | } 59 | }; 60 | 61 | } 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /kdecoration/darkly.h: -------------------------------------------------------------------------------- 1 | #ifndef darkly_h 2 | #define darkly_h 3 | 4 | /* 5 | * Copyright 2014 Hugo Pereira Da Costa 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU General Public License as 9 | * published by the Free Software Foundation; either version 2 of 10 | * the License or (at your option) version 3 or any later version 11 | * accepted by the membership of KDE e.V. (or its successor approved 12 | * by the membership of KDE e.V.), which shall act as a proxy 13 | * defined in Section 14 of version 3 of the license. 14 | * 15 | * This program is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with this program. If not, see . 22 | */ 23 | #pragma once 24 | #include "darklysettings.h" 25 | 26 | #include 27 | #include 28 | 29 | namespace Darkly 30 | { 31 | //* convenience typedefs 32 | using InternalSettingsPtr = QSharedPointer; 33 | using InternalSettingsList = QList; 34 | using InternalSettingsListIterator = QListIterator; 35 | 36 | //* metrics 37 | namespace Metrics 38 | { 39 | //* corner radius (pixels) 40 | static constexpr qreal Frame_FrameRadius = 5; 41 | 42 | //* titlebar metrics, in units of small spacing 43 | static constexpr int TitleBar_TopMargin = 2; 44 | static constexpr int TitleBar_BottomMargin = 2; 45 | static constexpr int TitleBar_SideMargin = 4; 46 | static constexpr int TitleBar_ButtonSpacing = 2; 47 | 48 | // shadow dimensions (pixels) 49 | static constexpr int Shadow_Overlap = 3; 50 | } 51 | 52 | //* standard pen widths 53 | namespace PenWidth 54 | { 55 | /* Using 1 instead of sdarkly more than 1 causes symbols drawn with 56 | * pen strokes to look skewed. The exact amount added does not matter 57 | * as long as it isn't too visible. 58 | */ 59 | // The standard pen stroke width for symbols. 60 | static constexpr qreal Symbol = 1.01; 61 | } 62 | 63 | //* exception 64 | enum ExceptionMask { 65 | None = 0, 66 | BorderSize = 1 << 4 67 | }; 68 | } 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /kstyle/animations/darklywidgetstatedata.h: -------------------------------------------------------------------------------- 1 | #ifndef darklywidgetstatedata_h 2 | #define darklywidgetstatedata_h 3 | 4 | /************************************************************************* 5 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 21 | *************************************************************************/ 22 | 23 | #include "darklygenericdata.h" 24 | 25 | namespace Darkly 26 | { 27 | 28 | //* handle widget state (hover/focus/enable) changes 29 | class WidgetStateData : public GenericData 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | //* constructor 35 | WidgetStateData(QObject *parent, QWidget *target, int duration, bool state = false) 36 | : GenericData(parent, target, duration) 37 | , _initialized(false) 38 | , _state(state) 39 | { 40 | } 41 | 42 | //* destructor 43 | virtual ~WidgetStateData() 44 | { 45 | } 46 | 47 | /** 48 | returns true if hover has Changed 49 | and starts timer accordingly 50 | */ 51 | virtual bool updateState(bool value, AnimationParameters parameters = AnimationDefaut); 52 | 53 | private: 54 | bool _initialized; 55 | bool _state; 56 | }; 57 | 58 | } 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /kstyle/animations/darklydialengine.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 18 | *************************************************************************/ 19 | 20 | #include "darklydialengine.h" 21 | 22 | #include 23 | 24 | namespace Darkly 25 | { 26 | 27 | //____________________________________________________________ 28 | bool DialEngine::registerWidget(QWidget *widget, AnimationModes mode) 29 | { 30 | // check widget 31 | if (!widget) 32 | return false; 33 | 34 | // only handle hover and focus 35 | if (mode & AnimationHover && !dataMap(AnimationHover).contains(widget)) { 36 | dataMap(AnimationHover).insert(widget, new DialData(this, widget, duration()), enabled()); 37 | } 38 | if (mode & AnimationFocus && !dataMap(AnimationFocus).contains(widget)) { 39 | dataMap(AnimationFocus).insert(widget, new WidgetStateData(this, widget, duration()), enabled()); 40 | } 41 | 42 | // connect destruction signal 43 | connect(widget, SIGNAL(destroyed(QObject *)), this, SLOT(unregisterWidget(QObject *)), Qt::UniqueConnection); 44 | 45 | return true; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /kstyle/animations/darklyheaderviewengine.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 18 | *************************************************************************/ 19 | 20 | #include "darklyheaderviewengine.h" 21 | 22 | #include 23 | 24 | namespace Darkly 25 | { 26 | 27 | //____________________________________________________________ 28 | bool HeaderViewEngine::registerWidget(QWidget *widget) 29 | { 30 | if (!widget) 31 | return false; 32 | 33 | // create new data class 34 | if (!_data.contains(widget)) 35 | _data.insert(widget, new HeaderViewData(this, widget, duration()), enabled()); 36 | 37 | // connect destruction signal 38 | connect(widget, SIGNAL(destroyed(QObject *)), this, SLOT(unregisterWidget(QObject *)), Qt::UniqueConnection); 39 | return true; 40 | } 41 | 42 | //____________________________________________________________ 43 | bool HeaderViewEngine::updateState(const QObject *object, const QPoint &position, bool value) 44 | { 45 | DataMap::Value data(_data.find(object)); 46 | return (data && data.data()->updateState(position, value)); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /kstyle/animations/darklyspinboxdata.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 18 | *************************************************************************/ 19 | 20 | #include "darklyspinboxdata.h" 21 | 22 | namespace Darkly 23 | { 24 | 25 | //________________________________________________ 26 | SpinBoxData::SpinBoxData(QObject *parent, QWidget *target, int duration) 27 | : AnimationData(parent, target) 28 | { 29 | _upArrowData._animation = new Animation(duration, this); 30 | _downArrowData._animation = new Animation(duration, this); 31 | setupAnimation(upArrowAnimation(), "upArrowOpacity"); 32 | setupAnimation(downArrowAnimation(), "downArrowOpacity"); 33 | } 34 | 35 | //______________________________________________ 36 | bool SpinBoxData::Data::updateState(bool value) 37 | { 38 | if (_state == value) 39 | return false; 40 | else { 41 | _state = value; 42 | _animation.data()->setDirection(_state ? Animation::Forward : Animation::Backward); 43 | if (!_animation.data()->isRunning()) 44 | _animation.data()->start(); 45 | return true; 46 | } 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /kstyle/animations/darklystackedwidgetdata.h: -------------------------------------------------------------------------------- 1 | #ifndef darklystackedwidget_datah 2 | #define darklystackedwidget_datah 3 | 4 | ////////////////////////////////////////////////////////////////////////////// 5 | // darklystackedwidgetdata.h 6 | // data container for QStackedWidget transition 7 | // ------------------- 8 | // 9 | // Copyright (c) 2009 Hugo Pereira Da Costa 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to 13 | // deal in the Software without restriction, including without limitation the 14 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 15 | // sell copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 27 | // IN THE SOFTWARE. 28 | ////////////////////////////////////////////////////////////////////////////// 29 | 30 | #include "darklytransitiondata.h" 31 | 32 | #include 33 | 34 | namespace Darkly 35 | { 36 | 37 | //* generic data 38 | class StackedWidgetData : public TransitionData 39 | { 40 | Q_OBJECT 41 | 42 | public: 43 | //* constructor 44 | StackedWidgetData(QObject *, QStackedWidget *, int); 45 | 46 | protected Q_SLOTS: 47 | 48 | //* initialize animation 49 | bool initializeAnimation() override; 50 | 51 | //* animate 52 | bool animate() override; 53 | 54 | //* finish animation 55 | void finishAnimation(); 56 | 57 | //* called when target is destroyed 58 | void targetDestroyed(); 59 | 60 | private: 61 | //* target 62 | WeakPointer _target; 63 | 64 | //* current index 65 | int _index; 66 | }; 67 | 68 | } 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /kstyle/animations/darklydialdata.h: -------------------------------------------------------------------------------- 1 | #ifndef darklydial_data_h 2 | #define darklydial_data_h 3 | 4 | /************************************************************************* 5 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 21 | *************************************************************************/ 22 | 23 | #include "darklywidgetstatedata.h" 24 | 25 | namespace Darkly 26 | { 27 | 28 | //* dial data 29 | class DialData : public WidgetStateData 30 | { 31 | Q_OBJECT 32 | 33 | public: 34 | //* constructor 35 | DialData(QObject *parent, QWidget *target, int); 36 | 37 | //* event filter 38 | bool eventFilter(QObject *, QEvent *) override; 39 | 40 | //* subcontrol rect 41 | void setHandleRect(const QRect &rect) 42 | { 43 | _handleRect = rect; 44 | } 45 | 46 | //* mouse position 47 | QPoint position() const 48 | { 49 | return _position; 50 | } 51 | 52 | private: 53 | //* hoverMoveEvent 54 | void hoverMoveEvent(QObject *, QEvent *); 55 | 56 | //* hoverMoveEvent 57 | void hoverLeaveEvent(QObject *, QEvent *); 58 | 59 | //* rect 60 | QRect _handleRect; 61 | 62 | //* mouse position 63 | QPoint _position; 64 | }; 65 | 66 | } 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /kstyle/darklytoolsareamanager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "darklyhelper.h" 4 | #include "darklystyle.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace Darkly 11 | { 12 | class ToolsAreaManager; 13 | 14 | // Trying to discriminate QApplication events from events from all QObjects 15 | // belonging to it is impractical with everything going through a single 16 | // eventFilter, so we have this class which provides a second one that allows 17 | // us to filter for the events we want. 18 | class AppListener : public QObject 19 | { 20 | Q_OBJECT 21 | using QObject::QObject; 22 | 23 | bool eventFilter(QObject *watched, QEvent *event) override; 24 | 25 | ToolsAreaManager *manager; 26 | friend class ToolsAreaManager; 27 | }; 28 | 29 | class ToolsAreaManager : public QObject 30 | { 31 | Q_OBJECT 32 | 33 | private: 34 | Helper *_helper; 35 | struct WindowToolBars { 36 | const QMainWindow *window; 37 | QVector> toolBars; 38 | }; 39 | std::vector _windows; 40 | KSharedConfigPtr _config; 41 | KConfigWatcher::Ptr _watcher; 42 | QPalette _palette = QPalette(); 43 | AppListener *_listener; 44 | bool _colorSchemeHasHeaderColor; 45 | 46 | void recreateConfigWatcher(const QString &path); 47 | void appendIfNotAlreadyExists(const QMainWindow *window, const QPointer &toolBar); 48 | void removeWindowToolBar(const QMainWindow *window, const QPointer &toolBar); 49 | void removeWindow(const QMainWindow *window); 50 | 51 | friend class AppListener; 52 | 53 | protected: 54 | bool tryRegisterToolBar(QPointer window, QPointer widget); 55 | void tryUnregisterToolBar(QPointer window, QPointer widget); 56 | void configUpdated(); 57 | 58 | public: 59 | explicit ToolsAreaManager(Helper *helper, QObject *parent = nullptr); 60 | ~ToolsAreaManager(); 61 | 62 | bool eventFilter(QObject *watched, QEvent *event) override; 63 | 64 | const QPalette &palette() const 65 | { 66 | return _palette; 67 | } 68 | 69 | void registerApplication(QApplication *application); 70 | void registerWidget(QWidget *widget); 71 | void unregisterWidget(QWidget *widget); 72 | 73 | QRect toolsAreaRect(const QMainWindow &window) const; 74 | 75 | bool hasHeaderColors(); 76 | }; 77 | } -------------------------------------------------------------------------------- /kstyle/darklymnemonics.h: -------------------------------------------------------------------------------- 1 | #ifndef darklymnemonics_h 2 | #define darklymnemonics_h 3 | 4 | /************************************************************************* 5 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 21 | *************************************************************************/ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include "darklystyleconfigdata.h" 28 | 29 | namespace Darkly 30 | { 31 | 32 | class Mnemonics : public QObject 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | //* constructor 38 | explicit Mnemonics(QObject *parent) 39 | : QObject(parent) 40 | { 41 | } 42 | 43 | //* set mode 44 | void setMode(int); 45 | 46 | //* event filter 47 | bool eventFilter(QObject *, QEvent *) override; 48 | 49 | //* true if mnemonics are enabled 50 | bool enabled() const 51 | { 52 | return _enabled; 53 | } 54 | 55 | //* alignment flag 56 | int textFlags() const 57 | { 58 | return _enabled ? Qt::TextShowMnemonic : Qt::TextHideMnemonic; 59 | } 60 | 61 | protected: 62 | //* set enable state 63 | void setEnabled(bool); 64 | 65 | private: 66 | //* enable state 67 | bool _enabled = true; 68 | }; 69 | 70 | } 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /kstyle/config/darklystyleconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef darklystyleconfig_h 2 | #define darklystyleconfig_h 3 | 4 | /************************************************************************* 5 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 21 | *************************************************************************/ 22 | 23 | #include "ui_darklystyleconfig.h" 24 | 25 | namespace Darkly 26 | { 27 | 28 | class StyleConfig : public QWidget, Ui::DarklyStyleConfig 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | //* constructor 34 | explicit StyleConfig(QWidget *); 35 | 36 | //* destructor 37 | virtual ~StyleConfig() 38 | { 39 | } 40 | 41 | private: 42 | std::list _shadowSizes = {"None", "Small", "Medium", "Large", "VeryLarge"}; 43 | 44 | Q_SIGNALS: 45 | 46 | //* emitted whenever one option is changed. 47 | void changed(bool); 48 | 49 | public Q_SLOTS: 50 | 51 | //* load setup from config data 52 | void load(); 53 | 54 | //* save current state 55 | void save(); 56 | 57 | //* restore all default values 58 | void defaults(); 59 | 60 | //* reset to saved configuration 61 | void reset(); 62 | 63 | protected Q_SLOTS: 64 | 65 | //* update modified state when option is checked/unchecked 66 | void updateChanged(); 67 | }; 68 | 69 | } 70 | #endif 71 | -------------------------------------------------------------------------------- /kstyle/animations/darklybusyindicatordata.h: -------------------------------------------------------------------------------- 1 | #ifndef darklybusyindicatordata_h 2 | #define darklybusyindicatordata_h 3 | 4 | /************************************************************************* 5 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 21 | *************************************************************************/ 22 | 23 | #include 24 | 25 | namespace Darkly 26 | { 27 | 28 | class BusyIndicatorData : public QObject 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | //* constructor 34 | explicit BusyIndicatorData(QObject *parent) 35 | : QObject(parent) 36 | , _animated(false) 37 | { 38 | } 39 | 40 | //* destructor 41 | virtual ~BusyIndicatorData() 42 | { 43 | } 44 | 45 | //*@name accessors 46 | //@{ 47 | 48 | //* animated 49 | bool isAnimated() const 50 | { 51 | return _animated; 52 | } 53 | 54 | //@} 55 | 56 | //*@name modifiers 57 | //@{ 58 | 59 | //* enabled 60 | void setEnabled(bool) 61 | { 62 | } 63 | 64 | //* enabled 65 | void setDuration(int) 66 | { 67 | } 68 | 69 | //* animated 70 | void setAnimated(bool value) 71 | { 72 | _animated = value; 73 | } 74 | 75 | //@} 76 | 77 | private: 78 | //* animated 79 | bool _animated; 80 | }; 81 | 82 | } 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /kstyle/config/main.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // darklyanimationconfigitem.h 3 | // animation configuration item 4 | // ------------------- 5 | // 6 | // Copyright (c) 2010 Hugo Pereira Da Costa 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to 10 | // deal in the Software without restriction, including without limitation the 11 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 12 | // sell copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 24 | // IN THE SOFTWARE. 25 | ////////////////////////////////////////////////////////////////////////////// 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | //__________________________________________ 36 | int main(int argc, char *argv[]) 37 | { 38 | KLocalizedString::setApplicationDomain("darkly_style_config"); 39 | 40 | QApplication app( argc, argv ); 41 | app.setApplicationName(i18n("Darkly Settings")); 42 | app.setWindowIcon(QIcon::fromTheme(QStringLiteral("darkly-settings"))); 43 | 44 | KCMultiDialog dialog; 45 | dialog.setWindowTitle(i18n("Darkly Settings")); 46 | dialog.addModule(KPluginMetaData(QStringLiteral("kstyle_config/darklystyleconfig"))); 47 | dialog.addModule(KPluginMetaData(QStringLiteral("org.kde.kdecoration3.kcm/kcm_darklydecoration.so"))); 48 | dialog.show(); 49 | 50 | foreach( auto child, dialog.findChildren() ) 51 | { 52 | child->adjustSize(); 53 | child->viewport()->adjustSize(); 54 | } 55 | 56 | return app.exec(); 57 | } 58 | -------------------------------------------------------------------------------- /kdecoration/config/darklyitemmodel.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // itemmodel.cpp 3 | // ------------------- 4 | // 5 | // Copyright (c) 2009-2010 Hugo Pereira Da Costa 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to 9 | // deal in the Software without restriction, including without limitation the 10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 11 | // sell copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 23 | // IN THE SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////// 25 | 26 | #include "darklyitemmodel.h" 27 | 28 | namespace Darkly 29 | { 30 | 31 | //_______________________________________________________________ 32 | ItemModel::ItemModel(QObject *parent) 33 | : QAbstractItemModel(parent) 34 | { 35 | } 36 | 37 | //____________________________________________________________ 38 | void ItemModel::sort(int column, Qt::SortOrder order) 39 | { 40 | // store column and order 41 | m_sortColumn = column; 42 | m_sortOrder = order; 43 | 44 | // emit signals and call private methods 45 | emit layoutAboutToBeChanged(); 46 | privateSort(column, order); 47 | emit layoutChanged(); 48 | } 49 | 50 | //____________________________________________________________ 51 | QModelIndexList ItemModel::indexes(int column, const QModelIndex &parent) const 52 | { 53 | QModelIndexList out; 54 | int rows(rowCount(parent)); 55 | for (int row = 0; row < rows; row++) { 56 | QModelIndex index(this->index(row, column, parent)); 57 | if (!index.isValid()) 58 | continue; 59 | out.append(index); 60 | out += indexes(column, index); 61 | } 62 | 63 | return out; 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /kstyle/animations/darklytoolboxengine.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 18 | *************************************************************************/ 19 | 20 | #include "darklytoolboxengine.h" 21 | 22 | namespace Darkly 23 | { 24 | 25 | //____________________________________________________________ 26 | bool ToolBoxEngine::registerWidget(QWidget *widget) 27 | { 28 | if (!widget) 29 | return false; 30 | if (!_data.contains(widget)) { 31 | _data.insert(widget, new WidgetStateData(this, widget, duration()), enabled()); 32 | } 33 | 34 | // connect destruction signal 35 | connect(widget, SIGNAL(destroyed(QObject *)), this, SLOT(unregisterWidget(QObject *)), Qt::UniqueConnection); 36 | return true; 37 | } 38 | 39 | //____________________________________________________________ 40 | bool ToolBoxEngine::updateState(const QPaintDevice *object, bool value) 41 | { 42 | PaintDeviceDataMap::Value data(ToolBoxEngine::data(object)); 43 | return (data && data.data()->updateState(value)); 44 | } 45 | 46 | //____________________________________________________________ 47 | bool ToolBoxEngine::isAnimated(const QPaintDevice *object) 48 | { 49 | PaintDeviceDataMap::Value data(ToolBoxEngine::data(object)); 50 | return (data && data.data()->animation() && data.data()->animation().data()->isRunning()); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /kstyle/debug/darklywidgetexplorer.h: -------------------------------------------------------------------------------- 1 | #ifndef darklywidgetexplorer_h 2 | #define darklywidgetexplorer_h 3 | 4 | /************************************************************************* 5 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 21 | *************************************************************************/ 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | namespace Darkly 30 | { 31 | 32 | //* print widget's and parent's information on mouse click 33 | class WidgetExplorer : public QObject 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | //* constructor 39 | explicit WidgetExplorer(QObject *); 40 | 41 | //* enable 42 | bool enabled() const; 43 | 44 | //* enable 45 | void setEnabled(bool); 46 | 47 | //* widget rects 48 | void setDrawWidgetRects(bool value) 49 | { 50 | _drawWidgetRects = value; 51 | } 52 | 53 | //* event filter 54 | bool eventFilter(QObject *, QEvent *) override; 55 | 56 | protected: 57 | //* event type 58 | QString eventType(const QEvent::Type &) const; 59 | 60 | //* print widget information 61 | QString widgetInformation(const QWidget *) const; 62 | 63 | private: 64 | //* enable state 65 | bool _enabled = false; 66 | 67 | //* widget rects 68 | bool _drawWidgetRects = false; 69 | 70 | //* map event types to string 71 | QMap _eventTypes; 72 | }; 73 | 74 | } 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /kstyle/config/darklystyleconfigmodule.cpp: -------------------------------------------------------------------------------- 1 | 2 | /************************************************************************* 3 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 4 | * * 5 | * This program is free software; you can redistribute it and/or modify * 6 | * it under the terms of the GNU General Public License as published by * 7 | * the Free Software Foundation; either version 2 of the License, or * 8 | * (at your option) any later version. * 9 | * * 10 | * This program is distributed in the hope that it will be useful, * 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 | * GNU General Public License for more details. * 14 | * * 15 | * You should have received a copy of the GNU General Public License * 16 | * along with this program; if not, write to the * 17 | * Free Software Foundation, Inc., * 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 19 | *************************************************************************/ 20 | 21 | #include "darklystyleconfigmodule.h" 22 | 23 | #include 24 | 25 | K_PLUGIN_CLASS_WITH_JSON(Darkly::ConfigurationModule, "darklystyleconfig.json") 26 | 27 | #include "darklystyleconfigmodule.moc" 28 | 29 | namespace Darkly 30 | { 31 | 32 | //_______________________________________________________________________ 33 | ConfigurationModule::ConfigurationModule(QObject *parent, const KPluginMetaData &data) 34 | : KCModule(parent, data) 35 | { 36 | widget()->setLayout(new QVBoxLayout); 37 | widget()->layout()->addWidget(m_config = new StyleConfig(widget())); 38 | connect(m_config, &StyleConfig::changed, this, &KCModule::setNeedsSave); 39 | } 40 | 41 | //_______________________________________________________________________ 42 | void ConfigurationModule::defaults() 43 | { 44 | m_config->defaults(); 45 | KCModule::defaults(); 46 | } 47 | 48 | //_______________________________________________________________________ 49 | void ConfigurationModule::load() 50 | { 51 | m_config->load(); 52 | KCModule::load(); 53 | } 54 | 55 | //_______________________________________________________________________ 56 | void ConfigurationModule::save() 57 | { 58 | m_config->save(); 59 | KCModule::save(); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /.github/workflows/archlinux.yml: -------------------------------------------------------------------------------- 1 | # Archlinux 2 | # Build Darkly from release tag and publish .zst package 3 | 4 | on: 5 | workflow_call: 6 | inputs: 7 | version: 8 | required: true 9 | type: string 10 | env: 11 | PKGBUILD: $GITHUB_WORKSPACE/.github/assets/pkgbuild/PKGBUILD 12 | jobs: 13 | build: 14 | runs-on: ubuntu-24.04 15 | container: archlinux:latest 16 | steps: 17 | - name: Checkout local 18 | uses: actions/checkout@v4.2.0 19 | with: 20 | repository: ${{ github.repository }} 21 | sparse-checkout: .github 22 | sparse-checkout-cone-mode: false 23 | - name: System update 24 | run: pacman -Syu --noconfirm 25 | - name: Install sudo, git and compile dependencies 26 | run: | 27 | pacman -Sy sudo git binutils make gcc pkg-config fakeroot plasma-desktop \ 28 | cmake extra-cmake-modules qt6-base \ 29 | kdecoration qt6-declarative kcoreaddons \ 30 | kcmutils kcolorscheme kconfig kguiaddons \ 31 | kiconthemes kwindowsystem kcmutils5 \ 32 | frameworkintegration5 kconfigwidgets5 kiconthemes5 \ 33 | kirigami2 kwindowsystem5 --noconfirm 34 | - name: Setup build user 35 | run: | 36 | useradd builduser -m # Create the builduser 37 | passwd -d builduser # Delete the buildusers password 38 | printf 'builduser ALL=(ALL) ALL\n' | tee -a /etc/sudoers # Allow the builduser passwordless sudo 39 | - name: Update PKGBUILD file with new checksum and git tag values 40 | run: | 41 | # update tag with latest version 42 | mkdir /var/tmp/darkly-archlinux 43 | cp ${{ env.PKGBUILD }} /var/tmp/darkly-archlinux 44 | sed -i "s/.*pkgver=.*/pkgver=${{ inputs.version }}/" /var/tmp/darkly-archlinux/PKGBUILD 45 | - name: Change permissions of build directory 46 | run: | 47 | chown builduser:builduser -R /var/tmp/darkly-archlinux 48 | - name: Generate package checksum 49 | run: sudo -u builduser bash -c 'cd /var/tmp/darkly-archlinux; makepkg -g >> PKGBUILD' 50 | - name: Build package 51 | run: | 52 | sudo -u builduser bash -c 'cd /var/tmp/darkly-archlinux; makepkg -s' 53 | zst_file=$(find /var/tmp/darkly-archlinux -name "*.zst*") 54 | publish_filename=darkly-${{ inputs.version }}-x86_64.pkg.zst 55 | mv "$zst_file" $publish_filename 56 | echo "ARTIFACT=$publish_filename" >> "$GITHUB_ENV" 57 | - name: Upload artifact 58 | uses: actions/upload-artifact@v5 59 | with: 60 | name: ${{ env.ARTIFACT }} 61 | path: ${{ env.ARTIFACT }} 62 | retention-days: 1 63 | 64 | -------------------------------------------------------------------------------- /.github/workflows/flatpak.yml: -------------------------------------------------------------------------------- 1 | # Flatpak build support 2 | on: 3 | workflow_call: 4 | inputs: 5 | cache-file-path: 6 | required: true 7 | type: string 8 | version: 9 | required: true 10 | type: string 11 | env: 12 | QT6_RUNTIME_VERSION: 6.9 13 | QT5_RUNTIME_VERSION: 5.15-24.08 14 | jobs: 15 | build: 16 | runs-on: ubuntu-24.04 17 | steps: 18 | - uses: actions/cache/restore@v4 19 | with: 20 | key: ${{ runner.os }}-v${{ inputs.version }}-${{ hashFiles(inputs.cache-file-path) }} 21 | path: ${{ inputs.cache-file-path }} 22 | fail-on-cache-miss: true 23 | - name: Install build dependencies 24 | run: | 25 | sudo apt update -y 26 | sudo apt dist-upgrade -y 27 | sudo apt install flatpak flatpak-builder git -y 28 | - name: Extract release tarball 29 | run: tar xvf ${{ inputs.cache-file-path }} 30 | - name: Flatpak remote-add flathub 31 | run: sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo 32 | - name: Flatpak build setup - QT6 33 | run: | 34 | sudo flatpak install org.kde.Sdk/x86_64/${{ env.QT6_RUNTIME_VERSION }} -y 35 | sudo flatpak install org.kde.Platform/x86_64/${{ env.QT6_RUNTIME_VERSION }} -y 36 | - name: Flatpak build setup - QT5 37 | run: | 38 | sudo flatpak install org.kde.Sdk/x86_64/${{ env.QT5_RUNTIME_VERSION }} -y 39 | sudo flatpak install org.kde.Platform/x86_64/${{ env.QT5_RUNTIME_VERSION }} -y 40 | - name: Flatpak build & bundle - QT6 41 | run: | 42 | sudo flatpak-builder flatpak-build --repo=local --force-clean --ccache Darkly-${{inputs.version}}/org.kde.KStyle.Darkly6.json 43 | sudo flatpak build-bundle local/ darkly-qt${{ env.QT6_RUNTIME_VERSION }}-${{ inputs.version }}-x86_64.flatpak runtime/org.kde.KStyle.Darkly/x86_64/${{ env.QT6_RUNTIME_VERSION }} 44 | - name: Flatpak build & bundle - QT5 45 | run: | 46 | sudo flatpak-builder flatpak-build --repo=local --force-clean --ccache Darkly-${{inputs.version}}/org.kde.KStyle.Darkly5.json 47 | sudo flatpak build-bundle local/ darkly-qt${{ env.QT5_RUNTIME_VERSION }}-${{ inputs.version }}-x86_64.flatpak runtime/org.kde.KStyle.Darkly/x86_64/${{ env.QT5_RUNTIME_VERSION }} 48 | - name: Upload artifact 49 | uses: actions/upload-artifact@v5 50 | with: 51 | name: darkly-flatpak 52 | path: | 53 | darkly-qt${{ env.QT6_RUNTIME_VERSION }}-${{ inputs.version }}-x86_64.flatpak 54 | darkly-qt${{ env.QT5_RUNTIME_VERSION }}-${{ inputs.version }}-x86_64.flatpak 55 | retention-days: 1 56 | -------------------------------------------------------------------------------- /kstyle/animations/darklydialengine.h: -------------------------------------------------------------------------------- 1 | #ifndef darklydialengine_h 2 | #define darklydialengine_h 3 | 4 | /************************************************************************* 5 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 21 | *************************************************************************/ 22 | 23 | #include "darklydialdata.h" 24 | #include "darklywidgetstateengine.h" 25 | 26 | namespace Darkly 27 | { 28 | 29 | //* stores dial hovered action and timeLine 30 | class DialEngine : public WidgetStateEngine 31 | { 32 | Q_OBJECT 33 | 34 | public: 35 | //* constructor 36 | explicit DialEngine(QObject *parent) 37 | : WidgetStateEngine(parent) 38 | { 39 | } 40 | 41 | //* destructor 42 | virtual ~DialEngine() 43 | { 44 | } 45 | 46 | //* register dial 47 | virtual bool registerWidget(QWidget *, AnimationModes); 48 | 49 | //* control rect 50 | virtual void setHandleRect(const QObject *object, const QRect &rect) 51 | { 52 | if (DataMap::Value data = this->data(object, AnimationHover)) { 53 | static_cast(data.data())->setHandleRect(rect); 54 | } 55 | } 56 | 57 | //* mouse position 58 | virtual QPoint position(const QObject *object) 59 | { 60 | if (DataMap::Value data = this->data(object, AnimationHover)) { 61 | return static_cast(data.data())->position(); 62 | 63 | } else 64 | return QPoint(-1, -1); 65 | } 66 | }; 67 | 68 | } 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /kstyle/animations/darklystackedwidgetengine.h: -------------------------------------------------------------------------------- 1 | #ifndef darklystackedwidgetengine_h 2 | #define darklystackedwidgetengine_h 3 | 4 | ////////////////////////////////////////////////////////////////////////////// 5 | // darklystackedwidgetengine.h 6 | // stores event filters and maps widgets to animations 7 | // ------------------- 8 | // 9 | // Copyright (c) 2009 Hugo Pereira Da Costa 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to 13 | // deal in the Software without restriction, including without limitation the 14 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 15 | // sell copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 27 | // IN THE SOFTWARE. 28 | ////////////////////////////////////////////////////////////////////////////// 29 | 30 | #include "darklybaseengine.h" 31 | #include "darklydatamap.h" 32 | #include "darklystackedwidgetdata.h" 33 | 34 | namespace Darkly 35 | { 36 | 37 | //* used for simple widgets 38 | class StackedWidgetEngine : public BaseEngine 39 | { 40 | Q_OBJECT 41 | 42 | public: 43 | //* constructor 44 | explicit StackedWidgetEngine(QObject *parent) 45 | : BaseEngine(parent) 46 | { 47 | } 48 | 49 | //* register widget 50 | bool registerWidget(QStackedWidget *); 51 | 52 | //* duration 53 | void setEnabled(bool value) override 54 | { 55 | BaseEngine::setEnabled(value); 56 | _data.setEnabled(value); 57 | } 58 | 59 | //* duration 60 | void setDuration(int value) override 61 | { 62 | BaseEngine::setDuration(value); 63 | _data.setDuration(value); 64 | } 65 | 66 | public Q_SLOTS: 67 | 68 | //* remove widget from map 69 | bool unregisterWidget(QObject *object) override 70 | { 71 | return _data.unregisterWidget(object); 72 | } 73 | 74 | private: 75 | //* maps 76 | DataMap _data; 77 | }; 78 | 79 | } 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /kdecoration/darklyexceptionlist.h: -------------------------------------------------------------------------------- 1 | #ifndef darklyexceptionlist_h 2 | #define darklyexceptionlist_h 3 | 4 | ////////////////////////////////////////////////////////////////////////////// 5 | // darklyexceptionlist.h 6 | // window decoration exceptions 7 | // ------------------- 8 | // 9 | // Copyright (c) 2009 Hugo Pereira Da Costa 10 | // 11 | // Permission is hereby granted, free of charge, to any person obtaining a copy 12 | // of this software and associated documentation files (the "Software"), to 13 | // deal in the Software without restriction, including without limitation the 14 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 15 | // sell copies of the Software, and to permit persons to whom the Software is 16 | // furnished to do so, subject to the following conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be included in 19 | // all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 27 | // IN THE SOFTWARE. 28 | ////////////////////////////////////////////////////////////////////////////// 29 | 30 | #pragma once 31 | #include "darkly.h" 32 | #include "darklysettings.h" 33 | 34 | #include 35 | 36 | namespace Darkly 37 | { 38 | 39 | //! darkly exceptions list 40 | class ExceptionList 41 | { 42 | public: 43 | //! constructor from list 44 | explicit ExceptionList(const InternalSettingsList &exceptions = InternalSettingsList()) 45 | : _exceptions(exceptions) 46 | { 47 | } 48 | 49 | //! exceptions 50 | const InternalSettingsList &get(void) const 51 | { 52 | return _exceptions; 53 | } 54 | 55 | //! read from KConfig 56 | void readConfig(KSharedConfig::Ptr); 57 | 58 | //! write to kconfig 59 | void writeConfig(KSharedConfig::Ptr); 60 | 61 | protected: 62 | //! generate exception group name for given exception index 63 | static QString exceptionGroupName(int index); 64 | 65 | //! read configuration 66 | static void readConfig(KCoreConfigSkeleton *, KConfig *, const QString &); 67 | 68 | //! write configuration 69 | static void writeConfig(KCoreConfigSkeleton *, KConfig *, const QString &); 70 | 71 | private: 72 | //! exceptions 73 | InternalSettingsList _exceptions; 74 | }; 75 | 76 | } 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /kdecoration/config/darklyexceptionmodel.h: -------------------------------------------------------------------------------- 1 | #ifndef darklyexceptionmodel_h 2 | #define darklyexceptionmodel_h 3 | ////////////////////////////////////////////////////////////////////////////// 4 | // darklyexceptionmodel.h 5 | // ------------------- 6 | // 7 | // Copyright (c) 2009 Hugo Pereira Da Costa 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to 11 | // deal in the Software without restriction, including without limitation the 12 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 13 | // sell copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 25 | // IN THE SOFTWARE. 26 | ////////////////////////////////////////////////////////////////////////////// 27 | 28 | #include "darkly.h" 29 | #include "darklylistmodel.h" 30 | #include "darklysettings.h" 31 | 32 | namespace Darkly 33 | { 34 | 35 | //* qlistview for object counters 36 | class ExceptionModel : public ListModel 37 | { 38 | public: 39 | //* number of columns 40 | enum { 41 | nColumns = 3 42 | }; 43 | 44 | //* column type enumeration 45 | enum ColumnType { 46 | ColumnEnabled, 47 | ColumnType, 48 | ColumnRegExp 49 | }; 50 | 51 | //*@name methods reimplemented from base class 52 | //@{ 53 | 54 | //* return data for a given index 55 | QVariant data(const QModelIndex &index, int role) const override; 56 | 57 | //* header data 58 | QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; 59 | 60 | //* number of columns for a given index 61 | int columnCount(const QModelIndex &) const override 62 | { 63 | return nColumns; 64 | } 65 | 66 | //@} 67 | 68 | protected: 69 | //* sort 70 | void privateSort(int, Qt::SortOrder) override 71 | { 72 | } 73 | 74 | private: 75 | //* column titles 76 | static const QString m_columnTitles[nColumns]; 77 | }; 78 | 79 | } 80 | #endif 81 | -------------------------------------------------------------------------------- /kstyle/animations/darklygenericdata.h: -------------------------------------------------------------------------------- 1 | #ifndef darklygeneric_data_h 2 | #define darklygeneric_data_h 3 | 4 | /************************************************************************* 5 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 21 | *************************************************************************/ 22 | 23 | #include "darklyanimation.h" 24 | #include "darklyanimationdata.h" 25 | 26 | #include 27 | #include 28 | namespace Darkly 29 | { 30 | 31 | //* generic data 32 | class GenericData : public AnimationData 33 | { 34 | Q_OBJECT 35 | 36 | //* declare opacity property 37 | Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity) 38 | 39 | public: 40 | //* constructor 41 | GenericData(QObject *parent, QWidget *widget, int duration); 42 | 43 | //* return animation object 44 | const Animation::Pointer &animation() const 45 | { 46 | return _animation; 47 | } 48 | 49 | //* duration 50 | void setDuration(int duration) override 51 | { 52 | _animation.data()->setDuration(duration); 53 | } 54 | 55 | //* opacity 56 | qreal opacity() const 57 | { 58 | return _opacity; 59 | } 60 | 61 | //* opacity 62 | void setOpacity(qreal value) 63 | { 64 | value = digitize(value); 65 | if (_opacity == value) 66 | return; 67 | 68 | _opacity = value; 69 | setDirty(); 70 | } 71 | 72 | private: 73 | //* animation handling 74 | Animation::Pointer _animation; 75 | 76 | //* opacity variable 77 | qreal _opacity = 0; 78 | }; 79 | 80 | } 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /.github/workflows/opensuse-tw.yml: -------------------------------------------------------------------------------- 1 | # openSUSE Tumbleweed 2 | # Build Darkly from release tag and publish .rpm package 3 | 4 | on: 5 | workflow_call: 6 | inputs: 7 | cache-file-path: 8 | required: true 9 | type: string 10 | version: 11 | required: true 12 | type: string 13 | jobs: 14 | build: 15 | runs-on: ubuntu-24.04 16 | container: opensuse/tumbleweed:latest 17 | steps: 18 | - name: Install build dependencies 19 | run: | 20 | zypper in -y zstd rpm-build cmake gcc-c++ extra-cmake-modules ki18n-devel frameworkintegration-devel kguiaddons-devel \ 21 | kcmutils-devel kwindowsystem-devel libqt5-qtquick3d-devel kirigami2-devel libKF5I18n5 \ 22 | kdecoration6-devel kf6-kconfig-devel kf6-kconfigwidgets-devel \ 23 | kf6-kcoreaddons-devel kf6-frameworkintegration-devel kf6-kcmutils-devel \ 24 | kf6-kwindowsystem-devel kwayland6-devel libplasma6-devel kf6-kirigami-devel fdupes qt6-quickwidgets-devel 25 | - uses: actions/cache/restore@v4 26 | id: cache 27 | with: 28 | key: ${{ runner.os }}-v${{ inputs.version }}-${{ hashFiles(inputs.cache-file-path) }} 29 | path: ${{ inputs.cache-file-path }} 30 | fail-on-cache-miss: true 31 | - name: Extract tarball 32 | run: tar xf ${{ inputs.cache-file-path }} 33 | - name: Build source 34 | run: | 35 | cmake_opts=( 36 | -B Darkly-${{ inputs.version }}/build 37 | -S Darkly-${{ inputs.version }} 38 | -DBUILD_RPMS=ON 39 | ) 40 | echo "${cmake_opts[@]}" 41 | cmake "${cmake_opts[@]}" && cmake --build Darkly-${{ inputs.version }}/build -j$(nproc) && echo "Build completed!" || echo "Build failed!" || exit 1 42 | - name: Build RPM package 43 | id: step_build 44 | run: | 45 | cd Darkly-${{ inputs.version }}/build; cpack -G RPM -V -DCPACK_THREADS=$(nproc) 46 | artifact=$GITHUB_WORKSPACE/Darkly-${{ inputs.version }}/packages/darkly-${{ inputs.version }}.x86_64.rpm 47 | publish_filename=darkly-${{ inputs.version }}.openSUSE-tumbleweed.x86_64.rpm 48 | echo "Moving file to $GITHUB_WORKSPACE/$publish_filename" 49 | mv $artifact $GITHUB_WORKSPACE/$publish_filename 50 | echo "ARTIFACT=$publish_filename" >> "$GITHUB_ENV" 51 | SHA256SUM=$(sha256sum $GITHUB_WORKSPACE/$publish_filename | awk '{ print $1 }') 52 | echo "ARTIFACT = $publish_filename | SHA256SUM = $SHA256SUM" 53 | echo "SHA256SUM=$SHA256SUM" >> "$GITHUB_ENV" 54 | - name: Publish RPM 55 | if: ${{ env.SHA256SUM != '' }} 56 | uses: actions/upload-artifact@v5 57 | with: 58 | name: ${{ env.ARTIFACT }} 59 | path: ${{ env.ARTIFACT }} 60 | retention-days: 1 61 | -------------------------------------------------------------------------------- /.github/workflows/neon.yml: -------------------------------------------------------------------------------- 1 | # KDE Neon 2 | # Requires a custom docker container 3 | # The Dockerfile is inside .github/assets/docker/kde-neon 4 | # Build Darkly from release tag and publish .deb package 5 | 6 | on: 7 | workflow_call: 8 | inputs: 9 | cache-file-path: 10 | required: true 11 | type: string 12 | version: 13 | required: true 14 | type: string 15 | jobs: 16 | build: 17 | runs-on: ubuntu-24.04 18 | container: deltacopy/darkly-kde-neon:0.2 19 | defaults: 20 | run: 21 | shell: bash 22 | steps: 23 | - uses: actions/cache/restore@v4 24 | id: cache 25 | with: 26 | key: ${{ runner.os }}-v${{ inputs.version }}-${{ hashFiles(inputs.cache-file-path) }} 27 | path: ${{ inputs.cache-file-path }} 28 | fail-on-cache-miss: true 29 | - name: Run update 30 | run: apt update -y 31 | - name: Run dist dist-upgrade 32 | run: apt dist-upgrade -y 33 | - name: Install extra build dependencies 34 | run: | 35 | apt install -y -qq libkf5coreaddons-dev libkf5configwidgets-dev libkf5iconthemes-dev \ 36 | libkf5windowsystem-dev libkf5kcmutils-dev libkf6style6 \ 37 | qtdeclarative5-dev libkf5style-dev 38 | - name: Extract release tarball 39 | run: | 40 | tar xvf ${{ inputs.cache-file-path }} 41 | - name: Build Darkly 42 | run: | 43 | cmake_opts=( 44 | -B Darkly-${{ inputs.version }}/build 45 | -S Darkly-${{ inputs.version }} 46 | -DBUILD_DEBS=ON 47 | ) 48 | echo "${cmake_opts[@]}" 49 | cmake "${cmake_opts[@]}" && cmake --build Darkly-${{ inputs.version }}/build -j$(nproc) && echo "Build completed!" || echo "Build failed!" || exit 1 50 | - name: Build DEB 51 | id: step_build 52 | run: | 53 | cd Darkly-${{ inputs.version }}/build; cpack -G DEB -V -DCPACK_THREADS=$(nproc) 54 | artifact=$GITHUB_WORKSPACE/Darkly-${{ inputs.version }}/packages/darkly-${{ inputs.version }}_amd64.deb 55 | publish_filename=darkly-${{ inputs.version }}_kdeneon_amd64.deb 56 | echo "Moving file to $GITHUB_WORKSPACE/$publish_filename" 57 | mv $artifact $GITHUB_WORKSPACE/$publish_filename 58 | echo "ARTIFACT=$publish_filename" >> "$GITHUB_ENV" 59 | SHA256SUM=$(sha256sum $GITHUB_WORKSPACE/$publish_filename | awk '{ print $1 }') 60 | echo "ARTIFACT = $publish_filename | SHA256SUM = $SHA256SUM" 61 | echo "SHA256SUM=$SHA256SUM" >> "$GITHUB_ENV" 62 | - name: Publish DEB 63 | if: ${{ env.SHA256SUM != '' }} 64 | uses: actions/upload-artifact@v5 65 | with: 66 | name: ${{ env.ARTIFACT }} 67 | path: ${{ env.ARTIFACT }} 68 | retention-days: 1 69 | -------------------------------------------------------------------------------- /kdecoration/config/darklyconfigwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef darklyconfigwidget_h 2 | #define darklyconfigwidget_h 3 | ////////////////////////////////////////////////////////////////////////////// 4 | // darklyconfigurationui.h 5 | // ------------------- 6 | // 7 | // Copyright (c) 2009 Hugo Pereira Da Costa 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to 11 | // deal in the Software without restriction, including without limitation the 12 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 13 | // sell copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 25 | // IN THE SOFTWARE. 26 | ////////////////////////////////////////////////////////////////////////////// 27 | 28 | #include "darkly.h" 29 | #include "darklyexceptionlistwidget.h" 30 | #include "darklysettings.h" 31 | #include "ui_darklyconfigurationui.h" 32 | 33 | #include 34 | #include 35 | 36 | #include 37 | #include 38 | 39 | namespace Darkly 40 | { 41 | 42 | //_____________________________________________ 43 | class ConfigWidget : public KCModule 44 | { 45 | Q_OBJECT 46 | 47 | public: 48 | //* constructor 49 | explicit ConfigWidget(QObject *parent, const KPluginMetaData &data, const QVariantList &args); 50 | 51 | //* destructor 52 | virtual ~ConfigWidget() = default; 53 | 54 | //* default 55 | void defaults() override; 56 | 57 | //* load configuration 58 | void load() override; 59 | 60 | //* save configuration 61 | void save() override; 62 | 63 | protected Q_SLOTS: 64 | 65 | //* update changed state 66 | virtual void updateChanged(); 67 | 68 | protected: 69 | //* set changed state 70 | void setChanged(bool); 71 | 72 | private: 73 | //* ui 74 | Ui_DarklyConfigurationUI m_ui; 75 | 76 | //* kconfiguration object 77 | KSharedConfig::Ptr m_configuration; 78 | 79 | //* internal exception 80 | InternalSettingsPtr m_internalSettings; 81 | 82 | //* changed state 83 | bool m_changed; 84 | }; 85 | 86 | } 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /libdarklycommon/darklyboxshadowrenderer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Vlad Zahorodnii 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #pragma once 20 | 21 | // Qt 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | namespace Darkly 28 | { 29 | class BoxShadowRenderer 30 | { 31 | public: 32 | // Compiler generated constructors & destructor are fine. 33 | 34 | /** 35 | * Set the size of the box. 36 | * @param size The size of the box. 37 | **/ 38 | void setBoxSize(const QSizeF &size); 39 | 40 | /** 41 | * Set the radius of box' corners. 42 | * @param radius The border radius, in pixels. 43 | **/ 44 | void setBorderRadius(qreal radius); 45 | 46 | /** 47 | * Add a shadow. 48 | * @param offset The offset of the shadow. 49 | * @param radius The blur radius. 50 | * @param color The color of the shadow. 51 | **/ 52 | void addShadow(const QPointF &offset, double radius, const QColor &color); 53 | 54 | /** 55 | * Render the shadow. 56 | **/ 57 | QImage render() const; 58 | 59 | /** 60 | * Calculate the minimum size of the box. 61 | * 62 | * This helper computes the minimum size of the box so the shadow behind it has 63 | * full its strength. 64 | * 65 | * @param radius The blur radius of the shadow. 66 | **/ 67 | static QSize calculateMinimumBoxSize(int radius); 68 | 69 | /** 70 | * Calculate the minimum size of the shadow texture. 71 | * 72 | * This helper computes the minimum size of the resulting texture so the shadow 73 | * is not clipped. 74 | * 75 | * @param boxSize The size of the box. 76 | * @param radius The blur radius. 77 | * @param offset The offset of the shadow. 78 | **/ 79 | static QSizeF calculateMinimumShadowTextureSize(const QSizeF &boxSize, double radius, const QPointF &offset); 80 | 81 | private: 82 | QSizeF m_boxSize; 83 | qreal m_borderRadius = 0.0; 84 | 85 | struct Shadow { 86 | QPointF offset; 87 | double radius; 88 | QColor color; 89 | }; 90 | 91 | QVector m_shadows; 92 | }; 93 | 94 | } // namespace Darkly 95 | -------------------------------------------------------------------------------- /kstyle/animations/darklybaseengine.h: -------------------------------------------------------------------------------- 1 | #ifndef darklybaseengine_h 2 | #define darklybaseengine_h 3 | 4 | /************************************************************************* 5 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 21 | *************************************************************************/ 22 | 23 | #include "darkly.h" 24 | 25 | #include 26 | #include 27 | 28 | namespace Darkly 29 | { 30 | 31 | //* base class for all animation engines 32 | /** it is used to store configuration values used by all animations stored in the engine */ 33 | class BaseEngine : public QObject 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | using Pointer = WeakPointer; 39 | 40 | //* constructor 41 | explicit BaseEngine(QObject *parent) 42 | : QObject(parent) 43 | { 44 | } 45 | 46 | //* enability 47 | virtual void setEnabled(bool value) 48 | { 49 | _enabled = value; 50 | } 51 | 52 | //* enability 53 | virtual bool enabled() const 54 | { 55 | return _enabled; 56 | } 57 | 58 | //* duration 59 | virtual void setDuration(int value) 60 | { 61 | _duration = value; 62 | } 63 | 64 | //* duration 65 | virtual int duration() const 66 | { 67 | return _duration; 68 | } 69 | 70 | //* unregister widget 71 | virtual bool unregisterWidget(QObject *object) = 0; 72 | 73 | //* list of widgets 74 | using WidgetList = QSet; 75 | 76 | //* returns registered widgets 77 | virtual WidgetList registeredWidgets() const 78 | { 79 | return WidgetList(); 80 | } 81 | 82 | private: 83 | //* engine enability 84 | bool _enabled = true; 85 | 86 | //* animation duration 87 | int _duration = 200; 88 | }; 89 | 90 | } 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /.github/workflows/debian14.yml: -------------------------------------------------------------------------------- 1 | # Debian testing edition (forky) 2 | 3 | on: 4 | workflow_call: 5 | inputs: 6 | cache-file-path: 7 | required: true 8 | type: string 9 | version: 10 | required: true 11 | type: string 12 | env: 13 | DEBIAN_RELEASE: "14" 14 | jobs: 15 | build: 16 | runs-on: ubuntu-24.04 17 | container: debian:forky 18 | defaults: 19 | run: 20 | shell: bash 21 | steps: 22 | - name: Install build dependencies 23 | run: | 24 | apt update -y 25 | apt dist-upgrade -y 26 | apt install -y -qq zstd cmake build-essential libkf5config-dev libkdecorations3-dev \ 27 | libqt5x11extras5-dev qtdeclarative5-dev extra-cmake-modules \ 28 | libkf5guiaddons-dev libkf5configwidgets-dev libkf5windowsystem-dev kirigami2-dev \ 29 | libkf5coreaddons-dev libkf5iconthemes-dev gettext qt3d5-dev libkf5kcmutils-dev \ 30 | qt6-base-dev libkf6coreaddons-dev libkf6colorscheme-dev \ 31 | libkf6config-dev libkf6guiaddons-dev libkf6i18n-dev libkf6iconthemes-dev \ 32 | libkf6windowsystem-dev libkf6kcmutils-dev libkirigami-dev libkf6style-dev 33 | - uses: actions/cache/restore@v4 34 | with: 35 | key: ${{ runner.os }}-v${{ inputs.version }}-${{ hashFiles(inputs.cache-file-path) }} 36 | path: ${{ inputs.cache-file-path }} 37 | fail-on-cache-miss: true 38 | - name: Extract release tarball 39 | run: tar xvf ${{ inputs.cache-file-path }} 40 | - name: Build Darkly 41 | run: | 42 | cmake_opts=( 43 | -B build_kf6 44 | -S Darkly-${{inputs.version}} 45 | -DBUILD_DEBS=ON 46 | ) 47 | echo "${cmake_opts[@]}" 48 | cmake "${cmake_opts[@]}" && cmake --build build_kf6 -j$(nproc) && echo "Build completed!" || echo "Build failed!" || exit 1 49 | - name: Build DEB package 50 | id: create_deb_package 51 | run: | 52 | cd build_kf6; cpack -G DEB -V -DCPACK_THREADS=$(nproc) 53 | artifact=$GITHUB_WORKSPACE/Darkly-${{ inputs.version }}/packages/darkly-${{ inputs.version }}_amd64.deb 54 | publish_filename="darkly-${{ inputs.version }}_debian${{ env.DEBIAN_RELEASE }}_amd64.deb" 55 | echo "Moving file to $GITHUB_WORKSPACE/$publish_filename" 56 | mv $artifact $GITHUB_WORKSPACE/$publish_filename 57 | echo "ARTIFACT=$publish_filename" >> "$GITHUB_ENV" 58 | SHA256SUM=$(sha256sum $GITHUB_WORKSPACE/$publish_filename | awk '{ print $1 }') 59 | echo "ARTIFACT = $publish_filename | SHA256SUM = $SHA256SUM" 60 | echo "SHA256SUM=$SHA256SUM" >> "$GITHUB_ENV" 61 | - name: Publish DEB 62 | if: ${{ env.SHA256SUM != '' }} 63 | uses: actions/upload-artifact@v5 64 | with: 65 | name: ${{ env.ARTIFACT }} 66 | path: ${{ env.ARTIFACT }} 67 | retention-days: 1 68 | -------------------------------------------------------------------------------- /kstyle/animations/darklywidgetstatedata.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 18 | *************************************************************************/ 19 | 20 | #include "darklywidgetstatedata.h" 21 | #include "darklystyleconfigdata.h" 22 | 23 | namespace Darkly 24 | { 25 | 26 | //______________________________________________ 27 | bool WidgetStateData::updateState(bool value, AnimationParameters parameters) 28 | { 29 | if (!_initialized) { 30 | _state = value; 31 | _initialized = true; 32 | return false; 33 | 34 | } else if (_state == value) { 35 | return false; 36 | 37 | } else { 38 | _state = value; 39 | animation().data()->setDirection((parameters & AnimationForwardOnly) ? Animation::Forward : _state ? Animation::Forward : Animation::Backward); 40 | if (parameters & AnimationOutBack) 41 | animation().data()->setEasingCurve(_state ? QEasingCurve::OutBack : QEasingCurve::InQuint); 42 | else 43 | animation().data()->setEasingCurve((parameters & AnimationForwardOnly) ? QEasingCurve::OutQuint 44 | : _state ? QEasingCurve::OutQuint 45 | : QEasingCurve::InQuint); 46 | 47 | if ((parameters & AnimationLongDuration)) 48 | animation().data()->setDuration(StyleConfigData::animationsDuration() * 3); // FIXME find a better way to set the duration 49 | 50 | if (!animation().data()->isRunning()) 51 | animation().data()->start(); 52 | else if (_state && (parameters & AnimationForwardOnly)) 53 | animation().data()->restart(); 54 | return true; 55 | } 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /.github/workflows/kubuntu.yml: -------------------------------------------------------------------------------- 1 | # Kubuntu 2 | # Requires a custom docker container 3 | # The Dockerfile is inside .github/assets/docker/kubuntu 4 | # Build Darkly from release tag and publish .deb package 5 | 6 | on: 7 | workflow_call: 8 | inputs: 9 | cache-file-path: 10 | required: true 11 | type: string 12 | version: 13 | required: true 14 | type: string 15 | env: 16 | KUBUNTU_RELEASE: "25.10" 17 | jobs: 18 | build: 19 | runs-on: ubuntu-24.04 20 | container: deltacopy/kubuntu:25.10 21 | steps: 22 | - uses: actions/cache/restore@v4 23 | with: 24 | key: ${{ runner.os }}-v${{ inputs.version }}-${{ hashFiles(inputs.cache-file-path) }} 25 | path: ${{ inputs.cache-file-path }} 26 | fail-on-cache-miss: true 27 | - name: Install build dependencies 28 | run: | 29 | apt update -y 30 | apt dist-upgrade -y 31 | apt install -y -qq cmake build-essential libkf5config-dev libkdecorations3-dev \ 32 | libqt5x11extras5-dev qtdeclarative5-dev extra-cmake-modules \ 33 | libkf5guiaddons-dev libkf5configwidgets-dev libkf5windowsystem-dev kirigami2-dev \ 34 | libkf5coreaddons-dev libkf5iconthemes-dev gettext qt3d5-dev libkf5kcmutils-dev \ 35 | qt6-base-dev libkf6coreaddons-dev libkf6colorscheme-dev \ 36 | libkf6config-dev libkf6guiaddons-dev libkf6i18n-dev libkf6iconthemes-dev \ 37 | libkf6windowsystem-dev libkf6kcmutils-dev libkirigami-dev libkf6style-dev 38 | - name: Extract release tarball 39 | run: tar xvf ${{ inputs.cache-file-path }} 40 | - name: Build Darkly 41 | run: | 42 | cmake_opts=( 43 | -B build_kf6 44 | -S Darkly-${{inputs.version}} 45 | -DBUILD_DEBS=ON 46 | ) 47 | echo "${cmake_opts[@]}" 48 | cmake "${cmake_opts[@]}" && cmake --build build_kf6 -j$(nproc) && echo "Build completed!" || echo "Build failed!" || exit 1 49 | - name: Build DEB package 50 | id: create_deb_package 51 | run: | 52 | cd build_kf6; cpack -G DEB -V -DCPACK_THREADS=$(nproc) 53 | artifact=$GITHUB_WORKSPACE/Darkly-${{ inputs.version }}/packages/darkly-${{ inputs.version }}_amd64.deb 54 | publish_filename="darkly-${{ inputs.version }}_kubuntu-${{ env.KUBUNTU_RELEASE }}_amd64.deb" 55 | echo "Moving file to $GITHUB_WORKSPACE/$publish_filename" 56 | mv $artifact $GITHUB_WORKSPACE/$publish_filename 57 | echo "ARTIFACT=$publish_filename" >> "$GITHUB_ENV" 58 | SHA256SUM=$(sha256sum $GITHUB_WORKSPACE/$publish_filename | awk '{ print $1 }') 59 | echo "ARTIFACT = $publish_filename | SHA256SUM = $SHA256SUM" 60 | echo "SHA256SUM=$SHA256SUM" >> "$GITHUB_ENV" 61 | - name: Publish DEB 62 | if: ${{ env.SHA256SUM != '' }} 63 | uses: actions/upload-artifact@v5 64 | with: 65 | name: ${{ env.ARTIFACT }} 66 | path: ${{ env.ARTIFACT }} 67 | retention-days: 1 68 | -------------------------------------------------------------------------------- /kstyle/animations/darklybusyindicatorengine.h: -------------------------------------------------------------------------------- 1 | #ifndef darklybusyindicatorengine_h 2 | #define darklybusyindicatorengine_h 3 | 4 | /************************************************************************* 5 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 21 | *************************************************************************/ 22 | 23 | #include "darklyanimation.h" 24 | #include "darklybaseengine.h" 25 | #include "darklybusyindicatordata.h" 26 | #include "darklydatamap.h" 27 | 28 | namespace Darkly 29 | { 30 | 31 | //* handles progress bar animations 32 | class BusyIndicatorEngine : public BaseEngine 33 | { 34 | Q_OBJECT 35 | 36 | //* declare opacity property 37 | Q_PROPERTY(int value READ value WRITE setValue) 38 | 39 | public: 40 | //* constructor 41 | explicit BusyIndicatorEngine(QObject *); 42 | 43 | //*@name accessors 44 | //@{ 45 | 46 | //* true if widget is animated 47 | bool isAnimated(const QObject *); 48 | 49 | //* value 50 | int value() const 51 | { 52 | return _value; 53 | } 54 | 55 | //@} 56 | 57 | //*@name modifiers 58 | //@{ 59 | 60 | //* register progressbar 61 | bool registerWidget(QObject *); 62 | 63 | //* duration 64 | void setDuration(int) override; 65 | 66 | //* set object as animated 67 | void setAnimated(const QObject *, bool); 68 | 69 | //* opacity 70 | void setValue(int value); 71 | 72 | //@} 73 | 74 | public Q_SLOTS: 75 | 76 | //* remove widget from map 77 | bool unregisterWidget(QObject *) override; 78 | 79 | protected: 80 | //* returns data associated to widget 81 | DataMap::Value data(const QObject *); 82 | 83 | private: 84 | //* map widgets to progressbar data 85 | DataMap _data; 86 | 87 | //* animation 88 | Animation::Pointer _animation; 89 | 90 | //* value 91 | int _value = 0; 92 | }; 93 | 94 | } 95 | 96 | #endif 97 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: File a bug report. 3 | title: "[Bug]: " 4 | labels: ["bug"] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | Thanks for taking the time to fill out this bug report! 10 | - type: textarea 11 | id: what-happened-bug-info 12 | attributes: 13 | label: Describe the bug 14 | description: A clear and concise description of what the bug is. 15 | placeholder: "A clear and concise description helps us understand what the bug is." 16 | validations: 17 | required: true 18 | - type: textarea 19 | id: version-darkly-release 20 | attributes: 21 | label: Darkly theme version 22 | description: State the Darkly theme version where you are encountering an issue. 23 | placeholder: ".e.g. darkly 0.5.25" 24 | validations: 25 | required: true 26 | - type: textarea 27 | id: version-plasma 28 | attributes: 29 | label: Plasma version 30 | description: Which version of Plasma are you using? 31 | placeholder: "e.g. Plasma 6.5.0" 32 | validations: 33 | required: true 34 | - type: textarea 35 | id: version-qt 36 | attributes: 37 | label: Qt version 38 | description: Which version of Qt are you using? 39 | placeholder: "e.g. Qt 6.9" 40 | validations: 41 | required: true 42 | - type: textarea 43 | id: what-happened-bug-screenshot 44 | attributes: 45 | label: Add screenshot 46 | description: If applicable add screenshots to help explain the problem. 47 | placeholder: Adding screenshots help explain the problem. 48 | validations: 49 | required: true 50 | - type: textarea 51 | id: distribution 52 | attributes: 53 | label: Which distribution are you using? 54 | description: Linux distribution in use? 55 | placeholder: ".e.g Arch Linux" 56 | validations: 57 | required: true 58 | - type: textarea 59 | id: color-scheme 60 | attributes: 61 | label: Which color-scheme are you using? 62 | description: The color-scheme in use 63 | placeholder: "Provide the name of the color-scheme, and if applicable a link to download the color-scheme" 64 | validations: 65 | required: true 66 | - type: dropdown 67 | id: session 68 | attributes: 69 | label: Wayland / X11 session in use? 70 | description: Are you using Wayland / X11? 71 | options: 72 | - Wayland 73 | - X11 74 | default: 0 75 | validations: 76 | required: true 77 | - type: dropdown 78 | id: fractional-scaling 79 | attributes: 80 | label: Is fractional scaling being used? 81 | description: Fractional scaling in use? 82 | options: 83 | - y 84 | - n 85 | default: 1 86 | validations: 87 | required: true 88 | - type: textarea 89 | id: additional-info 90 | attributes: 91 | label: Add any other context about the bug here 92 | description: Add any other context about the bug here 93 | placeholder: "Additional information which is relevant about the bug" 94 | validations: 95 | required: false 96 | -------------------------------------------------------------------------------- /kstyle/darklymnemonics.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 18 | *************************************************************************/ 19 | 20 | #include "darklymnemonics.h" 21 | 22 | #include 23 | #include 24 | 25 | namespace Darkly 26 | { 27 | 28 | //____________________________________________________ 29 | void Mnemonics::setMode(int mode) 30 | { 31 | switch (mode) { 32 | case StyleConfigData::MN_NEVER: 33 | qApp->removeEventFilter(this); 34 | setEnabled(false); 35 | break; 36 | 37 | default: 38 | case StyleConfigData::MN_ALWAYS: 39 | qApp->removeEventFilter(this); 40 | setEnabled(true); 41 | break; 42 | 43 | case StyleConfigData::MN_AUTO: 44 | qApp->removeEventFilter(this); 45 | qApp->installEventFilter(this); 46 | setEnabled(false); 47 | break; 48 | } 49 | } 50 | 51 | //____________________________________________________ 52 | bool Mnemonics::eventFilter(QObject *, QEvent *event) 53 | { 54 | switch (event->type()) { 55 | case QEvent::KeyPress: 56 | if (static_cast(event)->key() == Qt::Key_Alt) { 57 | setEnabled(true); 58 | } 59 | break; 60 | 61 | case QEvent::KeyRelease: 62 | if (static_cast(event)->key() == Qt::Key_Alt) { 63 | setEnabled(false); 64 | } 65 | break; 66 | 67 | case QEvent::ApplicationStateChange: { 68 | setEnabled(false); 69 | } break; 70 | 71 | default: 72 | break; 73 | } 74 | 75 | return false; 76 | } 77 | 78 | //____________________________________________________ 79 | void Mnemonics::setEnabled(bool value) 80 | { 81 | if (_enabled == value) 82 | return; 83 | 84 | _enabled = value; 85 | 86 | // update all top level widgets 87 | foreach (QWidget *widget, qApp->topLevelWidgets()) { 88 | widget->update(); 89 | } 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /kstyle/darklyblurhelper.h: -------------------------------------------------------------------------------- 1 | #ifndef darklyblurhelper_h 2 | #define darklyblurhelper_h 3 | 4 | ////////////////////////////////////////////////////////////////////////////// 5 | // darklyblurhelper.h 6 | // handle regions passed to kwin for blurring 7 | // ------------------- 8 | // 9 | // Copyright (C) 2018 Alex Nemeth 10 | // 11 | // Largely rewritten from Oxygen widget style 12 | // Copyright (C) 2007 Thomas Luebking 13 | // Copyright (c) 2010 Hugo Pereira Da Costa 14 | // 15 | // Permission is hereby granted, free of charge, to any person obtaining a copy 16 | // of this software and associated documentation files (the "Software"), to 17 | // deal in the Software without restriction, including without limitation the 18 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 19 | // sell copies of the Software, and to permit persons to whom the Software is 20 | // furnished to do so, subject to the following conditions: 21 | // 22 | // The above copyright notice and this permission notice shall be included in 23 | // all copies or substantial portions of the Software. 24 | // 25 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 26 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 27 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 28 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 29 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 30 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 31 | // IN THE SOFTWARE. 32 | ////////////////////////////////////////////////////////////////////////////// 33 | 34 | #include "darkly.h" 35 | #include "darklyhelper.h" 36 | 37 | #include 38 | #include 39 | #include 40 | 41 | namespace Darkly 42 | { 43 | class BlurHelper : public QObject 44 | { 45 | Q_OBJECT 46 | 47 | public: 48 | //! constructor 49 | BlurHelper(QObject *); 50 | 51 | //! register widget 52 | void registerWidget(QWidget *, const bool isDolphin); 53 | 54 | //! register widget 55 | void unregisterWidget(QWidget *); 56 | 57 | //! event filter 58 | bool eventFilter(QObject *, QEvent *) override; 59 | 60 | //! force update 61 | void forceUpdate(QWidget *widget) 62 | { 63 | if (widget->isWindow()) 64 | update(widget); 65 | } 66 | 67 | void setTranslucentTitlebar(bool value) 68 | { 69 | _translucentTitlebar = value; 70 | } 71 | 72 | protected: 73 | //! install event filter to object, in a unique way 74 | void addEventFilter(QObject *object) 75 | { 76 | object->removeEventFilter(this); 77 | object->installEventFilter(this); 78 | } 79 | 80 | //! handle blur region 81 | QRegion blurRegion(QWidget *widget) const; 82 | 83 | QRegion blurTabWidgetRegion(QWidget *widget) const; 84 | 85 | QRegion blurSettingsDialogRegion(QWidget *widget) const; 86 | 87 | //! update blur regions for given widget 88 | void update(QWidget *) const; 89 | 90 | private: 91 | bool _isDolphin = false; 92 | bool _translucentTitlebar = false; 93 | }; 94 | 95 | } 96 | 97 | #endif 98 | -------------------------------------------------------------------------------- /colors/Darkly.colors: -------------------------------------------------------------------------------- 1 | [ColorEffects:Disabled] 2 | Color=36,36,36 3 | ColorAmount=0.5 4 | ColorEffect=3 5 | ContrastAmount=0.5 6 | ContrastEffect=0 7 | IntensityAmount=0 8 | IntensityEffect=0 9 | 10 | [ColorEffects:Inactive] 11 | ChangeSelectionColor=true 12 | Color=51,51,51 13 | ColorAmount=0.4 14 | ColorEffect=3 15 | ContrastAmount=0.4 16 | ContrastEffect=0 17 | Enable=true 18 | IntensityAmount=-0.2 19 | IntensityEffect=0 20 | 21 | [Colors:Button] 22 | BackgroundAlternate=77,77,77 23 | BackgroundNormal=50,50,50 24 | DecorationFocus=52,120,218 25 | DecorationHover=0,161,236 26 | ForegroundActive=61,174,233 27 | ForegroundInactive=199,199,199 28 | ForegroundLink=0,100,255 29 | ForegroundNegative=218,68,83 30 | ForegroundNeutral=246,116,0 31 | ForegroundNormal=241,241,241 32 | ForegroundPositive=36,173,89 33 | ForegroundVisited=115,115,158 34 | 35 | [Colors:Complementary] 36 | BackgroundAlternate=59,64,69 37 | BackgroundNormal=49,54,59 38 | DecorationFocus=30,146,255 39 | DecorationHover=61,174,230 40 | ForegroundActive=246,116,0 41 | ForegroundInactive=175,176,179 42 | ForegroundLink=61,174,230 43 | ForegroundNegative=237,21,21 44 | ForegroundNeutral=201,206,59 45 | ForegroundNormal=239,240,241 46 | ForegroundPositive=17,209,22 47 | ForegroundVisited=61,174,230 48 | 49 | [Colors:Selection] 50 | BackgroundAlternate=29,153,243 51 | BackgroundNormal=27,145,213 52 | DecorationFocus=52,120,218 53 | DecorationHover=0,161,236 54 | ForegroundActive=252,252,252 55 | ForegroundInactive=241,241,241 56 | ForegroundLink=0,100,255 57 | ForegroundNegative=218,68,83 58 | ForegroundNeutral=246,116,0 59 | ForegroundNormal=241,241,241 60 | ForegroundPositive=36,173,89 61 | ForegroundVisited=115,115,158 62 | 63 | [Colors:Tooltip] 64 | BackgroundAlternate=77,77,77 65 | BackgroundNormal=59,59,59 66 | DecorationFocus=52,120,218 67 | DecorationHover=0,161,236 68 | ForegroundActive=61,174,233 69 | ForegroundInactive=199,199,199 70 | ForegroundLink=0,100,255 71 | ForegroundNegative=218,68,83 72 | ForegroundNeutral=246,116,0 73 | ForegroundNormal=239,240,241 74 | ForegroundPositive=36,173,89 75 | ForegroundVisited=115,115,158 76 | 77 | [Colors:View] 78 | BackgroundAlternate=54,54,54 79 | BackgroundNormal=44,44,44 80 | DecorationFocus=52,120,218 81 | DecorationHover=0,161,236 82 | ForegroundActive=61,174,233 83 | ForegroundInactive=199,199,199 84 | ForegroundLink=0,100,255 85 | ForegroundNegative=218,68,83 86 | ForegroundNeutral=246,116,0 87 | ForegroundNormal=241,241,241 88 | ForegroundPositive=36,173,89 89 | ForegroundVisited=115,115,158 90 | 91 | [Colors:Window] 92 | BackgroundAlternate=77,77,77 93 | BackgroundNormal=34,34,34 94 | DecorationFocus=52,120,218 95 | DecorationHover=0,161,236 96 | ForegroundActive=61,174,233 97 | ForegroundInactive=199,199,199 98 | ForegroundLink=0,100,255 99 | ForegroundNegative=218,68,83 100 | ForegroundNeutral=246,116,0 101 | ForegroundNormal=239,240,241 102 | ForegroundPositive=36,173,89 103 | ForegroundVisited=115,115,158 104 | 105 | [General] 106 | ColorScheme=Darkly 107 | Name=Darkly 108 | shadeSortColumn=true 109 | 110 | [KDE] 111 | contrast=0 112 | 113 | [WM] 114 | activeBackground=34,34,34 115 | activeBlend=255,255,255 116 | activeForeground=204,204,204 117 | inactiveBackground=44,44,44 118 | inactiveBlend=44,44,44 119 | inactiveForeground=144,144,144 120 | -------------------------------------------------------------------------------- /kstyle/animations/darklytabbarengine.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 18 | *************************************************************************/ 19 | 20 | #include "darklytabbarengine.h" 21 | 22 | #include 23 | 24 | namespace Darkly 25 | { 26 | 27 | //____________________________________________________________ 28 | bool TabBarEngine::registerWidget(QWidget *widget) 29 | { 30 | if (!widget) 31 | return false; 32 | 33 | // create new data class 34 | if (!_hoverData.contains(widget)) 35 | _hoverData.insert(widget, new TabBarData(this, widget, duration()), enabled()); 36 | if (!_focusData.contains(widget)) 37 | _focusData.insert(widget, new TabBarData(this, widget, duration()), enabled()); 38 | 39 | // connect destruction signal 40 | connect(widget, SIGNAL(destroyed(QObject *)), this, SLOT(unregisterWidget(QObject *)), Qt::UniqueConnection); 41 | return true; 42 | } 43 | 44 | //____________________________________________________________ 45 | bool TabBarEngine::updateState(const QObject *object, const QPoint &position, AnimationMode mode, bool value) 46 | { 47 | DataMap::Value data(TabBarEngine::data(object, mode)); 48 | return (data && data.data()->updateState(position, value)); 49 | } 50 | 51 | //____________________________________________________________ 52 | bool TabBarEngine::isAnimated(const QObject *object, const QPoint &position, AnimationMode mode) 53 | { 54 | DataMap::Value data(TabBarEngine::data(object, mode)); 55 | return (data && data.data()->animation(position) && data.data()->animation(position).data()->isRunning()); 56 | } 57 | 58 | //____________________________________________________________ 59 | DataMap::Value TabBarEngine::data(const QObject *object, AnimationMode mode) 60 | { 61 | switch (mode) { 62 | case AnimationHover: 63 | return _hoverData.find(object).data(); 64 | case AnimationFocus: 65 | return _focusData.find(object).data(); 66 | default: 67 | return DataMap::Value(); 68 | } 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /kstyle/config/darklystyleconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "KPlugin": { 3 | "Description": "Modify the appearance of widgets", 4 | "Description[ar]": "عدّل مظهر الودجات", 5 | "Description[az]": "Vidjetin görünüşünü dəyişin", 6 | "Description[bg]": "Настройване на външния изглед на приставките", 7 | "Description[ca@valencia]": "Modifica l'aparença dels ginys", 8 | "Description[ca]": "Modifica l'aparença dels ginys", 9 | "Description[cs]": "Změnit vzhled widgetů", 10 | "Description[da]": "Ændr kontrollers udseende", 11 | "Description[de]": "Das Erscheinungsbild der Bedienelemente ändern", 12 | "Description[el]": "Τροποποίηση εμφάνισης συστατικών", 13 | "Description[en_GB]": "Modify the appearance of widgets", 14 | "Description[es]": "Modificar el aspecto de los elementos gráficos", 15 | "Description[et]": "Vidinate välimuse muutmine", 16 | "Description[eu]": "Aldatu trepeten itxura", 17 | "Description[fi]": "Muuta elementtien ulkoasua", 18 | "Description[fr]": "Modifier l'apparence des composants graphiques", 19 | "Description[gl]": "Modifica a aparencia dos trebellos", 20 | "Description[he]": "התאם את המראה של היישומונים", 21 | "Description[hi]": "विजेट की दिखावट को परिवर्तित करें", 22 | "Description[hu]": "Az elemek megjelenésének módosítása", 23 | "Description[ia]": "Modifica le apparentia de widgets", 24 | "Description[id]": "Memodifikasi penampilan widget", 25 | "Description[it]": "Modifica l'aspetto degli oggetti", 26 | "Description[ja]": "ウィジェットの外観を編集", 27 | "Description[ko]": "위젯의 모습을 수정합니다", 28 | "Description[lt]": "Keisti valdiklių išvaizdą", 29 | "Description[nb]": "Endre utseende for skjermelementer", 30 | "Description[nl]": "Wijzig het uiterlijk van widgets", 31 | "Description[nn]": "Endra utsjånaden på skjermkontrollar", 32 | "Description[pl]": "Zmień wygląd interfejsu", 33 | "Description[pt]": "Modificar a aparência dos elementos gráficos", 34 | "Description[pt_BR]": "Modifica a aparência dos widgets", 35 | "Description[ro]": "Modifică aspectul controalelor", 36 | "Description[ru]": "Настройка элементов интерфейса в стиле Breeze", 37 | "Description[sk]": "Zmena vzhľadu miniaplikácií", 38 | "Description[sl]": "Spremenite videz gradnikov", 39 | "Description[sr@ijekavian]": "Измијените изглед виџета̂", 40 | "Description[sr@ijekavianlatin]": "Izmijenite izgled vidžetâ̂", 41 | "Description[sr@latin]": "Izmenite izgled vidžetâ̂", 42 | "Description[sr]": "Измените изглед виџета̂", 43 | "Description[sv]": "Ändra utseende hos grafiska komponenter", 44 | "Description[tg]": "Тағйир додани намуди зоҳирии виҷетҳо", 45 | "Description[tr]": "Araç takımlarının görünümünü değiştir", 46 | "Description[uk]": "Зміна вигляду віджетів", 47 | "Description[x-test]": "xxModify the appearance of widgetsxx", 48 | "Description[zh_CN]": "调整窗口部件外观", 49 | "Description[zh_TW]": "變更元件外觀", 50 | "Icon": "preferences-desktop-theme", 51 | "Name": "Darkly: Widget Style", 52 | "ServiceTypes": [ 53 | "KCModule" 54 | ] 55 | }, 56 | "X-KDE-Keywords": "darkly,widget,style", 57 | "X-KDE-ParentApp": "kcontrol", 58 | "X-KDE-Weight": 50 59 | } 60 | -------------------------------------------------------------------------------- /kstyle/animations/darklyheaderviewengine.h: -------------------------------------------------------------------------------- 1 | #ifndef darklyheaderviewengine_h 2 | #define darklyheaderviewengine_h 3 | 4 | /************************************************************************* 5 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 21 | *************************************************************************/ 22 | 23 | #include "darklybaseengine.h" 24 | #include "darklydatamap.h" 25 | #include "darklyheaderviewdata.h" 26 | 27 | namespace Darkly 28 | { 29 | 30 | //* stores headerview hovered action and timeLine 31 | class HeaderViewEngine : public BaseEngine 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | //* constructor 37 | explicit HeaderViewEngine(QObject *parent) 38 | : BaseEngine(parent) 39 | { 40 | } 41 | 42 | //* register headerview 43 | bool registerWidget(QWidget *); 44 | 45 | //* true if widget hover state is changed 46 | bool updateState(const QObject *, const QPoint &, bool); 47 | 48 | //* true if widget is animated 49 | bool isAnimated(const QObject *object, const QPoint &point) 50 | { 51 | if (DataMap::Value data = _data.find(object)) { 52 | if (Animation::Pointer animation = data.data()->animation(point)) 53 | return animation.data()->isRunning(); 54 | } 55 | return false; 56 | } 57 | 58 | //* animation opacity 59 | qreal opacity(const QObject *object, const QPoint &point) 60 | { 61 | return isAnimated(object, point) ? _data.find(object).data()->opacity(point) : AnimationData::OpacityInvalid; 62 | } 63 | 64 | //* enability 65 | void setEnabled(bool value) override 66 | { 67 | BaseEngine::setEnabled(value); 68 | _data.setEnabled(value); 69 | } 70 | 71 | //* duration 72 | void setDuration(int value) override 73 | { 74 | BaseEngine::setDuration(value); 75 | _data.setDuration(value); 76 | } 77 | 78 | public Q_SLOTS: 79 | 80 | //* remove widget from map 81 | bool unregisterWidget(QObject *object) override 82 | { 83 | return _data.unregisterWidget(object); 84 | } 85 | 86 | private: 87 | //* data map 88 | DataMap _data; 89 | }; 90 | 91 | } 92 | 93 | #endif 94 | -------------------------------------------------------------------------------- /kstyle/animations/darklydialdata.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 18 | *************************************************************************/ 19 | 20 | #include "darklydialdata.h" 21 | 22 | #include 23 | #include 24 | 25 | namespace Darkly 26 | { 27 | 28 | //______________________________________________ 29 | DialData::DialData(QObject *parent, QWidget *target, int duration) 30 | : WidgetStateData(parent, target, duration) 31 | , _position(-1, -1) 32 | { 33 | target->installEventFilter(this); 34 | } 35 | 36 | //______________________________________________ 37 | bool DialData::eventFilter(QObject *object, QEvent *event) 38 | { 39 | if (object != target().data()) { 40 | return WidgetStateData::eventFilter(object, event); 41 | } 42 | 43 | // check event type 44 | switch (event->type()) { 45 | case QEvent::HoverEnter: 46 | case QEvent::HoverMove: 47 | hoverMoveEvent(object, event); 48 | break; 49 | 50 | case QEvent::HoverLeave: 51 | hoverLeaveEvent(object, event); 52 | break; 53 | 54 | default: 55 | break; 56 | } 57 | 58 | return WidgetStateData::eventFilter(object, event); 59 | } 60 | 61 | //______________________________________________ 62 | void DialData::hoverMoveEvent(QObject *object, QEvent *event) 63 | { 64 | // try cast object to dial 65 | QDial *scrollBar(qobject_cast(object)); 66 | if (!scrollBar || scrollBar->isSliderDown()) 67 | return; 68 | 69 | // cast event 70 | QHoverEvent *hoverEvent = static_cast(event); 71 | 72 | // store position 73 | _position = 74 | #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 75 | hoverEvent->position().toPoint(); 76 | #else 77 | hoverEvent->pos(); 78 | #endif 79 | 80 | // trigger animation if position match handle rect 81 | updateState(_handleRect.contains(_position)); 82 | } 83 | 84 | //______________________________________________ 85 | void DialData::hoverLeaveEvent(QObject *, QEvent *) 86 | { 87 | // reset hover state 88 | updateState(false); 89 | 90 | // reset mouse position 91 | _position = QPoint(-1, -1); 92 | } 93 | 94 | } 95 | -------------------------------------------------------------------------------- /kstyle/animations/darklytoolboxengine.h: -------------------------------------------------------------------------------- 1 | #ifndef darklytoolboxengine_h 2 | #define darklytoolboxengine_h 3 | 4 | /************************************************************************* 5 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 21 | *************************************************************************/ 22 | 23 | #include "darklybaseengine.h" 24 | #include "darklydatamap.h" 25 | #include "darklywidgetstatedata.h" 26 | 27 | namespace Darkly 28 | { 29 | 30 | //* QToolBox animation engine 31 | class ToolBoxEngine : public BaseEngine 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | //* constructor 37 | explicit ToolBoxEngine(QObject *parent) 38 | : BaseEngine(parent) 39 | { 40 | } 41 | 42 | //* enability 43 | void setEnabled(bool value) override 44 | { 45 | BaseEngine::setEnabled(value); 46 | _data.setEnabled(value); 47 | } 48 | 49 | //* duration 50 | void setDuration(int value) override 51 | { 52 | BaseEngine::setDuration(value); 53 | _data.setDuration(value); 54 | } 55 | 56 | //* register widget 57 | bool registerWidget(QWidget *); 58 | 59 | //* true if widget hover state is changed 60 | bool updateState(const QPaintDevice *, bool); 61 | 62 | //* true if widget is animated 63 | bool isAnimated(const QPaintDevice *); 64 | 65 | //* animation opacity 66 | qreal opacity(const QPaintDevice *object) 67 | { 68 | return isAnimated(object) ? data(object).data()->opacity() : AnimationData::OpacityInvalid; 69 | } 70 | 71 | public Q_SLOTS: 72 | 73 | //* remove widget from map 74 | bool unregisterWidget(QObject *data) override 75 | { 76 | if (!data) 77 | return false; 78 | 79 | // reinterpret_cast is safe here since only the address is used to find 80 | // data in the map 81 | return _data.unregisterWidget(reinterpret_cast(data)); 82 | } 83 | 84 | protected: 85 | //* returns data associated to widget 86 | PaintDeviceDataMap::Value data(const QPaintDevice *object) 87 | { 88 | return _data.find(object).data(); 89 | } 90 | 91 | private: 92 | //* map 93 | PaintDeviceDataMap _data; 94 | }; 95 | 96 | } 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /kdecoration/config/ui/darklyexceptionlistwidget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | DarklyExceptionListWidget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 473 10 | 182 11 | 12 | 13 | 14 | 15 | 0 16 | 0 17 | 18 | 19 | 20 | 21 | 0 22 | 0 23 | 24 | 25 | 26 | 27 | 0 28 | 29 | 30 | 0 31 | 32 | 33 | 0 34 | 35 | 36 | 0 37 | 38 | 39 | 40 | 41 | 42 | 0 43 | 0 44 | 45 | 46 | 47 | 48 | 100 49 | 100 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | Qt::Vertical 58 | 59 | 60 | 61 | 20 62 | 1 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | Move Up 71 | 72 | 73 | 74 | 75 | 76 | 77 | Move Down 78 | 79 | 80 | 81 | 82 | 83 | 84 | Add 85 | 86 | 87 | 88 | 89 | 90 | 91 | Remove 92 | 93 | 94 | 95 | 96 | 97 | 98 | Edit 99 | 100 | 101 | 102 | 103 | 104 | 105 | exceptionListView 106 | moveUpButton 107 | moveDownButton 108 | addButton 109 | removeButton 110 | editButton 111 | 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /kdecoration/config/darklyexceptiondialog.h: -------------------------------------------------------------------------------- 1 | #ifndef darklyexceptiondialog_h 2 | #define darklyexceptiondialog_h 3 | ////////////////////////////////////////////////////////////////////////////// 4 | // darklyexceptiondialog.h 5 | // ------------------- 6 | // 7 | // Copyright (c) 2009 Hugo Pereira Da Costa 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to 11 | // deal in the Software without restriction, including without limitation the 12 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 13 | // sell copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 25 | // IN THE SOFTWARE. 26 | ////////////////////////////////////////////////////////////////////////////// 27 | 28 | #include "config/ui_darklyexceptiondialog.h" 29 | #include "darkly.h" 30 | 31 | #include 32 | #include 33 | 34 | namespace Darkly 35 | { 36 | 37 | class DetectDialog; 38 | 39 | //* darkly exceptions list 40 | class ExceptionDialog : public QDialog 41 | { 42 | Q_OBJECT 43 | 44 | public: 45 | //* constructor 46 | explicit ExceptionDialog(QWidget *parent); 47 | 48 | //* destructor 49 | virtual ~ExceptionDialog() 50 | { 51 | } 52 | 53 | //* set exception 54 | void setException(InternalSettingsPtr); 55 | 56 | //* save exception 57 | void save(); 58 | 59 | //* true if changed 60 | virtual bool isChanged() const 61 | { 62 | return m_changed; 63 | } 64 | 65 | Q_SIGNALS: 66 | 67 | //* emitted when changed 68 | void changed(bool); 69 | 70 | protected: 71 | //* set changed state 72 | virtual void setChanged(bool value) 73 | { 74 | m_changed = value; 75 | emit changed(value); 76 | } 77 | 78 | protected Q_SLOTS: 79 | 80 | //* check whether configuration is changed and emit appropriate signal if yes 81 | virtual void updateChanged(); 82 | 83 | private Q_SLOTS: 84 | 85 | //* select window properties from grabbed pointers 86 | void selectWindowProperties(); 87 | 88 | //* read properties of selected window 89 | void readWindowProperties(bool); 90 | 91 | private: 92 | //* map mask and checkbox 93 | using CheckBoxMap = QMap; 94 | 95 | Ui::DarklyExceptionDialog m_ui; 96 | 97 | //* map mask and checkbox 98 | CheckBoxMap m_checkboxes; 99 | 100 | //* internal exception 101 | InternalSettingsPtr m_exception; 102 | 103 | //* detection dialog 104 | DetectDialog *m_detectDialog = nullptr; 105 | 106 | //* changed state 107 | bool m_changed = false; 108 | }; 109 | 110 | } 111 | 112 | #endif 113 | -------------------------------------------------------------------------------- /kstyle/animations/darklyanimationdata.h: -------------------------------------------------------------------------------- 1 | #ifndef darkly_animationdata_h 2 | #define darkly_animationdata_h 3 | 4 | /************************************************************************* 5 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 21 | *************************************************************************/ 22 | 23 | #include "darklyanimation.h" 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | namespace Darkly 32 | { 33 | 34 | //* base class 35 | class AnimationData : public QObject 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | //* constructor 41 | AnimationData(QObject *parent, QWidget *target) 42 | : QObject(parent) 43 | , _target(target) 44 | { 45 | } 46 | 47 | //* duration 48 | virtual void setDuration(int) = 0; 49 | 50 | //* steps 51 | static void setSteps(int value) 52 | { 53 | _steps = value; 54 | } 55 | 56 | //* enability 57 | virtual bool enabled() const 58 | { 59 | return _enabled; 60 | } 61 | 62 | //* enability 63 | virtual void setEnabled(bool value) 64 | { 65 | _enabled = value; 66 | } 67 | 68 | //* target 69 | const WeakPointer &target() const 70 | { 71 | return _target; 72 | } 73 | 74 | //* invalid opacity 75 | static const qreal OpacityInvalid; 76 | 77 | protected: 78 | //* setup animation 79 | virtual void setupAnimation(const Animation::Pointer &animation, const QByteArray &property); 80 | 81 | //* apply step 82 | virtual qreal digitize(const qreal &value) const 83 | { 84 | // qDebug() << "receiving:" << value << "returning:" << std::floor( value*_steps )/_steps; 85 | /*if( _steps > 0 ) return std::floor( value*_steps )/_steps; 86 | else*/ 87 | return value; 88 | } 89 | 90 | //* trigger target update 91 | virtual void setDirty() const 92 | { 93 | if (_target) 94 | _target.data()->update(); 95 | } 96 | 97 | private: 98 | //* guarded target 99 | WeakPointer _target; 100 | 101 | //* enability 102 | bool _enabled = true; 103 | 104 | //* steps 105 | static int _steps; 106 | }; 107 | 108 | } 109 | 110 | #endif 111 | -------------------------------------------------------------------------------- /kdecoration/config/darklyexceptionmodel.cpp: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // darklyexceptionmodel.cpp 3 | // ------------------- 4 | // 5 | // Copyright (c) 2009 Hugo Pereira Da Costa 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to 9 | // deal in the Software without restriction, including without limitation the 10 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 11 | // sell copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 23 | // IN THE SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////// 25 | 26 | #include "darklyexceptionmodel.h" 27 | 28 | #include 29 | 30 | namespace Darkly 31 | { 32 | 33 | //_______________________________________________ 34 | const QString ExceptionModel::m_columnTitles[ExceptionModel::nColumns] = {QStringLiteral(""), i18n("Exception Type"), i18n("Regular Expression")}; 35 | 36 | //__________________________________________________________________ 37 | QVariant ExceptionModel::data(const QModelIndex &index, int role) const 38 | { 39 | // check index, role and column 40 | if (!index.isValid()) 41 | return QVariant(); 42 | 43 | // retrieve associated file info 44 | const InternalSettingsPtr &configuration(get(index)); 45 | 46 | // return text associated to file and column 47 | if (role == Qt::DisplayRole) { 48 | switch (index.column()) { 49 | case ColumnType: { 50 | switch (configuration->exceptionType()) { 51 | case InternalSettings::ExceptionWindowTitle: 52 | return i18n("Window Title"); 53 | 54 | default: 55 | case InternalSettings::ExceptionWindowClassName: 56 | return i18n("Window Class Name"); 57 | } 58 | } 59 | 60 | case ColumnRegExp: 61 | return configuration->exceptionPattern(); 62 | default: 63 | return QVariant(); 64 | break; 65 | } 66 | 67 | } else if (role == Qt::CheckStateRole && index.column() == ColumnEnabled) { 68 | return configuration->enabled() ? Qt::Checked : Qt::Unchecked; 69 | 70 | } else if (role == Qt::ToolTipRole && index.column() == ColumnEnabled) { 71 | return i18n("Enable/disable this exception"); 72 | } 73 | 74 | return QVariant(); 75 | } 76 | 77 | //__________________________________________________________________ 78 | QVariant ExceptionModel::headerData(int section, Qt::Orientation orientation, int role) const 79 | { 80 | if (orientation == Qt::Horizontal && role == Qt::DisplayRole && section >= 0 && section < nColumns) { 81 | return m_columnTitles[section]; 82 | } 83 | 84 | // return empty 85 | return QVariant(); 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /.github/workflows/fedora.yml: -------------------------------------------------------------------------------- 1 | # Fedora 41/40 2 | # Build Darkly from release tag and publish .rpm package 3 | 4 | on: 5 | workflow_call: 6 | inputs: 7 | cache-file-path: 8 | required: true 9 | type: string 10 | version: 11 | required: true 12 | type: string 13 | containers: 14 | required: true 15 | type: string 16 | jobs: 17 | build: 18 | strategy: 19 | max-parallel: 2 20 | matrix: 21 | image: ${{ fromJson(inputs.containers) }} 22 | runs-on: ubuntu-24.04 23 | container: ${{ matrix.image }} 24 | steps: 25 | - uses: actions/cache/restore@v4 26 | id: cache 27 | with: 28 | key: ${{ runner.os }}-v${{ inputs.version }}-${{ hashFiles(inputs.cache-file-path) }} 29 | path: ${{ inputs.cache-file-path }} 30 | fail-on-cache-miss: true 31 | - name: Install dependencies 32 | run: | 33 | sudo dnf install -y -q git rpmdevtools rpmlint cmake extra-cmake-modules "cmake(KDecoration3)" kwin-devel libepoxy-devel \ 34 | "cmake(Qt5Core)" "cmake(Qt5Gui)" "cmake(Qt5DBus)" "cmake(KF5GuiAddons)" "cmake(KF5WindowSystem)" \ 35 | "cmake(KF5I18n)" "cmake(KF5CoreAddons)" "cmake(KF5ConfigWidgets)" "cmake(Qt5UiTools)" "cmake(KF5GlobalAccel)" \ 36 | "cmake(KF5IconThemes)" "cmake(KF5Init)" "cmake(KF5KIO)" "cmake(KF5Notifications)" kf5-kpackage-devel kf5-kcmutils-devel \ 37 | qt5-qtquickcontrols2-devel kf5-kirigami2-devel "cmake(KF5Crash)" "cmake(KF5FrameworkIntegration)" \ 38 | kf6-kcolorscheme-devel kf6-kguiaddons-devel kf6-ki18n-devel kf6-kiconthemes-devel \ 39 | kf6-kirigami-devel kf6-kcmutils-devel kf6-frameworkintegration-devel \ 40 | "cmake(KF6Crash)" "cmake(KF6GlobalAccel)" "cmake(KF6KIO)" "cmake(KF6Notifications)" \ 41 | "cmake(KF6Package)" "cmake(KWayland)" "cmake(Plasma)" "cmake(Plasma5Support)" \ 42 | kf6-kpackage-devel libepoxy-devel fdupes 43 | - name: Extract tarball 44 | run: tar xf ${{ inputs.cache-file-path }} 45 | - name: Build source 46 | run: | 47 | cmake_opts=( 48 | -B Darkly-${{ inputs.version }}/build 49 | -S Darkly-${{ inputs.version }} 50 | -DBUILD_RPMS=ON 51 | ) 52 | echo "${cmake_opts[@]}" 53 | cmake "${cmake_opts[@]}" && cmake --build Darkly-${{ inputs.version }}/build -j$(nproc) && echo "Build completed!" || echo "Build failed!" || exit 1 54 | - name: Build RPM package 55 | id: step_build 56 | run: | 57 | cd Darkly-${{ inputs.version }}/build; cpack -G RPM -V -DCPACK_THREADS=$(nproc) 58 | artifact=$GITHUB_WORKSPACE/Darkly-${{ inputs.version }}/packages/darkly-${{ inputs.version }}.x86_64.rpm 59 | source /etc/os-release 60 | echo "Version ID = $VERSION_ID" 61 | publish_filename=darkly-${{ inputs.version }}.fc$VERSION_ID.x86_64.rpm 62 | echo "Moving file to $GITHUB_WORKSPACE/$publish_filename" 63 | mv $artifact $GITHUB_WORKSPACE/$publish_filename 64 | echo "ARTIFACT=$publish_filename" >> "$GITHUB_ENV" 65 | SHA256SUM=$(sha256sum $GITHUB_WORKSPACE/$publish_filename | awk '{ print $1 }') 66 | echo "ARTIFACT = $publish_filename | SHA256SUM = $SHA256SUM" 67 | echo "SHA256SUM=$SHA256SUM" >> "$GITHUB_ENV" 68 | - name: Publish RPM 69 | if: ${{ env.SHA256SUM != '' }} 70 | uses: actions/upload-artifact@v5 71 | with: 72 | name: ${{ env.ARTIFACT }} 73 | path: ${{ env.ARTIFACT }} 74 | retention-days: 1 75 | -------------------------------------------------------------------------------- /kdecoration/config/darklyitemmodel.h: -------------------------------------------------------------------------------- 1 | #ifndef ItemModel_h 2 | #define ItemModel_h 3 | 4 | ////////////////////////////////////////////////////////////////////////////// 5 | // itemmodel.h 6 | // ------------------- 7 | // 8 | // Copyright (c) 2009-2010 Hugo Pereira Da Costa 9 | // 10 | // Permission is hereby granted, free of charge, to any person obtaining a copy 11 | // of this software and associated documentation files (the "Software"), to 12 | // deal in the Software without restriction, including without limitation the 13 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 14 | // sell copies of the Software, and to permit persons to whom the Software is 15 | // furnished to do so, subject to the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be included in 18 | // all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 25 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 26 | // IN THE SOFTWARE. 27 | ////////////////////////////////////////////////////////////////////////////// 28 | 29 | #include 30 | 31 | namespace Darkly 32 | { 33 | 34 | //* Job model. Stores job information for display in lists 35 | class ItemModel : public QAbstractItemModel 36 | { 37 | public: 38 | //* constructor 39 | explicit ItemModel(QObject *parent = nullptr); 40 | 41 | //* destructor 42 | virtual ~ItemModel() 43 | { 44 | } 45 | 46 | //* return all indexes in model starting from parent [recursive] 47 | QModelIndexList indexes(int column = 0, const QModelIndex &parent = QModelIndex()) const; 48 | 49 | //*@name sorting 50 | //@{ 51 | 52 | //* sort 53 | virtual void sort() 54 | { 55 | sort(sortColumn(), sortOrder()); 56 | } 57 | 58 | //* sort 59 | void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override; 60 | 61 | //* current sorting column 62 | const int &sortColumn() const 63 | { 64 | return m_sortColumn; 65 | } 66 | 67 | //* current sort order 68 | const Qt::SortOrder &sortOrder() const 69 | { 70 | return m_sortOrder; 71 | } 72 | 73 | //@} 74 | 75 | protected: 76 | //* this sort columns without calling the layout changed callbacks 77 | void privateSort() 78 | { 79 | privateSort(m_sortColumn, m_sortOrder); 80 | } 81 | 82 | //* private sort, with no signals emitted 83 | virtual void privateSort(int column, Qt::SortOrder order) = 0; 84 | 85 | //* used to sort items in list 86 | class SortFTor 87 | { 88 | public: 89 | //* constructor 90 | explicit SortFTor(const int &type, Qt::SortOrder order = Qt::AscendingOrder) 91 | : _type(type) 92 | , _order(order) 93 | { 94 | } 95 | 96 | protected: 97 | //* column 98 | int _type; 99 | 100 | //* order 101 | Qt::SortOrder _order; 102 | }; 103 | 104 | private: 105 | //* sorting column 106 | int m_sortColumn = 0; 107 | 108 | //* sorting order 109 | Qt::SortOrder m_sortOrder = Qt::AscendingOrder; 110 | }; 111 | 112 | } 113 | 114 | #endif 115 | -------------------------------------------------------------------------------- /kdecoration/config/darklyexceptionlistwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef darklyexceptionlistwidget_h 2 | #define darklyexceptionlistwidget_h 3 | ////////////////////////////////////////////////////////////////////////////// 4 | // darklyexceptionlistwidget.h 5 | // ------------------- 6 | // 7 | // Copyright (c) 2009 Hugo Pereira Da Costa 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files (the "Software"), to 11 | // deal in the Software without restriction, including without limitation the 12 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 13 | // sell copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions: 15 | // 16 | // The above copyright notice and this permission notice shall be included in 17 | // all copies or substantial portions of the Software. 18 | // 19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 25 | // IN THE SOFTWARE. 26 | ////////////////////////////////////////////////////////////////////////////// 27 | 28 | #include "config/ui_darklyexceptionlistwidget.h" 29 | #include "darklyexceptionmodel.h" 30 | 31 | //* QDialog used to commit selected files 32 | namespace Darkly 33 | { 34 | 35 | class ExceptionListWidget : public QWidget 36 | { 37 | //* Qt meta object 38 | Q_OBJECT 39 | 40 | public: 41 | //* constructor 42 | explicit ExceptionListWidget(QWidget * = nullptr); 43 | 44 | //* set exceptions 45 | void setExceptions(const InternalSettingsList &); 46 | 47 | //* get exceptions 48 | InternalSettingsList exceptions(); 49 | 50 | //* true if changed 51 | virtual bool isChanged() const 52 | { 53 | return m_changed; 54 | } 55 | 56 | Q_SIGNALS: 57 | 58 | //* emitted when changed 59 | void changed(bool); 60 | 61 | protected: 62 | //* model 63 | const ExceptionModel &model() const 64 | { 65 | return m_model; 66 | } 67 | 68 | //* model 69 | ExceptionModel &model() 70 | { 71 | return m_model; 72 | } 73 | 74 | protected Q_SLOTS: 75 | 76 | //* update button states 77 | virtual void updateButtons(); 78 | 79 | //* add 80 | virtual void add(); 81 | 82 | //* edit 83 | virtual void edit(); 84 | 85 | //* remove 86 | virtual void remove(); 87 | 88 | //* toggle 89 | virtual void toggle(const QModelIndex &); 90 | 91 | //* move up 92 | virtual void up(); 93 | 94 | //* move down 95 | virtual void down(); 96 | 97 | protected: 98 | //* resize columns 99 | void resizeColumns() const; 100 | 101 | //* check exception 102 | bool checkException(InternalSettingsPtr); 103 | 104 | //* set changed state 105 | virtual void setChanged(bool value) 106 | { 107 | m_changed = value; 108 | emit changed(value); 109 | } 110 | 111 | private: 112 | //* model 113 | ExceptionModel m_model; 114 | 115 | //* ui 116 | Ui_DarklyExceptionListWidget m_ui; 117 | 118 | //* changed state 119 | bool m_changed = false; 120 | }; 121 | 122 | } 123 | 124 | #endif 125 | -------------------------------------------------------------------------------- /kstyle/animations/darklyspinboxengine.h: -------------------------------------------------------------------------------- 1 | #ifndef darklyspinboxengine_h 2 | #define darklyspinboxengine_h 3 | 4 | /************************************************************************* 5 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 21 | *************************************************************************/ 22 | 23 | #include "darklybaseengine.h" 24 | #include "darklydatamap.h" 25 | #include "darklyspinboxdata.h" 26 | 27 | namespace Darkly 28 | { 29 | 30 | //* handle spinbox arrows hover effect 31 | class SpinBoxEngine : public BaseEngine 32 | { 33 | Q_OBJECT 34 | 35 | public: 36 | //* constructor 37 | explicit SpinBoxEngine(QObject *parent) 38 | : BaseEngine(parent) 39 | { 40 | } 41 | 42 | //* register widget 43 | bool registerWidget(QWidget *); 44 | 45 | //* state 46 | bool updateState(const QObject *object, QStyle::SubControl subControl, bool value) 47 | { 48 | if (DataMap::Value data = _data.find(object)) { 49 | return data.data()->updateState(subControl, value); 50 | } else 51 | return false; 52 | } 53 | 54 | //* true if widget is animated 55 | bool isAnimated(const QObject *object, QStyle::SubControl subControl) 56 | { 57 | if (DataMap::Value data = _data.find(object)) { 58 | return data.data()->isAnimated(subControl); 59 | } else 60 | return false; 61 | } 62 | 63 | //* animation opacity 64 | qreal opacity(const QObject *object, QStyle::SubControl subControl) 65 | { 66 | if (DataMap::Value data = _data.find(object)) { 67 | return data.data()->opacity(subControl); 68 | } else 69 | return AnimationData::OpacityInvalid; 70 | } 71 | 72 | //* enability 73 | void setEnabled(bool value) override 74 | { 75 | BaseEngine::setEnabled(value); 76 | _data.setEnabled(value); 77 | } 78 | 79 | //* duration 80 | void setDuration(int value) override 81 | { 82 | BaseEngine::setDuration(value); 83 | _data.setDuration(value); 84 | } 85 | 86 | public Q_SLOTS: 87 | 88 | //* remove widget from map 89 | bool unregisterWidget(QObject *object) override 90 | { 91 | return _data.unregisterWidget(object); 92 | } 93 | 94 | private: 95 | //* data map 96 | DataMap _data; 97 | }; 98 | 99 | } 100 | 101 | #endif 102 | -------------------------------------------------------------------------------- /kstyle/animations/darklytabbarengine.h: -------------------------------------------------------------------------------- 1 | #ifndef darklytabbarengine_h 2 | #define darklytabbarengine_h 3 | 4 | /************************************************************************* 5 | * Copyright (C) 2014 by Hugo Pereira Da Costa * 6 | * * 7 | * This program is free software; you can redistribute it and/or modify * 8 | * it under the terms of the GNU General Public License as published by * 9 | * the Free Software Foundation; either version 2 of the License, or * 10 | * (at your option) any later version. * 11 | * * 12 | * This program is distributed in the hope that it will be useful, * 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 15 | * GNU General Public License for more details. * 16 | * * 17 | * You should have received a copy of the GNU General Public License * 18 | * along with this program; if not, write to the * 19 | * Free Software Foundation, Inc., * 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * 21 | *************************************************************************/ 22 | 23 | #include "darkly.h" 24 | #include "darklybaseengine.h" 25 | #include "darklydatamap.h" 26 | #include "darklytabbardata.h" 27 | 28 | namespace Darkly 29 | { 30 | 31 | //* stores tabbar hovered action and timeLine 32 | class TabBarEngine : public BaseEngine 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | //* constructor 38 | explicit TabBarEngine(QObject *parent) 39 | : BaseEngine(parent) 40 | { 41 | } 42 | 43 | //* register tabbar 44 | bool registerWidget(QWidget *); 45 | 46 | //* true if widget hover state is changed 47 | bool updateState(const QObject *, const QPoint &, AnimationMode, bool); 48 | 49 | //* true if widget is animated 50 | bool isAnimated(const QObject *object, const QPoint &point, AnimationMode); 51 | 52 | //* animation opacity 53 | qreal opacity(const QObject *object, const QPoint &point, AnimationMode mode) 54 | { 55 | return isAnimated(object, point, mode) ? data(object, mode).data()->opacity(point) : AnimationData::OpacityInvalid; 56 | } 57 | 58 | //* enability 59 | void setEnabled(bool value) override 60 | { 61 | BaseEngine::setEnabled(value); 62 | _hoverData.setEnabled(value); 63 | _focusData.setEnabled(value); 64 | } 65 | 66 | //* duration 67 | void setDuration(int value) override 68 | { 69 | BaseEngine::setDuration(value); 70 | _hoverData.setDuration(value); 71 | _focusData.setDuration(value); 72 | } 73 | 74 | public Q_SLOTS: 75 | 76 | //* remove widget from map 77 | bool unregisterWidget(QObject *object) override 78 | { 79 | if (!object) 80 | return false; 81 | bool found = false; 82 | if (_hoverData.unregisterWidget(object)) 83 | found = true; 84 | if (_focusData.unregisterWidget(object)) 85 | found = true; 86 | return found; 87 | } 88 | 89 | private: 90 | //* returns data associated to widget 91 | DataMap::Value data(const QObject *, AnimationMode); 92 | 93 | //* data map 94 | DataMap _hoverData; 95 | DataMap _focusData; 96 | }; 97 | 98 | } 99 | 100 | #endif 101 | -------------------------------------------------------------------------------- /kdecoration/config/darklydetectwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef darklydetectwidget_h 2 | #define darklydetectwidget_h 3 | 4 | ////////////////////////////////////////////////////////////////////////////// 5 | // darklydetectwidget.h 6 | // Note: this class is a stripped down version of 7 | // /kdebase/workspace/kwin/kcmkwin/kwinrules/detectwidget.h 8 | // Copyright (c) 2004 Lubos Lunak 9 | 10 | // ------------------- 11 | // 12 | // Copyright (c) 2009 Hugo Pereira Da Costa 13 | // 14 | // Permission is hereby granted, free of charge, to any person obtaining a copy 15 | // of this software and associated documentation files (the "Software"), to 16 | // deal in the Software without restriction, including without limitation the 17 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 18 | // sell copies of the Software, and to permit persons to whom the Software is 19 | // furnished to do so, subject to the following conditions: 20 | // 21 | // The above copyright notice and this permission notice shall be included in 22 | // all copies or substantial portions of the Software. 23 | // 24 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 30 | // IN THE SOFTWARE. 31 | ////////////////////////////////////////////////////////////////////////////// 32 | 33 | #include "config/ui_darklydetectwidget.h" 34 | #include "darklysettings.h" 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | #include 43 | #include 44 | namespace Darkly 45 | { 46 | 47 | class DetectDialog : public QDialog 48 | { 49 | Q_OBJECT 50 | 51 | public: 52 | //* constructor 53 | explicit DetectDialog(QWidget *); 54 | 55 | //* read window properties or select one from mouse grab 56 | void detect(WId window); 57 | 58 | //* selected class 59 | QByteArray selectedClass() const; 60 | 61 | //* window information 62 | const KWindowInfo &windowInfo() const 63 | { 64 | return *(m_info.data()); 65 | } 66 | 67 | //* exception type 68 | InternalSettings::EnumExceptionType exceptionType() const 69 | { 70 | if (m_ui.windowClassCheckBox->isChecked()) 71 | return InternalSettings::ExceptionWindowClassName; 72 | else if (m_ui.windowTitleCheckBox->isChecked()) 73 | return InternalSettings::ExceptionWindowTitle; 74 | else 75 | return InternalSettings::ExceptionWindowClassName; 76 | } 77 | 78 | Q_SIGNALS: 79 | 80 | void detectionDone(bool); 81 | 82 | protected: 83 | bool eventFilter(QObject *o, QEvent *e) override; 84 | 85 | private: 86 | //* select window from grab 87 | void selectWindow(); 88 | 89 | //* read window properties 90 | void readWindow(WId window); 91 | 92 | //* find window under cursor 93 | WId findWindow(); 94 | 95 | //* execute 96 | void executeDialog(); 97 | 98 | //* ui 99 | Ui::DarklyDetectWidget m_ui; 100 | 101 | //* invisible dialog used to grab mouse 102 | QDialog *m_grabber = nullptr; 103 | 104 | //* current window information 105 | QScopedPointer m_info; 106 | 107 | //* wm state atom 108 | quint32 m_wmStateAtom = 0; 109 | }; 110 | 111 | } // namespace 112 | 113 | #endif 114 | -------------------------------------------------------------------------------- /kdecoration/config/kcm_darklydecoration.json: -------------------------------------------------------------------------------- 1 | { 2 | "KPlugin": { 3 | "Description": "Modify the appearance of window decorations", 4 | "Description[ar]": "عدّل مظهر زخرفات النّوافذ", 5 | "Description[az]": "Pəncərə tərtibatının görünüşünü dəyişdirin", 6 | "Description[bg]": "Настройване на външния изглед на прозорците", 7 | "Description[ca@valencia]": "Modifica l'aparença de les decoracions de les finestres", 8 | "Description[ca]": "Modifica l'aparença de les decoracions de les finestres", 9 | "Description[cs]": "Změnit vzhled dekorace oken", 10 | "Description[da]": "Ændr vinduesdekorationers udseende", 11 | "Description[de]": "Das Erscheinungsbild der Fensterdekoration ändern", 12 | "Description[el]": "Τροποποίηση εμφάνισης της διακόσμησης παραθύρου", 13 | "Description[en_GB]": "Modify the appearance of window decorations", 14 | "Description[es]": "Modificar el aspecto de las decoraciones de las ventanas", 15 | "Description[et]": "Akna dekoratsioonide välimuse muutmine", 16 | "Description[eu]": "Aldatu leiho apainduren itxura", 17 | "Description[fi]": "Muuta ikkunoiden kehysten ulkoasua", 18 | "Description[fr]": "Modifier l'apparence des décorations des fenêtres", 19 | "Description[gl]": "Modifica a aparencia da decoración da xanela", 20 | "Description[he]": "התאם את מראה מסגרות החלונות", 21 | "Description[hi]": "विंडो सजावटों की दिखावट को परिवर्तित करें", 22 | "Description[hu]": "Az ablakdekorációk megjelenésének módosítása", 23 | "Description[ia]": "Modifica le apparentia de decorationes de fenestra", 24 | "Description[id]": "Memodifikasi penampilan dekorasi window", 25 | "Description[it]": "Modifica l'aspetto delle decorazioni delle finestre", 26 | "Description[ja]": "ウィンドウ装飾の外観を編集", 27 | "Description[ko]": "창 장식의 모습을 수정합니다", 28 | "Description[lt]": "Keisti lango dekoracijų išvaizdą", 29 | "Description[nb]": "Endre utseende for vindusdekorasjoner", 30 | "Description[nl]": "Wijzig het uiterlijk van vensterdecoraties", 31 | "Description[nn]": "Endra utsjånad på vindaugspynt", 32 | "Description[pa]": "ਵਿੰਡੋ ਸਜਾਵਟ ਦੀ ਦਿੱਖ ਨੂੰ ਸੋਧੋ", 33 | "Description[pl]": "Zmień wygląd i wystrój okien", 34 | "Description[pt]": "Modificar a aparência das decorações das janelas", 35 | "Description[pt_BR]": "Modifica a aparência das decorações da janela", 36 | "Description[ro]": "Modifică aspectul decorațiilor pentru ferestre", 37 | "Description[ru]": "Настройка заголовков окон в стиле Breeze", 38 | "Description[sk]": "Zmena vzhľadu dekorácie okien", 39 | "Description[sl]": "Spremenite videz okrasitve oken", 40 | "Description[sr@ijekavian]": "Измијените изглед декорација прозора", 41 | "Description[sr@ijekavianlatin]": "Izmijenite izgled dekoracija prozora", 42 | "Description[sr@latin]": "Izmenite izgled dekoracija prozora", 43 | "Description[sr]": "Измените изглед декорација прозора", 44 | "Description[sv]": "Ändra utseendet hos fönsterdekorationer", 45 | "Description[tg]": "Тағйир додани ороиши намуди зоҳирии равзанаҳо", 46 | "Description[tr]": "Pencere dekorasyonlarının görünümünü değiştir", 47 | "Description[uk]": "Зміна вигляду декорацій вікон", 48 | "Description[x-test]": "xxModify the appearance of window decorationsxx", 49 | "Description[zh_CN]": "修改窗口装饰外观", 50 | "Description[zh_TW]": "變更視窗裝飾外觀", 51 | "Icon": "preferences-system-windows", 52 | "Name": "Darkly: Window Decoration", 53 | "ServiceTypes": [ 54 | "KCModule" 55 | ] 56 | }, 57 | "X-KDE-Keywords": "Darkly,decoration", 58 | "X-KDE-ParentApp": "kcontrol", 59 | "X-KDE-Weight": 50 60 | } 61 | --------------------------------------------------------------------------------