summaryrefslogtreecommitdiff
path: root/src/ui/sidebarwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-02-20 15:15:42 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-02-20 15:15:42 +0200
commit1ca771a41e430f866e3a3270f285fc9a7eacfc65 (patch)
tree9812569c07a0d569719e1af2ca8b8e494ef7e638 /src/ui/sidebarwidget.c
parent876bde9002a5d1faa66cbdac08bf04f4d6719b6e (diff)
iOS: Removed 2nd sidebar; background tweaks
Diffstat (limited to 'src/ui/sidebarwidget.c')
-rw-r--r--src/ui/sidebarwidget.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c
index 5c6285fb..456bcee7 100644
--- a/src/ui/sidebarwidget.c
+++ b/src/ui/sidebarwidget.c
@@ -428,11 +428,11 @@ iBool setMode_SidebarWidget(iSidebarWidget *d, enum iSidebarMode mode) {
428} 428}
429 429
430enum iSidebarMode mode_SidebarWidget(const iSidebarWidget *d) { 430enum iSidebarMode mode_SidebarWidget(const iSidebarWidget *d) {
431 return d->mode; 431 return d ? d->mode : 0;
432} 432}
433 433
434int width_SidebarWidget(const iSidebarWidget *d) { 434int width_SidebarWidget(const iSidebarWidget *d) {
435 return d->width; 435 return d ? d->width : 0;
436} 436}
437 437
438static const char *normalModeLabels_[max_SidebarMode] = { 438static const char *normalModeLabels_[max_SidebarMode] = {
@@ -488,12 +488,16 @@ void init_SidebarWidget(iSidebarWidget *d, enum iSidebarSide side) {
488 addChildFlags_Widget(vdiv, 488 addChildFlags_Widget(vdiv,
489 iClob(buttons), 489 iClob(buttons),
490 arrangeHorizontal_WidgetFlag | resizeWidthOfChildren_WidgetFlag | 490 arrangeHorizontal_WidgetFlag | resizeWidthOfChildren_WidgetFlag |
491 arrangeHeight_WidgetFlag | resizeToParentWidth_WidgetFlag); 491 arrangeHeight_WidgetFlag | resizeToParentWidth_WidgetFlag |
492 drawBackgroundToHorizontalSafeArea_WidgetFlag);
493 if (deviceType_App() == phone_AppDeviceType) {
494 setBackgroundColor_Widget(buttons, uiBackground_ColorId);
495 }
492 iWidget *content = new_Widget(); 496 iWidget *content = new_Widget();
493 setFlags_Widget(content, resizeChildren_WidgetFlag, iTrue); 497 setFlags_Widget(content, resizeChildren_WidgetFlag, iTrue);
494 d->list = new_ListWidget(); 498 d->list = new_ListWidget();
495 setPadding_Widget(as_Widget(d->list), 0, gap_UI, 0, gap_UI); 499 setPadding_Widget(as_Widget(d->list), 0, gap_UI, 0, gap_UI);
496 addChild_Widget(content, iClob(d->list)); 500 addChildFlags_Widget(content, iClob(d->list), drawBackgroundToHorizontalSafeArea_WidgetFlag);
497 d->contextItem = NULL; 501 d->contextItem = NULL;
498 d->blank = new_Widget(); 502 d->blank = new_Widget();
499 addChildFlags_Widget(content, iClob(d->blank), resizeChildren_WidgetFlag); 503 addChildFlags_Widget(content, iClob(d->blank), resizeChildren_WidgetFlag);