Fix regression: TextBox isn't rendering text (doesn't update the bounds area of the text box)

Regression in dd0c296209 (Use
tooltip_text style & color to paint tooltip windows #2554).

Prior this fix, text box does not update its bounds area because it
has not a style assigned.

Fix #3442, fix #3443
master
Gaspar Capello 2022-07-29 18:42:20 -03:00 committed by David Capello
parent 3e6360d024
commit 55885ee266
4 changed files with 10 additions and 10 deletions

View File

@ -503,6 +503,10 @@
<background color="tooltip_face" />
<text color="tooltip_text" align="left" />
</style>
<style id="textbox_text" align="left top wordwrap" border="4">
<background color="textbox_face" />
<text color="textbox_text" align="left" />
</style>
<style id="label" padding="1">
<text color="text" align="left" />
<text color="disabled" align="left" state="disabled" />

View File

@ -913,9 +913,8 @@ void SkinTheme::initWidget(Widget* widget)
break;
case kTextBoxWidget:
BORDER(4*guiscale());
widget->setChildSpacing(0);
widget->setBgColor(colors.textboxFace());
widget->setStyle(styles.textboxText());
break;
case kViewWidget:

View File

@ -294,10 +294,9 @@ void Theme::paintTooltip(Graphics* g,
}
}
gfx::Size Theme::paintTextBoxWithStyle(Graphics* g,
const Widget* widget)
void Theme::paintTextBoxWithStyle(Graphics* g,
const Widget* widget)
{
gfx::Size size;
gfx::Color bg = gfx::ColorNone, fg = gfx::ColorNone;
for_each_layer(
@ -311,9 +310,7 @@ gfx::Size Theme::paintTextBoxWithStyle(Graphics* g,
});
if (fg != gfx::ColorNone)
Theme::drawTextBox(g, widget, &size.w, &size.h, bg, fg);
return size;
Theme::drawTextBox(g, widget, nullptr, nullptr, bg, fg);
}
void Theme::paintLayer(Graphics* g,

View File

@ -101,8 +101,8 @@ namespace ui {
const int arrowAlign,
const gfx::Rect& target);
gfx::Size paintTextBoxWithStyle(Graphics* g,
const Widget* widget);
void paintTextBoxWithStyle(Graphics* g,
const Widget* widget);
virtual gfx::Size calcSizeHint(const Widget* widget,
const Style* style);