1
0
Fork 0

Format Code, Fix progress bar overlap on background.

This commit is contained in:
namedkitten 2020-04-22 13:17:08 +01:00
parent 7e04c5c05e
commit 8fbc30e17e
22 changed files with 93 additions and 98 deletions

View file

@ -1,5 +1,6 @@
#!/usr/bin/env bash
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
find . -name "*.qml" -exec qmlfmt -w {} \; find . -name "*.qml" -exec qmlfmt -w {} \;
find . -name "*.cpp" -o -name "*.hpp" -o -name "*.c" -o -name "*.h" -exec clang-format90 -style mozilla -i {} \; find . -name "*.cpp" -o -name "*.hpp" -o -name "*.c" -o -name "*.h" -exec clang-format90 -style mozilla -i {} \;
popdi i popd

1
spdlog

@ -1 +0,0 @@
Subproject commit 2b326e90b82f74492229b8d2b27d66d088386e74

View file

@ -38,9 +38,7 @@ Item {
if (component.status == Component.Error) { if (component.status == Component.Error) {
console.error("Error loading component: " + component.errorString()) console.error("Error loading component: " + component.errorString())
} }
component.createObject(controlsBar, { component.createObject(controlsBar, {})
})
} }
Item { Item {
@ -137,7 +135,6 @@ Item {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.bottomMargin: 0 anchors.bottomMargin: 0
bottomPadding: 0
} }
} }
} }

View file

@ -9,6 +9,5 @@ Menu {
color: getAppearanceValueForTheme(appearance.themeName, color: getAppearanceValueForTheme(appearance.themeName,
"mainBackground") "mainBackground")
} }
delegate: CustomMenuItem { delegate: CustomMenuItem {}
}
} }

View file

@ -50,7 +50,7 @@ Dialog {
var component = Qt.createComponent("ThumbnailProcess.qml") var component = Qt.createComponent("ThumbnailProcess.qml")
var thumbnailerProcess = component.createObject( var thumbnailerProcess = component.createObject(
playlistDialog, { playlistDialog, {
name: thumbnailJobs[0] "name": thumbnailJobs[0]
}) })
if (String(titleJobs[0]).indexOf("://") !== -1) { if (String(titleJobs[0]).indexOf("://") !== -1) {
@ -85,7 +85,7 @@ Dialog {
} }
var component = Qt.createComponent("TitleProcess.qml") var component = Qt.createComponent("TitleProcess.qml")
var titleProcess = component.createObject(playlistDialog, { var titleProcess = component.createObject(playlistDialog, {
name: titleJobs[0] "name": titleJobs[0]
}) })
titleProcess.start("youtube-dl", titleProcess.start("youtube-dl",
["--get-title", titleJobs[0]]) ["--get-title", titleJobs[0]])
@ -107,10 +107,10 @@ Dialog {
for (var thing in playlist) { for (var thing in playlist) {
var item = playlist[thing] var item = playlist[thing]
playlistModel.append({ playlistModel.append({
playlistItemTitle: item["title"], "playlistItemTitle": item["title"],
playlistItemFilename: item["filename"], "playlistItemFilename": item["filename"],
current: item["current"], "current": item["current"],
playlistPos: thing "playlistPos": thing
}) })
} }
} }
@ -212,8 +212,7 @@ Dialog {
id: playlistModel id: playlistModel
} }
delegate: playlistDelegate delegate: playlistDelegate
highlight: Item { highlight: Item {}
}
snapMode: ListView.SnapToItem snapMode: ListView.SnapToItem
flickableDirection: Flickable.VerticalFlick flickableDirection: Flickable.VerticalFlick
boundsBehavior: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds

View file

