vkdoom_m/include/zwidget/widgets/imagebox/imagebox.h
Marisa the Magician 991d522c57 Squashed 'libraries/ZWidget/' changes from b5ae8c8ab0..bac2a2edc5
bac2a2edc5 Exclude SDL2 from Windows compilation.
5b859bfd84 WaylandDisplayBackend: If the clicked window has a locked mouse, hide the cursor afterwards
ce76df6aa6 WaylandDisplayBackend: Add a TODO about XDG_Activation
a0ba04275b WaylandDisplayWindow: Move XDG Activation Token outside activate()

git-subtree-dir: libraries/ZWidget
git-subtree-split: bac2a2edc52cf12d1223244251876e9c4533e614
2025-09-24 19:42:37 +02:00

31 lines
495 B
C++

#pragma once
#include "../../core/widget.h"
#include "../../core/image.h"
enum ImageBoxMode
{
Center,
Contain,
Cover
};
class ImageBox : public Widget
{
public:
ImageBox(Widget* parent);
void SetImage(std::shared_ptr<Image> newImage);
void SetImageMode(ImageBoxMode mode);
double GetPreferredWidth() const;
double GetPreferredHeight() const;
protected:
void OnPaint(Canvas* canvas) override;
private:
std::shared_ptr<Image> image;
ImageBoxMode mode = ImageBoxMode::Center;
};