Browse Source

Separated the main view of the Live player from the main window; set

fixed window size to 640x480 to avoid maximizing

Signed-off-by: Blagovest Petrov <blagovest@petrovs.info>
pull/14/head
Blagovest Petrov 4 years ago
parent
commit
b333d9817f
  1. 101
      PgLive.qml
  2. 97
      main.qml
  3. 1
      qml.qrc

101
PgLive.qml

@ -0,0 +1,101 @@
import QtQuick 2.12
import QtQuick.Window 2.12
import Qt.labs.platform 1.1
import QtMultimedia 5.15
Item {
Image {
id: logo
x: 190
y: 51
visible: true
width: 260
height: 175
fillMode: Image.PreserveAspectFit
source: "Resources/logo.png"
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onPressed: {
Qt.openUrlExternally("http://radiotangra.com")
}
}
}
// Text {
// id: element
// x: 17
// y: 68
// text: qsTr("Качество:")
// font.bold: true
// color: "#f9c620"
// styleColor: "#f9c620"
// horizontalAlignment: Text.AlignHCenter
// font.pixelSize: 20
// }
// Rectangle {
// id: buttonHighQuality
// color: "#f9c620"
// x: 17
// y: 102
// width: 100
// height: 34
// Text {
// anchors.centerIn: parent
// id: element1
// text: qsTr("ВИСОКО")
// color: "#000000"
// font.pixelSize: 20
// horizontalAlignment: Text.AlignHCenter
// font.bold: true
// }
// }
// Rectangle {
// id: buttonLowQuality
// color: "transparent"
// x: 24
// y: 146
// width: 100
// height: 34
// Text {
// text: qsTr("НИСКО")
// color: "#f9c620"
// horizontalAlignment: Text.AlignHCenter
// font.pixelSize: 20
// font.bold: true
// }
// }
MediaButton {
id: playPause
width: 359
height: 85
MouseArea {
anchors.fill: parent
onClicked: {
mediaControl();
playPause.isClicked = !playPause.isClicked;
}
}
}
Text {
id: aboutLink
x: 509
y: 455
text: qsTr("Относно програмата")
font.pixelSize: 12
font.family: mainfont.name
color: "#f9c620"
MouseArea {
anchors.fill: parent
onClicked: aboutDialog.open()
}
}
}

97
main.qml

@ -8,7 +8,9 @@ Window {
id: mainWindow id: mainWindow
visible: true visible: true
width: 640 width: 640
maximumWidth: 640
height: 480 height: 480
maximumHeight: 480
flags: Qt.FramelessWindowHint flags: Qt.FramelessWindowHint
FontLoader { id: mainfont; source: "Resources/KellySlab-Regular.ttf" } FontLoader { id: mainfont; source: "Resources/KellySlab-Regular.ttf" }
@ -127,98 +129,7 @@ Window {
} }
} }
} }
Image {
id: logo
x: 190
y: 51
visible: true
width: 260
height: 175
fillMode: Image.PreserveAspectFit
source: "Resources/logo.png"
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onPressed: {
Qt.openUrlExternally("http://radiotangra.com")
}
}
}
// Text {
// id: element
// x: 17
// y: 68
// text: qsTr("Качество:")
// font.bold: true
// color: "#f9c620"
// styleColor: "#f9c620"
// horizontalAlignment: Text.AlignHCenter
// font.pixelSize: 20
// }
// Rectangle {
// id: buttonHighQuality
// color: "#f9c620"
// x: 17
// y: 102
// width: 100
// height: 34
// Text {
// anchors.centerIn: parent
// id: element1
// text: qsTr("ВИСОКО")
// color: "#000000"
// font.pixelSize: 20
// horizontalAlignment: Text.AlignHCenter
// font.bold: true
// }
// }
// Rectangle {
// id: buttonLowQuality
// color: "transparent"
// x: 24
// y: 146
// width: 100
// height: 34
// Text {
// text: qsTr("НИСКО")
// color: "#f9c620"
// horizontalAlignment: Text.AlignHCenter
// font.pixelSize: 20
// font.bold: true
// }
// }
MediaButton {
id: playPause
width: 359
height: 85
MouseArea {
anchors.fill: parent
onClicked: {
mediaControl();
playPause.isClicked = !playPause.isClicked;
}
}
}
Text {
id: aboutLink
x: 509
y: 455
text: qsTr("Относно програмата")
font.pixelSize: 12
font.family: mainfont.name
color: "#f9c620"
MouseArea {
anchors.fill: parent
onClicked: aboutDialog.open()
}
}
} }
PgLive {}
} }

1
qml.qrc

@ -14,5 +14,6 @@
<file>Resources/blago.png</file> <file>Resources/blago.png</file>
<file>Resources/tangra.ico</file> <file>Resources/tangra.ico</file>
<file>Resources/KellySlab-Regular.ttf</file> <file>Resources/KellySlab-Regular.ttf</file>
<file>PgLive.qml</file>
</qresource> </qresource>
</RCC> </RCC>

Loading…
Cancel
Save