<commit_before>/*
 * QML Material - An application framework implementing Material Design.
 * Copyright (C) 2015 <NAME> <<EMAIL>>
 *               2015 <NAME> <<EMAIL>>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 2.1 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
import QtQuick 2.0
import Material 0.1

PopupBase {
    id: bottomSheet

    /*!
       The maximum height of the bottom sheet. This is useful when used with a flickable,
       so the bottom sheet will scroll when the content is higher than the maximum height.
     */
    property int maxHeight: parent.height * 0.6
    
    default property alias content: containerView.data

    overlayLayer: "dialogOverlayLayer"
    overlayColor: Qt.rgba(0, 0, 0, 0.2)
    height: Math.min(maxHeight, implicitHeight)
    implicitHeight: containerView.childrenRect.height
    width: parent.width

    property real percentOpen: showing ? 1 : 0

    Behavior on percentOpen {

        NumberAnimation {
            duration: 200
            easing {
                 type: Easing.OutCubic
            }
        }
    }
<commit_msg>[BottomSheet] Hide the bottom sheet when it isn't showing<commit_after>/*
 * QML Material - An application framework implementing Material Design.
 * Copyright (C) 2015 <NAME> <<EMAIL>>
 *               2015 <NAME> <<EMAIL>>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 2.1 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
import QtQuick 2.0
import Material 0.1

PopupBase {
    id: bottomSheet

    /*!
       The maximum height of the bottom sheet. This is useful when used with a flickable,
       so the bottom sheet will scroll when the content is higher than the maximum height.
     */
    property int maxHeight: parent.height * 0.6
    
    default property alias content: containerView.data

    overlayLayer: "dialogOverlayLayer"
    overlayColor: Qt.rgba(0, 0, 0, 0.2)
    height: Math.min(maxHeight, implicitHeight)
    implicitHeight: containerView.childrenRect.height
    width: parent.width

    visible: percentOpen > 0

    property real percentOpen: showing ? 1 : 0

    Behavior on percentOpen {

        NumberAnimation {
            duration: 200
            easing {
                 type: Easing.OutCubic
            }
        }
    }

{'fraction_non_alphanumeric': 0.06861012956419317, 'fraction_numerical': 0.015606595995288575, 'mean_word_length': 2.7997762863534676, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '797160', 'n_tokens_mistral': 915, 'n_tokens_neox': 857, 'n_words': 405}