diff --git a/src/qml/CheckListItem.qml b/src/qml/CheckListItem.qml deleted file mode 100644 index a57b3fc..0000000 --- a/src/qml/CheckListItem.qml +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2012 Sebastian Gottfried - * Copyright 2013-2014 Andreas Cord-Landwehr - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License or (at your option) version 3 or any later version - * accepted by the membership of KDE e.V. (or its successor approved - * by the membership of KDE e.V.), which shall act as a proxy - * defined in Section 14 of version 3 of the license. - * - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.1 -import QtQuick.Controls 1.2 -import artikulate 1.0 - -Item { - id: root - - property alias title: label.text - property string iconName - property alias label: label - property bool checked: false - - signal stateChanged(bool checked) - - height: 15 + 30 + 15 - state: mouseArea.containsMouse? "hover": "normal" - - Rectangle { - id: bg - radius: 8 - anchors.fill: parent - } - - Item { - id: padding - opacity: root.checked ? 1.0 : 0.5 - - anchors { - fill: parent - topMargin: 5 - rightMargin: 5 - bottomMargin: 5 - leftMargin: 5 - } - - width: parent.width - height: Math.max(label.height, label.height) - - Icon { - id: iconItem - visible: !!root.iconName - anchors { - left: parent.left - verticalCenter: parent.verticalCenter - } - icon: root.iconName - width: theme.smallIconSize - height: theme.smallIconSize - enabled: root.checked - } - - Label { - id: label - elide: Text.ElideRight - anchors { - left: iconItem.visible? iconItem.right: parent.left - leftMargin: iconItem.visible ? Math.floor(theme.smallIconSize/2) : 0 - right: parent.right - verticalCenter: parent.verticalCenter - } - height: paintedHeight - font.italic: !root.checked - } - } - - MouseArea { - id: mouseArea - anchors.fill: parent - hoverEnabled: true - onClicked: { - root.checked = !root.checked - root.stateChanged(root.checked) - } - } - - states: [ - State { - name: "normal" - PropertyChanges { - target: bg - opacity: 0 - } - }, - State { - name: "hover" - PropertyChanges { - target: bg - opacity: 1.7 - } - } - ] -} diff --git a/src/qml/CourseSwitcher.qml b/src/qml/CourseSwitcher.qml deleted file mode 100644 index 749f517..0000000 --- a/src/qml/CourseSwitcher.qml +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2013-2015 Andreas Cord-Landwehr - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License or (at your option) version 3 or any later version - * accepted by the membership of KDE e.V. (or its successor approved - * by the membership of KDE e.V.), which shall act as a proxy - * defined in Section 14 of version 3 of the license. - * - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.1 -import QtQuick.Controls 1.2 -import artikulate 1.0 - -Item { - id: root - - property ResourceManager resourceManager - property Language language - property Course selectedCourse - property int view : CourseFilterModel.AllResources - - signal courseSelected(variant course) - - width: 300 - height: Math.max(buttonLeft.height, courseView.height) - - Connections { - target: courseModel - onLanguageChanged: { - if (courseModel.course(courseView.currentIndex) !== null) { - selectedCourse = courseModel.course(courseView.currentIndex) - courseSelected(selectedCourse) - } - } - } - - Component.onCompleted: { - courseView.currentIndex = 0 - } - - Component { - id: itemDelegate - - Row { - width: root.width - buttonLeft.width - buttonRight.width - height: theme.mediumIconSize - spacing: 10 - Icon { - id: icon - icon: "artikulate-course" - width: theme.smallMediumIconSize - height: theme.smallMediumIconSize - anchors.verticalCenter: parent.verticalCenter - } - Label { - id: courseTitleLabel - anchors.verticalCenter: parent.verticalCenter - height: paintedHeight - font.pointSize: theme.fontPointSize - text: model.title - } - } - } - - Row { - spacing : 10 - ToolButton { - id : buttonLeft - iconName: "arrow-left" - enabled: courseView.currentIndex > 0 - onClicked: { - languageView.decrementCurrentIndex() - } - } - - ListView { - id: courseView - - width: root.width - buttonLeft.width - buttonRight.width - height: theme.mediumIconSize - - clip: true - snapMode: ListView.SnapToItem - orientation: ListView.Horizontal - model: CourseFilterModel { - view: root.view - courseModel: CourseModel { - id: courseModel - resourceManager: root.resourceManager - language: root.language - } - } - onCurrentIndexChanged: { - if (courseModel.language === null) { - return; - } - if (courseModel.course(currentIndex) !== null) { - selectedCourse = courseModel.course(currentIndex) - courseSelected(selectedCourse) - } - } - delegate: itemDelegate - } - - ToolButton { - id: buttonRight - enabled: courseView.currentIndex < courseView.count - 2 - iconName: "arrow-right" - onClicked: { - courseView.incrementCurrentIndex() - } - } - } -} diff --git a/src/qml/ListItem.qml b/src/qml/ListItem.qml deleted file mode 100644 index ee07031..0000000 --- a/src/qml/ListItem.qml +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2012 Sebastian Gottfried - * Copyright 2014 Andreas Cord-Landwehr - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License or (at your option) version 3 or any later version - * accepted by the membership of KDE e.V. (or its successor approved - * by the membership of KDE e.V.), which shall act as a proxy - * defined in Section 14 of version 3 of the license. - * - * 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -import QtQuick 2.1 -import QtQuick.Controls 1.2 -import artikulate 1.0 - -Item { - id: root - property alias title: label.text - property string iconName - property alias label: label - signal selected - height: Math.max(label.height + 15 + 15, 15 + 15 + 30) - state: mouseArea.containsMouse? "hover": ListView.isCurrentItem? "selected": "normal" - - SystemPalette { - id: palette - colorGroup: root.enabled ? SystemPalette.Active : SystemPalette.Disabled - } - - Rectangle { - id: bg - border.width: 0 - anchors.fill: parent - } - - Item { - id: padding - - anchors { - fill: parent - topMargin: 10 - rightMargin: 10 - bottomMargin: 10 - leftMargin: 10 - } - - Icon { - id: iconItem - visible: !!root.iconName - anchors { - left: parent.left - verticalCenter: parent.verticalCenter - } - icon: root.iconName - width: theme.smallIconSize - height: theme.smallIconSize - } - - Label { - id: label - elide: Text.ElideRight - color: palette.buttonText - anchors { - left: iconItem.visible? iconItem.right: parent.left - leftMargin: iconItem.visible ? Math.floor(theme.smallIconSize/2) : 0 - right: parent.right - verticalCenter: parent.verticalCenter - } - height: paintedHeight - } - } - - MouseArea { - id: mouseArea - anchors.fill: parent - hoverEnabled: true - onClicked: root.selected() - } - - states: [ - State { - name: "normal" - PropertyChanges { - target: bg - color: palette.base - opacity: 1 - } - }, - State { - name: "hover" - PropertyChanges { - target: bg - color: palette.highlight - opacity: ListView.isCurrentItem? 0.8 : 0.4 - } - }, - State { - name: "selected" - PropertyChanges { - target: bg - color: palette.highlight - opacity: 1 - } - } - ] -} diff --git a/src/resources.qrc b/src/resources.qrc index b399c19..17cb202 100644 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -1,29 +1,26 @@ qml/ActionListItem.qml qml/ArtikulateDrawer.qml - qml/CheckListItem.qml - qml/CourseSwitcher.qml qml/DownloadPage.qml qml/Editor.qml - qml/ListItem.qml qml/Main.qml qml/PhonemeUnitSelector.qml qml/PhraseEditor.qml qml/PhraseEditorEditStateComponent.qml qml/PhraseEditorSoundComponent.qml qml/PhraseEditorTypeComponent.qml qml/ProfileSelector.qml qml/ProfileSettingsPage.qml qml/ProfileUserImageItem.qml qml/SoundPlayer.qml qml/SoundRecorder.qml qml/TrainerCourseStatistics.qml qml/TrainingPage.qml qml/UnitEditor.qml qml/WelcomePage.qml artikulate.knsrc