Add initial token theming.

This commit is contained in:
jmsgrogan 2023-01-17 13:01:59 +00:00
parent 3d37a7244b
commit 1f85954e98
34 changed files with 406 additions and 253 deletions

View file

@ -12,7 +12,7 @@ ImageEditorView::ImageEditorView()
{
auto label = Label::Create();
label->setLabel("Image Editor");
label->setBackgroundColor(Theme::getBackgroundPrimary());
label->setBackground(ThemeToken::SystemToken::Primary);
label->setMargin(1);
auto image_widget = std::make_unique<ImageViewWidget>();

View file

@ -3,7 +3,8 @@
#include "GridNode.h"
#include "TransformNode.h"
#include <iostream>
#include "ThemeManager.h"
#include "PaintEvent.h"
ImageViewWidget::ImageViewWidget()
{
@ -27,7 +28,7 @@ void ImageViewWidget::doPaint(const PaintEvent* event)
mGridNode->setWidth(mSize.mWidth);
mGridNode->setHeight(mSize.mHeight);
mGridNode->setStrokeColor(mBorderColor);
mGridNode->setStrokeColor(event->getThemesManager()->getColor(mBorder));
mRootNode->addChild(mGridNode.get());
}
@ -41,6 +42,6 @@ void ImageViewWidget::doPaint(const PaintEvent* event)
if (mMaterialDirty)
{
mGridNode->setFillColor(mBorderColor);
mGridNode->setFillColor(event->getThemesManager()->getColor(mBorder));
}
}