Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/main.qml
Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Line(s) | 140 | function playFeedback(sinkIndex) { | |||
---|---|---|---|---|---|
144 | if (sinkIndex == undefined) { | 144 | if (sinkIndex == undefined) { | ||
145 | sinkIndex = paSinkModel.preferredSink.index; | 145 | sinkIndex = paSinkModel.preferredSink.index; | ||
146 | } | 146 | } | ||
147 | feedback.play(sinkIndex); | 147 | feedback.play(sinkIndex); | ||
148 | } | 148 | } | ||
149 | 149 | | |||
150 | SinkModel { | 150 | SinkModel { | ||
151 | id: paSinkModel | 151 | id: paSinkModel | ||
152 | | ||||
153 | property bool initalDefaultSinkIsSet: false | ||||
154 | | ||||
155 | onDefaultSinkChanged: { | ||||
156 | if (!defaultSink || !plasmoid.configuration.outputChangeOsd) { | ||||
157 | return; | ||||
158 | } | ||||
drosca: It won't work when default sink is changed from KCM, so I think let's just show the OSD every… | |||||
159 | | ||||
160 | // avoid showing a OSD on startup | ||||
161 | if (!initalDefaultSinkIsSet) { | ||||
162 | initalDefaultSinkIsSet = true; | ||||
163 | return; | ||||
164 | } | ||||
165 | | ||||
166 | var icon = Icon.formFactorIcon(defaultSink.formFactor); | ||||
167 | if (!icon) { | ||||
168 | icon = Icon.name(defaultSink.volume, defaultSink.muted); | ||||
169 | } | ||||
170 | osd.showText(icon, defaultSink.description); | ||||
171 | } | ||||
152 | } | 172 | } | ||
153 | 173 | | |||
154 | SourceModel { | 174 | SourceModel { | ||
155 | id: paSourceModel | 175 | id: paSourceModel | ||
156 | } | 176 | } | ||
157 | 177 | | |||
158 | Plasmoid.compactRepresentation: PlasmaCore.IconItem { | 178 | Plasmoid.compactRepresentation: PlasmaCore.IconItem { | ||
159 | source: plasmoid.icon | 179 | source: plasmoid.icon | ||
▲ Show 20 Lines • Show All 313 Lines • Show Last 20 Lines |
It won't work when default sink is changed from KCM, so I think let's just show the OSD every time (except startup)?