Files
o3de/Code/Framework/AzQtComponents/AzQtComponents/Components/Widgets/ProgressBar.cpp
T
Steve Pham 38261d0800 Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
2021-07-16 15:25:48 -07:00

49 lines
1.1 KiB
C++

/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include <AzQtComponents/Components/Widgets/ProgressBar.h>
#include <AzQtComponents/Components/Style.h>
#include <AzQtComponents/Components/ConfigHelpers.h>
#include <QSettings>
#include <QStyleFactory>
namespace AzQtComponents
{
ProgressBar::Config ProgressBar::loadConfig(QSettings& settings)
{
Config config = defaultConfig();
ConfigHelpers::read<int>(settings, QStringLiteral("Height"), config.height);
return config;
}
ProgressBar::Config ProgressBar::defaultConfig()
{
Config config;
config.height = 5;
return config;
}
QSize ProgressBar::sizeFromContents(const Style* style, QStyle::ContentsType type, const QStyleOption* option, const QSize& size, const QWidget* widget, const ProgressBar::Config& config)
{
Q_UNUSED(config);
QSize sz = style->QProxyStyle::sizeFromContents(type, option, size, widget);
sz.setHeight(config.height);
return sz;
}
} // namespace AzQtComponents