<commit_before>// Copyright (c) 2015 <NAME>.
// Cura is released under the terms of the AGPLv3 or higher.

import QtQuick 2.1
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1

import UM 1.0 as UM

QtObject {
    property Component sidebar_header_button: Component {
        ButtonStyle {
            background: Rectangle {
                color: UM.Theme.colors.setting_control
                border.width: 1
                border.color: control.hovered ? UM.Theme.colors.setting_control_border_highlight : UM.Theme.colors.setting_control_border
                UM.RecolorImage {
                    id: downArrow
                    anchors.verticalCenter: parent.verticalCenter
                    anchors.right: parent.right
                    anchors.rightMargin: UM.Theme.sizes.default_margin.width
                    width: UM.Theme.sizes.standard_arrow.width
                    height: UM.Theme.sizes.standard_arrow.height
                    sourceSize.width: width
                    sourceSize.height: width
                    color: UM.Theme.colors.setting_category_text
                    source: UM.Theme.icons.arrow_bottom
                }
                Label {
                    id: sidebarComboBoxLabel
                    color: UM.Theme.colors.setting_control_text
                    text: control.text;
                    elide: Text.ElideRight;
                    anchors.left: parent.left;
                    anchors.leftMargin: UM.Theme.sizes.setting_unit_margin.width
                    anchors.right: downArrow.left;
                    anchors.verticalCenter: parent.verticalCenter;
                    font: UM.Theme.fonts.default
                }
            }
            label: Label{}
        }
    }

/*
    property Component open_file_button: Component {
        ButtonStyle {
            background: Item{
                implicitWidth: UM.Theme.sizes.button.width;
                implicitHeight: UM.Theme.sizes.button.height;
                Rectangle {
                    id: tool_button_background
                    anchors.left: parent.right
                    anchors.verticalCenter: parent.verticalCenter
                    opacity: control.hovered ? 1.0 : 0.0;

                    width: control.hovered ? label.width : 0;
                    height: label.height

                    Behavior on width { NumberAnimation { duration: 100; } }
                    Behavior on height { NumberAnimation { duration: 100; } }
                    Behavior on opacity { NumberAnimation { duration: 100; } }

                    Label {
                        id: label
                        anchors.bottom: parent.bottom
                        text: control.text
                        font: UM.Theme.fonts.button_tooltip;
                        color: UM.Theme.colors.button_tooltip_text;
                    }
                }
                Rectangle {
                    anchors.fill: parent;
                    color: control.pressed ? UM.Theme.colors.button_active :
                               control.hovered ? UM.Theme.colors.button_hover : UM.Theme.colors.button
                    Behavior on color { ColorAnimation { duration: 50; } }
                }
            }
            label: Item {
                Image {
                    anchors.centerIn: parent;
                    source: control.iconSource;
                    width: UM.Theme.sizes.button_icon.width;
                    height: UM.Theme.sizes.button_icon.height;
                    sourceSize: UM.Theme.sizes.button_icon
                }
            }
        }
    }
*/

    property Component tool_button: Component {
        ButtonStyle {
            background: Item {
                implicitWidth: UM.Theme.sizes.button.width;
                implicitHeight: UM.Theme.sizes.button.height;

                UM.PointingRectangle {
                    id: button_tooltip

                    anchors.left: parent.right
                    anchors.leftMargin: UM.Theme.sizes.button_tooltip_arrow.width * 2
                    anchors.verticalCenter: parent.verticalCenter

                    target: Qt.point(parent.x, y + height/2)
                    arrowSize: UM.Theme.sizes.button_tooltip_arrow.width
                    color: UM.Theme.colors.tooltip
                    opacity: control.hovered ? 1.0 : 0.0;

                    width: control.hovered ? button_tip.width + UM.Theme.sizes.button_tooltip.width : 0
                    height: UM.Theme.sizes.button_tooltip.height

                    Behavior on width { NumberAnimation { duration: 100; } }
                    Behavior on opacity { NumberAnimation { duration: 100; } }

                    Label {
                        id: button_tip

                        anchors.horizontalCenter: parent.horizontalCenter
                        anchors.verticalCenter: parent.verticalCenter;

                        text: control.text;
                        font: UM.Theme.fonts.button_tooltip;
                        color: UM.Theme.colors.tooltip_text;
                    }
                }

                Rectangle {
                    id: buttonFace;

                    anchors.fill: parent;
                    property bool down: control.pressed || (control.checkable && control.checked);

                    color: {
                        if(control.checkable && control.checked && control.hovered) {
                            return UM.Theme.colors.button_active_hover;
                        } else if(control.pressed || (control.checkable && control.checked)) {
                            return UM.Theme.colors.button_active;
                        } else if(control.hovered) {
                            return UM.Theme.colors.button_hover;
                        } else {
                            return UM.Theme.colors.button;
                        }
                    }
                    Behavior on color { ColorAnimation { duration: 50; } }


                    UM.RecolorImage {
                        id: tool_button_arrow
                        opacity: !control.enabled ? 0.2 : 1.0
                        anchors.right: parent.right;
                        anchors.rightMargin: (UM.Theme.sizes.button.width - UM.Theme.sizes.button_icon.width) / 4
                        anchors.bottom: parent.bottom;
                        anchors.bottomMargin: (UM.Theme.sizes.button.height - UM.Theme.sizes.button_icon.height) / 4
                        width: UM.Theme.sizes.standard_arrow.width
                        height: UM.Theme.sizes.standard_arrow.height
                        sourceSize.width: width
                        sourceSize.height: width
                        visible: control.menu != null;
                        color: UM.Theme.colors.button_text
                        source: UM.Theme.icons.arrow_bottom
                    }
                }
            }

            label: Item {
                Image {
                    anchors.centerIn: parent;
                    opacity: !control.enabled ? 0.2 : 1.0
                    source: control.iconSource;
                    width: UM.Theme.sizes.button_icon.width;
                    height: UM.Theme.sizes.button_icon.height;

                    sourceSize: UM.Theme.sizes.button_icon
                }
            }
        }
    }

/*
    property Component tool_button_panel: Component {
        ButtonStyle {
            background: Item {
                implicitWidth: UM.Theme.sizes.button.width;
                implicitHeight: UM.Theme.sizes.button.height;

                Rectangle {
                    id: tool_button_background
                    anchors.left: parent.right
                    anchors.verticalCenter: parent.verticalCenter
                    opacity: control.hovered ? 1.0 : 0.0;

                    width: control.hovered ? label.width : 0;
                    height: label.height

                    Behavior on width { NumberAnimation { duration: 100; } }
                    Behavior on height { NumberAnimation { duration: 100; } }
                    Behavior on opacity { NumberAnimation { duration: 100; } }

                    Label {
                        id: label
                        anchors.bottom: parent.bottom
                        text: control.text
                        font: UM.Theme.fonts.button_tooltip;
                        color: UM.Theme.colors.button_tooltip_text;
                    }
                }

                Rectangle {
                    id: buttonFace;

                    anchors.fill: parent;

                    property bool down: control.pressed || (control.checkable && control.checked);

                    color: {
                        if(!control.enabled) {
                            return UM.Theme.colors.button_disabled;
                        } else if(control.checkable && control.checked && control.hovered) {
                            return UM.Theme.colors.button_active_hover;
                        } else if(control.pressed || (control.checkable && control.checked)) {
                            return UM.Theme.colors.button_active;
                        } else if(control.hovered) {
                            return UM.Theme.colors.button_hover;
                        } else {
                            return UM.Theme.colors.button;
                        }
                    }
                    Behavior on color { ColorAnimation { duration: 50; } }
                }
            }

            label: Item {
                Image {
                    anchors.centerIn: parent;

                    source: control.iconSource;
                    width: UM.Theme.sizes.button_icon.width;
                    height: UM.Theme.sizes.button_icon.height;

                    sourceSize: UM.Theme.sizes.button_icon
                }
            }
        }
    }
*/

    property Component progressbar: Component{
        ProgressBarStyle {
            background:Rectangle {
                implicitWidth: UM.Theme.sizes.message.width - (UM.Theme.sizes.default_margin.width * 2)
                implicitHeight: UM.Theme.sizes.progressbar.height
                color: UM.Theme.colors.progressbar_background
            }
            progress: Rectangle {
                color: control.indeterminate ? "transparent" : UM.Theme.colors.progressbar_control
                Rectangle{
                    color: UM.Theme.colors.progressbar_control
                    width: UM.Theme.sizes.progressbar_control.width
                    height: UM.Theme.sizes.progressbar_control.height<commit_msg>Add radius to MessageStack progressbar for consistency<commit_after>// Copyright (c) 2015 <NAME>.V.
// Cura is released under the terms of the AGPLv3 or higher.

import QtQuick 2.1
import QtQuick.Controls 1.1
import QtQuick.Controls.Styles 1.1

import UM 1.0 as UM

QtObject {
    property Component sidebar_header_button: Component {
        ButtonStyle {
            background: Rectangle {
                color: UM.Theme.colors.setting_control
                border.width: 1
                border.color: control.hovered ? UM.Theme.colors.setting_control_border_highlight : UM.Theme.colors.setting_control_border
                UM.RecolorImage {
                    id: downArrow
                    anchors.verticalCenter: parent.verticalCenter
                    anchors.right: parent.right
                    anchors.rightMargin: UM.Theme.sizes.default_margin.width
                    width: UM.Theme.sizes.standard_arrow.width
                    height: UM.Theme.sizes.standard_arrow.height
                    sourceSize.width: width
                    sourceSize.height: width
                    color: UM.Theme.colors.setting_category_text
                    source: UM.Theme.icons.arrow_bottom
                }
                Label {
                    id: sidebarComboBoxLabel
                    color: UM.Theme.colors.setting_control_text
                    text: control.text;
                    elide: Text.ElideRight;
                    anchors.left: parent.left;
                    anchors.leftMargin: UM.Theme.sizes.setting_unit_margin.width
                    anchors.right: downArrow.left;
                    anchors.verticalCenter: parent.verticalCenter;
                    font: UM.Theme.fonts.default
                }
            }
            label: Label{}
        }
    }

/*
    property Component open_file_button: Component {
        ButtonStyle {
            background: Item{
                implicitWidth: UM.Theme.sizes.button.width;
                implicitHeight: UM.Theme.sizes.button.height;
                Rectangle {
                    id: tool_button_background
                    anchors.left: parent.right
                    anchors.verticalCenter: parent.verticalCenter
                    opacity: control.hovered ? 1.0 : 0.0;

                    width: control.hovered ? label.width : 0;
                    height: label.height

                    Behavior on width { NumberAnimation { duration: 100; } }
                    Behavior on height { NumberAnimation { duration: 100; } }
                    Behavior on opacity { NumberAnimation { duration: 100; } }

                    Label {
                        id: label
                        anchors.bottom: parent.bottom
                        text: control.text
                        font: UM.Theme.fonts.button_tooltip;
                        color: UM.Theme.colors.button_tooltip_text;
                    }
                }
                Rectangle {
                    anchors.fill: parent;
                    color: control.pressed ? UM.Theme.colors.button_active :
                               control.hovered ? UM.Theme.colors.button_hover : UM.Theme.colors.button
                    Behavior on color { ColorAnimation { duration: 50; } }
                }
            }
            label: Item {
                Image {
                    anchors.centerIn: parent;
                    source: control.iconSource;
                    width: UM.Theme.sizes.button_icon.width;
                    height: UM.Theme.sizes.button_icon.height;
                    sourceSize: UM.Theme.sizes.button_icon
                }
            }
        }
    }
*/

    property Component tool_button: Component {
        ButtonStyle {
            background: Item {
                implicitWidth: UM.Theme.sizes.button.width;
                implicitHeight: UM.Theme.sizes.button.height;

                UM.PointingRectangle {
                    id: button_tooltip

                    anchors.left: parent.right
                    anchors.leftMargin: UM.Theme.sizes.button_tooltip_arrow.width * 2
                    anchors.verticalCenter: parent.verticalCenter

                    target: Qt.point(parent.x, y + height/2)
                    arrowSize: UM.Theme.sizes.button_tooltip_arrow.width
                    color: UM.Theme.colors.tooltip
                    opacity: control.hovered ? 1.0 : 0.0;

                    width: control.hovered ? button_tip.width + UM.Theme.sizes.button_tooltip.width : 0
                    height: UM.Theme.sizes.button_tooltip.height

                    Behavior on width { NumberAnimation { duration: 100; } }
                    Behavior on opacity { NumberAnimation { duration: 100; } }

                    Label {
                        id: button_tip

                        anchors.horizontalCenter: parent.horizontalCenter
                        anchors.verticalCenter: parent.verticalCenter;

                        text: control.text;
                        font: UM.Theme.fonts.button_tooltip;
                        color: UM.Theme.colors.tooltip_text;
                    }
                }

                Rectangle {
                    id: buttonFace;

                    anchors.fill: parent;
                    property bool down: control.pressed || (control.checkable && control.checked);

                    color: {
                        if(control.checkable && control.checked && control.hovered) {
                            return UM.Theme.colors.button_active_hover;
                        } else if(control.pressed || (control.checkable && control.checked)) {
                            return UM.Theme.colors.button_active;
                        } else if(control.hovered) {
                            return UM.Theme.colors.button_hover;
                        } else {
                            return UM.Theme.colors.button;
                        }
                    }
                    Behavior on color { ColorAnimation { duration: 50; } }


                    UM.RecolorImage {
                        id: tool_button_arrow
                        opacity: !control.enabled ? 0.2 : 1.0
                        anchors.right: parent.right;
                        anchors.rightMargin: (UM.Theme.sizes.button.width - UM.Theme.sizes.button_icon.width) / 4
                        anchors.bottom: parent.bottom;
                        anchors.bottomMargin: (UM.Theme.sizes.button.height - UM.Theme.sizes.button_icon.height) / 4
                        width: UM.Theme.sizes.standard_arrow.width
                        height: UM.Theme.sizes.standard_arrow.height
                        sourceSize.width: width
                        sourceSize.height: width
                        visible: control.menu != null;
                        color: UM.Theme.colors.button_text
                        source: UM.Theme.icons.arrow_bottom
                    }
                }
            }

            label: Item {
                Image {
                    anchors.centerIn: parent;
                    opacity: !control.enabled ? 0.2 : 1.0
                    source: control.iconSource;
                    width: UM.Theme.sizes.button_icon.width;
                    height: UM.Theme.sizes.button_icon.height;

                    sourceSize: UM.Theme.sizes.button_icon
                }
            }
        }
    }

/*
    property Component tool_button_panel: Component {
        ButtonStyle {
            background: Item {
                implicitWidth: UM.Theme.sizes.button.width;
                implicitHeight: UM.Theme.sizes.button.height;

                Rectangle {
                    id: tool_button_background
                    anchors.left: parent.right
                    anchors.verticalCenter: parent.verticalCenter
                    opacity: control.hovered ? 1.0 : 0.0;

                    width: control.hovered ? label.width : 0;
                    height: label.height

                    Behavior on width { NumberAnimation { duration: 100; } }
                    Behavior on height { NumberAnimation { duration: 100; } }
                    Behavior on opacity { NumberAnimation { duration: 100; } }

                    Label {
                        id: label
                        anchors.bottom: parent.bottom
                        text: control.text
                        font: UM.Theme.fonts.button_tooltip;
                        color: UM.Theme.colors.button_tooltip_text;
                    }
                }

                Rectangle {
                    id: buttonFace;

                    anchors.fill: parent;

                    property bool down: control.pressed || (control.checkable && control.checked);

                    color: {
                        if(!control.enabled) {
                            return UM.Theme.colors.button_disabled;
                        } else if(control.checkable && control.checked && control.hovered) {
                            return UM.Theme.colors.button_active_hover;
                        } else if(control.pressed || (control.checkable && control.checked)) {
                            return UM.Theme.colors.button_active;
                        } else if(control.hovered) {
                            return UM.Theme.colors.button_hover;
                        } else {
                            return UM.Theme.colors.button;
                        }
                    }
                    Behavior on color { ColorAnimation { duration: 50; } }
                }
            }

            label: Item {
                Image {
                    anchors.centerIn: parent;

                    source: control.iconSource;
                    width: UM.Theme.sizes.button_icon.width;
                    height: UM.Theme.sizes.button_icon.height;

                    sourceSize: UM.Theme.sizes.button_icon
                }
            }
        }
    }
*/

    property Component progressbar: Component{
        ProgressBarStyle {
            background:Rectangle {
                implicitWidth: UM.Theme.sizes.message.width - (UM.Theme.sizes.default_margin.width * 2)
                implicitHeight: UM.Theme.sizes.progressbar.height
                radius: UM.Theme.sizes.progressbar_radius.width
                color: UM.Theme.colors.progressbar_background
            }
            progress: Rectangle {
                color: control.indeterminate ? "transparent" : UM.Theme.colors.progressbar_control
                Rectangle{
                    radius: UM.Theme.sizes.progressbar_radius.width
                    color: UM.Theme.colors.progressbar_control
                    width: UM.Theme.sizes.progressbar_control.width
                    height: UM.Theme.sizes.progressbar_control.height
{'fraction_non_alphanumeric': 0.07476505717327901, 'fraction_numerical': 0.006666358038979677, 'mean_word_length': 1.1468892864241702, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4532083', 'n_tokens_mistral': 5507, 'n_tokens_neox': 4850, 'n_words': 933}