Changeset View
Changeset View
Standalone View
Standalone View
applet/contents/ui/main.qml
Show First 20 Lines • Show All 388 Lines • ▼ Show 20 Line(s) | 388 | VolumeFeedback { | |||
---|---|---|---|---|---|
389 | id: feedback | 389 | id: feedback | ||
390 | } | 390 | } | ||
391 | 391 | | |||
392 | PlasmaCore.Svg { | 392 | PlasmaCore.Svg { | ||
393 | id: lineSvg | 393 | id: lineSvg | ||
394 | imagePath: "widgets/line" | 394 | imagePath: "widgets/line" | ||
395 | } | 395 | } | ||
396 | 396 | | |||
397 | Plasmoid.fullRepresentation: ColumnLayout { | 397 | Plasmoid.fullRepresentation: PlasmaComponents3.Page { | ||
398 | spacing: units.smallSpacing | | |||
399 | Layout.preferredHeight: main.Layout.preferredHeight | 398 | Layout.preferredHeight: main.Layout.preferredHeight | ||
400 | Layout.preferredWidth: main.Layout.preferredWidth | 399 | Layout.preferredWidth: main.Layout.preferredWidth | ||
401 | 400 | | |||
402 | function beginMoveStream(type, stream) { | 401 | function beginMoveStream(type, stream) { | ||
403 | if (type == "sink") { | 402 | if (type == "sink") { | ||
404 | sourceView.visible = false; | 403 | sourceView.visible = false; | ||
405 | } else if (type == "source") { | 404 | } else if (type == "source") { | ||
406 | sinkView.visible = false; | 405 | sinkView.visible = false; | ||
407 | } | 406 | } | ||
408 | 407 | | |||
409 | devicesLine.visible = false; | 408 | devicesLine.visible = false; | ||
410 | tabBar.currentTab = devicesTab; | 409 | tabBar.currentTab = devicesTab; | ||
411 | } | 410 | } | ||
412 | 411 | | |||
413 | function endMoveStream() { | 412 | function endMoveStream() { | ||
414 | tabBar.currentTab = streamsTab; | 413 | tabBar.currentTab = streamsTab; | ||
415 | 414 | | |||
416 | sourceView.visible = true; | 415 | sourceView.visible = true; | ||
417 | devicesLine.visible = true; | 416 | devicesLine.visible = true; | ||
418 | sinkView.visible = true; | 417 | sinkView.visible = true; | ||
419 | } | 418 | } | ||
420 | 419 | | |||
420 | header: PlasmaExtras.PlasmoidHeading { | ||||
421 | RowLayout { | 421 | RowLayout { | ||
422 | spacing: units.smallSpacing | 422 | spacing: units.smallSpacing | ||
423 | Layout.fillWidth: true | 423 | anchors.fill: parent | ||
424 | 424 | | |||
425 | PlasmaComponents.TabBar { | 425 | PlasmaComponents.TabBar { | ||
426 | id: tabBar | 426 | id: tabBar | ||
427 | Layout.fillWidth: true | 427 | Layout.fillWidth: true | ||
428 | activeFocusOnTab: true | 428 | activeFocusOnTab: true | ||
429 | 429 | | |||
430 | PlasmaComponents.TabButton { | 430 | PlasmaComponents.TabButton { | ||
431 | id: devicesTab | 431 | id: devicesTab | ||
432 | text: i18n("Devices") | 432 | text: i18n("Devices") | ||
433 | } | 433 | } | ||
434 | 434 | | |||
435 | PlasmaComponents.TabButton { | 435 | PlasmaComponents.TabButton { | ||
436 | id: streamsTab | 436 | id: streamsTab | ||
437 | text: i18n("Applications") | 437 | text: i18n("Applications") | ||
438 | } | 438 | } | ||
439 | } | 439 | } | ||
440 | } | 440 | } | ||
441 | } | ||||
442 | | ||||
443 | ColumnLayout { | ||||
444 | anchors.fill: parent | ||||
441 | 445 | | |||
442 | PlasmaExtras.ScrollArea { | 446 | PlasmaExtras.ScrollArea { | ||
443 | id: scrollView; | 447 | id: scrollView | ||
444 | 448 | | |||
445 | Layout.fillWidth: true | 449 | Layout.fillWidth: true | ||
446 | Layout.fillHeight: true | 450 | Layout.fillHeight: true | ||
447 | 451 | | |||
448 | horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff | 452 | horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff | ||
449 | flickableItem.boundsBehavior: Flickable.StopAtBounds; | 453 | flickableItem.boundsBehavior: Flickable.StopAtBounds; | ||
450 | 454 | | |||
451 | //our scroll isn't a list of delegates, all internal items are tab focussable, making this redundant | 455 | //our scroll isn't a list of delegates, all internal items are tab focussable, making this redundant | ||
▲ Show 20 Lines • Show All 148 Lines • ▼ Show 20 Line(s) | 599 | PlasmaExtras.Heading { | |||
600 | visible: devicesView.visible && !sinkView.count && !sourceView.count | 604 | visible: devicesView.visible && !sinkView.count && !sourceView.count | ||
601 | text: i18n("No output or input devices found") | 605 | text: i18n("No output or input devices found") | ||
602 | wrapMode: Text.WordWrap | 606 | wrapMode: Text.WordWrap | ||
603 | verticalAlignment: Text.AlignVCenter | 607 | verticalAlignment: Text.AlignVCenter | ||
604 | horizontalAlignment: Text.AlignHCenter | 608 | horizontalAlignment: Text.AlignHCenter | ||
605 | } | 609 | } | ||
606 | } | 610 | } | ||
607 | } | 611 | } | ||
608 | | ||||
609 | PlasmaCore.SvgItem { | | |||
610 | elementId: "horizontal-line" | | |||
611 | Layout.fillWidth: true | | |||
612 | Layout.topMargin: 0 - units.smallSpacing / 2 | | |||
613 | Layout.leftMargin: 0 - units.smallSpacing * 1.5 | | |||
614 | Layout.rightMargin: Layout.leftMargin | | |||
615 | svg: lineSvg | | |||
616 | } | 612 | } | ||
617 | 613 | | |||
614 | footer: PlasmaExtras.PlasmoidHeading { | ||||
615 | location: PlasmaExtras.PlasmoidHeading.Location.Footer | ||||
618 | RowLayout { | 616 | RowLayout { | ||
617 | anchors.fill: parent | ||||
619 | 618 | | |||
620 | PlasmaComponents3.CheckBox { | 619 | PlasmaComponents3.CheckBox { | ||
621 | id: raiseMaximumVolumeCheckbox | 620 | id: raiseMaximumVolumeCheckbox | ||
622 | // Align center, with the devices mute icon. Calculating the size based on SmallToolButton.qml. '4' is margin in ListItem. | 621 | // Align center, with the devices mute icon. Calculating the size based on SmallToolButton.qml. '4' is margin in ListItem. | ||
623 | Layout.leftMargin: LayoutMirroring.enabled ? 0 : Math.round((Math.ceil(units.iconSizes.small + units.smallSpacing * 2) - raiseMaximumVolumeCheckbox.indicator.width) / 2) + 4 | 622 | Layout.leftMargin: LayoutMirroring.enabled ? 0 : Math.round((Math.ceil(units.iconSizes.small + units.smallSpacing * 2) - raiseMaximumVolumeCheckbox.indicator.width) / 2) + 4 | ||
624 | Layout.rightMargin: !LayoutMirroring.enabled ? 0 : Math.round((Math.ceil(units.iconSizes.small + units.smallSpacing * 2) - raiseMaximumVolumeCheckbox.indicator.width) / 2) + 4 | 623 | Layout.rightMargin: !LayoutMirroring.enabled ? 0 : Math.round((Math.ceil(units.iconSizes.small + units.smallSpacing * 2) - raiseMaximumVolumeCheckbox.indicator.width) / 2) + 4 | ||
625 | spacing: Math.round((Math.ceil(units.iconSizes.small + units.smallSpacing * 2) - raiseMaximumVolumeCheckbox.indicator.width) / 2) + units.smallSpacing | 624 | spacing: Math.round((Math.ceil(units.iconSizes.small + units.smallSpacing * 2) - raiseMaximumVolumeCheckbox.indicator.width) / 2) + units.smallSpacing | ||
626 | checked: plasmoid.configuration.raiseMaximumVolume | 625 | checked: plasmoid.configuration.raiseMaximumVolume | ||
Show All 36 Lines | |||||
663 | PlasmaComponents.ToolButton { | 662 | PlasmaComponents.ToolButton { | ||
664 | tooltip: plasmoid.action("configure").text | 663 | tooltip: plasmoid.action("configure").text | ||
665 | iconName: "configure" | 664 | iconName: "configure" | ||
666 | Accessible.name: tooltip | 665 | Accessible.name: tooltip | ||
667 | onClicked: plasmoid.action("configure").trigger() | 666 | onClicked: plasmoid.action("configure").trigger() | ||
668 | } | 667 | } | ||
669 | } | 668 | } | ||
670 | } | 669 | } | ||
670 | } | ||||
671 | 671 | | |||
672 | Component.onCompleted: { | 672 | Component.onCompleted: { | ||
673 | MicrophoneIndicator.init(); | 673 | MicrophoneIndicator.init(); | ||
674 | } | 674 | } | ||
675 | } | 675 | } |