From 0d88597ecc664cc55b76fcd8296d3ee3c773f8cc Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 17 Sep 2021 07:12:43 +0300 Subject: Fixed minor widget glitches --- src/ui/labelwidget.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/ui/labelwidget.c') diff --git a/src/ui/labelwidget.c b/src/ui/labelwidget.c index ec324d02..c3c5fbe5 100644 --- a/src/ui/labelwidget.c +++ b/src/ui/labelwidget.c @@ -504,6 +504,14 @@ void setText_LabelWidget(iLabelWidget *d, const iString *text) { } } +void setTextCStr_LabelWidget(iLabelWidget *d, const char *text) { + updateTextCStr_LabelWidget(d, text); + updateSize_LabelWidget(d); + if (isWrapped_LabelWidget(d)) { + sizeChanged_LabelWidget_(d); + } +} + void setAlignVisually_LabelWidget(iLabelWidget *d, iBool alignVisual) { d->flags.alignVisual = alignVisual; } @@ -565,13 +573,6 @@ void updateTextAndResizeWidthCStr_LabelWidget(iLabelWidget *d, const char *text) d->widget.rect.size.x = defaultSize_LabelWidget(d).x; } -void setTextCStr_LabelWidget(iLabelWidget *d, const char *text) { - setCStr_String(&d->label, text); - set_String(&d->srcLabel, &d->label); - replaceVariables_LabelWidget_(d); - updateSize_LabelWidget(d); -} - void setCommand_LabelWidget(iLabelWidget *d, const iString *command) { set_String(&d->command, command); } -- cgit v1.2.3