Skip to content

Commit

Permalink
Qt 6 and ECM
Browse files Browse the repository at this point in the history
Exclude decoration and lockscreen shell integration for now.
  • Loading branch information
plfiorini committed Dec 31, 2023
1 parent 04824ae commit a450ea1
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 55 deletions.
44 changes: 29 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,39 +1,53 @@
cmake_minimum_required(VERSION 3.10.0)
cmake_minimum_required(VERSION 3.19)

project("PlatformIntegration"
VERSION "1.0.0"
DESCRIPTION "Integration of Qt applications with the Liri desktop environment"
LANGUAGES CXX C
)

## Shared macros and functions:
if(NOT LIRI_LOCAL_ECM)
find_package(LiriCMakeShared "2.0.0" REQUIRED NO_MODULE)
list(APPEND CMAKE_MODULE_PATH "${LCS_MODULE_PATH}")
## Only build on the appropriate platforms.
if(NOT (UNIX OR NOT CMAKE_SYSTEM_NAME MATCHES "Android"))
message(NOTICE "Skipping the build as the condition \"UNIX OR NOT Android\" is not met.")
return()
endif()

## Add some paths to check for CMake modules:
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake;${CMAKE_CURRENT_SOURCE_DIR}/cmake/3rdparty/extra-cmake-modules")
#list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake;${CMAKE_CURRENT_SOURCE_DIR}/cmake/3rdparty/extra-cmake-modules")

## Liri specific setup common for all modules:
include(LiriSetup)
## ECM:
find_package(ECM 5.245.0 REQUIRED NO_MODULE)
list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})

## Only build on the appropriate platforms.
if(NOT UNIX OR ANDROID)
message(NOTICE "Skipping the build as the condition \"UNIX OR ANDROID\" is not met.")
return()
endif()
## Installation directories:
include(KDEInstallDirs)

## Compiler settings:
set(KDE_SKIP_NULLPTR_WARNINGS_SETTINGS TRUE)
include(KDECompilerSettings NO_POLICY_SCOPE)

## CMake settings:
include(KDECMakeSettings)

## QML module:
include(ECMQmlModule)

## ECM:
include(ECMQtDeclareLoggingCategory)

## Disable use of C++ API deprecated in Qt 5.15
add_compile_definitions(QT_DISABLE_DEPRECATED_UP_TO=0x050F00)

## Features:
include(features.cmake)

## Add subdirectories:
if(FEATURE_qtintegration_material_decoration)
add_subdirectory(src/plugins/decorations/material)
# add_subdirectory(src/plugins/decorations/material)
endif()
if(FEATURE_qtintegration_platformtheme)
add_subdirectory(src/plugins/platformtheme)
endif()
if(FEATURE_qtintegration_lockscreen_integration)
add_subdirectory(src/plugins/shellintegration/lockscreen)
# add_subdirectory(src/plugins/shellintegration/lockscreen)
endif()
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,23 @@ not use any client-side decoration.

## Dependencies

Qt >= 5.15.0 with at least the following modules is required:
Qt >= 6.6.0 with at least the following modules is required:

