Commit b26439c3 authored by AlmAck's avatar AlmAck
Browse files

fixed #52

replaced old rss link with community.chakralinux.org
parent 18df3ebe
/*
* Copyright 2017 Luca Giambonini <almack@chakralinux.org>
*
* 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 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.1
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.2
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
PlasmaComponents.Button {
id: ueButton
implicitWidth: 150
implicitHeight: 140
style: ButtonStyle {
background: Item {
opacity: control.hovered ? 1.0 : 0.5
//This code is duplicated here and Button and ToolButton
//maybe we can make an AbstractButton class?
PlasmaCore.FrameSvgItem {
id: surfaceNormal
anchors.fill: parent
imagePath: "widgets/button"
prefix: "normal"
}
PlasmaCore.FrameSvgItem {
id: surfacePressed
anchors.fill: parent
imagePath: "widgets/button"
prefix: "pressed"
opacity: 0
}
state: control.pressed || control.checked ? "pressed" : "normal"
states: [
State { name: "normal" },
State { name: "pressed"
PropertyChanges {
target: surfaceNormal
opacity: 0
}
PropertyChanges {
target: surfacePressed
opacity: 1
}
}
]
transitions: [
Transition {
to: "normal"
//Cross fade from pressed to normal
ParallelAnimation {
NumberAnimation { target: surfaceNormal; property: "opacity"; to: 1; duration: 100 }
NumberAnimation { target: surfacePressed; property: "opacity"; to: 0; duration: 100 }
}
}
]
Component.onCompleted: {
padding.top = surfaceNormal.margins.top
padding.left = surfaceNormal.margins.left
padding.right = surfaceNormal.margins.right
padding.bottom = surfaceNormal.margins.bottom
}
}
label: Item {
implicitHeight: buttonContent.Layout.preferredHeight
implicitWidth: buttonContent.implicitWidth
ColumnLayout {
id: buttonContent
anchors.fill: parent
spacing: units.smallSpacing
Layout.preferredHeight: iconSize+ label.implicitHeight
property real minimumWidth: Layout.minimumWidth + style.padding.left + style.padding.right
onMinimumWidthChanged: {
if (control.minimumWidth !== undefined) {
style.minimumWidth = minimumWidth;
control.minimumWidth = minimumWidth;
}
}
property real minimumHeight: Layout.preferredHeight + style.padding.top + style.padding.bottom
onMinimumHeightChanged: {
if (control.minimumHeight !== undefined) {
style.minimumHeight = minimumHeight;
control.minimumHeight = minimumHeight;
}
}
PlasmaCore.IconItem {
id: icon
source: control.iconName || control.iconSource
anchors.horizontalCenter: parent.horizontalCenter
implicitHeight: iconSize
implicitWidth: iconSize
Layout.preferredHeight: iconSize
Layout.alignment: Qt.AlignHCenter
active: control.hovered
colorGroup: controlHovered || !flat ? PlasmaCore.Theme.ButtonColorGroup : PlasmaCore.ColorScope.colorGroup
}
PlasmaComponents.Label {
id: label
text: control.text
textFormat: Text.StyledText
font.pointSize: iconSize > 96 ? theme.defaultFont.pointSize : theme.smallestFont.pointSize
visible: control.text != ""
Layout.fillWidth: true
color: theme.buttonTextColor
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap
maximumLineCount: 3
}
}
}
}
}
......@@ -11,11 +11,8 @@ XmlListModel {
source: feedUrl
query: "/rss/channel/item"
XmlRole { name: "title"; query: "title/string()"; }
XmlRole { name: "story"; query: "content:encoded/string()"; }
XmlRole { name: "encodedContent"; query: "content:encoded/string()"; }
XmlRole { name: "story"; query: "description/string()"; }
XmlRole { name: "url"; query: "link/string()"; isKey: true }
XmlRole { name: "enclosureUrl"; query: "enclosure/@url/string()"; isKey: true }
XmlRole { name: "enclosureType"; query: "enclosure/@type/string()"; isKey: true }
XmlRole { name: "pubDate"; query: "pubDate/string()"; isKey: true }
}
......@@ -34,11 +34,13 @@ Item {
Layout.minimumWidth: minimumWidth < buttonRow.width ? buttonRow.width : minimumWidth
Layout.minimumHeight: minimumHeight
property int iconSize: units.iconSizes.large
InfoModel { id: infoModel }
RssModel {
id: newsFeedModel
feedUrl: "https://chakralinux.org/news/index.php?/feeds/index.rss2"
feedUrl: "https://community.chakralinux.org/c/news.rss"
}
Item {
......@@ -100,7 +102,9 @@ Item {
id: buttonRow
spacing: 3
anchors { horizontalCenter: parent.horizontalCenter; bottom: parent.bottom }
anchors {
horizontalCenter: parent.horizontalCenter;bottom: parent.bottom
}
Rectangle {
height: 48
......@@ -112,7 +116,7 @@ Item {
onNewData: {executer.disconnectSource(sourceName);}
}
PlasmaComponents.Button {
InfoButton {
id: install
text: i18n("Install Chakra")
......@@ -120,7 +124,7 @@ Item {
onClicked: executer.connectSource("/usr/bin/launch-calamares.sh");
}
PlasmaComponents.Button {
InfoButton {
id: website
text: i18n("Website")
......@@ -128,7 +132,7 @@ Item {
onClicked: executer.connectSource("xdg-open https://chakralinux.org/")
}
PlasmaComponents.Button {
InfoButton {
id: donate
text: i18n("Donate")
......@@ -136,7 +140,7 @@ Item {
onClicked: executer.connectSource("xdg-open https://chakralinux.org/?donate")
}
PlasmaComponents.Button {
InfoButton {
id: beginner
text: i18n("Beginners Guide")
......@@ -144,7 +148,7 @@ Item {
onClicked: executer.connectSource("xdg-open https://chakralinux.org/wiki/index.php?title=Beginner%E2%80%99s_Guide")
}
PlasmaComponents.Button {
InfoButton {
id: passwords
text: i18n("Passwords")
......@@ -155,7 +159,7 @@ Item {
+ "\"" + i18n("You may need some passwords to do stuff, so here they are:\n\nroot: root / root\nuser: live / live\n\nHave fun") + "\"")
}
PlasmaComponents.Button {
InfoButton {
id: installed
text: i18n("Installed Packages")
......
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