Commit 26946fe4 authored by Andreas Cord-Landwehr's avatar Andreas Cord-Landwehr
Browse files

Remove outdated resources

parent fc7420f7
/*
* Copyright 2012 Sebastian Gottfried <sebastiangottfried@web.de>
* Copyright 2013-2014 Andreas Cord-Landwehr <cordlandwehr@kde.org>
*
* 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 <http://www.gnu.org/licenses/>.
*/
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
}
}
]
}
/*
* Copyright 2013-2015 Andreas Cord-Landwehr <cordlandwehr@kde.org>
*
* 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 <http://www.gnu.org/licenses/>.
*/
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()
}
}
}
}
/*
* Copyright 2012 Sebastian Gottfried <sebastiangottfried@web.de>
* Copyright 2014 Andreas Cord-Landwehr <cordlandwehr@kde.org>
*
* 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 <http://www.gnu.org/licenses/>.
*/
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
}
}
]
}
......@@ -2,11 +2,8 @@
<qresource prefix="/artikulate">
<file>qml/ActionListItem.qml</file>
<file>qml/ArtikulateDrawer.qml</file>
<file>qml/CheckListItem.qml</file>
<file>qml/CourseSwitcher.qml</file>
<file>qml/DownloadPage.qml</file>
<file>qml/Editor.qml</file>
<file>qml/ListItem.qml</file>
<file>qml/Main.qml</file>
<file>qml/PhonemeUnitSelector.qml</file>
<file>qml/PhraseEditor.qml</file>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment