mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-02 19:08:54 -05:00
In the settings, the user can choose a clock face with quotes. A dedicated clock face includes information about the time, alarm settings, quote and author of the quote.
39 lines
1.0 KiB
C++
39 lines
1.0 KiB
C++
// Copyright (c) 2017-2024, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#include "ImageBox.hpp"
|
|
|
|
using namespace gui;
|
|
|
|
ImageBox::ImageBox(Item *parent, const Position &x, const Position &y, const Length &w, const Length &h, Image *image)
|
|
: VBox(parent, x, y, w, h), image(image)
|
|
{
|
|
setEdges(RectangleEdge::None);
|
|
setAlignment(gui::Alignment(gui::Alignment::Horizontal::Center, gui::Alignment::Vertical::Center));
|
|
addWidget(image);
|
|
}
|
|
|
|
ImageBox::ImageBox(Item *parent, Image *image) : ImageBox(parent, 0, 0, 0, 0, image)
|
|
{}
|
|
|
|
void ImageBox::showImage(bool show)
|
|
{
|
|
image->setVisible(show);
|
|
}
|
|
|
|
void ImageBox::setImage(const UTF8 &name, ImageTypeSpecifier specifier)
|
|
{
|
|
image->set(name, specifier);
|
|
}
|
|
|
|
void ImageBox::fitBoxToImage()
|
|
{
|
|
setMinimumSize(image->getWidth(), image->getHeight());
|
|
setMaximumSize(image->getWidth(), image->getHeight());
|
|
}
|
|
|
|
void ImageBox::setMinimumSizeToFitImage()
|
|
{
|
|
setMinimumSize(image->getWidth(), image->getHeight());
|
|
}
|