summaryrefslogtreecommitdiff
path: root/src/ui/uploadwidget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/uploadwidget.c')
-rw-r--r--src/ui/uploadwidget.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/ui/uploadwidget.c b/src/ui/uploadwidget.c
index ef407b6d..e0bc3755 100644
--- a/src/ui/uploadwidget.c
+++ b/src/ui/uploadwidget.c
@@ -58,6 +58,7 @@ struct Impl_UploadWidget {
58 iLabelWidget * info; 58 iLabelWidget * info;
59 iInputWidget * mime; 59 iInputWidget * mime;
60 iInputWidget * token; 60 iInputWidget * token;
61 iLabelWidget * ident;
61 iInputWidget * input; 62 iInputWidget * input;
62 iLabelWidget * filePathLabel; 63 iLabelWidget * filePathLabel;
63 iLabelWidget * fileSizeLabel; 64 iLabelWidget * fileSizeLabel;
@@ -124,9 +125,10 @@ static const iArray *makeIdentityItems_UploadWidget_(const iUploadWidget *d) {
124 iConstForEach(PtrArray, i, listIdentities_GmCerts(certs_App(), NULL, NULL)) { 125 iConstForEach(PtrArray, i, listIdentities_GmCerts(certs_App(), NULL, NULL)) {
125 const iGmIdentity *id = i.ptr; 126 const iGmIdentity *id = i.ptr;
126 iString *str = collect_String(copy_String(name_GmIdentity(id))); 127 iString *str = collect_String(copy_String(name_GmIdentity(id)));
128 prependCStr_String(str, uiTextStrong_ColorEscape);
127 if (!isEmpty_String(&id->notes)) { 129 if (!isEmpty_String(&id->notes)) {
128 appendFormat_String( 130 appendFormat_String(
129 str, "\n%s%s", escape_Color(uiAnnotation_ColorId), cstr_String(&id->notes)); 131 str, "\n%s%s", escape_Color(uiTextDim_ColorId), cstr_String(&id->notes));
130 } 132 }
131 pushBack_Array( 133 pushBack_Array(
132 items, 134 items,
@@ -259,19 +261,20 @@ void init_UploadWidget(iUploadWidget *d) {
259 /* Identity and Token. */ { 261 /* Identity and Token. */ {
260 addChild_Widget(w, iClob(makePadding_Widget(gap_UI))); 262 addChild_Widget(w, iClob(makePadding_Widget(gap_UI)));
261 iWidget *page = makeTwoColumns_Widget(&headings, &values); 263 iWidget *page = makeTwoColumns_Widget(&headings, &values);
262 /* Token. */
263 d->token = addTwoColumnDialogInputField_Widget(
264 headings, values, "${upload.token}", "upload.token", iClob(new_InputWidget(0)));
265 setHint_InputWidget(d->token, "${hint.upload.token}");
266 setFixedSize_Widget(as_Widget(d->token), init_I2(50 * gap_UI, -1));
267 /* Identity. */ 264 /* Identity. */
268 const iArray * identItems = makeIdentityItems_UploadWidget_(d); 265 const iArray * identItems = makeIdentityItems_UploadWidget_(d);
269 const iMenuItem *items = constData_Array(identItems); 266 const iMenuItem *items = constData_Array(identItems);
270 const size_t numItems = size_Array(identItems); 267 const size_t numItems = size_Array(identItems);
271 iLabelWidget * ident = makeMenuButton_LabelWidget("${upload.id}", items, numItems); 268 d->ident = makeMenuButton_LabelWidget("${upload.id}", items, numItems);
272 setTextCStr_LabelWidget(ident, items[findWidestLabel_MenuItem(items, numItems)].label); 269 setTextCStr_LabelWidget(d->ident, items[findWidestLabel_MenuItem(items, numItems)].label);
270 //setFixedSize_Widget(as_Widget(d->ident), init_I2(50 * gap_UI, ));
273 addChild_Widget(headings, iClob(makeHeading_Widget("${upload.id}"))); 271 addChild_Widget(headings, iClob(makeHeading_Widget("${upload.id}")));
274 setId_Widget(addChildFlags_Widget(values, iClob(ident), alignLeft_WidgetFlag), "upload.id"); 272 setId_Widget(addChildFlags_Widget(values, iClob(d->ident), alignLeft_WidgetFlag), "upload.id");
273 /* Token. */
274 d->token = addTwoColumnDialogInputField_Widget(
275 headings, values, "${upload.token}", "upload.token", iClob(new_InputWidget(0)));
276 setHint_InputWidget(d->token, "${hint.upload.token}");
277 setFixedSize_Widget(as_Widget(d->token), init_I2(50 * gap_UI, -1));
275 addChild_Widget(w, iClob(page)); 278 addChild_Widget(w, iClob(page));
276 } 279 }
277 /* Buttons. */ { 280 /* Buttons. */ {
@@ -287,6 +290,8 @@ void init_UploadWidget(iUploadWidget *d) {
287 resizeToLargestPage_Widget(tabs); 290 resizeToLargestPage_Widget(tabs);
288 arrange_Widget(w); 291 arrange_Widget(w);
289 setFixedSize_Widget(as_Widget(d->token), init_I2(width_Widget(tabs) - left_Rect(parent_Widget(d->token)->rect), -1)); 292 setFixedSize_Widget(as_Widget(d->token), init_I2(width_Widget(tabs) - left_Rect(parent_Widget(d->token)->rect), -1));
293 setFixedSize_Widget(as_Widget(d->ident), init_I2(width_Widget(d->token),
294 lineHeight_Text(uiLabel_FontId) + 2 * gap_UI));
290 setFlags_Widget(as_Widget(d->token), expand_WidgetFlag, iTrue); 295 setFlags_Widget(as_Widget(d->token), expand_WidgetFlag, iTrue);
291 setFocus_Widget(as_Widget(d->input)); 296 setFocus_Widget(as_Widget(d->input));
292 } 297 }
@@ -560,7 +565,7 @@ static iBool processEvent_UploadWidget_(iUploadWidget *d, const SDL_Event *ev) {
560 destroy_Widget(w); 565 destroy_Widget(w);
561 return iTrue; 566 return iTrue;
562 } 567 }
563 else if (isCommand_Widget(w, ev, "input.resized")) { 568 else if (!isUsingPanelLayout_Mobile() && isCommand_Widget(w, ev, "input.resized")) {
564 resizeToLargestPage_Widget(findChild_Widget(w, "upload.tabs")); 569 resizeToLargestPage_Widget(findChild_Widget(w, "upload.tabs"));
565 arrange_Widget(w); 570 arrange_Widget(w);
566 refresh_Widget(w); 571 refresh_Widget(w);