Widgets: Add ProgressBarWidget

This commit is contained in:
SirLynix
2024-01-16 14:13:06 +01:00
parent c8776bc950
commit 964d32b34e
11 changed files with 249 additions and 6 deletions

View File

@@ -0,0 +1,43 @@
// Copyright (C) 2024 Jérôme "SirLynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - Widgets module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_WIDGETS_PROGRESSBARWIDGET_HPP
#define NAZARA_WIDGETS_PROGRESSBARWIDGET_HPP
#include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Widgets/BaseWidget.hpp>
#include <Nazara/Widgets/WidgetTheme.hpp>
namespace Nz
{
class NAZARA_WIDGETS_API ProgressBarWidget : public BaseWidget
{
public:
ProgressBarWidget(BaseWidget* parent);
ProgressBarWidget(const ProgressBarWidget&) = delete;
ProgressBarWidget(ProgressBarWidget&&) = delete;
~ProgressBarWidget() = default;
inline float GetFraction() const;
void Layout() override;
void OnRenderLayerUpdated(int baseRenderLayer) override;
inline void SetFraction(float fraction);
ProgressBarWidget& operator=(const ProgressBarWidget&) = delete;
ProgressBarWidget& operator=(ProgressBarWidget&&) = delete;
private:
std::unique_ptr<ProgressBarWidgetStyle> m_style;
float m_fraction;
};
}
#include <Nazara/Widgets/ProgressBarWidget.inl>
#endif // NAZARA_WIDGETS_PROGRESSBARWIDGET_HPP