Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/main.qml
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 54 | Plasmoid.toolTipMainText: { | |||
---|---|---|---|---|---|
58 | } | 58 | } | ||
59 | 59 | | |||
60 | if (sink.muted) { | 60 | if (sink.muted) { | ||
61 | return i18n("Audio Muted"); | 61 | return i18n("Audio Muted"); | ||
62 | } else { | 62 | } else { | ||
63 | return i18n("Volume at %1%", volumePercent(sink.volume)); | 63 | return i18n("Volume at %1%", volumePercent(sink.volume)); | ||
64 | } | 64 | } | ||
65 | } | 65 | } | ||
66 | Plasmoid.toolTipSubText: paSinkModel.preferredSink && !isDummyOutput(paSinkModel.preferredSink) ? paSinkModel.preferredSink.description : "" | 66 | Plasmoid.toolTipSubText: { | ||
67 | if (paSinkModel.preferredSink && !isDummyOutput(paSinkModel.preferredSink)) { | ||||
68 | var port = paSinkModel.preferredSink.ports[paSinkModel.preferredSink.activePortIndex]; | ||||
69 | if (port) { | ||||
70 | return port.description | ||||
71 | } | ||||
72 | return paSinkModel.preferredSink.name | ||||
73 | } | ||||
74 | return "" | ||||
75 | } | ||||
67 | 76 | | |||
68 | function isDummyOutput(output) { | 77 | function isDummyOutput(output) { | ||
69 | return output && output.name === dummyOutputName; | 78 | return output && output.name === dummyOutputName; | ||
70 | } | 79 | } | ||
71 | 80 | | |||
72 | function boundVolume(volume) { | 81 | function boundVolume(volume) { | ||
73 | return Math.max(PulseAudio.MinimalVolume, Math.min(volume, maxVolumeValue)); | 82 | return Math.max(PulseAudio.MinimalVolume, Math.min(volume, maxVolumeValue)); | ||
74 | } | 83 | } | ||
▲ Show 20 Lines • Show All 218 Lines • ▼ Show 20 Line(s) | |||||
293 | VolumeOSD { | 302 | VolumeOSD { | ||
294 | id: osd | 303 | id: osd | ||
295 | } | 304 | } | ||
296 | 305 | | |||
297 | VolumeFeedback { | 306 | VolumeFeedback { | ||
298 | id: feedback | 307 | id: feedback | ||
299 | } | 308 | } | ||
300 | 309 | | |||
310 | PlasmaCore.Svg { | ||||
311 | id: lineSvg | ||||
312 | imagePath: "widgets/line" | ||||
313 | } | ||||
314 | | ||||
301 | Plasmoid.fullRepresentation: ColumnLayout { | 315 | Plasmoid.fullRepresentation: ColumnLayout { | ||
302 | spacing: units.smallSpacing | 316 | spacing: 0 | ||
ngraham: Revert this change | |||||
303 | Layout.minimumHeight: main.Layout.minimumHeight | 317 | Layout.minimumHeight: main.Layout.minimumHeight | ||
304 | Layout.minimumWidth: main.Layout.minimumWidth | 318 | Layout.minimumWidth: main.Layout.minimumWidth | ||
305 | 319 | | |||
306 | function beginMoveStream(type, stream) { | 320 | function beginMoveStream(type, stream) { | ||
307 | if (type == "sink") { | 321 | if (type == "sink") { | ||
308 | sourceView.visible = false; | 322 | sourceView.visible = false; | ||
309 | sourceViewHeader.visible = false; | 323 | sourceViewHeader.visible = false; | ||
310 | } else if (type == "source") { | 324 | } else if (type == "source") { | ||
Show All 27 Lines | 350 | PlasmaComponents.TabButton { | |||
338 | text: i18n("Devices") | 352 | text: i18n("Devices") | ||
339 | } | 353 | } | ||
340 | 354 | | |||
341 | PlasmaComponents.TabButton { | 355 | PlasmaComponents.TabButton { | ||
342 | id: streamsTab | 356 | id: streamsTab | ||
343 | text: i18n("Applications") | 357 | text: i18n("Applications") | ||
344 | } | 358 | } | ||
345 | } | 359 | } | ||
346 | | ||||
347 | PlasmaComponents.ToolButton { | | |||
348 | Layout.alignment: Qt.AlignBottom | | |||
349 | tooltip: plasmoid.action("configure").text | | |||
350 | iconName: "configure" | | |||
351 | Accessible.name: tooltip | | |||
352 | onClicked: { | | |||
353 | plasmoid.action("configure").trigger(); | | |||
354 | } | | |||
355 | } | | |||
356 | } | 360 | } | ||
357 | 361 | | |||
358 | PlasmaExtras.ScrollArea { | 362 | PlasmaExtras.ScrollArea { | ||
359 | id: scrollView; | 363 | id: scrollView; | ||
360 | 364 | | |||
361 | Layout.fillWidth: true | 365 | Layout.fillWidth: true | ||
362 | Layout.fillHeight: true | 366 | Layout.fillHeight: true | ||
363 | 367 | | |||
Show All 10 Lines | 374 | Item { | |||
374 | ColumnLayout { | 378 | ColumnLayout { | ||
375 | id: streamsView | 379 | id: streamsView | ||
376 | visible: tabBar.currentTab == streamsTab | 380 | visible: tabBar.currentTab == streamsTab | ||
377 | readonly property bool simpleMode: (sinkInputView.count >= 1 && sourceOutputView.count == 0) || (sinkInputView.count == 0 && sourceOutputView.count >= 1) | 381 | readonly property bool simpleMode: (sinkInputView.count >= 1 && sourceOutputView.count == 0) || (sinkInputView.count == 0 && sourceOutputView.count >= 1) | ||
378 | property int maximumWidth: scrollView.viewport.width | 382 | property int maximumWidth: scrollView.viewport.width | ||
379 | width: maximumWidth | 383 | width: maximumWidth | ||
380 | Layout.maximumWidth: maximumWidth | 384 | Layout.maximumWidth: maximumWidth | ||
381 | 385 | | |||
382 | Header { | | |||
383 | Layout.fillWidth: true | | |||
384 | visible: sinkInputView.count > 0 && !streamsView.simpleMode | | |||
385 | text: i18n("Playback Streams") | | |||
386 | } | | |||
387 | ListView { | 386 | ListView { | ||
388 | id: sinkInputView | 387 | id: sinkInputView | ||
389 | 388 | | |||
390 | Layout.fillWidth: true | 389 | Layout.fillWidth: true | ||
391 | Layout.minimumHeight: contentHeight | 390 | Layout.minimumHeight: contentHeight | ||
392 | Layout.maximumHeight: contentHeight | 391 | Layout.maximumHeight: contentHeight | ||
393 | 392 | | |||
394 | model: PulseObjectFilterModel { | 393 | model: PulseObjectFilterModel { | ||
395 | filters: [ { role: "VirtualStream", value: false } ] | 394 | filters: [ { role: "VirtualStream", value: false } ] | ||
396 | sourceModel: SinkInputModel {} | 395 | sourceModel: SinkInputModel {} | ||
397 | } | 396 | } | ||
398 | boundsBehavior: Flickable.StopAtBounds; | 397 | boundsBehavior: Flickable.StopAtBounds; | ||
399 | delegate: StreamListItem { | 398 | delegate: StreamListItem { | ||
400 | type: "sink-input" | 399 | type: "sink-input" | ||
401 | draggable: sinkView.count > 1 | 400 | draggable: sinkView.count > 1 | ||
402 | onlyOne: streamsView.simpleMode | 401 | onlyOne: streamsView.simpleMode | ||
403 | } | 402 | } | ||
404 | } | 403 | } | ||
405 | 404 | | |||
406 | Header { | 405 | PlasmaCore.SvgItem { | ||
406 | elementId: "horizontal-line" | ||||
407 | Layout.topMargin: naturalSize.height | ||||
ngraham: I think there isn't a line here in the mockup, right? | |||||
407 | Layout.fillWidth: true | 408 | Layout.fillWidth: true | ||
408 | visible: sourceOutputView.count > 0 && !streamsView.simpleMode | 409 | Layout.preferredHeight: naturalSize.height | ||
409 | text: i18n("Recording Streams") | 410 | svg: lineSvg | ||
This is the line that separates the playback and recording applications. gvgeo: This is the line that separates the playback and recording applications.
Just notice that… | |||||
410 | } | 411 | } | ||
412 | | ||||
411 | ListView { | 413 | ListView { | ||
412 | id: sourceOutputView | 414 | id: sourceOutputView | ||
413 | 415 | | |||
414 | Layout.fillWidth: true | 416 | Layout.fillWidth: true | ||
415 | Layout.minimumHeight: contentHeight | 417 | Layout.minimumHeight: contentHeight | ||
416 | Layout.maximumHeight: contentHeight | 418 | Layout.maximumHeight: contentHeight | ||
417 | 419 | | |||
418 | model: PulseObjectFilterModel { | 420 | model: PulseObjectFilterModel { | ||
Show All 12 Lines | |||||
431 | ColumnLayout { | 433 | ColumnLayout { | ||
432 | id: devicesView | 434 | id: devicesView | ||
433 | visible: tabBar.currentTab == devicesTab | 435 | visible: tabBar.currentTab == devicesTab | ||
434 | readonly property bool simpleMode: sinkView.count == 1 && sourceView.count == 1 | 436 | readonly property bool simpleMode: sinkView.count == 1 && sourceView.count == 1 | ||
435 | property int maximumWidth: scrollView.viewport.width | 437 | property int maximumWidth: scrollView.viewport.width | ||
436 | width: maximumWidth | 438 | width: maximumWidth | ||
437 | Layout.maximumWidth: maximumWidth | 439 | Layout.maximumWidth: maximumWidth | ||
438 | 440 | | |||
439 | Header { | | |||
440 | id: sinkViewHeader | | |||
441 | Layout.fillWidth: true | | |||
442 | visible: sinkView.count > 0 && !devicesView.simpleMode | | |||
443 | text: i18n("Playback Devices") | | |||
444 | } | | |||
445 | ListView { | 441 | ListView { | ||
446 | id: sinkView | 442 | id: sinkView | ||
447 | 443 | | |||
448 | Layout.fillWidth: true | 444 | Layout.fillWidth: true | ||
449 | Layout.minimumHeight: contentHeight | 445 | Layout.minimumHeight: contentHeight | ||
450 | Layout.maximumHeight: contentHeight | 446 | Layout.maximumHeight: contentHeight | ||
451 | 447 | | |||
452 | model: PlasmaCore.SortFilterModel { | 448 | model: PlasmaCore.SortFilterModel { | ||
Show All 13 Lines | |||||
466 | } | 462 | } | ||
467 | boundsBehavior: Flickable.StopAtBounds; | 463 | boundsBehavior: Flickable.StopAtBounds; | ||
468 | delegate: DeviceListItem { | 464 | delegate: DeviceListItem { | ||
469 | type: "sink" | 465 | type: "sink" | ||
470 | onlyOne: devicesView.simpleMode | 466 | onlyOne: devicesView.simpleMode | ||
471 | } | 467 | } | ||
472 | } | 468 | } | ||
473 | 469 | | |||
474 | Header { | 470 | PlasmaCore.SvgItem { | ||
475 | id: sourceViewHeader | 471 | elementId: "horizontal-line" | ||
472 | Layout.topMargin: naturalSize.height | ||||
ngraham: ditto | |||||
476 | Layout.fillWidth: true | 473 | Layout.fillWidth: true | ||
477 | visible: sourceView.count > 0 && !devicesView.simpleMode | 474 | Layout.preferredHeight: naturalSize.height | ||
478 | text: i18n("Recording Devices") | 475 | svg: lineSvg | ||
479 | } | 476 | } | ||
477 | | ||||
480 | ListView { | 478 | ListView { | ||
481 | id: sourceView | 479 | id: sourceView | ||
482 | 480 | | |||
483 | Layout.fillWidth: true | 481 | Layout.fillWidth: true | ||
484 | Layout.minimumHeight: contentHeight | 482 | Layout.minimumHeight: contentHeight | ||
485 | Layout.maximumHeight: contentHeight | 483 | Layout.maximumHeight: contentHeight | ||
486 | 484 | | |||
487 | model: PulseObjectFilterModel { | 485 | model: PulseObjectFilterModel { | ||
Show All 29 Lines | 510 | PlasmaExtras.Heading { | |||
517 | visible: devicesView.visible && !sinkView.count && !sourceView.count | 515 | visible: devicesView.visible && !sinkView.count && !sourceView.count | ||
518 | text: i18n("No output or input devices found") | 516 | text: i18n("No output or input devices found") | ||
519 | wrapMode: Text.WordWrap | 517 | wrapMode: Text.WordWrap | ||
520 | verticalAlignment: Text.AlignVCenter | 518 | verticalAlignment: Text.AlignVCenter | ||
521 | horizontalAlignment: Text.AlignHCenter | 519 | horizontalAlignment: Text.AlignHCenter | ||
522 | } | 520 | } | ||
523 | } | 521 | } | ||
524 | } | 522 | } | ||
523 | | ||||
524 | PlasmaCore.SvgItem { | ||||
you can give it negative side margins to get it to touch the sides of the pop-up, as in the mockup ngraham: you can give it negative side margins to get it to touch the sides of the pop-up, as in the… | |||||
525 | elementId: "horizontal-line" | ||||
526 | Layout.fillWidth: true | ||||
527 | Layout.preferredHeight: naturalSize.height | ||||
528 | svg: lineSvg | ||||
529 | } | ||||
530 | | ||||
531 | RowLayout { | ||||
532 | spacing: units.smallSpacing | ||||
533 | Layout.fillWidth: true | ||||
534 | | ||||
535 | PlasmaComponents.CheckBox { | ||||
536 | id: raiseMaximumVolumeCheckbox | ||||
537 | Layout.alignment: Qt.AlignLeft | ||||
538 | } | ||||
So this doesn't actually do anything yet? Obviously that needs to change before this can land. :) Also the checked state needs to be saved somewhere. ngraham: So this doesn't actually do anything yet? Obviously that needs to change before this can land. | |||||
539 | | ||||
540 | PlasmaExtras.Heading { | ||||
541 | Layout.fillWidth: true | ||||
ngraham: Don't use a separate Heading here; give the Checkbox a `text:` property | |||||
542 | level: 5 | ||||
543 | text: i18n("Raise maximum volume") | ||||
544 | elide: Text.ElideRight | ||||
545 | } | ||||
546 | | ||||
547 | PlasmaComponents.ToolButton { | ||||
548 | Layout.alignment: Qt.AlignRight | ||||
549 | tooltip: plasmoid.action("configure").text | ||||
550 | iconName: "configure" | ||||
551 | Accessible.name: tooltip | ||||
552 | onClicked: { | ||||
553 | plasmoid.action("configure").trigger(); | ||||
554 | } | ||||
555 | } | ||||
556 | } | ||||
525 | } | 557 | } | ||
526 | 558 | | |||
527 | Component.onCompleted: { | 559 | Component.onCompleted: { | ||
528 | MicrophoneIndicator.init(); | 560 | MicrophoneIndicator.init(); | ||
529 | } | 561 | } | ||
530 | } | 562 | } |
Revert this change