diff --git a/CMakeLists.txt b/CMakeLists.txt index f8f487d..6e5442f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,47 +1,47 @@ project(Kamoso) cmake_minimum_required(VERSION 2.8.12) -set(KF5_MIN_VERSION 5.48.0) +set(KF5_MIN_VERSION 5.56.0) find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) find_package(Qt5 NO_MODULE REQUIRED COMPONENTS Core Gui Widgets Quick Test OpenGL) find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Config DocTools KIO I18n Purpose) find_package(GStreamer 1.1.90 REQUIRED) find_package(GLIB2 REQUIRED) find_package(GObject REQUIRED) find_package(KF5Kirigami2) set_package_properties(KF5Kirigami2 PROPERTIES DESCRIPTION "A QtQuick based components set" PURPOSE "Required at runtime" TYPE RUNTIME ) include(ECMQMLModules) ecm_find_qmlmodule(QtGraphicalEffects 1.0) ecm_find_qmlmodule(QtQml 2.2) ecm_find_qmlmodule(QtQuick 2.5) ecm_find_qmlmodule(QtQuick.Controls 1.2) ecm_find_qmlmodule(QtQuick.Dialogs 1.0) ecm_find_qmlmodule(QtQuick.Layouts 1.1) ecm_find_qmlmodule(QtQuick.Window 2.2) include(KDEInstallDirs) include(KDECompilerSettings NO_POLICY_SCOPE) include(KDECMakeSettings) include(ECMInstallIcons) include(ECMAddTests) include(FeatureSummary) add_definitions(-DQT_NO_URL_CAST_FROM_STRING) add_subdirectory(src) add_subdirectory(icons) add_subdirectory(doc) install(FILES org.kde.kamoso.appdata.xml DESTINATION ${CMAKE_INSTALL_METAINFODIR}) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/icons/CMakeLists.txt b/icons/CMakeLists.txt index 8f11b55..95cbbcf 100644 --- a/icons/CMakeLists.txt +++ b/icons/CMakeLists.txt @@ -1,11 +1,10 @@ ecm_install_icons(ICONS 16-apps-kamoso.png 22-apps-kamoso.png 32-apps-kamoso.png 48-apps-kamoso.png 64-apps-kamoso.png sc-apps-kamoso.svgz sc-actions-burst.svgz - sc-actions-record.svgz THEME hicolor DESTINATION ${ICON_INSTALL_DIR} ) diff --git a/icons/sc-actions-record.svgz b/icons/sc-actions-record.svgz deleted file mode 100644 index 02a0ecf..0000000 Binary files a/icons/sc-actions-record.svgz and /dev/null differ diff --git a/src/qml/Main.qml b/src/qml/Main.qml index 483ec60..ef8e37c 100644 --- a/src/qml/Main.qml +++ b/src/qml/Main.qml @@ -1,216 +1,216 @@ import QtQuick 2.5 import QtQuick.Controls 1.1 import QtQuick.Controls 2.0 as QQC2 import QtQuick.Layouts 1.1 import QtQuick.Window 2.2 import KamosoQtGStreamer 1.0 import org.kde.kirigami 2.0 as Kirigami import org.kde.kamoso 3.0 Kirigami.ApplicationWindow { id: root visible: true title: i18n("Kamoso") pageStack.globalToolBar.style: Kirigami.ApplicationHeaderStyle.None Component.onCompleted: { width = 700 height = width*3/4 } function awesomeAnimation(path) { // tada.x = visor.x // tada.y = 0 // tada.width = visor.width // tada.height = visor.height tada.source = "file://"+path tada.state = "go" tada.state = "done" // tada.visible = true } Image { id: tada z: 10 width: 10 height: 10 fillMode: Image.PreserveAspectFit states: [ State { name: "go" PropertyChanges { target: tada; x: visor.x } PropertyChanges { target: tada; y: visor.y } PropertyChanges { target: tada; width: visor.width } PropertyChanges { target: tada; height: visor.height } }, State { name: "done" PropertyChanges { target: tada; x: root.width } PropertyChanges { target: tada; y: root.height } PropertyChanges { target: tada; width: Kirigami.Units.gridUnit } PropertyChanges { target: tada; height: Kirigami.Units.gridUnit } } ] transitions: [ Transition { from: "go"; to: "done" NumberAnimation { target: tada properties: "width,height"; duration: 700; easing.type: Easing.InCubic } NumberAnimation { target: tada properties: "x,y"; duration: 700; easing.type: Easing.InCubic } } ] } Mode { id: photoMode mimes: "image/jpeg" checkable: false iconName: "camera-photo-symbolic" text: i18n("Take a Picture") nameFilter: "picture_*" onTriggered: { whites.showAll() webcam.takePhoto() } Connections { target: webcam onPhotoTaken: awesomeAnimation(path) } } Mode { id: burstMode mimes: "image/jpeg" checkable: true iconName: checked ? "media-playback-stop" : "burst" text: checked? i18n("End Burst") : i18n("Capture a Burst") property int photosTaken: 0 modeInfo: photosTaken > 0 ? i18np("1 photo taken", "%1 photos taken", photosTaken) : "" nameFilter: "picture_*" enabled: !videoMode.checked onCheckedChanged: if (checked) { photosTaken = 0 } readonly property var smth: Timer { id: burstTimer running: burstMode.checked interval: 2500 repeat: true onTriggered: { webcam.takePhoto() burstMode.photosTaken++; } } } Mode { id: videoMode mimes: "video/x-matroska" checkable: true - iconName: checked ? "media-playback-stop" : "record" + iconName: checked ? "media-playback-stop" : "camera-video-symbolic" text: checked? i18n("Stop Recording") : i18n("Record a Video") modeInfo: webcam.recordingTime nameFilter: "video_*" enabled: !burstMode.checked onCheckedChanged: { webcam.isRecording = checked; } } contextDrawer: Kirigami.OverlayDrawer { edge: Qt.RightEdge drawerOpen: false handleVisible: true modal: true leftPadding: 0 topPadding: 0 rightPadding: 0 bottomPadding: 0 contentItem: ImagesView { id: view implicitWidth: Kirigami.Units.gridUnit * 20 mimeFilter: root.pageStack.currentItem.actions.main.mimes nameFilter: root.pageStack.currentItem.actions.main.nameFilter } } globalDrawer: Kirigami.OverlayDrawer { edge: Qt.LeftEdge drawerOpen: false handleVisible: true modal: true width: Kirigami.Units.gridUnit * 20 leftPadding: Kirigami.Units.smallSpacing topPadding: Kirigami.Units.smallSpacing rightPadding: Kirigami.Units.smallSpacing bottomPadding: Kirigami.Units.smallSpacing contentItem: Config { id: configView QQC2.ScrollBar.vertical: QQC2.ScrollBar {} header: QQC2.Control { height: effectsGalleryHeading.height + Kirigami.Units.largeSpacing Kirigami.Heading { id: effectsGalleryHeading level: 1 color: Kirigami.Theme.textColor elide: Text.ElideRight text: i18n("Effects Gallery") } } } } Shortcut { sequence: "Return" onActivated: visor.actions.main.triggered(null) } pageStack.initialPage: Kirigami.Page { id: visor bottomPadding: 0 topPadding: 0 rightPadding: 0 leftPadding: 0 actions { left: videoMode main: photoMode right: burstMode } Rectangle { anchors.fill: parent color: "black" z: -1 } VideoItem { surface: videoSurface1 anchors.fill: parent } Text { anchors { horizontalCenter: parent.horizontalCenter top: parent.top margins: 20 } text: videoMode.checked ? videoMode.modeInfo : burstMode.checked ? burstMode.modeInfo : "" color: "white" styleColor: "black" font.pointSize: 20 style: Text.Outline } } }