Browse Source

Merge pull request 'separated_item_windows' (#14) from separated_item_windows into master

First page separation; Redesign of the Live page

Reviewed-on: http://code.petrovs.info/blago/TangraPlay/pulls/14
pull/15/head 0.6.0
Blagovest Petrov 4 years ago
parent
commit
e76d8f2a67
  1. 10
      MediaButton.qml
  2. 87
      MenuToolbar.qml
  3. 91
      PgLive.qml
  4. 38
      PgNews.qml
  5. BIN
      Resources/buuf-pause.png
  6. BIN
      Resources/buuf-play.png
  7. BIN
      Resources/live.png
  8. BIN
      Resources/news-icon.png
  9. BIN
      Resources/news.png
  10. BIN
      Resources/playbtn-frame.png
  11. BIN
      Resources/podcast.png
  12. 14
      fetchshowid.cpp
  13. 12
      fetchshowid.h
  14. 159
      main.qml
  15. 10
      qml.qrc

10
MediaButton.qml

@ -1,20 +1,18 @@
import QtQuick 2.0
import QtQuick.Controls 2.15
Rectangle {
Item {
id: container
x: 141
y: 367
x: 64
y: 64
property bool isClicked : false
color: isClicked ? "#a98415" : "#f9c620"
Image {
id: buttonIcon
width: 64
anchors.centerIn: parent
fillMode: Image.PreserveAspectFit
source: isClicked ? "Resources/pause-button.svg" : "Resources/play-button.svg"
source: isClicked ? "Resources/buuf-pause.png" : "Resources/buuf-play.png"
}
}

87
MenuToolbar.qml

@ -0,0 +1,87 @@
import QtQuick 2.0
import QtQuick.Window 2.12
Item {
Rectangle {
id: menu
width: mainWindow.width
height: 32
Image {
source: "Resources/menu-background.png"
fillMode: Image.Tile
anchors.fill: parent
}
MouseArea {
anchors.fill: parent;
property variant clickPos: "1,1"
onPressed: {
clickPos = Qt.point(mouse.x,mouse.y)
}
onPositionChanged: {
var delta = Qt.point(mouse.x-clickPos.x, mouse.y-clickPos.y)
var new_x = mainWindow.x + delta.x
var new_y = mainWindow.y + delta.y
if (new_y <= 0)
mainWindow.visibility = Window.Maximized
else
{
if (mainWindow.visibility === Window.Maximized)
mainWindow.visibility = Window.Windowed
mainWindow.x = new_x
mainWindow.y = new_y
}
}
MenuButton {
id: buttonExit
caption: "X"
onClicked: Qt.quit();
}
MenuButton {
id: buttonMinimize
anchors.left: buttonExit.right
caption: "_"
onClicked: mainWindow.hide()
}
Text {
id: appTitle
anchors.left: buttonMinimize.right
text: qsTr("TangraPlay")
font.family: mainfont.name
font.pixelSize: 20
font.bold: true
color: "#f9c620"
}
// Image {
// id: buttonLive
// source: "Resources/live.png"
// anchors.left: appTitle.left
// anchors.leftMargin: 128
// width: 32
// height: 32
// MouseArea {
// anchors.fill: parent
// hoverEnabled: true
// onClicked: {
// pgLive1.visible = false;
// pgnews1.visible = true;
//// contentLoader.sourceComponent = PgNews
// }
// }
// }
}
}
}

91
PgLive.qml

@ -0,0 +1,91 @@
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")
}
}
}
MediaButton {
id: playPause
x: 35
y: 291
width: 64
height: 64
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()
}
}
Image {
id: playbtnframe
x: 0
y: 259
width: 629
height: 127
source: "Resources/playbtn-frame.png"
fillMode: Image.PreserveAspectFit
Text {
id: text1
x: 156
y: 17
text: qsTr("Предаване в ефир:")
color: "#f9c620"
font.family: mainfont.name
font.pixelSize: 15
}
Text {
id: text2
x: 156
y: 60
text: qsTr("В момента звучи:")
color: "#f9c620"
font.family: mainfont.name
font.pixelSize: 15
}
}
}
/*##^##
Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/

38
PgNews.qml

@ -0,0 +1,38 @@
import QtQuick 2.12
import QtQuick.Window 2.12
import Qt.labs.platform 1.1
import QtMultimedia 5.15
Item {
x: 190
y: 51
Row {
id: row
x: 8
y: 50
width: 624
height: 400
spacing: 2
Text {
id: text1
x: 61
y: 50
text: qsTr("Гледайте първо видео от новия албум на GOJIRA - той излиза на 3 април")
font.pixelSize: 12
font.family: mainfont.name
}
Text {
id: text2
x: 61
y: 50
text: qsTr("Историята на BLONDIE в предаването 'РОКЕНДРОЛ' на МОНИ ПАНЧЕВ от 16:00")
font.pixelSize: 12
font.family: mainfont.name
}
}
}

BIN
Resources/buuf-pause.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
Resources/buuf-play.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
Resources/live.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

BIN
Resources/news-icon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
Resources/news.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
Resources/playbtn-frame.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

BIN
Resources/podcast.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

14
fetchshowid.cpp

@ -1,15 +1,15 @@
#include "fetchshowid.h"
#include <QNetworkAccessManager>
#include <QObject>
#include <QDebug>
#include <QString>
FetchShowID::FetchShowID()
{
n_manager = new QNetworkAccessManager;
connect(n_manager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(replyFinished(QNetworkReply*)));
}
//int FetchShowID::Fetch() {
// QNetworkAccessManager *manager = new QNetworkAccessManager(this);
//}
void FetchShowID::Fetch() {
n_manager->get(QNetworkRequest(QUrl("http://app.radiotangra.com/TMR_monitor_songs")));
}

12
fetchshowid.h

@ -1,12 +1,20 @@
#ifndef FETCHSHOWID_H
#define FETCHSHOWID_H
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QObject>
#include <QDebug>
#include <QString>
class FetchShowID
class FetchShowID : public QObject
{
public:
FetchShowID();
// int Fetch();
void Fetch();
private:
QNetworkAccessManager* n_manager;
};
#endif // FETCHSHOWID_H

159
main.qml

@ -8,7 +8,9 @@ Window {
id: mainWindow
visible: true
width: 640
maximumWidth: 640
height: 480
maximumHeight: 480
flags: Qt.FramelessWindowHint
FontLoader { id: mainfont; source: "Resources/KellySlab-Regular.ttf" }
@ -65,160 +67,25 @@ Window {
fillMode: Image.Tile
source: "Resources/dark_leather.png"
Rectangle {
id: menu
width: mainWindow.width
height: 32
MenuToolbar {}
Image {
source: "Resources/menu-background.png"
fillMode: Image.Tile
anchors.fill: parent
}
MouseArea {
anchors.fill: parent;
property variant clickPos: "1,1"
onPressed: {
clickPos = Qt.point(mouse.x,mouse.y)
}
onPositionChanged: {
var delta = Qt.point(mouse.x-clickPos.x, mouse.y-clickPos.y)
var new_x = mainWindow.x + delta.x
var new_y = mainWindow.y + delta.y
if (new_y <= 0)
mainWindow.visibility = Window.Maximized
else
{
if (mainWindow.visibility === Window.Maximized)
mainWindow.visibility = Window.Windowed
mainWindow.x = new_x
mainWindow.y = new_y
}
}
MenuButton {
id: buttonExit
caption: "X"
onClicked: Qt.quit()
}
MenuButton {
id: buttonMinimize
anchors.left: buttonExit.right
caption: "_"
onClicked: mainWindow.hide()
}
Text {
id: appTitle
anchors.left: buttonMinimize.right
text: qsTr("TangraPlay")
font.family: mainfont.name
font.pixelSize: 20
font.bold: true
color: "#f9c620"
}
}
PgLive {
id: pgLive1
}
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
// PgNews {
// id: pgNews1
// visible: false
// }
// 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
// }
// Item {
// Component {
// id: myComp
// }
// 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
// }
// Loader { id: contentLoader }
// }
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()
}
}
}
}

10
qml.qrc

@ -14,5 +14,15 @@
<file>Resources/blago.png</file>
<file>Resources/tangra.ico</file>
<file>Resources/KellySlab-Regular.ttf</file>
<file>PgLive.qml</file>
<file>MenuToolbar.qml</file>
<file>PgNews.qml</file>
<file>Resources/news-icon.png</file>
<file>Resources/buuf-pause.png</file>
<file>Resources/buuf-play.png</file>
<file>Resources/playbtn-frame.png</file>
<file>Resources/live.png</file>
<file>Resources/news.png</file>
<file>Resources/podcast.png</file>
</qresource>
</RCC>

Loading…
Cancel
Save