Skip to content

Commit

Permalink
Formatted the Source code
Browse files Browse the repository at this point in the history
  • Loading branch information
jsmitar committed Aug 29, 2015
1 parent 0db4c18 commit b64bad1
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 58 deletions.
4 changes: 2 additions & 2 deletions plasmoid/contents/ui/PlaybackBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ PlaybackItem {
if ( !model.itemAt( 1 ) ) return

if ( playing )
model.itemAt( 1 ) .iconSource = 'media-playback-pause'
model.itemAt( 1 ).iconSource = 'media-playback-pause'
else
model.itemAt( 1 ) .iconSource = 'media-playback-start'
model.itemAt( 1 ).iconSource = 'media-playback-start'
}

ListModel {
Expand Down
26 changes: 13 additions & 13 deletions plasmoid/contents/ui/PlaybackItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,25 @@ import QtQuick 2.4
import org.kde.plasma.core 2.0 as PlasmaCore

Item {
id: playbackitem
id: playbackitem

property bool playing: mpris2.playbackStatus == 'Playing'
property bool playing: mpris2.playbackStatus == 'Playing'

property bool showStop: mpris2.source == 'spotify' ? false : playbarEngine.showStop
property bool showStop: mpris2.source == 'spotify' ? false : playbarEngine.showStop

property int buttonSize: units.iconSizes.small
property int buttonSize: units.iconSizes.small

enabled: mpris2.sourceActive && mpris2.canControl
enabled: mpris2.sourceActive && mpris2.canControl

signal playPause()
signal playPause()

signal previous()
signal previous()

signal next()
signal next()

signal stop()
signal stop()

onPlayPause: {
onPlayPause: {
if ( mpris2.source == 'spotify' ) {
mpris2.startOperation( 'PlayPause' )
return
Expand All @@ -48,15 +48,15 @@ Item {
else mpris2.startOperation( 'PlayPause' )
}

onPrevious: {
onPrevious: {
if ( mpris2.canGoPrevious )
mpris2.startOperation( 'Previous' )
}
onNext: {
onNext: {
if ( mpris2.canGoNext )
mpris2.startOperation( 'Next' )
}
onStop: {
onStop: {
if ( mpris2.playbackStatus != 'Stopped' )
mpris2.startOperation( 'Stop' )
}
Expand Down
4 changes: 2 additions & 2 deletions plasmoid/contents/ui/PlaybackWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ PlaybackItem {
if ( !model.itemAt( 1 ) ) return

if ( playing )
model.itemAt( 1 ) .iconSource = 'media-playback-pause'
model.itemAt( 1 ).iconSource = 'media-playback-pause'
else
model.itemAt( 1 ) .iconSource = 'media-playback-start'
model.itemAt( 1 ).iconSource = 'media-playback-start'
}

ListModel {
Expand Down
8 changes: 4 additions & 4 deletions plasmoid/contents/ui/PopupButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -69,28 +69,28 @@ IconWidget {
},
State {
name: 'default'
when: Plasmoid.location == PlasmaCore.Types.TopEdge
when: plasmoid.location === PlasmaCore.Types.TopEdge
PropertyChanges {
target: iconPopup
iconSource: 'down-arrow'
}
},
State {
when: Plasmoid.location == PlasmaCore.Types.BottomEdge
when: plasmoid.location === PlasmaCore.Types.BottomEdge
PropertyChanges {
target: iconPopup
iconSource: 'up-arrow'
}
},
State {
when: Plasmoid.location == PlasmaCore.Types.LeftEdge
when: plasmoid.location === PlasmaCore.Types.LeftEdge
PropertyChanges {
target: iconPopup
iconSource: 'right-arrow'
}
},
State {
when: Plasmoid.location == PlasmaCore.Types.RightEdge
when: plasmoid.location === PlasmaCore.Types.RightEdge
PropertyChanges {
target: iconPopup
iconSource: 'left-arrow'
Expand Down
52 changes: 26 additions & 26 deletions plasmoid/contents/ui/TimeLabel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,42 +22,42 @@ import org.kde.plasma.extras 2.0 as PlasmaExtras
import '../code/utils.js' as Utils

PlasmaExtras.Paragraph {
id: time
id: time

// units in hundredth of second
property int topTime: mpris2.length
// units in hundredth of second
property int currentTime: mpris2.position
// units in hundredth of second
property int topTime: mpris2.length
// units in hundredth of second
property int currentTime: mpris2.position

property bool showPosition: true
property bool showPosition: true

property bool showRemaining: true
property bool showRemaining: true

property bool labelSwitch: false
property bool labelSwitch: false

property alias interactive: mouseArea.hoverEnabled
property alias interactive: mouseArea.hoverEnabled

property alias autoTimeUpdate: timer.running

color: Utils.adjustAlpha( theme.textColor, 0.8 )

enabled: mpris2.sourceActive & mpris2.length > 0

function positionUpdate( negative ) {
var min, sec
function positionUpdate( negative ) {
var min, sec

if ( negative ) sec = Math.abs( ( topTime - currentTime ) /100 )
else sec = currentTime/100
if ( negative ) sec = Math.abs( ( topTime - currentTime ) /100 )
else sec = currentTime/100

min = Utils.truncate( sec/60 )
sec = Utils.truncate( sec - min*60 )

if ( negative ) text = '-' + min + ':'
else text = min + ':'
text += sec <= 9 ? '0' + sec : sec
}
}

function lengthUpdate() {
function lengthUpdate() {
var min
var sec = topTime/100
min = Utils.truncate( sec/60 )
Expand Down Expand Up @@ -85,21 +85,21 @@ PlasmaExtras.Paragraph {
}
}

MouseArea {
id: mouseArea
MouseArea {
id: mouseArea

anchors.fill: parent
acceptedButtons: Qt.LeftButton
anchors.fill: parent
acceptedButtons: Qt.LeftButton
enabled: hoverEnabled

onEntered: color = theme.viewHoverColor
onExited: color = Utils.adjustAlpha( theme.textColor, 0.8 )
onReleased: {
if ( !exited || containsMouse ) {
onExited: color = Utils.adjustAlpha( theme.textColor, 0.8 )
onReleased: {
if ( !exited || containsMouse ) {
timer._switch = !timer._switch
plasmoid.configuration.TimeLabelSwitch = timer._switch
timer.triggered()
}
}
}
timer.triggered()
}
}
}
}
4 changes: 2 additions & 2 deletions plasmoid/contents/ui/VolumeLabel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ PlasmaExtras.Paragraph {
color: Utils.adjustAlpha( theme.textColor, 0.8 )

function setLabel( value ) {
text = ( value * 100 ) .toFixed() +'%'
text = ( value * 100 ).toFixed() +'%'
}

text: ( value * 100 ) .toFixed() + '%'
text: ( value * 100 ).toFixed() + '%'

}
4 changes: 2 additions & 2 deletions plasmoid/contents/ui/VolumeWheel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ MouseArea {
if ( wheel.modifiers == Qt.NoModifier ) {
if ( wheel.angleDelta.y > 80 ) {
volumePrevious = volumePrevious.toPrecision( 3 ) - volumePrevious.toPrecision( 3 ) % 0.05
volumePrevious = mpris2.setVolume( volumePrevious + 0.058 ) .toPrecision( 3 )
volumePrevious = mpris2.setVolume( volumePrevious + 0.058 ).toPrecision( 3 )
} else if ( wheel.angleDelta.y < -80 ) {
volumePrevious = volumePrevious.toPrecision( 3 ) - volumePrevious.toPrecision( 3 ) % 0.05
volumePrevious = mpris2.setVolume( volumePrevious - 0.05 ) .toPrecision( 3 )
volumePrevious = mpris2.setVolume( volumePrevious - 0.05 ).toPrecision( 3 )
}
}
}
Expand Down
14 changes: 7 additions & 7 deletions plasmoid/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import org.kde.plasma.plasmoid 2.0
import '../code/utils.js' as Utils

Item {
id: root
id: root

//! dataengine
PlasmaCore.DataSource {
Expand Down Expand Up @@ -112,22 +112,22 @@ Item {
Utils.i18n = i18n
Plasmoid.removeAction( 'configure' )
Plasmoid.setAction( 'configure', i18n( 'Configure PlayBar' ) , 'configure', 'alt+d, s' )
}
}

QtObject {
id: internal

property string icon:
mpris2.artUrl != '' ? Qt.resolvedUrl( mpris2.artUrl ) : 'media-playback-start'
property string title:
mpris2.title != '' ? mpris2.title : 'PlayBar'
mpris2.title != '' ? mpris2.title : 'PlayBar'
property string artist:
mpris2.artist != '' ? i18n( '<b>By</b> %1 ', mpris2.artist ) : ''
mpris2.artist != '' ? i18n( '<b>By</b> %1 ', mpris2.artist ) : ''
property string album:
mpris2.album != ''? i18n( '<b>On</b> %1', mpris2.album ) : ''
mpris2.album != ''? i18n( '<b>On</b> %1', mpris2.album ) : ''
property string subText:
( title === 'PlayBar' & artist === '' & album === '' ) ?
i18n( 'Client MPRIS2, allows you to control your favorite media player' )
( title === 'PlayBar' & artist === '' & album === '' ) ?
i18n( 'Client MPRIS2, allows you to control your favorite media player' )
: artist + album
}
}
Expand Down

0 comments on commit b64bad1

Please sign in to comment.