<commit_before>import QtQuick 2.0

import QtQuick.Controls 1.0
import QtQuick.Layouts 1.0

import org.kde.kquickcontrolsaddons 2.0
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.core 2.0 as PlasmaCore

PlasmaComponents.ListItem {
    id: item

    property alias label: textLabel.text
    property alias icon: clientIcon.icon

    function setVolume(volume) {
        throw "Pure Virtual BaseItem::setVolumve(volume) called.";
    }

    function increaseVolume() {
        var step = slider.maximumValue / 10;
        setVolume(Volume + step);
    }

    function decreaseVolume() {
        var step = slider.maximumValue / 10;
        setVolume(Volume - step);
    }

    anchors {
        left: parent.left;
        right: parent.right;
    }

    RowLayout {
        property int maximumWidth: parent.width
        width: maximumWidth
        Layout.maximumWidth: maximumWidth
        spacing: 8

        QIconItem {
            id: clientIcon
            Layout.alignment: Qt.AlignHCenter
            width: height
            height: column.height * 0.75
        }

        ColumnLayout {
            id: column

            RowLayout {
                PlasmaComponents.Label {
                    id: textLabel
                    Layout.fillWidth: true
                    elide: Text.ElideRight
                }

                // The volume icon is packed into an item because we need to have it centered
                // with regards to the percent text, so we can potentially have a wider item
                // with a centered less wide icon.
                Item {
                    // Layout might want to make the text's height bigger than the content
                    // because of us, so we have to go after contentHeight to make sure we get the
                    // correct reference value, also we'd make an indirect binding loop otherwise.
                    width: Math.max(referenceText.width, textLabel.contentHeight)
                    height: textLabel.contentHeight

                    PlasmaCore.SvgItem {
                        id: muteIcon;

                        anchors.centerIn: parent
                        height: parent.height
                        width: height

                        elementId: {
                            var split_base = 65536/3.0;
                            var icon = null;
                            if (Volume / split_base <= 0) {
                                icon = "audio-volume-muted";
                            } else if (Volume / split_base <= 1) {
                                icon = "audio-volume-low";
                            } else if (Volume / split_base <= 2) {<commit_msg>force vertical anchor to prevent alignment problems with text label<commit_after>import QtQuick 2.0

import QtQuick.Controls 1.0
import QtQuick.Layouts 1.0

import org.kde.kquickcontrolsaddons 2.0
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.core 2.0 as PlasmaCore

PlasmaComponents.ListItem {
    id: item

    property alias label: textLabel.text
    property alias icon: clientIcon.icon

    function setVolume(volume) {
        throw "Pure Virtual BaseItem::setVolumve(volume) called.";
    }

    function increaseVolume() {
        var step = slider.maximumValue / 10;
        setVolume(Volume + step);
    }

    function decreaseVolume() {
        var step = slider.maximumValue / 10;
        setVolume(Volume - step);
    }

    anchors {
        left: parent.left;
        right: parent.right;
    }

    RowLayout {
        property int maximumWidth: parent.width
        width: maximumWidth
        Layout.maximumWidth: maximumWidth
        spacing: 8

        QIconItem {
            id: clientIcon
            Layout.alignment: Qt.AlignHCenter
            width: height
            height: column.height * 0.75
        }

        ColumnLayout {
            id: column

            RowLayout {
                PlasmaComponents.Label {
                    id: textLabel
                    Layout.fillWidth: true
                    anchors.verticalCenter: iconContainer.verticalCenter
                    elide: Text.ElideRight
                }

                // The volume icon is packed into an item because we need to have it centered
                // with regards to the percent text, so we can potentially have a wider item
                // with a centered less wide icon.
                Item {
                    id: iconContainer

                    // Layout might want to make the text's height bigger than the content
                    // because of us, so we have to go after contentHeight to make sure we get the
                    // correct reference value, also we'd make an indirect binding loop otherwise.
                    width: Math.max(referenceText.width, textLabel.contentHeight)
                    height: textLabel.contentHeight

                    PlasmaCore.SvgItem {
                        id: muteIcon;

                        anchors.centerIn: parent
                        height: parent.height
                        width: height

                        elementId: {
                            var split_base = 65536/3.0;
                            var icon = null;
                            if (Volume / split_base <= 0) {
                                icon = "audio-volume-muted";
                            } else if (Volume / split_base <= 1) {
                                icon = "audio-volume-low";
                            } else if (Volume / split_base <= 2) {
{'fraction_non_alphanumeric': 0.06392857142857143, 'fraction_numerical': 0.010714285714285714, 'mean_word_length': 1.342534504391468, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6622328', 'n_tokens_mistral': 1430, 'n_tokens_neox': 1292, 'n_words': 427}