summaryrefslogtreecommitdiff
path: root/src/ui/labelwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-12-12 13:52:57 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-12-12 13:52:57 +0200
commit8bd055049a7878f4509dff5bcd0e152890665976 (patch)
tree43ed29914b2c8961562514063b153c38cf486781 /src/ui/labelwidget.c
parentc391ce4fccf6de52b884a438329d12e76bd1a160 (diff)
Mobile: Crash when dismissing sidebar during Edit mode
Diffstat (limited to 'src/ui/labelwidget.c')
-rw-r--r--src/ui/labelwidget.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/ui/labelwidget.c b/src/ui/labelwidget.c
index 5ad43b0e..4ace6204 100644
--- a/src/ui/labelwidget.c
+++ b/src/ui/labelwidget.c
@@ -492,6 +492,7 @@ int font_LabelWidget(const iLabelWidget *d) {
492} 492}
493 493
494void updateSize_LabelWidget(iLabelWidget *d) { 494void updateSize_LabelWidget(iLabelWidget *d) {
495 if (!d) return;
495 iWidget *w = as_Widget(d); 496 iWidget *w = as_Widget(d);
496 const int64_t flags = flags_Widget(w); 497 const int64_t flags = flags_Widget(w);
497 const iInt2 size = defaultSize_LabelWidget(d); 498 const iInt2 size = defaultSize_LabelWidget(d);
@@ -562,18 +563,22 @@ void setTextColor_LabelWidget(iLabelWidget *d, int color) {
562} 563}
563 564
564void setText_LabelWidget(iLabelWidget *d, const iString *text) { 565void setText_LabelWidget(iLabelWidget *d, const iString *text) {
565 updateText_LabelWidget(d, text); 566 if (d) {
566 updateSize_LabelWidget(d); 567 updateText_LabelWidget(d, text);
567 if (isWrapped_LabelWidget(d)) { 568 updateSize_LabelWidget(d);
568 sizeChanged_LabelWidget_(d); 569 if (isWrapped_LabelWidget(d)) {
570 sizeChanged_LabelWidget_(d);
571 }
569 } 572 }
570} 573}
571 574
572void setTextCStr_LabelWidget(iLabelWidget *d, const char *text) { 575void setTextCStr_LabelWidget(iLabelWidget *d, const char *text) {
573 updateTextCStr_LabelWidget(d, text); 576 if (d) {
574 updateSize_LabelWidget(d); 577 updateTextCStr_LabelWidget(d, text);
575 if (isWrapped_LabelWidget(d)) { 578 updateSize_LabelWidget(d);
576 sizeChanged_LabelWidget_(d); 579 if (isWrapped_LabelWidget(d)) {
580 sizeChanged_LabelWidget_(d);
581 }
577 } 582 }
578} 583}
579 584