From 4175ca0db94fafcf18072187c462e0b61e71016b Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Sun, 21 Feb 2021 21:05:13 +0200 Subject: iOS: Working on menu styling --- src/ui/listwidget.c | 2 +- src/ui/sidebarwidget.c | 2 -- src/ui/util.c | 13 +++++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ui/listwidget.c b/src/ui/listwidget.c index fe53c595..28a19b9c 100644 --- a/src/ui/listwidget.c +++ b/src/ui/listwidget.c @@ -138,7 +138,7 @@ void updateVisible_ListWidget(iListWidget *d) { void setItemHeight_ListWidget(iListWidget *d, int itemHeight) { d->itemHeight = itemHeight; if (deviceType_App() != desktop_AppDeviceType) { - d->itemHeight += gap_UI; + d->itemHeight += 1.5 * gap_UI; } invalidate_ListWidget(d); } diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index b1dfc378..bbd65268 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c @@ -476,8 +476,6 @@ void init_SidebarWidget(iSidebarWidget *d, enum iSidebarSide side) { setFlags_Widget(w, fixedWidth_WidgetFlag, iTrue); iWidget *vdiv = makeVDiv_Widget(); addChildFlags_Widget(w, vdiv, resizeToParentWidth_WidgetFlag | resizeToParentHeight_WidgetFlag); - if (deviceType_App() == phone_AppDeviceType && d->side == left_SideBarSide) { - } iZap(d->modeButtons); /* On a phone, the right sidebar is used exclusively for Identities. */ const iBool isPhone = deviceType_App() == phone_AppDeviceType; diff --git a/src/ui/util.c b/src/ui/util.c index c55b2c36..4f059dc7 100644 --- a/src/ui/util.c +++ b/src/ui/util.c @@ -477,6 +477,19 @@ void openMenu_Widget(iWidget *d, iInt2 coord) { setFlags_Widget(d, hidden_WidgetFlag, iFalse); setFlags_Widget(d, commandOnMouseMiss_WidgetFlag, iTrue); setFlags_Widget(findChild_Widget(d, "menu.cancel"), disabled_WidgetFlag, iFalse); + if (deviceType_App() == phone_AppDeviceType) { + if (isPortrait_App()) { + setFlags_Widget(d, arrangeWidth_WidgetFlag | resizeChildrenToWidestChild_WidgetFlag, iFalse); + setFlags_Widget(d, resizeWidthOfChildren_WidgetFlag, iTrue); + d->rect.size.x = rootSize_Window(get_Window()).x; + iForEach(ObjectList, i, children_Widget(d)) { + if (isInstance_Object(i.object, &Class_LabelWidget)) { + iLabelWidget *label = i.object; + setFont_LabelWidget(label, defaultBig_FontId); + } + } + } + } arrange_Widget(d); d->rect.pos = coord; /* Ensure the full menu is visible. */ -- cgit v1.2.3