mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-02 10:58:45 -05:00
35 lines
1.1 KiB
C++
35 lines
1.1 KiB
C++
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#include "Icon.hpp"
|
|
#include <Style.hpp>
|
|
#include <Font.hpp>
|
|
|
|
using namespace gui;
|
|
|
|
Icon::Icon(Item *parent,
|
|
const uint32_t &x,
|
|
const uint32_t &y,
|
|
const uint32_t &w,
|
|
const uint32_t &h,
|
|
const UTF8 &imageName,
|
|
const UTF8 &str,
|
|
ImageTypeSpecifier specifier)
|
|
: VBox(parent, x, y, w, h)
|
|
{
|
|
setEdges(RectangleEdge::None);
|
|
setAlignment(Alignment(Alignment::Horizontal::Center, Alignment::Vertical::Center));
|
|
|
|
image = new Image(this, imageName, specifier);
|
|
image->setMargins(Margins(0, icon::image_top_margin, 0, icon::image_bottom_margin));
|
|
|
|
text = new Text(this, 0, 0, 0, 0);
|
|
text->setMaximumSize(w, h);
|
|
text->setTextType(TextType::MultiLine);
|
|
text->setEditMode(EditMode::Browse);
|
|
text->setEdges(RectangleEdge::None);
|
|
text->setAlignment(gui::Alignment(gui::Alignment::Horizontal::Center, gui::Alignment::Vertical::Center));
|
|
text->setFont(style::window::font::medium);
|
|
text->setRichText(str);
|
|
}
|