diff --git a/CMakeLists.txt b/CMakeLists.txt index f188c37..99ea31d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,72 +1,72 @@ cmake_minimum_required(VERSION 2.8.12) project(PlasmaIntegration) set(PROJECT_VERSION "5.11.90") set(PROJECT_VERSION_MAJOR 5) include(FeatureSummary) find_package(ECM 5.17.0 NO_MODULE) set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake Modules." URL "https://projects.kde.org/projects/kdesupport/extra-cmake-modules") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND FATAL_ON_MISSING_REQUIRED_PACKAGES) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) include(GenerateExportHeader) include(ECMPackageConfigHelpers) include(ECMSetupVersion) include(ECMGenerateHeaders) include(KDEInstallDirs) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(KDECMakeSettings) set(REQUIRED_QT_VERSION 5.9.0) find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Widgets DBus X11Extras QuickControls2) set(KF5_DEP_VERSION "5.33.0") find_package(KF5 ${KF5_DEP_VERSION} REQUIRED COMPONENTS Config ConfigWidgets I18n IconThemes KIO Notifications Wayland - WidgetsAddons WindowSystem + WidgetsAddons WindowSystem ConfigWidgets ) find_package(XCB COMPONENTS XCB) set_package_properties(XCB PROPERTIES DESCRIPTION "X protocol C-language Binding" URL "http://xcb.freedesktop.org" TYPE REQUIRED PURPOSE "Required to pass style properties to native Windows on X11 Platform" ) find_package(Breeze ${PROJECT_VERSION} CONFIG) set_package_properties(Breeze PROPERTIES TYPE REQUIRED PURPOSE "For setting the default QStyle name") # dependencies for QPA plugin find_package(Qt5ThemeSupport REQUIRED) set(QT5PLATFORMSUPPORT_LIBS Qt5ThemeSupport::Qt5ThemeSupport) add_definitions(-DTRANSLATION_DOMAIN=\"plasmaintegration5\") if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po") ki18n_install(po) endif() add_subdirectory(src) add_subdirectory(autotests) add_subdirectory(tests) find_package(FontNotoSans) set_package_properties(FontNotoSans PROPERTIES PURPOSE "Default sans-serif font -- this is not detected automatically, pass -DCMAKE_DISABLE_FIND_PACKAGE_FontNotoSans=true to mark it ignored." URL "https://www.google.com/get/noto/" TYPE RUNTIME ) find_package(FontHack) set_package_properties(FontHack PROPERTIES PURPOSE "Default monospace font -- this is not detected automatically, pass -DCMAKE_DISABLE_FIND_PACKAGE_FontHack=true to mark it ignored." URL "http://sourcefoundry.org/hack/" TYPE RUNTIME ) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ed5f8a6..d26e2b2 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,5 +1,5 @@ add_executable(qfiledialogtest qfiledialogtest.cpp) target_link_libraries(qfiledialogtest Qt5::Core Qt5::Widgets) add_executable(windowdecotest windowdecotest.cpp) -target_link_libraries(windowdecotest Qt5::Core Qt5::Widgets) +target_link_libraries(windowdecotest Qt5::Core Qt5::Widgets KF5::ConfigWidgets) diff --git a/tests/windowdecotest.cpp b/tests/windowdecotest.cpp index 5d1253c..ac512c0 100644 --- a/tests/windowdecotest.cpp +++ b/tests/windowdecotest.cpp @@ -1,71 +1,86 @@ /* This file is part of the KDE libraries Copyright 2017 David Edmundson This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library. If not, see . */ /* * This class is for checking that wayland server side window decorations remain * after a window is hidden and shown. */ #include #include #include #include #include +#include +#include +#include +#include +#include + class ATestWindow: public QWidget { Q_OBJECT public: ATestWindow(); private: QPushButton *mBtn; QWidget *m_area; }; ATestWindow::ATestWindow() { mBtn = new QPushButton(QStringLiteral("Hide and Show")); m_area = new QWidget; m_area->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); connect(mBtn, &QPushButton::clicked, this, [this]() { this->hide(); QTimer::singleShot(1000, this, [this](){this->show();}); }); + QComboBox *colorCombo = new QComboBox(); + KColorSchemeManager *schemes = new KColorSchemeManager(this); + colorCombo->setModel(schemes->model()); + + connect(colorCombo, QOverload::of(&QComboBox::activated), schemes, [=](int row) { + schemes->activateScheme(colorCombo->model()->index(row, 0)); + }); + QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(mBtn); + layout->addWidget(colorCombo); setLayout(layout); } int main(int argc, char **argv) { QApplication app(argc, argv); ATestWindow wnd; wnd.show(); return app.exec(); } #include "windowdecotest.moc"