summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ui/sidebarwidget.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c
index c234c934..8f1273bf 100644
--- a/src/ui/sidebarwidget.c
+++ b/src/ui/sidebarwidget.c
@@ -1,6 +1,8 @@
1#include "sidebarwidget.h" 1#include "sidebarwidget.h"
2#include "labelwidget.h"
2#include "scrollwidget.h" 3#include "scrollwidget.h"
3#include "paint.h" 4#include "paint.h"
5#include "util.h"
4 6
5struct Impl_SidebarWidget { 7struct Impl_SidebarWidget {
6 iWidget widget; 8 iWidget widget;
@@ -13,11 +15,30 @@ iDefineObjectConstruction(SidebarWidget)
13void init_SidebarWidget(iSidebarWidget *d) { 15void init_SidebarWidget(iSidebarWidget *d) {
14 iWidget *w = as_Widget(d); 16 iWidget *w = as_Widget(d);
15 init_Widget(w); 17 init_Widget(w);
18 setFlags_Widget(w, resizeChildren_WidgetFlag, iTrue);
16 d->mode = documentOutline_SidebarMode; 19 d->mode = documentOutline_SidebarMode;
17 addChild_Widget(w, iClob(d->scroll = new_ScrollWidget())); 20 addChild_Widget(w, iClob(d->scroll = new_ScrollWidget()));
18 w->rect.size.x = 60 * gap_UI; 21 w->rect.size.x = 80 * gap_UI;
19 setFlags_Widget(w, fixedWidth_WidgetFlag, iTrue); 22 setFlags_Widget(w, fixedWidth_WidgetFlag, iTrue);
20 setBackgroundColor_Widget(w, red_ColorId); 23 iWidget *modeButtons = makeHDiv_Widget();
24 setFlags_Widget(modeButtons, arrangeWidth_WidgetFlag | arrangeHeight_WidgetFlag, iTrue);
25 addChild_Widget(w, iClob(modeButtons));
26 addChildFlags_Widget(
27 modeButtons,
28 iClob(new_LabelWidget(
29 "\U0001f5b9 Outline", 0, 0, format_CStr("sidebar.mode arg:%d", documentOutline_SidebarMode))), frameless_WidgetFlag);
30 addChildFlags_Widget(
31 modeButtons,
32 iClob(new_LabelWidget(
33 "\U0001f588 Bookmarks", 0, 0, format_CStr("sidebar.mode arg:%d", bookmarks_SidebarMode))), frameless_WidgetFlag);
34 addChildFlags_Widget(
35 modeButtons,
36 iClob(new_LabelWidget(
37 "\U0001f553 History", 0, 0, format_CStr("sidebar.mode arg:%d", history_SidebarMode))), frameless_WidgetFlag);
38 addChildFlags_Widget(
39 modeButtons,
40 iClob(new_LabelWidget(
41 "\U0001f464 Identities", 0, 0, format_CStr("sidebar.mode arg:%d", identities_SidebarMode))), frameless_WidgetFlag);
21} 42}
22 43
23void deinit_SidebarWidget(iSidebarWidget *d) { 44void deinit_SidebarWidget(iSidebarWidget *d) {