diff --git a/examples/galleryapp/CMakeLists.txt b/examples/galleryapp/CMakeLists.txt index 5148a9e2..2eafb3f5 100644 --- a/examples/galleryapp/CMakeLists.txt +++ b/examples/galleryapp/CMakeLists.txt @@ -1,48 +1,48 @@ set(kirigami2gallery_SRCS main.cpp ) qt5_add_resources(RESOURCES resources.qrc) if (CMAKE_SYSTEM_NAME STREQUAL "Android") find_package(KF5Kirigami2 ${KF5_DEP_VERSION}) set(kirigami2gallery_EXTRA_LIBS Qt5::AndroidExtras #FIXME: we shouldn't have to link to it but otherwise the lib won't be packaged on Android Qt5::QuickControls2 KF5::Kirigami2) endif() find_program(kpackagetool_cmd kpackagetool5) if (kpackagetool_cmd) set(component org.kde.kirigami2.gallery) set(APPDATAFILE "${CMAKE_CURRENT_BINARY_DIR}/${component}.appdata.xml") message(STATUS "${kpackagetool_cmd} --appstream-metainfo ${CMAKE_CURRENT_SOURCE_DIR}/../gallerydata --appstream-metainfo-output ${APPDATAFILE}") execute_process( COMMAND ${kpackagetool_cmd} --appstream-metainfo ${CMAKE_CURRENT_SOURCE_DIR}/../gallerydata --appstream-metainfo-output ${APPDATAFILE} ERROR_VARIABLE appstreamerror RESULT_VARIABLE result) if (NOT result EQUAL 0) message(WARNING "couldn't generate metainfo for ${component}: ${appstreamerror}") else() if(appstreamerror) message(WARNING "warnings during generation of metainfo for ${component}: ${appstreamerror}") endif() # OPTIONAL because desktop files can be NoDisplay so they render no XML. install(FILES ${APPDATAFILE} DESTINATION ${KDE_INSTALL_METAINFODIR} OPTIONAL) endif() else() message(WARNING "KPackage components should be specified in reverse domain notation. Appstream information won't be generated for ${component}.") endif() add_executable(kirigami2gallery ${kirigami2gallery_SRCS} ${RESOURCES}) target_link_libraries(kirigami2gallery Qt5::Core Qt5::Qml Qt5::Quick Qt5::Svg ${kirigami2gallery_EXTRA_LIBS}) install(TARGETS kirigami2gallery ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}) if (CMAKE_SYSTEM_NAME STREQUAL "Android") include(${CMAKE_SOURCE_DIR}/KF5Kirigami2Macros.cmake) -kirigami_package_breeze_icons(ICONS applications-graphics view-list-icons folder-sync view-list-details configure document-edit dialog-information dialog-positive dialog-warning dialog-error dialog-cancel document-decrypt system-run mail-reply-sender bookmarks folder media-record-symbolic add-placemark address-book-new-symbolic) +kirigami_package_breeze_icons(ICONS applications-graphics view-list-icons folder-sync view-list-details configure document-edit dialog-information dialog-positive dialog-warning dialog-error dialog-cancel document-decrypt system-run mail-reply-sender bookmarks folder media-record-symbolic add-placemark address-book-new-symbolic view-right-new view-right-close) endif() diff --git a/examples/gallerydata/contents/ui/gallery/ColorSetGallery.qml b/examples/gallerydata/contents/ui/gallery/ColorSetGallery.qml index e73fa5b8..6fecf1a6 100644 --- a/examples/gallerydata/contents/ui/gallery/ColorSetGallery.qml +++ b/examples/gallerydata/contents/ui/gallery/ColorSetGallery.qml @@ -1,214 +1,214 @@ /* * Copyright 2017 Marco Martin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 or * (at your option) any later version. * * This program 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 Library General Public License for more details * * You should have received a copy of the GNU Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.0 import QtQuick.Controls 2.0 as Controls import QtQuick.Layouts 1.2 import org.kde.kirigami 2.2 as Kirigami Kirigami.ScrollablePage { id: page title: "Color Sets" background: Rectangle { color: Kirigami.Theme.backgroundColor } ColumnLayout { GridLayout { columns: 2 Controls.Label { text: "Global Drawer color set:" Layout.alignment: Qt.AlignRight } Controls.ComboBox { Kirigami.Theme.inherit: true currentIndex: 0 model: ["View", "Window", "Button", "Selection", "Tooltip", "Complementary"] onCurrentTextChanged: applicationWindow().globalDrawer.Kirigami.Theme.colorSet = currentText } Controls.Label { text: "Page color set:" Layout.alignment: Qt.AlignRight } Controls.ComboBox { Kirigami.Theme.inherit: true currentIndex: 1 model: ["View", "Window", "Button", "Selection", "Tooltip", "Complementary"] onCurrentTextChanged: page.Kirigami.Theme.colorSet = currentText } } Controls.Frame { Kirigami.Theme.inherit: true Layout.minimumHeight: childrenRect.height Layout.fillWidth: true height: childrenRect.height width: parent.width background: Rectangle { color: Kirigami.Theme.backgroundColor } contentItem: ColumnLayout { width: parent.width Controls.Label { text: "Set inherited from parent Item" } Kirigami.BasicListItem { width: parent.width - icon: "media-record-symbolic" + icon: "view-right-close" label: "Delegate1" } Kirigami.BasicListItem { width: parent.width label: "Delegate2" } } } Controls.Frame { Kirigami.Theme.inherit: false Kirigami.Theme.colorSet: Kirigami.Theme.Window Layout.minimumHeight: childrenRect.height Layout.fillWidth: true height: childrenRect.height width: parent.width background: Rectangle { color: Kirigami.Theme.backgroundColor } contentItem: ColumnLayout { width: parent.width Controls.Label { text: "Window Set" } Kirigami.BasicListItem { width: parent.width - icon: "media-record-symbolic" + icon: "view-right-close" label: "Delegate1" } Kirigami.BasicListItem { width: parent.width label: "Delegate2" } } } Controls.Frame { Kirigami.Theme.inherit: false Kirigami.Theme.colorSet: Kirigami.Theme.View Layout.minimumHeight: childrenRect.height Layout.fillWidth: true height: childrenRect.height width: parent.width background: Rectangle { color: Kirigami.Theme.backgroundColor } contentItem: ColumnLayout { width: parent.width Controls.Label { text: "View Set" } Kirigami.BasicListItem { width: parent.width - icon: "media-record-symbolic" + icon: "view-right-close" label: "Delegate1" } Kirigami.BasicListItem { width: parent.width label: "Delegate2" } } } Controls.Frame { Kirigami.Theme.inherit: false Kirigami.Theme.colorSet: Kirigami.Theme.Complementary Layout.minimumHeight: childrenRect.height Layout.fillWidth: true height: childrenRect.height width: parent.width background: Rectangle { color: Kirigami.Theme.backgroundColor } contentItem: ColumnLayout { Controls.Label { text: "Complementary Set" } Kirigami.BasicListItem { width: parent.width - icon: "media-record-symbolic" + icon: "view-right-close" label: "Delegate1" } Kirigami.BasicListItem { width: parent.width label: "Delegate2" } } } Controls.Button { Kirigami.Theme.colorSet: Kirigami.Theme.Button Kirigami.Theme.inherit: false text: "Fixed Color Button" } Controls.Button { Kirigami.Theme.inherit: true text: "Dynamic Color Button" } Kirigami.Icon { id: customColorIcon - source: "media-record-symbolic" + source: "view-right-close" color: "green" Layout.minimumWidth: 32 Layout.minimumHeight: 32 } RowLayout { Controls.Label { text: "RGB color for icon:" } Controls.SpinBox{ id: red editable: true from: 0 to: 255 onValueChanged: { customColorIcon.color = Qt.rgba(red.value/255, green.value/255, blue.value/255, 1); } } Controls.SpinBox{ id: green editable: true from: 0 to: 255 value: 255 onValueChanged: { customColorIcon.color = Qt.rgba(red.value/255, green.value/255, blue.value/255, 1); } } Controls.SpinBox{ id: blue editable: true from: 0 to: 255 onValueChanged: { customColorIcon.color = Qt.rgba(red.value/255, green.value/255, blue.value/255, 1); } } } } }