* [qtbase](http://code.qt.io/cgit/qt/qtbase.git)
* [qtquickcontrols2](http://code.qt.io/cgit/qt/qtquickcontrols2.git)
* [qtwayland](http://code.qt.io/cgit/qt/qtwayland.git)

And the following modules:

* [cmake](https://gitlab.kitware.com/cmake/cmake) >= 3.10.0
* [cmake-shared](https://github.com/lirios/cmake-shared.git) >= 1.0.0
* [qtgsettings](https://github.com/lirios/qtgsettings.git) >= 1.1.0
* [aurora-client](https://github.com/lirios/aurora-client)
* [cmake](https://gitlab.kitware.com/cmake/cmake) >= 3.19.0
* [extra-cmake-modules](https://invent.kde.org/frameworks/extra-cmake-modules) >= 5.245.0
* [qtgsettings](https://github.com/lirios/qtgsettings.git) >= 2.0.0
* [wayland-protocols](https://gitlab.freedesktop.org/wayland/wayland-protocols) >= 1.15
* [xkbcommon](https://github.com/xkbcommon/libxkbcommon)

Build-time only dependencies:

* [aurora](https://github.com/lirios/aurora) for aurora-wayland-scanner
* [aurora-scanner](https://github.com/lirios/aurora-scanner.git)

## Installation

Expand Down
15 changes: 7 additions & 8 deletions features.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
# SPDX-License-Identifier: BSD-3-Clause

## Find Wayland:
find_package(Wayland 1.15 COMPONENTS Client)
set_package_properties(Wayland PROPERTIES TYPE REQUIRED)
#find_package(Wayland 1.15 COMPONENTS Client)
#set_package_properties(Wayland PROPERTIES TYPE REQUIRED)

## Find wayland-protocols:
find_package(WaylandProtocols 1.15)
set_package_properties(WaylandProtocols PROPERTIES TYPE REQUIRED)
#find_package(WaylandProtocols 1.15)
#set_package_properties(WaylandProtocols PROPERTIES TYPE REQUIRED)

## Find Qt 5:
set(QT_MIN_VERSION "5.15.0")
find_package(Qt5 "${QT_MIN_VERSION}"
CONFIG REQUIRED
## Find Qt:
find_package(Qt6 "6.6.0"
REQUIRED
COMPONENTS
Core
Gui
Expand Down
53 changes: 32 additions & 21 deletions src/plugins/platformtheme/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
if(NOT TARGET Liri::Qt5GSettings)
find_package(Qt5GSettings REQUIRED)
if(NOT TARGET Liri::Qt6GSettings)
find_package(Qt6GSettings REQUIRED)
endif()

liri_add_plugin(liritheme
TYPE
platformthemes
SOURCES
hintssettings.cpp
hintssettings.h
liritheme.cpp
liritheme.h
logging_p.cpp
logging_p.h
main.cpp
resourcehelper.cpp
resourcehelper.h
LIBRARIES
Qt5::GuiPrivate
Qt5::Widgets
Qt5::QuickControls2
Liri::Qt5GSettings
qt6_add_plugin(LiriQtPlatformThemePlugin
SHARED
CLASS_NAME LiriThemePlugin
MANUAL_FINALIZATION
hintssettings.cpp hintssettings.h
liritheme.cpp liritheme.h
logging_p.cpp logging_p.h
main.cpp
resourcehelper.cpp resourcehelper.h
)

liri_finalize_plugin(liritheme)
set_target_properties(LiriQtPlatformThemePlugin
PROPERTIES OUTPUT_NAME liritheme
)

target_link_libraries(LiriQtPlatformThemePlugin
PUBLIC
Qt6::Core
Qt6::Gui
Qt6::Widgets
Qt6::QuickControls2
PRIVATE
Qt6::GuiPrivate
Liri::Qt6GSettings
)

qt6_finalize_target(LiriQtPlatformThemePlugin)

install(
TARGETS LiriQtPlatformThemePlugin
DESTINATION ${KDE_INSTALL_PLUGINDIR}/platformthemes
)
7 changes: 2 additions & 5 deletions src/plugins/platformtheme/hintssettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <QtWidgets/QToolButton>
#include <QStandardPaths>

#include <Qt5GSettings/QGSettings>
#include <Qt6GSettings/QGSettings>

#include "hintssettings.h"

Expand Down Expand Up @@ -48,7 +48,7 @@ static QStringList xdgIconThemePaths()
xdgDataDirs = QLatin1String("/usr/local/share/:/usr/share/");

// Split ':' path separator from XDG data directories
xdgPaths += xdgDataDirs.split(QLatin1Char(':'), QString::SkipEmptyParts);
xdgPaths += xdgDataDirs.split(QLatin1Char(':'), Qt::SkipEmptyParts);

// Append the icons directory to all XDG data directories
for (const QString &xdgPath : qAsConst(xdgPaths)) {
Expand Down Expand Up @@ -148,10 +148,7 @@ void HintsSettings::collectHints()
QPlatformTheme::AnimateToolBoxUiEffect);
m_hints.insert(QPlatformTheme::SpellCheckUnderlineStyle,
int(QTextCharFormat::SpellCheckUnderline));
m_hints.insert(QPlatformTheme::TabAllWidgets, true);
#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
m_hints.insert(QPlatformTheme::TabFocusBehavior, int(Qt::TabFocusAllControls));
#endif
QList<int> pixmapSizes;
pixmapSizes
<< 512 << 256 << 128 << 96 << 64 << 48
Expand Down

0 comments on commit a450ea1

Please sign in to comment.