Set up stacked widget.
This commit is contained in:
parent
4e85edacc8
commit
ee51f3ee09
51 changed files with 808 additions and 195 deletions
|
@ -8,7 +8,8 @@ TextBox::TextBox()
|
|||
mContent(),
|
||||
mCaps(false)
|
||||
{
|
||||
mBackgroundColor = Color::Create(240, 240, 220);
|
||||
mBackgroundColor = Color::Create(250, 250, 250);
|
||||
mPadding = {10, 0, 10, 0};
|
||||
}
|
||||
|
||||
std::unique_ptr<TextBox> TextBox::Create()
|
||||
|
@ -64,7 +65,6 @@ bool TextBox::OnMyKeyboardEvent(const KeyboardEvent* event)
|
|||
AppendContent(keyString);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -85,12 +85,14 @@ void TextBox::OnPaintEvent(const PaintEvent* event)
|
|||
}
|
||||
for(const auto& line : seglist)
|
||||
{
|
||||
auto loc = DiscretePoint(mLocation.GetX() + mWidth/10,
|
||||
mLocation.GetY() + mHeight/10 + offset);
|
||||
auto loc = DiscretePoint(mLocation.GetX() + mPadding.mLeft,
|
||||
mLocation.GetY() + mPadding.mTop + offset);
|
||||
auto textLayer = VisualLayer::Create();
|
||||
textLayer->SetText(TextElement::Create(line, loc));
|
||||
auto textElement = TextElement::Create(line, loc);
|
||||
textElement->SetFillColor(Color::Create(*mBackgroundColor));
|
||||
textLayer->SetText(std::move(textElement));
|
||||
mMyLayers.push_back(std::move(textLayer));
|
||||
offset += 15;
|
||||
offset += 20;
|
||||
}
|
||||
}
|
||||
CopyMyLayers();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue