Changeset View
Changeset View
Standalone View
Standalone View
lookandfeel/contents/lockscreen/MediaControls.qml
Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Line(s) | 31 | RowLayout { | |||
---|---|---|---|---|---|
111 | ColumnLayout { | 111 | ColumnLayout { | ||
112 | Layout.fillWidth: true | 112 | Layout.fillWidth: true | ||
113 | spacing: 0 | 113 | spacing: 0 | ||
114 | 114 | | |||
115 | PlasmaComponents.Label { | 115 | PlasmaComponents.Label { | ||
116 | Layout.fillWidth: true | 116 | Layout.fillWidth: true | ||
117 | wrapMode: Text.NoWrap | 117 | wrapMode: Text.NoWrap | ||
118 | elide: Text.ElideRight | 118 | elide: Text.ElideRight | ||
119 | text: mpris2Source.track || i18nd("plasma_lookandfeel_org.kde.lookandfeel", "No media playing") | 119 | text: mpris2Source.track || "" | ||
120 | textFormat: Text.PlainText | 120 | textFormat: Text.PlainText | ||
121 | font.pointSize: theme.defaultFont.pointSize + 1 | 121 | font.pointSize: theme.defaultFont.pointSize + 1 | ||
122 | } | 122 | } | ||
123 | 123 | | |||
124 | PlasmaExtras.DescriptiveLabel { | 124 | PlasmaExtras.DescriptiveLabel { | ||
125 | Layout.fillWidth: true | 125 | Layout.fillWidth: true | ||
126 | wrapMode: Text.NoWrap | 126 | wrapMode: Text.NoWrap | ||
127 | elide: Text.ElideRight | 127 | elide: Text.ElideRight | ||
128 | // if no artist is given, show player name instead | 128 | // if no artist is given, show player name instead | ||
129 | text: mpris2Source.artist || mpris2Source.identity || "" | 129 | text: mpris2Source.artist || mpris2Source.identity || "" | ||
130 | textFormat: Text.PlainText | 130 | textFormat: Text.PlainText | ||
131 | font.pointSize: theme.smallestFont.pointSize + 1 | 131 | font.pointSize: theme.smallestFont.pointSize + 1 | ||
132 | } | 132 | } | ||
133 | } | 133 | } | ||
134 | 134 | | |||
135 | PlasmaComponents.ToolButton { | 135 | PlasmaComponents.ToolButton { | ||
136 | enabled: mpris2Source.canGoBack | 136 | enabled: mpris2Source.canGoBack | ||
137 | iconName: LayoutMirroring.enabled ? "media-skip-forward" : "media-skip-backward" | 137 | iconName: LayoutMirroring.enabled ? "media-skip-forward" : "media-skip-backward" | ||
138 | onClicked: mpris2Source.goPrevious() | 138 | onClicked: mpris2Source.goPrevious() | ||
139 | visible: mpris2Source.canGoBack || mpris2Source.canGoNext | 139 | visible: mpris2Source.canGoBack || mpris2Source.canGoNext | ||
140 | Accessible.name: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Previous track") | 140 | Accessible.name: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Previous track") | ||
141 | } | 141 | } | ||
142 | 142 | | |||
143 | if (mpris2Source.track != "") { | ||||
143 | PlasmaComponents.ToolButton { | 144 | PlasmaComponents.ToolButton { | ||
144 | Layout.fillHeight: true | 145 | Layout.fillHeight: true | ||
145 | Layout.preferredWidth: height // make this button bigger | 146 | Layout.preferredWidth: height // make this button bigger | ||
146 | iconName: mpris2Source.playing ? "media-playback-pause" : "media-playback-start" | 147 | iconName: mpris2Source.playing ? "media-playback-pause" : "media-playback-start" | ||
147 | onClicked: mpris2Source.playPause() | 148 | onClicked: mpris2Source.playPause() | ||
148 | Accessible.name: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Play or Pause media") | 149 | Accessible.name: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Play or Pause media") | ||
149 | } | 150 | } | ||
151 | } | ||||
150 | 152 | | |||
151 | PlasmaComponents.ToolButton { | 153 | PlasmaComponents.ToolButton { | ||
152 | enabled: mpris2Source.canGoNext | 154 | enabled: mpris2Source.canGoNext | ||
153 | iconName: LayoutMirroring.enabled ? "media-skip-backward" : "media-skip-forward" | 155 | iconName: LayoutMirroring.enabled ? "media-skip-backward" : "media-skip-forward" | ||
154 | onClicked: mpris2Source.goNext() | 156 | onClicked: mpris2Source.goNext() | ||
155 | visible: mpris2Source.canGoBack || mpris2Source.canGoNext | 157 | visible: mpris2Source.canGoBack || mpris2Source.canGoNext | ||
156 | Accessible.name: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Next track") | 158 | Accessible.name: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Next track") | ||
157 | } | 159 | } | ||
158 | } | 160 | } | ||
159 | } | 161 | } |