Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
glacier-home
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
NemoMobile
glacier-home
Commits
3eb6ebd9
Unverified
Commit
3eb6ebd9
authored
Nov 16, 2017
by
Aleksi Suomalainen
Committed by
GitHub
Nov 16, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #66 from neochapay/master
[Statusbar] Add media controller panel
parents
a15c1f82
56711827
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
155 additions
and
3 deletions
+155
-3
lipstick-glacier-home-qt5.spec
rpm/lipstick-glacier-home-qt5.spec
+1
-0
Statusbar.qml
src/qml/Statusbar.qml
+13
-1
CommonPanel.qml
src/qml/statusbar/CommonPanel.qml
+3
-1
MediaController.qml
src/qml/statusbar/MediaController.qml
+136
-0
src.pro
src/src.pro
+2
-1
No files found.
rpm/lipstick-glacier-home-qt5.spec
View file @
3eb6ebd9
...
...
@@ -21,6 +21,7 @@ Requires: connman-qt5
Requires: libqofono-qt5-declarative
Requires: nemo-theme-glacier
Requires: google-opensans-fonts
Requires: mpris-qt5-qml-plugin
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Quick)
...
...
src/qml/Statusbar.qml
View file @
3eb6ebd9
...
...
@@ -35,7 +35,9 @@ import QtQuick.Controls.Nemo 1.0
import
QtQuick
.
Controls
.
Styles
.
Nemo
1.0
import
org
.
freedesktop
.
contextkit
1.0
import
MeeGo
.
Connman
0.2
import
org
.
nemomobile
.
lipstick
0.1
import
org
.
nemomobile
.
mpris
1.0
import
"
statusbar
"
...
...
@@ -289,9 +291,19 @@ Item {
iconSize
:
Theme
.
itemHeightExtraSmall
source
:
"
image://theme/icon_gps_normal
"
}
StatusbarItem
{
MprisManager
{
id
:
mprisManager
}
property
bool
isPlaying
:
mprisManager
.
currentService
&&
mprisManager
.
playbackStatus
==
Mpris
.
Playing
iconSize
:
Theme
.
itemHeightExtraSmall
source
:
"
image://theme/icon_play_pause
"
source
:
isPlaying
?
"
image://theme/pause
"
:
"
image://theme/play
"
panel
:
MediaController
{}
}
StatusbarItem
{
iconSize
:
root
.
height
...
...
src/qml/statusbar/CommonPanel.qml
View file @
3eb6ebd9
...
...
@@ -40,6 +40,8 @@ Rectangle {
id
:
commonPanel
property
alias
switcherEnabled
:
columnCheckBox
.
enabled
property
bool
settingsIconEnabled
:
true
property
alias
switcherChecked
:
columnCheckBox
.
checked
property
string
name
:
""
signal
click
...
...
@@ -120,7 +122,7 @@ Rectangle {
id
:
settingsIcon
fillMode
:
Image
.
PreserveAspectFit
height
:
Theme
.
itemHeightMedium
visible
:
parent
.
height
>
Theme
.
itemSpacingMedium
visible
:
settingsIconEnabled
&&
parent
.
height
>
Theme
.
itemSpacingMedium
source
:
"
image://theme/icon-app-settings
"
//maybe better icon? settings.png from statusbar spec
anchors
{
right
:
parent
.
right
...
...
src/qml/statusbar/MediaController.qml
0 → 100644
View file @
3eb6ebd9
/****************************************************************************************
**
** Copyright (C) 2017 Sergey Chupligin <mail@neochapay.ru>
** All rights reserved.
**
** You may use this file under the terms of BSD license as follows:
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
** * Neither the name of the author nor the
** names of its contributors may be used to endorse or promote products
** derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR
** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
****************************************************************************************/
import
QtQuick
2.1
import
QtQuick
.
Controls
1.0
import
QtQuick
.
Controls
.
Nemo
1.0
import
QtQuick
.
Controls
.
Styles
.
Nemo
1.0
import
QtQuick
.
Layouts
1.0
import
org
.
nemomobile
.
mpris
1.0
Component
{
id
:
mediaPanelItem
CommonPanel
{
id
:
mediaPanelcommon
switcherEnabled
:
false
settingsIconEnabled
:
false
property
bool
isPlaying
:
mprisManager
.
currentService
&&
mprisManager
.
playbackStatus
==
Mpris
.
Playing
Item
{
width
:
parent
.
width
height
:
parent
.
height
Label
{
id
:
trackName
width
:
parent
.
width
text
:
if
(
mprisManager
.
currentService
)
{
var
artistTag
=
Mpris
.
metadataToString
(
Mpris
.
Artist
)
var
titleTag
=
Mpris
.
metadataToString
(
Mpris
.
Title
)
var
artistLabel
=
(
artistTag
in
mprisManager
.
metadata
)
?
mprisManager
.
metadata
[
artistTag
].
toString
()
:
""
;
var
titleLabel
=
(
titleTag
in
mprisManager
.
metadata
)
?
mprisManager
.
metadata
[
titleTag
].
toString
()
:
""
return
artistLabel
+
"
\n
"
+
titleLabel
}
else
{
return
qsTr
(
"
No music playing
"
)
}
horizontalAlignment
:
Text
.
AlignHCenter
}
Image
{
id
:
backBtn
width
:
playPause
.
width
*
0.6
height
:
width
visible
:
mprisManager
.
currentService
anchors
{
right
:
playPause
.
left
rightMargin
:
width
/
2
verticalCenter
:
playPause
.
verticalCenter
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
if
(
mprisManager
.
canGoPrevious
)
mprisManager
.
previous
()
}
source
:
"
image://theme/backward
"
}
Image
{
id
:
playPause
width
:
Theme
.
itemHeightHuge
height
:
width
visible
:
mprisManager
.
currentService
anchors
{
horizontalCenter
:
parent
.
horizontalCenter
top
:
trackName
.
bottom
topMargin
:
Theme
.
itemSpacingLarge
}
source
:
isPlaying
?
"
image://theme/pause
"
:
"
image://theme/play
"
MouseArea
{
anchors.fill
:
parent
onClicked
:
(
isPlaying
)?
mprisManager
.
pause
()
:
mprisManager
.
play
()
}
}
Image
{
id
:
forwBtn
width
:
playPause
.
width
*
0.6
height
:
width
visible
:
mprisManager
.
currentService
anchors
{
left
:
playPause
.
right
leftMargin
:
width
/
2
verticalCenter
:
playPause
.
verticalCenter
}
source
:
"
image://theme/forward
"
MouseArea
{
anchors.fill
:
parent
onClicked
:
if
(
mprisManager
.
canGoNext
)
mprisManager
.
next
()
}
}
}
}
}
src/src.pro
View file @
3eb6ebd9
...
...
@@ -80,7 +80,8 @@ statusbar.files = qml/statusbar/BatteryPanel.qml\
qml/statusbar/SimPanel.qml\
qml/statusbar/WifiPanel.qml\
qml/statusbar/StatusbarItem.qml\
qml/statusbar/NumButton.qml
qml/statusbar/NumButton.qml \
qml/statusbar/MediaController.qml
INSTALLS += styles \
images \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment