stuff-from-scratch/apps/notes_tk/image_editor/ImageEditorView.cpp
2022-12-02 11:50:15 +00:00

30 lines
741 B
C++

#include "ImageEditorView.h"
#include "Label.h"
#include "Color.h"
#include "TextNode.h"
#include "Theme.h"
#include "ImageViewWidget.h"
#include "HorizontalSpacer.h"
ImageEditorView::ImageEditorView()
{
auto label = Label::Create();
label->setLabel("Image Editor");
label->setBackgroundColor(Theme::getBackgroundPrimary());
label->setMargin(1);
auto image_widget = std::make_unique<ImageViewWidget>();
auto hSpacer = HorizontalSpacer::Create();
hSpacer->addWidgetWithScale(std::move(label), 1);
hSpacer->addWidgetWithScale(std::move(image_widget), 14);
addWidget(std::move(hSpacer));
}
std::unique_ptr<ImageEditorView> ImageEditorView::Create()
{
return std::make_unique<ImageEditorView>();
}