summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ui/uploadwidget.c14
-rw-r--r--src/ui/util.c3
-rw-r--r--src/ui/widget.h1
3 files changed, 16 insertions, 2 deletions
diff --git a/src/ui/uploadwidget.c b/src/ui/uploadwidget.c
index 4fd35732..67075040 100644
--- a/src/ui/uploadwidget.c
+++ b/src/ui/uploadwidget.c
@@ -76,6 +76,13 @@ void init_UploadWidget(iUploadWidget *d) {
76 d->info = addChildFlags_Widget(w, iClob(new_LabelWidget("", NULL)), frameless_WidgetFlag); 76 d->info = addChildFlags_Widget(w, iClob(new_LabelWidget("", NULL)), frameless_WidgetFlag);
77 /* Tabs for input data. */ 77 /* Tabs for input data. */
78 iWidget *tabs = makeTabs_Widget(w); 78 iWidget *tabs = makeTabs_Widget(w);
79 /* Make the tabs support vertical expansion based on content. */ {
80 setFlags_Widget(tabs, resizeHeightOfChildren_WidgetFlag, iFalse);
81 setFlags_Widget(tabs, arrangeHeight_WidgetFlag, iTrue);
82 iWidget *tabPages = findChild_Widget(tabs, "tabs.pages");
83 setFlags_Widget(tabPages, resizeHeightOfChildren_WidgetFlag, iFalse);
84 setFlags_Widget(tabPages, arrangeHeight_WidgetFlag, iTrue);
85 }
79 iWidget *headings, *values; 86 iWidget *headings, *values;
80 setBackgroundColor_Widget(findChild_Widget(tabs, "tabs.buttons"), uiBackgroundSidebar_ColorId); 87 setBackgroundColor_Widget(findChild_Widget(tabs, "tabs.buttons"), uiBackgroundSidebar_ColorId);
81 setId_Widget(tabs, "upload.tabs"); 88 setId_Widget(tabs, "upload.tabs");
@@ -235,6 +242,13 @@ static iBool processEvent_UploadWidget_(iUploadWidget *d, const SDL_Event *ev) {
235 destroy_Widget(w); 242 destroy_Widget(w);
236 return iTrue; 243 return iTrue;
237 } 244 }
245 else if (isCommand_Widget(w, ev, "input.resized")) {
246
247 resizeToLargestPage_Widget(findChild_Widget(w, "upload.tabs"));
248 arrange_Widget(w);
249 refresh_Widget(w);
250 return iTrue;
251 }
238 if (ev->type == SDL_DROPFILE) { 252 if (ev->type == SDL_DROPFILE) {
239 /* Switch to File tab. */ 253 /* Switch to File tab. */
240 iWidget *tabs = findChild_Widget(w, "upload.tabs"); 254 iWidget *tabs = findChild_Widget(w, "upload.tabs");
diff --git a/src/ui/util.c b/src/ui/util.c
index 152df0bd..13a9237e 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -1043,7 +1043,8 @@ void resizeToLargestPage_Widget(iWidget *tabs) {
1043 iWidget *pages = findChild_Widget(tabs, "tabs.pages"); 1043 iWidget *pages = findChild_Widget(tabs, "tabs.pages");
1044 iForEach(ObjectList, i, children_Widget(pages)) { 1044 iForEach(ObjectList, i, children_Widget(pages)) {
1045 setMinSize_Widget(i.object, zero_I2()); 1045 setMinSize_Widget(i.object, zero_I2());
1046// resetSize_Widget(i.object); 1046 iWidget *w = i.object;
1047 w->rect.size = zero_I2();
1047 } 1048 }
1048 arrange_Widget(tabs); 1049 arrange_Widget(tabs);
1049 iInt2 largest = zero_I2(); 1050 iInt2 largest = zero_I2();
diff --git a/src/ui/widget.h b/src/ui/widget.h
index 41784b99..1a944c0a 100644
--- a/src/ui/widget.h
+++ b/src/ui/widget.h
@@ -268,7 +268,6 @@ iAny * removeChild_Widget (iWidget *, iAnyObject *child); /* returns a
268iAny * child_Widget (iWidget *, size_t index); /* O(n) */ 268iAny * child_Widget (iWidget *, size_t index); /* O(n) */
269size_t childIndex_Widget (const iWidget *, const iAnyObject *child); /* O(n) */ 269size_t childIndex_Widget (const iWidget *, const iAnyObject *child); /* O(n) */
270void arrange_Widget (iWidget *); 270void arrange_Widget (iWidget *);
271void resetSize_Widget (iWidget *);
272iBool scrollOverflow_Widget (iWidget *, int delta); /* moves the widget */ 271iBool scrollOverflow_Widget (iWidget *, int delta); /* moves the widget */
273iBool dispatchEvent_Widget (iWidget *, const SDL_Event *); 272iBool dispatchEvent_Widget (iWidget *, const SDL_Event *);
274iBool processEvent_Widget (iWidget *, const SDL_Event *); 273iBool processEvent_Widget (iWidget *, const SDL_Event *);