summaryrefslogtreecommitdiff
path: root/src/ui/sidebarwidget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/sidebarwidget.c')
-rw-r--r--src/ui/sidebarwidget.c47
1 files changed, 25 insertions, 22 deletions
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c
index e0ec9083..0ec43249 100644
--- a/src/ui/sidebarwidget.c
+++ b/src/ui/sidebarwidget.c
@@ -226,28 +226,6 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) {
226 addItem_ListWidget(d->list, item); 226 addItem_ListWidget(d->list, item);
227 iRelease(item); 227 iRelease(item);
228 } 228 }
229 if (isEmpty_ListWidget(d->list)) {
230 iWidget *div = makeVDiv_Widget();
231 setPadding_Widget(div, 3 * gap_UI, 0, 3 * gap_UI, 0);
232 addChildFlags_Widget(div, iClob(new_Widget()), expand_WidgetFlag); /* pad */
233 iLabelWidget *msg = new_LabelWidget("No Identities", 0, 0, NULL);
234 setFont_LabelWidget(msg, uiLabelLarge_FontId);
235 addChildFlags_Widget(div, iClob(msg), frameless_WidgetFlag);
236 addChild_Widget(div, iClob(makePadding_Widget(3 * gap_UI)));
237 addChild_Widget(div, iClob(new_LabelWidget("New Identity...", 0, 0, "ident.new")));
238 addChild_Widget(div, iClob(makePadding_Widget(3 * gap_UI)));
239 addChildFlags_Widget(
240 div,
241 iClob(new_LabelWidget("See " uiTextStrong_ColorEscape "Help" uiText_ColorEscape
242 " for more information about TLS client certificates.",
243 0,
244 0,
245 "!open newtab:1 gotoheading:Identities url:about:help")),
246 frameless_WidgetFlag | fixedHeight_WidgetFlag | wrapText_WidgetFlag);
247 addChildFlags_Widget(div, iClob(new_Widget()), expand_WidgetFlag); /* pad */
248 addChild_Widget(d->blank, iClob(div));
249 arrange_Widget(d->blank);
250 }
251 const iMenuItem menuItems[] = { 229 const iMenuItem menuItems[] = {
252 { "Use on This Page", 0, 0, "ident.use arg:1" }, 230 { "Use on This Page", 0, 0, "ident.use arg:1" },
253 { "Stop Using This Page", 0, 0, "ident.use arg:0" }, 231 { "Stop Using This Page", 0, 0, "ident.use arg:0" },
@@ -268,6 +246,31 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) {
268 } 246 }
269 updateVisible_ListWidget(d->list); 247 updateVisible_ListWidget(d->list);
270 invalidate_ListWidget(d->list); 248 invalidate_ListWidget(d->list);
249 /* Content for a blank tab. */
250 if (isEmpty_ListWidget(d->list)) {
251 if (d->mode == identities_SidebarMode) {
252 iWidget *div = makeVDiv_Widget();
253 setPadding_Widget(div, 3 * gap_UI, 0, 3 * gap_UI, 0);
254 addChildFlags_Widget(div, iClob(new_Widget()), expand_WidgetFlag); /* pad */
255 iLabelWidget *msg = new_LabelWidget("No Identities", 0, 0, NULL);
256 setFont_LabelWidget(msg, uiLabelLarge_FontId);
257 addChildFlags_Widget(div, iClob(msg), frameless_WidgetFlag);
258 addChild_Widget(div, iClob(makePadding_Widget(3 * gap_UI)));
259 addChild_Widget(div, iClob(new_LabelWidget("New Identity...", 0, 0, "ident.new")));
260 addChild_Widget(div, iClob(makePadding_Widget(3 * gap_UI)));
261 addChildFlags_Widget(
262 div,
263 iClob(new_LabelWidget("See " uiTextStrong_ColorEscape "Help" uiText_ColorEscape
264 " for more information about TLS client certificates.",
265 0,
266 0,
267 "!open newtab:1 gotoheading:Identities url:about:help")),
268 frameless_WidgetFlag | fixedHeight_WidgetFlag | wrapText_WidgetFlag);
269 addChildFlags_Widget(div, iClob(new_Widget()), expand_WidgetFlag); /* pad */
270 addChild_Widget(d->blank, iClob(div));
271 }
272 arrange_Widget(d->blank);
273 }
271} 274}
272 275
273iBool setMode_SidebarWidget(iSidebarWidget *d, enum iSidebarMode mode) { 276iBool setMode_SidebarWidget(iSidebarWidget *d, enum iSidebarMode mode) {