@ -51,31 +51,31 @@ MenuBar {
var component = Qt.createComponent("TrackItem.qml") var component = Qt.createComponent("TrackItem.qml")
if (trackType == "sub") { if (trackType == "sub") {
var action = component.createObject(subMenu, { var action = component.createObject(subMenu, {
text: trackLang, "text": trackLang,
trackID: String( "trackID": String(
trackID), trackID),
trackType: "sid", "trackType": "sid",
checked: track["selected"] "checked": track["selected"]
}) })
action.ActionGroup.group = subMenuGroup action.ActionGroup.group = subMenuGroup
subMenu.addAction(action) subMenu.addAction(action)
} else if (trackType == "audio") { } else if (trackType == "audio") {
var action = component.createObject(audioMenu, { var action = component.createObject(audioMenu, {
text: trackTitle + trackLang, "text": trackTitle + trackLang,
trackID: String( "trackID": String(
trackID), trackID),
trackType: "aid", "trackType": "aid",
checked: track["selected"] "checked": track["selected"]
}) })
action.ActionGroup.group = audioMenuGroup action.ActionGroup.group = audioMenuGroup
audioMenu.addAction(action) audioMenu.addAction(action)
} else if (trackType == "video") { } else if (trackType == "video") {
var action = component.createObject(videoMenu, { var action = component.createObject(videoMenu, {
text: "Video " + trackID + trackTitle, "text": "Video " + trackID + trackTitle,
trackID: String( "trackID": String(
trackID), trackID),
trackType: "vid", "trackType": "vid",
checked: track["selected"] "checked": track["selected"]
}) })
action.ActionGroup.group = videoMenuGroup action.ActionGroup.group = videoMenuGroup
videoMenu.addAction(action) videoMenu.addAction(action)
@ -337,8 +337,7 @@ MenuBar {
shortcut: keybinds.mute shortcut: keybinds.mute
} }
MenuSeparator { MenuSeparator {}
}
CustomMenu { CustomMenu {
title: translate.getTranslation("AUDIO_DEVICES", i18n.language) title: translate.getTranslation("AUDIO_DEVICES", i18n.language)
@ -359,9 +358,9 @@ MenuBar {
var audioDevice = audioDevices[thing] var audioDevice = audioDevices[thing]
var component = Qt.createComponent("AudioDeviceItem.qml") var component = Qt.createComponent("AudioDeviceItem.qml")
var action = component.createObject(audioDeviceMenu, { var action = component.createObject(audioDeviceMenu, {
text: audioDevices[thing]["description"], "text": audioDevices[thing]["description"],
deviceID: String( "deviceID": String(
audioDevices[thing]["name"]) audioDevices[thing]["name"])
}) })
action.ActionGroup.group = audioDeviceMenuGroup action.ActionGroup.group = audioDeviceMenuGroup
audioDeviceMenu.addAction(action) audioDeviceMenu.addAction(action)
@ -373,8 +372,7 @@ MenuBar {
} }
} }
MenuSeparator { MenuSeparator {}
}
CustomMenu { CustomMenu {
title: translate.getTranslation("AUDIO", i18n.language) title: translate.getTranslation("AUDIO", i18n.language)
@ -401,8 +399,7 @@ MenuBar {
} }
shortcut: keybinds.cycleVideo shortcut: keybinds.cycleVideo
} }
MenuSeparator { MenuSeparator {}
}
CustomMenu { CustomMenu {
title: translate.getTranslation("VIDEO", i18n.language) title: translate.getTranslation("VIDEO", i18n.language)
@ -435,8 +432,7 @@ MenuBar {
} }
shortcut: keybinds.cycleSubBackwards shortcut: keybinds.cycleSubBackwards
} }
MenuSeparator { MenuSeparator {}
}
CustomMenu { CustomMenu {
title: translate.getTranslation("SUBTITLES", i18n.language) title: translate.getTranslation("SUBTITLES", i18n.language)

View file

@ -48,11 +48,11 @@ Item {
iconWidth: parent.height / 1.25 iconWidth: parent.height / 1.25
hoverEnabled: true hoverEnabled: true
iconColor: hovered iconColor: hovered
|| mouseAreaVolumeArea.containsMouse ? getAppearanceValueForTheme( || mouseAreaVolumeArea.containsMouse ? getAppearanceValueForTheme(
appearance.themeName, appearance.themeName,
"buttonHoverColor") : getAppearanceValueForTheme( "buttonHoverColor") : getAppearanceValueForTheme(
appearance.themeName, appearance.themeName,
"buttonColor") "buttonColor")
} }
VerticalVolume { VerticalVolume {

View file

@ -13,9 +13,9 @@ SmoothButton {
hoverEnabled: true hoverEnabled: true
iconColor: hovered ? getAppearanceValueForTheme( iconColor: hovered ? getAppearanceValueForTheme(
appearance.themeName, appearance.themeName,
"buttonHoverColor") : getAppearanceValueForTheme( "buttonHoverColor") : getAppearanceValueForTheme(
appearance.themeName, "buttonColor") appearance.themeName, "buttonColor")
onClicked: { onClicked: {
player.playerCommand(Enums.Commands.Seek, "-10") player.playerCommand(Enums.Commands.Seek, "-10")
} }

View file

@ -5,12 +5,13 @@ import QtGraphicalEffects 1.0
Image { Image {
id: root id: root
smooth: true smooth: true
property alias color: colorOverlay.color property alias color: colorOverlay.color
property int size: 24 property int iconHeight: 24
property int iconWidth: 24
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
sourceSize.width: size sourceSize.height: iconHeight
sourceSize.height: size sourceSize.width: iconWidth
ColorOverlay { ColorOverlay {
id: colorOverlay id: colorOverlay
@ -18,4 +19,4 @@ Image {
source: root source: root
color: "#000000" color: "#000000"
} }
} }

View file

@ -12,9 +12,9 @@ SmoothButton {
iconSource: "icons/" + appearance.themeName + "/forward.svg" iconSource: "icons/" + appearance.themeName + "/forward.svg"
hoverEnabled: true hoverEnabled: true
iconColor: hovered ? getAppearanceValueForTheme( iconColor: hovered ? getAppearanceValueForTheme(
appearance.themeName, appearance.themeName,
"buttonHoverColor") : getAppearanceValueForTheme( "buttonHoverColor") : getAppearanceValueForTheme(
appearance.themeName, "buttonColor") appearance.themeName, "buttonColor")
onClicked: { onClicked: {
player.playerCommand(Enums.Commands.Seek, "10") player.playerCommand(Enums.Commands.Seek, "10")
} }

View file

@ -12,9 +12,9 @@ SmoothButton {
iconSource: "icons/" + appearance.themeName + "/fullscreen.svg" iconSource: "icons/" + appearance.themeName + "/fullscreen.svg"
hoverEnabled: true hoverEnabled: true
iconColor: 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
onClicked: { onClicked: {

View file

@ -12,9 +12,9 @@ SmoothButton {
iconSource: "icons/" + appearance.themeName + "/pause.svg" iconSource: "icons/" + appearance.themeName + "/pause.svg"
hoverEnabled: true hoverEnabled: true
iconColor: hovered ? getAppearanceValueForTheme( iconColor: hovered ? getAppearanceValueForTheme(
appearance.themeName, appearance.themeName,
"buttonHoverColor") : getAppearanceValueForTheme( "buttonHoverColor") : getAppearanceValueForTheme(
appearance.themeName, "buttonColor") appearance.themeName, "buttonColor")
onClicked: { onClicked: {
player.playerCommand(Enums.Commands.TogglePlayPause) player.playerCommand(Enums.Commands.TogglePlayPause)
} }

View file

@ -13,9 +13,9 @@ SmoothButton {
iconSource: "icons/" + appearance.themeName + "/next.svg" iconSource: "icons/" + appearance.themeName + "/next.svg"
hoverEnabled: true hoverEnabled: true
iconColor: hovered ? getAppearanceValueForTheme( iconColor: hovered ? getAppearanceValueForTheme(
appearance.themeName, appearance.themeName,
"buttonHoverColor") : getAppearanceValueForTheme( "buttonHoverColor") : getAppearanceValueForTheme(
appearance.themeName, "buttonColor") appearance.themeName, "buttonColor")
onClicked: { onClicked: {
player.playerCommand(Enums.Commands.NextPlaylistItem) player.playerCommand(Enums.Commands.NextPlaylistItem)
} }

View file

@ -13,9 +13,9 @@ SmoothButton {
iconSource: "icons/" + appearance.themeName + "/prev.svg" iconSource: "icons/" + appearance.themeName + "/prev.svg"
hoverEnabled: true hoverEnabled: true
iconColor: hovered ? getAppearanceValueForTheme( iconColor: hovered ? getAppearanceValueForTheme(
appearance.themeName, appearance.themeName,
"buttonHoverColor") : getAppearanceValueForTheme( "buttonHoverColor") : getAppearanceValueForTheme(
appearance.themeName, "buttonColor") appearance.themeName, "buttonColor")
visible: appearance.themeName == "Youtube" ? false : true visible: appearance.themeName == "Youtube" ? false : true
onClicked: { onClicked: {
player.playerCommand(Enums.Commands.PreviousPlaylistItem) player.playerCommand(Enums.Commands.PreviousPlaylistItem)

View file

@ -12,9 +12,9 @@ SmoothButton {
iconSource: "icons/" + appearance.themeName + "/settings.svg" iconSource: "icons/" + appearance.themeName + "/settings.svg"
hoverEnabled: true hoverEnabled: true
iconColor: 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
onClicked: { onClicked: {
var aptn = appearance.themeName var aptn = appearance.themeName

View file

@ -1,7 +1,7 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtQuick.Dialogs 1.3 import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.2 import QtQuick.Layouts 1.2
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import Qt.labs.settings 1.0 import Qt.labs.settings 1.0
@ -11,18 +11,19 @@ Control {
id: root id: root
property alias iconSource: icon.source property alias iconSource: icon.source
property alias iconColor: icon.color property alias iconColor: icon.color
property alias iconHeight: icon.size property alias iconHeight: icon.iconHeight
property alias iconWidth: icon.size property alias iconWidth: icon.iconWidth
background: Item {} background: Item {}
property bool iconRight: false property bool iconRight: false
focusPolicy: Qt.NoFocus focusPolicy: Qt.NoFocus
signal clicked
signal clicked();
//onClicked: print('buttonClick') //onClicked: print('buttonClick')
leftPadding: appearance.themeName == "YouTube" ? iconWidth / 12 : appearance.themeName == "RoosterTeeth" ? iconWidth / 12 : iconWidth / 2.5 leftPadding: appearance.themeName
== "YouTube" ? iconWidth / 12 : appearance.themeName
== "RoosterTeeth" ? iconWidth / 12 : iconWidth / 2.5
rightPadding: root.leftPadding rightPadding: root.leftPadding
contentItem: ButtonImage { contentItem: ButtonImage {
@ -34,6 +35,6 @@ Control {
id: mouseArea id: mouseArea
anchors.fill: parent anchors.fill: parent
propagateComposedEvents: true propagateComposedEvents: true
onClicked: root.clicked() onClicked: root.clicked()
} }
} }

View file

@ -20,9 +20,9 @@ Rectangle {
orientation: Qt.Vertical orientation: Qt.Vertical
implicitWidth: Math.max(background ? background.implicitWidth : 0, implicitWidth: Math.max(
(handle ? handle.implicitWidth : 0) background ? background.implicitWidth : 0,
+ leftPadding + rightPadding) (handle ? handle.implicitWidth : 0) + leftPadding + rightPadding)
implicitHeight: Math.max( implicitHeight: Math.max(
background.implicitHeight, background.implicitHeight,
handle.implicitHeight + topPadding + bottomPadding) handle.implicitHeight + topPadding + bottomPadding)

View file

@ -97,8 +97,7 @@ Slider {
ProgressBar { ProgressBar {
id: cachedLength id: cachedLength
background: Item { background: Item {}
}
contentItem: Item { contentItem: Item {
Rectangle { Rectangle {
width: cachedLength.visualPosition * parent.width width: cachedLength.visualPosition * parent.width
@ -123,7 +122,7 @@ Slider {
for (var i = 0, len = chapters.length; i < len; i++) { for (var i = 0, len = chapters.length; i < len; i++) {
var component = Qt.createComponent("ChapterMarker.qml") var component = Qt.createComponent("ChapterMarker.qml")
var marker = component.createObject(chapterMarkers, { var marker = component.createObject(chapterMarkers, {
time: chapters[i]["time"] "time": chapters[i]["time"]
}) })
} }
} }

View file

@ -13,9 +13,9 @@ SmoothButton {
iconSource: "icons/" + appearance.themeName + "/volume-up.svg" iconSource: "icons/" + appearance.themeName + "/volume-up.svg"
hoverEnabled: true hoverEnabled: true
iconColor: hovered ? getAppearanceValueForTheme( iconColor: hovered ? getAppearanceValueForTheme(
appearance.themeName, appearance.themeName,
"buttonHoverColor") : getAppearanceValueForTheme( "buttonHoverColor") : getAppearanceValueForTheme(
appearance.themeName, "buttonColor") appearance.themeName, "buttonColor")
onClicked: { onClicked: {
player.playerCommand(Enums.Commands.ToggleMute) player.playerCommand(Enums.Commands.ToggleMute)
} }

View file

@ -14,12 +14,12 @@ Slider {
palette.dark: "#f00" palette.dark: "#f00"
hoverEnabled: true hoverEnabled: true
implicitWidth: Math.max(background ? background.implicitWidth : 0, implicitWidth: Math.max(
(handle ? handle.implicitWidth : 0) background ? background.implicitWidth : 0,
+ leftPadding + rightPadding) (handle ? handle.implicitWidth : 0) + leftPadding + rightPadding)
implicitHeight: Math.max(background ? background.implicitHeight : 0, implicitHeight: Math.max(
(handle ? handle.implicitHeight : 0) background ? background.implicitHeight : 0,
+ topPadding + bottomPadding) (handle ? handle.implicitHeight : 0) + topPadding + bottomPadding)
onMoved: { onMoved: {
player.playerCommand(Enums.Commands.SetVolume, player.playerCommand(Enums.Commands.SetVolume,
Math.round(volumeBar.value).toString()) Math.round(volumeBar.value).toString())

View file

@ -29,6 +29,7 @@ Item {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
iconHeight: parent.height / 1.25 iconHeight: parent.height / 1.25
iconWidth: parent.height / 1.25 iconWidth: parent.height / 1.25
leftPadding: 14
} }
PlaylistNextButton { PlaylistNextButton {
id: playlistNextButton id: playlistNextButton

View file

@ -439,12 +439,14 @@ Window {
anchors.top: parent.top anchors.top: parent.top
font.family: appearance.fontName font.family: appearance.fontName
fontSizeMode: Text.VerticalFit fontSizeMode: Text.VerticalFit
font.pixelSize: appearance.scaleFactor*(height-anchors.topMargin-anchors.bottomMargin-2) font.pixelSize: appearance.scaleFactor
* (height - anchors.topMargin - anchors.bottomMargin - 2)
font.bold: true font.bold: true
opacity: 1 opacity: 1
visible: controlsOverlay.controlsShowing visible: controlsOverlay.controlsShowing
&& ((!appearance.titleOnlyOnFullscreen) && ((!appearance.titleOnlyOnFullscreen)
|| (mainWindow.visibility == Window.FullScreen || mainWindow.visibility == Window.Maximized)) || (mainWindow.visibility == Window.FullScreen
|| mainWindow.visibility == Window.Maximized))
Connections { Connections {
target: player target: player
onTitleChanged: function (title) { onTitleChanged: function (title) {