ny commit

This commit is contained in:
Niels
2025-05-28 20:47:14 +02:00
commit d4cd7f8bdc
324 changed files with 7462 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
Rectangle {
property bool fill: true
property bool borderVisible: true
anchors.fill: parent
anchors.margins: Theme.paddingSmall
color: "transparent"
border.color: borderVisible ? Theme.rgba(Theme.highlightBackgroundColor, 0.8) : "transparent"
radius: 20
Rectangle {
visible: fill
anchors.fill: parent
anchors.topMargin: parent.border.width
anchors.leftMargin: parent.border.width
anchors.rightMargin: parent.border.width
anchors.bottomMargin: parent.border.width
radius: 30
gradient: Gradient {
GradientStop { position: 0.0; color: Theme.rgba(Theme.highlightBackgroundColor,0.125) }
GradientStop { position: 1.0; color: "transparent" }
}
}
}
+38
View File
@@ -0,0 +1,38 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
BackgroundItem {
id: delegate
width: parent.width;
height: Theme.itemSizeExtraSmall
Image {
id: countryImage
height: parent.height * 0.6
fillMode: Image.PreserveAspectFit
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: Theme.paddingLarge
source: "../flags/"+alpha_2.toLowerCase()+".png"
}
Label {
id: land
anchors.verticalCenter: parent.verticalCenter
anchors.left: countryImage.right
anchors.leftMargin: Theme.paddingMedium
anchors.right: count.left
anchors.rightMargin: Theme.paddingMedium
color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
font.pixelSize: Theme.fontSizeSmall
text: radioBrowser.getCountryName(alpha_2)
}
Label {
id: count
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.rightMargin: Theme.paddingMedium
color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
font.pixelSize: Theme.fontSizeSmall;
text: "["+stationcount+"]"
}
}
+31
View File
@@ -0,0 +1,31 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
//import "../../helpers/jsFunctions.js" as JS
BackgroundItem {
id: delegate
width: parent.width / 2;
height: Theme.itemSizeExtraSmall
ButtonRect {fill: false}
Image {
id: countryImage
height: parent.height * 0.6
fillMode: Image.PreserveAspectFit
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: Theme.paddingLarge
source: "../flags/"+alpha_2.toLowerCase()+".png"
}
Label {
id: land
anchors.verticalCenter: parent.verticalCenter
anchors.left: countryImage.right
anchors.leftMargin: Theme.paddingMedium
color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
font.pixelSize: Theme.fontSizeSmall;
width: parent.width - countryImage.width - Theme.paddingMedium - (Theme.paddingLarge * 2)
elide: Text.ElideRight
text: radioBrowser.getCountryName(alpha_2)
}
}
+253
View File
@@ -0,0 +1,253 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
import QtGraphicalEffects 1.0
import "../helpers/jsFunctions.js" as JS
ListItem {
id: delegate
property alias favIcon: favIcon
property alias contextMenuHeight: contextMenu.height
property bool favo: favorite ? true : false
property variant view
// property bool favorite: false
height: menuOpen ? contextMenu.height + Theme.itemSizeExtraLarge : Theme.itemSizeExtraLarge
menu: contextMenu
contentHeight: Theme.itemSizeExtraLarge
showMenuOnPressAndHold: true
ContextMenu {
id: contextMenu
MenuItem {
Row {
anchors.centerIn: parent
spacing: Theme.paddingMedium
Image {
source: "image://theme/icon-m-like"
anchors.verticalCenter: parent.verticalCenter
height: Theme.itemSizeExtraSmall * 0.5
width: height
fillMode: Image.PreserveAspectFit
}
Label {
font.pixelSize: Theme.fontSizeSmall
text: qsTr("Vote on Community Radio Browser")
}
}
onClicked: console.log("LIKE!!!") //remove()//listView.currentItem.remove(rpindex,rpsource) //listView.remorseAction();
}
MenuItem {
Row {
anchors.centerIn: parent
spacing: Theme.paddingMedium
Image {
source: favo ? "image://theme/icon-m-favorite-selected" : "image://theme/icon-m-favorite"
anchors.verticalCenter: parent.verticalCenter
height: Theme.itemSizeExtraSmall * 0.5
width: height
fillMode: Image.PreserveAspectFit
}
Label {
font.pixelSize: Theme.fontSizeSmall
text: favo ? qsTr("Remove from favorites") : qsTr("Add to favorites")
}
}
onClicked: {
favo ? favo = false : favo = true
//radioPlayer._favorite = favo
radioPlayer.setStationFavorite(stationuuid,name,countrycode,homepage,url_resolved,favicon,tags,codec,bitrate,hls,favo)
}
}
/* MenuItem {
Row {
anchors.centerIn: parent
spacing: Theme.paddingMedium
Image {
source: "image://theme/icon-m-delete"
anchors.verticalCenter: parent.verticalCenter
height: Theme.itemSizeExtraSmall * 0.5
width: height
fillMode: Image.PreserveAspectFit
}
Label {
font.pixelSize: Theme.fontSizeSmall
text: qsTr("Remove from AllRadio2")
}
}
onClicked: remove()//console.log("DELETE!!!") //remove()//listView.currentItem.remove(rpindex,rpsource) //listView.remorseAction();
} */
}
/* Rectangle {
id: stationLogo
anchors.top: header.bottom
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width - (Theme.paddingLarge * 2)
height: width
radius: 20
color: "transparent" //Theme.rgba(Theme.highlightDimmerColor,0.8)
border.color: Theme.rgba(Theme.highlightDimmerColor,0.8)
border.width: Theme.paddingSmall
} */
Rectangle {
id: favIcon
property alias source: stationimage.source
anchors.left: parent.left
anchors.leftMargin: Theme.paddingMedium
anchors.verticalCenter: parent.verticalCenter
height: Theme.itemSizeLarge//nameLabel.height + codecLabel.height + tagLabel.height
width: height
radius: 20
color: "transparent" //Theme.rgba(Theme.highlightDimmerColor,0.8)
border.color: Theme.rgba(Theme.highlightDimmerColor,0.8)
border.width: Theme.paddingSmall
}
Image {
id: stationimage
anchors.fill: favIcon
anchors.margins: favIcon.border.width
fillMode: Image.PreserveAspectFit
source: favicon ? favicon : "../images/community.png"
// layer.enabled: true
// layer.effect: OpacityMask {
// maskSource: parent
// }
// layer {
// enabled: false
// effect: ColorOverlay {
// color: Theme.highlightBackgroundColor
// }
// }
BusyIndicator {
size: BusyIndicatorSize.Medium
anchors.centerIn: stationimage
//running: appActive && stationimage.status != Image.Ready
}
onStatusChanged:
switch(stationimage.status){
case Image.Null:
//console.log("no image has been set: "+ name);
source = "../images/community.png"
break;
case Image.Ready:
//console.log("the image has been loaded: "+name+"\n"
// + stationimage.width + " x " + stationimage.height);
break;
case Image.Loading:
break;
case Image.Error:
//console.log("an error occurred while loading the image: "+name);
source = "../images/community.png"
break;
}
}
/* Image {
height: stationimage.height * 0.50
fillMode: Image.PreserveAspectFit
opacity: 0.9
anchors.right: favIcon.right
anchors.bottom: favIcon.bottom
source: "../flags/"+countrycode.toLowerCase()+".png"
} */
// }
Label {
id: nameLabel
anchors.bottom: countryLabel.top
// anchors.bottomMargin: Theme.paddingSmall
anchors.left: favIcon.right
anchors.right: fav.left
anchors.leftMargin: Theme.paddingLarge
anchors.rightMargin: Theme.paddingMedium
elide: Text.ElideRight
width: parent.width - (favIcon.width + (Theme.paddingLarge * 2))
text: lastcheckok == "1" ? name : " [DOWN] "+name
color: lastcheckok == "1" ? Theme.primaryColor : Theme.secondaryColor
font.strikeout: lastcheckok == "1" ? false : true
font.pixelSize: Theme.fontSizeSmall
}
Image {
id:countryImage
height: countryLabel.height * 0.8
anchors.leftMargin: Theme.paddingLarge
fillMode: Image.PreserveAspectFit
opacity: 0.7
anchors.left: favIcon.right
anchors.bottom: countryLabel.bottom
source: "../flags/"+countrycode.toLowerCase()+".png"
}
Label {
id: countryLabel
anchors.verticalCenter: parent.verticalCenter
anchors.left: countryImage.right
anchors.leftMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeExtraSmall
text: radioBrowser.getCountryName(countrycode)//"Country name"//getAll(hls,codec,bitrate)
color: delegate.highlighted ? Theme.highlightColor : Theme.secondaryColor
}
Label {
id: codecLabel
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.leftMargin: Theme.paddingLarge
font.pixelSize: Theme.fontSizeExtraSmall
text: JS.getAll(hls,codec,bitrate)
color: delegate.highlighted ? Theme.highlightColor : Theme.secondaryColor
}
Label {
id: tagLabel
anchors.top: countryLabel.bottom
//anchors.topMargin: Theme.paddingSmall
anchors.left: favIcon.right
anchors.leftMargin: Theme.paddingLarge
font.pixelSize: Theme.fontSizeExtraSmall
width: parent.width - (favIcon.width + (Theme.paddingLarge * 2))
elide: Text.ElideRight
text: tags
color: delegate.highlighted ? Theme.highlightColor : Theme.secondaryColor
}
Image {
id: fav
height: nameLabel.height * 0.8
width: height
fillMode: Image.PreserveAspectFit
opacity: 0.8
visible: favo
anchors.right: parent.right
anchors.verticalCenter: nameLabel.verticalCenter
//anchors.top: nameLabel.top
anchors.rightMargin: Theme.paddingMedium
source: "image://theme/icon-m-favorite-selected" //favo ? "image://theme/icon-m-favorite-selected" : "image://theme/icon-m-favorite"
}
//onFavoChanged: if (favo) setRadioData()
onClicked: {
if (model.url_resolved !== radioPlayer._url_resolved) {
radioPlayer._favicon = model.favicon
radioPlayer._name = model.name
radioPlayer._countrycode = model.countrycode
radioPlayer._tags = model.tags
radioPlayer._codec = model.codec//getCodec(model.codec)
radioPlayer._bitrate = model.bitrate //getBitrate(model.bitrate)
radioPlayer._hls = model.hls
radioPlayer._url_resolved = model.url_resolved
radioPlayer._homepage = model.homepage
radioPlayer._stationuuid = model.stationuuid
radioPlayer._favorite = favo
radioPlayer.clicked = false
} else radioPlayer.clicked = true
}
}
+109
View File
@@ -0,0 +1,109 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
import QtGraphicalEffects 1.0
//import "../../helpers/jsFunctions.js" as JS
Column {
property string stationImage: "" //stationImage
property string stationLabel: "" //imagelabel
property bool flag: false
property string flagimage: "" //flagimage
property bool stationBorder: true
property alias imageVisible: stationimage.visible
spacing: Theme.paddingMedium
Rectangle {
width: parent.width
height: width
color: Theme.overlayBackgroundColor
border.color: stationBorder ? Theme.rgba(Theme.highlightBackgroundColor, 0.8) : "transparent"
anchors.horizontalCenter: parent.horizontalCenter
//border.width:
//onWidthChanged: console.log(" *********** WIDTH: "+width)
/* BusyIndicator {
z:99
size: BusyIndicatorSize.Medium
anchors.centerIn: stationimage
running: stationimage.loading && stationImage !== ""//appActive && stationimage.status != Image.Ready
} */
Image {
property bool loading: false
id: stationimage
width: parent.width - (Theme.paddingSmall * 2)
height: width
anchors.centerIn: parent
fillMode: Image.PreserveAspectFit
visible: false
source: stationImage ? Qt.resolvedUrl(stationImage) : ""// ? stationImage : stationimage.visible = false
/* BusyIndicator {
size: BusyIndicatorSize.Medium
anchors.centerIn: stationimage
running: stationimage.status != Image.Ready && stationimage.visible//appActive && stationimage.status != Image.Ready
} */
onStatusChanged:
switch(stationimage.status){
case Image.Null:
loading = false
visible = false
break;
case Image.Ready:
loading = false
visible = true
break;
case Image.Loading:
loading = true
break;
case Image.Error:
loading = false
visible = false
break;
default:
loading = false
visible = false
}
}
Label {
id: stationlabel
anchors.fill: stationimage
anchors.margins: Theme.paddingMedium
visible: !stationimage.visible
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
width: parent.width - (parent.border.width * 2)
height: width
text: stationLabel ? stationLabel : "AllRadio"//lastcheckok == "1" ? name : " [DOWN] "+name
color: Theme.primaryColor//stationlabel === "1" ? Theme.lightPrimaryColor : Theme.secondaryColor
wrapMode: Text.WordWrap
maximumLineCount: 4
//font.strikeout: lastcheckok == "1" ? false : true
font.pixelSize: Theme.fontSizeHuge * 4
fontSizeMode: Text.Fit
font.bold: true
opacity: 0.6
}
/* Glow {
id: stationglow
visible: stationlabel.visible
radius: Math.round((parent.width / Screen.width) * 10)
samples: radius * 2
spread: radius / 10//0.9//parent.width / Screen.width
//opacity: 0.4
transparentBorder: true
color: Theme.secondaryColor//JS.getRandomColor()
source: stationlabel
anchors.fill: stationlabel
} */
Image {
id:countryImage
visible: flag
width: Theme.itemSizeSmall * 0.5
anchors.top: stationimage.visible ? stationimage.top : parent.top
anchors.right: stationimage.visible ? stationimage.right : parent.right
anchors.margins: Theme.paddingMedium
fillMode: Image.PreserveAspectFit
source: flagimage
}
}
}
+34
View File
@@ -0,0 +1,34 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
import QtGraphicalEffects 1.0
import "../helpers/jsFunctions.js" as JSfunctions
ListItem {
id: delegate
property bool flagVisible: false
height: parent.height //Theme.itemSizeHuge * 2
width: height * 0.83
contentHeight: height
contentWidth: width
Column {
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: Theme.paddingMedium
spacing: Theme.paddingMedium
RadioImage {id:stationimage;anchors.horizontalCenter: parent.horizontalCenter; width: delegate.width * 0.8;stationImage: favicon ? favicon : ""; flag: flagVisible;stationLabel: name;flagimage: "../flags/"+countrycode.toLowerCase()+".png"}
Label {
id: nameLabel
horizontalAlignment: Text.AlignHCenter
elide: Text.ElideRight
width: stationimage.width
height: Theme.itemSizeExtraSmall
text: lastcheckok === "1" ? name : " [DOWN] "+name
color: lastcheckok === "1" ? Theme.primaryColor : Theme.secondaryColor
wrapMode: Text.WordWrap
maximumLineCount: 2
font.strikeout: lastcheckok === "1" ? false : true
font.pixelSize: Theme.fontSizeTiny
}
}
}
+34
View File
@@ -0,0 +1,34 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
import QtGraphicalEffects 1.0
import "../helpers/jsFunctions.js" as JSfunctions
ListItem {
id: delegate
property bool flagVisible: false
height: parent.height //Theme.itemSizeHuge * 2
width: height * 0.83
contentHeight: height
contentWidth: width
Column {
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: Theme.paddingMedium
spacing: Theme.paddingMedium
TagImage {id:stationimage;anchors.horizontalCenter: parent.horizontalCenter; width: delegate.width * 0.8;stationImage: ""; stationLabel: tag;}
Label {
id: nameLabel
horizontalAlignment: Text.AlignHCenter
elide: Text.ElideRight
width: stationimage.width
height: Theme.itemSizeExtraSmall
text: tag ? tag : "No Tag"
color: Theme.primaryColor
wrapMode: Text.WordWrap
maximumLineCount: 2
//font.strikeout: lastcheckok == "1" ? false : true
font.pixelSize: Theme.fontSizeTiny
}
}
}
+154
View File
@@ -0,0 +1,154 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
import QtGraphicalEffects 1.0
import "../helpers/jsFunctions.js" as JSfunctions
ListItem {
id: delegate
property alias favIcon: favIcon
property alias contextMenuHeight: contextMenu.height
//property bool favo: favorite ? true : false
property variant view
enabled: lastcheckok
opacity: lastcheckok ? 1.0 : 0.3
// property bool favorite: false
height: menuOpen ? contextMenu.height + Theme.itemSizeExtraLarge : Theme.itemSizeExtraLarge
menu: contextMenu
contentHeight: Theme.itemSizeExtraLarge
showMenuOnPressAndHold: true
ContextMenu {
id: contextMenu
MenuItem {
Row {
anchors.centerIn: parent
spacing: Theme.paddingMedium
Image {
source: "image://theme/icon-m-like"
anchors.verticalCenter: parent.verticalCenter
height: Theme.itemSizeExtraSmall * 0.5
width: height
fillMode: Image.PreserveAspectFit
}
Label {
font.pixelSize: Theme.fontSizeSmall
text: qsTr("Vote on Community Radio Browser")
}
}
onClicked: console.log("LIKE!!!") //remove()//listView.currentItem.remove(rpindex,rpsource) //listView.remorseAction();
}
MenuItem {
Row {
anchors.centerIn: parent
spacing: Theme.paddingMedium
Image {
//source: favo ? "image://theme/icon-m-favorite-selected" : "image://theme/icon-m-favorite"
anchors.verticalCenter: parent.verticalCenter
height: Theme.itemSizeExtraSmall * 0.5
width: height
fillMode: Image.PreserveAspectFit
}
Label {
font.pixelSize: Theme.fontSizeSmall
//text: favo ? qsTr("Remove from favorites") : qsTr("Add to favorites")
}
}
onClicked: {
favo ? favo = false : favo = true
//radioPlayer._favorite = favo
radioPlayer.setStationFavorite(stationuuid,name,countrycode,homepage,url_resolved,favicon,tags,codec,bitrate,hls,favo)
}
}
}
RadioImage {
id: favIcon
anchors.left: parent.left
anchors.leftMargin: Theme.paddingSmall
anchors.verticalCenter: parent.verticalCenter
height: Theme.itemSizeLarge//nameLabel.height + codecLabel.height + tagLabel.height
width: height
stationImage: favicon ? favicon : ""
stationLabel: name
//radius: 20
}
Label {
id: nameLabel
anchors.bottom: countryLabel.top
// anchors.bottomMargin: Theme.paddingSmall
anchors.left: favIcon.right
anchors.right: fav.left
anchors.leftMargin: Theme.paddingLarge
anchors.rightMargin: Theme.paddingMedium
elide: Text.ElideRight
width: parent.width - (favIcon.width + (Theme.paddingLarge * 2))
text: lastcheckok == "1" ? name : " [DOWN] "+name
color: lastcheckok == "1" ? Theme.primaryColor : Theme.secondaryColor
font.strikeout: lastcheckok == "1" ? false : true
font.pixelSize: Theme.fontSizeSmall
}
Image {
id:countryImage
height: countryLabel.height * 0.8
anchors.leftMargin: Theme.paddingLarge
fillMode: Image.PreserveAspectFit
opacity: 0.7
anchors.left: favIcon.right
anchors.bottom: countryLabel.bottom
source: countrycode ? "../flags/"+countrycode.toLowerCase()+".png" : ""
}
Label {
id: countryLabel
anchors.verticalCenter: parent.verticalCenter
anchors.left: countryImage.right
anchors.leftMargin: Theme.paddingMedium
font.pixelSize: Theme.fontSizeExtraSmall
text: countrycode ? radioBrowser.getCountryName(countrycode) : "No country"//"Country name"//getAll(hls,codec,bitrate)
color: delegate.highlighted ? Theme.highlightColor : Theme.secondaryColor
}
Label {
id: codecLabel
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.leftMargin: Theme.paddingLarge
anchors.rightMargin: Theme.paddingSmall
font.pixelSize: Theme.fontSizeExtraSmall
text: lastcheckok ? JSfunctions.getAll(hls,codec,bitrate) : "[OFFLINES]"
color: delegate.highlighted ? Theme.highlightColor : Theme.secondaryColor
}
Label {
id: tagLabel
anchors.top: countryLabel.bottom
//anchors.topMargin: Theme.paddingSmall
anchors.left: favIcon.right
anchors.leftMargin: Theme.paddingLarge
font.pixelSize: Theme.fontSizeExtraSmall
font.italic: true
width: parent.width - (favIcon.width + (Theme.paddingLarge * 2))
elide: Text.ElideRight
text: tags
color: delegate.highlighted ? Theme.highlightColor : Theme.secondaryColor
}
Image {
id: fav
height: nameLabel.height * 0.8
width: height
fillMode: Image.PreserveAspectFit
opacity: 0.8
visible: false//favo
anchors.right: parent.right
anchors.verticalCenter: nameLabel.verticalCenter
//anchors.top: nameLabel.top
anchors.rightMargin: Theme.paddingMedium
source: "image://theme/icon-m-favorite-selected" //favo ? "image://theme/icon-m-favorite-selected" : "image://theme/icon-m-favorite"
}
//onFavoChanged: if (favo) setRadioData()
}
+50
View File
@@ -0,0 +1,50 @@
import QtQuick 2.0
import QtGraphicalEffects 1.0
import Sailfish.Silica 1.0
Rectangle {
property alias text: text.text
property bool down: false
property alias fontSize: text.font.pixelSize
property alias fontColor: text.color
property alias icon: image.source
property alias iconVisible: image.visible
signal buttonClick()
height: column.height
width: column.width
color: "transparent"// !down ? Theme.highlightDimmerColor : "transparent"
opacity: !down ? 0.8 : 1.0
//anchors.fill: parent
Column {
id: column
anchors.centerIn: parent
Image {
id: image
height: visible ? Theme.itemSizeExtraSmall * 0.8 : 0
anchors.horizontalCenter: parent.horizontalCenter
width: height
}
Label {
id: text
visible: text.text !== "" ? true : false
anchors.horizontalCenter: parent.horizontalCenter
color: down ? Theme.primaryColor : Theme.secondaryColor//highlighted ? Theme.primaryColor : Theme.secondaryColor
// font.bold: down ? true : false
}
Rectangle {
anchors.horizontalCenter: parent.horizontalCenter
visible: down
width: text.width
height: Theme.paddingSmall * 0.4
color: fontColor//Theme.secondaryHighlightColor
}
}
MouseArea {
anchors.fill: parent
onClicked: parent.buttonClick()
}
}
+39
View File
@@ -0,0 +1,39 @@
import QtQuick 2.0
Item {
property string page: "FavoritesTab.qml"
property real showP: 0.0
property int tab: 0
width: parent.width
height: Theme.itemSizeMedium//play.height + (Theme.paddingMedium * 2)
Row {
id: row
width: parent.width
height: parent.height//Theme.itemSizeMedium//play.height + (Theme.paddingMedium * 2)
anchors.verticalCenter: parent.verticalCenter
TabButton {
id: home
down: tab === 0
width: parent.width / 3
// icon: "image://theme/icon-m-home" //"image://theme/icon-m-video"
text: "Favorites"
onButtonClick: {showP=0.0;tab = 0}
}
TabButton {
id: search
down: tab === 1
width: parent.width / 3
// icon: "image://theme/icon-m-search"
text: "History"
onButtonClick: {showP=0.0;tab = 1}
}
TabButton {
id: favorite
down: tab === 2
width: parent.width / 3
// icon: "image://theme/icon-m-favorite"
text: "Search"
onButtonClick: {showP=0.0;tab = 2;console.log("CLICK")}
}
}
}
+106
View File
@@ -0,0 +1,106 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
import QtGraphicalEffects 1.0
//import "../../helpers/jsFunctions.js" as JS
Column {
property string stationImage: "" //stationImage
property string stationLabel: "" //imagelabel
property bool flag: false
property string flagimage: "" //flagimage
spacing: Theme.paddingMedium
Rectangle {
width: parent.width
height: width
color: Theme.overlayBackgroundColor
border.color: Theme.rgba(Theme.highlightBackgroundColor, 0.8)
anchors.horizontalCenter: parent.horizontalCenter
//onWidthChanged: console.log(" *********** WIDTH: "+width)
/* BusyIndicator {
z:99
size: BusyIndicatorSize.Medium
anchors.centerIn: stationimage
running: stationimage.loading && stationImage !== ""//appActive && stationimage.status != Image.Ready
} */
Image {
property bool loading: false
id: stationimage
width: parent.width - (Theme.paddingSmall * 2)
height: width
anchors.centerIn: parent
fillMode: Image.PreserveAspectFit
visible: false
source: stationImage ? stationImage : ""// ? stationImage : stationimage.visible = false
/* BusyIndicator {
size: BusyIndicatorSize.Medium
anchors.centerIn: stationimage
running: stationimage.status != Image.Ready && stationimage.visible//appActive && stationimage.status != Image.Ready
} */
onStatusChanged:
switch(stationimage.status){
case Image.Null:
loading = false
visible = false
break;
case Image.Ready:
loading = false
visible = true
break;
case Image.Loading:
loading = true
break;
case Image.Error:
loading = false
visible = false
break;
default:
loading = false
visible = false
}
}
Label {
id: stationlabel
anchors.fill: stationimage
anchors.margins: Theme.paddingMedium
visible: !stationimage.visible
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
width: parent.width - (parent.border.width * 2)
height: width
text: stationLabel ? stationLabel : "No Tag"//lastcheckok == "1" ? name : " [DOWN] "+name
color: stationlabel === "1" ? Theme.lightPrimaryColor : Theme.secondaryColor
wrapMode: Text.WordWrap
maximumLineCount: 4
//font.strikeout: lastcheckok == "1" ? false : true
font.pixelSize: Theme.fontSizeHuge
fontSizeMode: Text.Fit
font.bold: false
opacity: 0.5
}
Glow {
id: stationglow
visible: stationlabel.visible
radius: Math.round((parent.width / Screen.width) * 10)
samples: radius * 2
spread: 0.7//parent.width / Screen.width
transparentBorder: true
color: Theme.secondaryHighlightColor//JS.getRandomColor()
source: stationlabel
anchors.fill: stationlabel
}
Image {
id:countryImage
visible: flag
width: Theme.itemSizeSmall * 0.5
anchors.top: stationimage.visible ? stationimage.top : parent.top
anchors.right: stationimage.visible ? stationimage.right : parent.right
anchors.margins: Theme.paddingMedium
fillMode: Image.PreserveAspectFit
source: flagimage
}
}
}