Make buttons look better, improve misc QML.
This commit is contained in:
parent
84a84fd57d
commit
7e04c5c05e
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
"editor.fontFamily": "monospace"
|
|
||||||
}
|
|
|
@ -1,5 +1,5 @@
|
||||||
SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
SOURCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
||||||
pushd $SOURCE_DIR
|
pushd $SOURCE_DIR
|
||||||
qmlfmt -w src/qml/*.qml src/qml/*/*.qml
|
find . -name "*.qml" -exec qmlfmt -w {} \;
|
||||||
clang-format -style mozilla -i src/* src/Backends/*/*
|
find . -name "*.cpp" -o -name "*.hpp" -o -name "*.c" -o -name "*.h" -exec clang-format90 -style mozilla -i {} \;
|
||||||
popd
|
popdi i
|
||||||
|
|
1
spdlog
Submodule
1
spdlog
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 2b326e90b82f74492229b8d2b27d66d088386e74
|
|
@ -1,7 +1,7 @@
|
||||||
#ifndef BackendInterface_H
|
#ifndef BackendInterface_H
|
||||||
#define BackendInterface_H
|
#define BackendInterface_H
|
||||||
#include <QObject>
|
|
||||||
#include "enums.hpp"
|
#include "enums.hpp"
|
||||||
|
#include <QObject>
|
||||||
class BackendInterface
|
class BackendInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
#define LOGGER_HPP
|
#define LOGGER_HPP
|
||||||
#include <iosfwd> // IWYU pragma: keep
|
#include <iosfwd> // IWYU pragma: keep
|
||||||
#include <memory> // IWYU pragma: keep
|
#include <memory> // IWYU pragma: keep
|
||||||
#include <spdlog/spdlog.h> // IWYU pragma: keep
|
|
||||||
#include <spdlog/sinks/basic_file_sink.h> // IWYU pragma: keep
|
#include <spdlog/sinks/basic_file_sink.h> // IWYU pragma: keep
|
||||||
#include <spdlog/sinks/daily_file_sink.h> // IWYU pragma: keep
|
#include <spdlog/sinks/daily_file_sink.h> // IWYU pragma: keep
|
||||||
#include <spdlog/sinks/stdout_color_sinks.h> // IWYU pragma: keep
|
#include <spdlog/sinks/stdout_color_sinks.h> // IWYU pragma: keep
|
||||||
|
#include <spdlog/spdlog.h> // IWYU pragma: keep
|
||||||
|
|
||||||
std::shared_ptr<spdlog::logger>
|
std::shared_ptr<spdlog::logger>
|
||||||
initLogger(std::string name);
|
initLogger(std::string name);
|
||||||
|
|
|
@ -17,16 +17,16 @@ Item {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
icon.height: parent.height / 2
|
iconHeight: parent.height / 2
|
||||||
icon.width: parent.height / 2
|
iconWidth: parent.height / 2
|
||||||
}
|
}
|
||||||
VolumeButton {
|
VolumeButton {
|
||||||
id: volumeButton
|
id: volumeButton
|
||||||
anchors.left: playPauseButton.right
|
anchors.left: playPauseButton.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
icon.height: parent.height / 2
|
iconHeight: parent.height / 2
|
||||||
icon.width: parent.height / 2
|
iconWidth: parent.height / 2
|
||||||
}
|
}
|
||||||
VolumeSlider {
|
VolumeSlider {
|
||||||
anchors.left: volumeButton.right
|
anchors.left: volumeButton.right
|
||||||
|
@ -39,16 +39,16 @@ Item {
|
||||||
anchors.right: backwardButton.left
|
anchors.right: backwardButton.left
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
icon.height: parent.height / 2
|
iconHeight: parent.height / 2
|
||||||
icon.width: parent.height / 2
|
iconWidth: parent.height / 2
|
||||||
}
|
}
|
||||||
BackwardButton {
|
BackwardButton {
|
||||||
id: backwardButton
|
id: backwardButton
|
||||||
anchors.right: timeLabel.left
|
anchors.right: timeLabel.left
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
icon.height: parent.height / 2
|
iconHeight: parent.height / 2
|
||||||
icon.width: parent.height / 2
|
iconWidth: parent.height / 2
|
||||||
}
|
}
|
||||||
TimeLabel {
|
TimeLabel {
|
||||||
id: timeLabel
|
id: timeLabel
|
||||||
|
@ -61,16 +61,16 @@ Item {
|
||||||
anchors.left: timeLabel.right
|
anchors.left: timeLabel.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
icon.height: parent.height / 2
|
iconHeight: parent.height / 2
|
||||||
icon.width: parent.height / 2
|
iconWidth: parent.height / 2
|
||||||
}
|
}
|
||||||
PlaylistNextButton {
|
PlaylistNextButton {
|
||||||
id: playlistNextButton
|
id: playlistNextButton
|
||||||
anchors.left: forwardButton.right
|
anchors.left: forwardButton.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
icon.height: parent.height / 2
|
iconHeight: parent.height / 2
|
||||||
icon.width: parent.height / 2
|
iconWidth: parent.height / 2
|
||||||
}
|
}
|
||||||
|
|
||||||
FullscreenButton {
|
FullscreenButton {
|
||||||
|
@ -78,15 +78,15 @@ Item {
|
||||||
anchors.right: settingsButton.left
|
anchors.right: settingsButton.left
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
icon.height: parent.height / 2
|
iconHeight: parent.height / 2
|
||||||
icon.width: parent.height / 2
|
iconWidth: parent.height / 2
|
||||||
}
|
}
|
||||||
SettingsButton {
|
SettingsButton {
|
||||||
id: settingsButton
|
id: settingsButton
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
icon.height: parent.height / 2
|
iconHeight: parent.height / 2
|
||||||
icon.width: parent.height / 2
|
iconWidth: parent.height / 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,22 +16,20 @@ Item {
|
||||||
id: playPauseButton
|
id: playPauseButton
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
icon.height: parent.height / 1.25
|
iconHeight: parent.height / 1.25
|
||||||
icon.width: parent.height / 1.25
|
iconWidth: parent.height / 1.25
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: mouseAreaVolumeArea
|
id: mouseAreaVolumeArea
|
||||||
anchors.bottom: volumeButton.bottom
|
|
||||||
anchors.left: volumeSliderArea.left
|
|
||||||
anchors.right: volumeSliderArea.right
|
anchors.right: volumeSliderArea.right
|
||||||
anchors.top: volumeSliderArea.top
|
anchors.bottom: volumeButton.bottom
|
||||||
height: layout.height + volumeButton.height
|
anchors.left: volumeButton.left
|
||||||
+ (volumeSliderArea.visible ? volumeSliderArea.height : 0)
|
height: parent.height + (volumeSliderArea.visible ? volumeSliderArea.height : 0)
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
z: 500
|
||||||
propagateComposedEvents: true
|
propagateComposedEvents: true
|
||||||
acceptedButtons: Qt.NoButton
|
acceptedButtons: Qt.NoButton
|
||||||
|
|
||||||
onEntered: {
|
onEntered: {
|
||||||
mouseAreaPlayerTimer.stop()
|
mouseAreaPlayerTimer.stop()
|
||||||
}
|
}
|
||||||
|
@ -46,9 +44,10 @@ Item {
|
||||||
anchors.left: playPauseButton.right
|
anchors.left: playPauseButton.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
icon.height: parent.height / 1.25
|
iconHeight: parent.height / 1.25
|
||||||
icon.width: parent.height / 1.25
|
iconWidth: parent.height / 1.25
|
||||||
icon.color: hovered
|
hoverEnabled: true
|
||||||
|
iconColor: hovered
|
||||||
|| mouseAreaVolumeArea.containsMouse ? getAppearanceValueForTheme(
|
|| mouseAreaVolumeArea.containsMouse ? getAppearanceValueForTheme(
|
||||||
appearance.themeName,
|
appearance.themeName,
|
||||||
"buttonHoverColor") : getAppearanceValueForTheme(
|
"buttonHoverColor") : getAppearanceValueForTheme(
|
||||||
|
@ -95,15 +94,15 @@ Item {
|
||||||
anchors.right: settingsButton.left
|
anchors.right: settingsButton.left
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
icon.height: parent.height / 1.25
|
iconHeight: parent.height / 1.25
|
||||||
icon.width: parent.height / 1.25
|
iconWidth: parent.height / 1.25
|
||||||
}
|
}
|
||||||
SettingsButton {
|
SettingsButton {
|
||||||
id: settingsButton
|
id: settingsButton
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
icon.height: parent.height / 1.25
|
iconHeight: parent.height / 1.25
|
||||||
icon.width: parent.height / 1.25
|
iconWidth: parent.height / 1.25
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,19 +7,16 @@ import Qt.labs.settings 1.0
|
||||||
import Qt.labs.platform 1.0 as LabsPlatform
|
import Qt.labs.platform 1.0 as LabsPlatform
|
||||||
import player 1.0
|
import player 1.0
|
||||||
|
|
||||||
Button {
|
SmoothButton {
|
||||||
id: backwardButton
|
id: backwardButton
|
||||||
icon.source: "icons/" + appearance.themeName + "/backward.svg"
|
iconSource: "icons/" + appearance.themeName + "/backward.svg"
|
||||||
|
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
icon.color: hovered ? getAppearanceValueForTheme(
|
iconColor: hovered ? getAppearanceValueForTheme(
|
||||||
appearance.themeName,
|
appearance.themeName,
|
||||||
"buttonHoverColor") : getAppearanceValueForTheme(
|
"buttonHoverColor") : getAppearanceValueForTheme(
|
||||||
appearance.themeName, "buttonColor")
|
appearance.themeName, "buttonColor")
|
||||||
display: AbstractButton.IconOnly
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
player.playerCommand(Enums.Commands.Seek, "-10")
|
player.playerCommand(Enums.Commands.Seek, "-10")
|
||||||
}
|
}
|
||||||
background: Item {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
21
src/qml/UIComponents/ButtonImage.qml
Normal file
21
src/qml/UIComponents/ButtonImage.qml
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
import QtQuick.Window 2.2
|
||||||
|
import QtGraphicalEffects 1.0
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: root
|
||||||
|
smooth: true
|
||||||
|
|
||||||
|
property alias color: colorOverlay.color
|
||||||
|
property int size: 24
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
sourceSize.width: size
|
||||||
|
sourceSize.height: size
|
||||||
|
|
||||||
|
ColorOverlay {
|
||||||
|
id: colorOverlay
|
||||||
|
anchors.fill: root
|
||||||
|
source: root
|
||||||
|
color: "#000000"
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,18 +7,15 @@ import Qt.labs.settings 1.0
|
||||||
import Qt.labs.platform 1.0 as LabsPlatform
|
import Qt.labs.platform 1.0 as LabsPlatform
|
||||||
import player 1.0
|
import player 1.0
|
||||||
|
|
||||||
Button {
|
SmoothButton {
|
||||||
id: forwardButton
|
id: forwardButton
|
||||||
icon.source: "icons/" + appearance.themeName + "/forward.svg"
|
iconSource: "icons/" + appearance.themeName + "/forward.svg"
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
icon.color: hovered ? getAppearanceValueForTheme(
|
iconColor: hovered ? getAppearanceValueForTheme(
|
||||||
appearance.themeName,
|
appearance.themeName,
|
||||||
"buttonHoverColor") : getAppearanceValueForTheme(
|
"buttonHoverColor") : getAppearanceValueForTheme(
|
||||||
appearance.themeName, "buttonColor")
|
appearance.themeName, "buttonColor")
|
||||||
display: AbstractButton.IconOnly
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
player.playerCommand(Enums.Commands.Seek, "10")
|
player.playerCommand(Enums.Commands.Seek, "10")
|
||||||
}
|
}
|
||||||
background: Item {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,21 +7,17 @@ import Qt.labs.settings 1.0
|
||||||
import Qt.labs.platform 1.0 as LabsPlatform
|
import Qt.labs.platform 1.0 as LabsPlatform
|
||||||
import player 1.0
|
import player 1.0
|
||||||
|
|
||||||
Button {
|
SmoothButton {
|
||||||
id: fullscreenButton
|
id: fullscreenButton
|
||||||
icon.source: "icons/" + appearance.themeName + "/fullscreen.svg"
|
iconSource: "icons/" + appearance.themeName + "/fullscreen.svg"
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
icon.color: hovered ? getAppearanceValueForTheme(
|
iconColor: hovered ? getAppearanceValueForTheme(
|
||||||
appearance.themeName,
|
appearance.themeName,
|
||||||
"buttonHoverColor") : getAppearanceValueForTheme(
|
"buttonHoverColor") : getAppearanceValueForTheme(
|
||||||
appearance.themeName, "buttonColor")
|
appearance.themeName, "buttonColor")
|
||||||
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
|
||||||
|
|
||||||
display: AbstractButton.IconOnly
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
toggleFullscreen()
|
toggleFullscreen()
|
||||||
}
|
}
|
||||||
|
|
||||||
background: Item {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,27 +7,24 @@ import Qt.labs.settings 1.0
|
||||||
import Qt.labs.platform 1.0 as LabsPlatform
|
import Qt.labs.platform 1.0 as LabsPlatform
|
||||||
import player 1.0
|
import player 1.0
|
||||||
|
|
||||||
Button {
|
SmoothButton {
|
||||||
id: playPauseButton
|
id: playPauseButton
|
||||||
icon.source: "icons/" + appearance.themeName + "/pause.svg"
|
iconSource: "icons/" + appearance.themeName + "/pause.svg"
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
icon.color: hovered ? getAppearanceValueForTheme(
|
iconColor: hovered ? getAppearanceValueForTheme(
|
||||||
appearance.themeName,
|
appearance.themeName,
|
||||||
"buttonHoverColor") : getAppearanceValueForTheme(
|
"buttonHoverColor") : getAppearanceValueForTheme(
|
||||||
appearance.themeName, "buttonColor")
|
appearance.themeName, "buttonColor")
|
||||||
display: AbstractButton.IconOnly
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
player.playerCommand(Enums.Commands.TogglePlayPause)
|
player.playerCommand(Enums.Commands.TogglePlayPause)
|
||||||
}
|
}
|
||||||
background: Item {
|
|
||||||
}
|
|
||||||
Connections {
|
Connections {
|
||||||
target: player
|
target: player
|
||||||
onPlayStatusChanged: function (status) {
|
onPlayStatusChanged: function (status) {
|
||||||
if (status == Enums.PlayStatus.Playing) {
|
if (status == Enums.PlayStatus.Playing) {
|
||||||
icon.source = "qrc:/icons/" + appearance.themeName + "/pause.svg"
|
iconSource = "qrc:/icons/" + appearance.themeName + "/pause.svg"
|
||||||
} else if (status == Enums.PlayStatus.Paused) {
|
} else if (status == Enums.PlayStatus.Paused) {
|
||||||
icon.source = "qrc:/icons/" + appearance.themeName + "/play.svg"
|
iconSource = "qrc:/icons/" + appearance.themeName + "/play.svg"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,19 +7,16 @@ import Qt.labs.settings 1.0
|
||||||
import Qt.labs.platform 1.0 as LabsPlatform
|
import Qt.labs.platform 1.0 as LabsPlatform
|
||||||
import player 1.0
|
import player 1.0
|
||||||
|
|
||||||
Button {
|
SmoothButton {
|
||||||
id: playlistNextButton
|
id: playlistNextButton
|
||||||
//icon.name: "next"
|
//icon.name: "next"
|
||||||
icon.source: "icons/" + appearance.themeName + "/next.svg"
|
iconSource: "icons/" + appearance.themeName + "/next.svg"
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
icon.color: hovered ? getAppearanceValueForTheme(
|
iconColor: hovered ? getAppearanceValueForTheme(
|
||||||
appearance.themeName,
|
appearance.themeName,
|
||||||
"buttonHoverColor") : getAppearanceValueForTheme(
|
"buttonHoverColor") : getAppearanceValueForTheme(
|
||||||
appearance.themeName, "buttonColor")
|
appearance.themeName, "buttonColor")
|
||||||
display: AbstractButton.IconOnly
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
player.playerCommand(Enums.Commands.NextPlaylistItem)
|
player.playerCommand(Enums.Commands.NextPlaylistItem)
|
||||||
}
|
}
|
||||||
background: Item {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,22 +7,19 @@ import Qt.labs.settings 1.0
|
||||||
import Qt.labs.platform 1.0 as LabsPlatform
|
import Qt.labs.platform 1.0 as LabsPlatform
|
||||||
import player 1.0
|
import player 1.0
|
||||||
|
|
||||||
Button {
|
SmoothButton {
|
||||||
id: playlistPrevButton
|
id: playlistPrevButton
|
||||||
objectName: "playlistPrevButton"
|
objectName: "playlistPrevButton"
|
||||||
icon.source: "icons/" + appearance.themeName + "/prev.svg"
|
iconSource: "icons/" + appearance.themeName + "/prev.svg"
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
icon.color: hovered ? getAppearanceValueForTheme(
|
iconColor: hovered ? getAppearanceValueForTheme(
|
||||||
appearance.themeName,
|
appearance.themeName,
|
||||||
"buttonHoverColor") : getAppearanceValueForTheme(
|
"buttonHoverColor") : getAppearanceValueForTheme(
|
||||||
appearance.themeName, "buttonColor")
|
appearance.themeName, "buttonColor")
|
||||||
display: AbstractButton.IconOnly
|
|
||||||
visible: appearance.themeName == "Youtube" ? false : true
|
visible: appearance.themeName == "Youtube" ? false : true
|
||||||
onClicked: {
|
onClicked: {
|
||||||
player.playerCommand(Enums.Commands.PreviousPlaylistItem)
|
player.playerCommand(Enums.Commands.PreviousPlaylistItem)
|
||||||
}
|
}
|
||||||
background: Item {
|
|
||||||
}
|
|
||||||
Connections {
|
Connections {
|
||||||
target: player
|
target: player
|
||||||
onPlaylistPositionChanged: function (position) {
|
onPlaylistPositionChanged: function (position) {
|
||||||
|
|
|
@ -7,23 +7,18 @@ import Qt.labs.settings 1.0
|
||||||
import Qt.labs.platform 1.0 as LabsPlatform
|
import Qt.labs.platform 1.0 as LabsPlatform
|
||||||
import player 1.0
|
import player 1.0
|
||||||
|
|
||||||
Button {
|
SmoothButton {
|
||||||
id: settingsButton
|
id: settingsButton
|
||||||
//icon.name: "settings"
|
iconSource: "icons/" + appearance.themeName + "/settings.svg"
|
||||||
icon.source: "icons/" + appearance.themeName + "/settings.svg"
|
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
icon.color: hovered ? getAppearanceValueForTheme(
|
iconColor: hovered ? getAppearanceValueForTheme(
|
||||||
appearance.themeName,
|
appearance.themeName,
|
||||||
"buttonHoverColor") : getAppearanceValueForTheme(
|
"buttonHoverColor") : getAppearanceValueForTheme(
|
||||||
appearance.themeName, "buttonColor")
|
appearance.themeName, "buttonColor")
|
||||||
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
|
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
|
||||||
display: AbstractButton.IconOnly
|
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
var aptn = appearance.themeName
|
var aptn = appearance.themeName
|
||||||
appearance.themeName = aptn == "YouTube" ? "RoosterTeeth" : aptn
|
appearance.themeName = aptn == "YouTube" ? "RoosterTeeth" : aptn
|
||||||
== "RoosterTeeth" ? "Niconico" : "YouTube"
|
== "RoosterTeeth" ? "Niconico" : "YouTube"
|
||||||
}
|
}
|
||||||
background: Item {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
39
src/qml/UIComponents/SmoothButton.qml
Normal file
39
src/qml/UIComponents/SmoothButton.qml
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
import QtQuick.Controls 2.3
|
||||||
|
import QtQuick.Dialogs 1.3
|
||||||
|
import QtQuick.Layouts 1.2
|
||||||
|
import QtQuick.Window 2.2
|
||||||
|
import Qt.labs.settings 1.0
|
||||||
|
|
||||||
|
import QtQuick 2.0
|
||||||
|
|
||||||
|
Control {
|
||||||
|
id: root
|
||||||
|
property alias iconSource: icon.source
|
||||||
|
property alias iconColor: icon.color
|
||||||
|
property alias iconHeight: icon.size
|
||||||
|
property alias iconWidth: icon.size
|
||||||
|
|
||||||
|
background: Item {}
|
||||||
|
property bool iconRight: false
|
||||||
|
|
||||||
|
focusPolicy: Qt.NoFocus
|
||||||
|
|
||||||
|
|
||||||
|
signal clicked();
|
||||||
|
//onClicked: print('buttonClick')
|
||||||
|
leftPadding: appearance.themeName == "YouTube" ? iconWidth / 12 : appearance.themeName == "RoosterTeeth" ? iconWidth / 12 : iconWidth / 2.5
|
||||||
|
rightPadding: root.leftPadding
|
||||||
|
|
||||||
|
contentItem: ButtonImage {
|
||||||
|
id: icon
|
||||||
|
source: "cup.svg"
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: mouseArea
|
||||||
|
anchors.fill: parent
|
||||||
|
propagateComposedEvents: true
|
||||||
|
onClicked: root.clicked()
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,29 +7,25 @@ import Qt.labs.settings 1.0
|
||||||
import Qt.labs.platform 1.0 as LabsPlatform
|
import Qt.labs.platform 1.0 as LabsPlatform
|
||||||
import player 1.0
|
import player 1.0
|
||||||
|
|
||||||
Button {
|
SmoothButton {
|
||||||
id: volumeButton
|
id: volumeButton
|
||||||
objectName: "volumeButton"
|
objectName: "volumeButton"
|
||||||
icon.source: "icons/" + appearance.themeName + "/volume-up.svg"
|
iconSource: "icons/" + appearance.themeName + "/volume-up.svg"
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
icon.color: hovered ? getAppearanceValueForTheme(
|
iconColor: hovered ? getAppearanceValueForTheme(
|
||||||
appearance.themeName,
|
appearance.themeName,
|
||||||
"buttonHoverColor") : getAppearanceValueForTheme(
|
"buttonHoverColor") : getAppearanceValueForTheme(
|
||||||
appearance.themeName, "buttonColor")
|
appearance.themeName, "buttonColor")
|
||||||
display: AbstractButton.IconOnly
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
player.playerCommand(Enums.Commands.ToggleMute)
|
player.playerCommand(Enums.Commands.ToggleMute)
|
||||||
}
|
}
|
||||||
background: Item {
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateStatus(status) {
|
function updateStatus(status) {
|
||||||
if (status == Enums.VolumeStatus.Muted) {
|
if (status == Enums.VolumeStatus.Muted) {
|
||||||
volumeButton.icon.source = "qrc:/icons/" + appearance.themeName + "/volume-mute.svg"
|
volumeButton.iconSource = "qrc:/icons/" + appearance.themeName + "/volume-mute.svg"
|
||||||
} else if (status == Enums.VolumeStatus.Low) {
|
} else if (status == Enums.VolumeStatus.Low) {
|
||||||
volumeButton.icon.source = "qrc:/icons/" + appearance.themeName + "/volume-down.svg"
|
volumeButton.iconSource = "qrc:/icons/" + appearance.themeName + "/volume-down.svg"
|
||||||
} else if (status == Enums.VolumeStatus.Normal) {
|
} else if (status == Enums.VolumeStatus.Normal) {
|
||||||
volumeButton.icon.source = "qrc:/icons/" + appearance.themeName + "/volume-up.svg"
|
volumeButton.iconSource = "qrc:/icons/" + appearance.themeName + "/volume-up.svg"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ Slider {
|
||||||
to: 100
|
to: 100
|
||||||
value: 100
|
value: 100
|
||||||
palette.dark: "#f00"
|
palette.dark: "#f00"
|
||||||
|
hoverEnabled: true
|
||||||
|
|
||||||
implicitWidth: Math.max(background ? background.implicitWidth : 0,
|
implicitWidth: Math.max(background ? background.implicitWidth : 0,
|
||||||
(handle ? handle.implicitWidth : 0)
|
(handle ? handle.implicitWidth : 0)
|
||||||
|
|
|
@ -19,24 +19,24 @@ Item {
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
width: visible ? playlistNextButton.width : 0
|
width: visible ? playlistNextButton.width : 0
|
||||||
icon.height: parent.height / 1.25
|
iconHeight: parent.height / 1.25
|
||||||
icon.width: parent.height / 1.25
|
iconWidth: parent.height / 1.25
|
||||||
}
|
}
|
||||||
PlayPauseButton {
|
PlayPauseButton {
|
||||||
id: playPauseButton
|
id: playPauseButton
|
||||||
anchors.left: playlistPrevButton.right
|
anchors.left: playlistPrevButton.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
icon.height: parent.height / 1.25
|
iconHeight: parent.height / 1.25
|
||||||
icon.width: parent.height / 1.25
|
iconWidth: parent.height / 1.25
|
||||||
}
|
}
|
||||||
PlaylistNextButton {
|
PlaylistNextButton {
|
||||||
id: playlistNextButton
|
id: playlistNextButton
|
||||||
anchors.left: playPauseButton.right
|
anchors.left: playPauseButton.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
icon.height: parent.height / 1.25
|
iconHeight: parent.height / 1.25
|
||||||
icon.width: parent.height / 1.25
|
iconWidth: parent.height / 1.25
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
@ -49,6 +49,7 @@ Item {
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
propagateComposedEvents: true
|
propagateComposedEvents: true
|
||||||
acceptedButtons: Qt.NoButton
|
acceptedButtons: Qt.NoButton
|
||||||
|
z: 500
|
||||||
}
|
}
|
||||||
|
|
||||||
VolumeButton {
|
VolumeButton {
|
||||||
|
@ -56,8 +57,8 @@ Item {
|
||||||
anchors.left: playlistNextButton.right
|
anchors.left: playlistNextButton.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
icon.height: parent.height / 1.25
|
iconHeight: parent.height / 1.25
|
||||||
icon.width: parent.height / 1.25
|
iconWidth: parent.height / 1.25
|
||||||
}
|
}
|
||||||
VolumeSlider {
|
VolumeSlider {
|
||||||
id: volumeSlider
|
id: volumeSlider
|
||||||
|
@ -79,15 +80,15 @@ Item {
|
||||||
anchors.right: fullscreenButton.left
|
anchors.right: fullscreenButton.left
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
icon.height: parent.height / 1.25
|
iconHeight: parent.height / 1.25
|
||||||
icon.width: parent.height / 1.25
|
iconWidth: parent.height / 1.25
|
||||||
}
|
}
|
||||||
FullscreenButton {
|
FullscreenButton {
|
||||||
id: fullscreenButton
|
id: fullscreenButton
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
icon.height: parent.height / 1.25
|
iconHeight: parent.height / 1.25
|
||||||
icon.width: parent.height / 1.25
|
iconWidth: parent.height / 1.25
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -226,7 +226,7 @@ Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
function startPlayer() {
|
function startPlayer() {
|
||||||
console.info(qmlDebugger.properties(player))
|
//console.info(qmlDebugger.properties(player))
|
||||||
console.info("OwO!")
|
console.info("OwO!")
|
||||||
|
|
||||||
var args = Qt.application.arguments
|
var args = Qt.application.arguments
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
<file>YouTubeButtonLayout.qml</file>
|
<file>YouTubeButtonLayout.qml</file>
|
||||||
<file>NiconicoButtonLayout.qml</file>
|
<file>NiconicoButtonLayout.qml</file>
|
||||||
<file>RoosterTeethButtonLayout.qml</file>
|
<file>RoosterTeethButtonLayout.qml</file>
|
||||||
|
<file alias="SmoothButton.qml">UIComponents/SmoothButton.qml</file>
|
||||||
|
<file alias="ButtonImage.qml">UIComponents/ButtonImage.qml</file>
|
||||||
<file alias="VerticalVolume.qml">UIComponents/VerticalVolume.qml</file>
|
<file alias="VerticalVolume.qml">UIComponents/VerticalVolume.qml</file>
|
||||||
<file alias="SpeedText.qml">UIComponents/SpeedText.qml</file>
|
<file alias="SpeedText.qml">UIComponents/SpeedText.qml</file>
|
||||||
<file alias="ForwardButton.qml">UIComponents/ForwardButton.qml</file>
|
<file alias="ForwardButton.qml">UIComponents/ForwardButton.qml</file>
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
<file>YouTubeButtonLayout.qml</file>
|
<file>YouTubeButtonLayout.qml</file>
|
||||||
<file>NiconicoButtonLayout.qml</file>
|
<file>NiconicoButtonLayout.qml</file>
|
||||||
<file>RoosterTeethButtonLayout.qml</file>
|
<file>RoosterTeethButtonLayout.qml</file>
|
||||||
|
<file alias="SmoothButton.qml">UIComponents/SmoothButton.qml</file>
|
||||||
|
<file alias="ButtonImage.qml">UIComponents/ButtonImage.qml</file>
|
||||||
<file alias="VerticalVolume.qml">UIComponents/VerticalVolume.qml</file>
|
<file alias="VerticalVolume.qml">UIComponents/VerticalVolume.qml</file>
|
||||||
<file alias="SpeedText.qml">UIComponents/SpeedText.qml</file>
|
<file alias="SpeedText.qml">UIComponents/SpeedText.qml</file>
|
||||||
<file alias="ForwardButton.qml">UIComponents/ForwardButton.qml</file>
|
<file alias="ForwardButton.qml">UIComponents/ForwardButton.qml</file>
|
||||||
|
|
Loading…
Reference in a new issue