diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/inputwidget.c | 29 | ||||
-rw-r--r-- | src/ui/sidebarwidget.c | 2 |
2 files changed, 17 insertions, 14 deletions
diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c index 18c0c20c..00ade351 100644 --- a/src/ui/inputwidget.c +++ b/src/ui/inputwidget.c | |||
@@ -1175,16 +1175,18 @@ void begin_InputWidget(iInputWidget *d) { | |||
1175 | d->inFlags &= ~enterPressed_InputWidgetFlag; | 1175 | d->inFlags &= ~enterPressed_InputWidgetFlag; |
1176 | #if LAGRANGE_USE_SYSTEM_TEXT_INPUT | 1176 | #if LAGRANGE_USE_SYSTEM_TEXT_INPUT |
1177 | set_String(&d->oldText, &d->text); | 1177 | set_String(&d->oldText, &d->text); |
1178 | d->sysCtrl = new_SystemTextInput(contentBounds_InputWidget_(d), | 1178 | d->sysCtrl = new_SystemTextInput( |
1179 | (d->maxWrapLines > 1 ? multiLine_SystemTextInputFlags : 0) | | 1179 | contentBounds_InputWidget_(d), |
1180 | (d->inFlags & isUrl_InputWidgetFlag ? (disableAutocorrect_SystemTextInputFlag | | 1180 | (d->maxWrapLines > 1 ? multiLine_SystemTextInputFlags : 0) | |
1181 | disableAutocapitalize_SystemTextInputFlag) : 0) | | 1181 | (d->inFlags & isUrl_InputWidgetFlag ? (disableAutocorrect_SystemTextInputFlag | |
1182 | /* widget-specific tweaks (hacks) */ | 1182 | disableAutocapitalize_SystemTextInputFlag) |
1183 | (!cmp_String(id_Widget(w), "url") ? returnGo_SystemTextInputFlags : 0) | | 1183 | : 0) | |
1184 | (!cmp_String(id_Widget(w), "upload.text") ? extraPadding_SystemTextInputFlag : 0) | | 1184 | /* widget-specific tweaks (hacks) */ |
1185 | (flags_Widget(w) & alignRight_WidgetFlag ? alignRight_SystemTextInputFlag : 0) | | 1185 | (!cmp_String(id_Widget(w), "url") ? returnGo_SystemTextInputFlags : 0) | |
1186 | (isAllowedToInsertNewline_InputWidget_(d) ? insertNewlines_SystemTextInputFlag : 0) | | 1186 | (!cmp_String(id_Widget(w), "upload.text") ? extraPadding_SystemTextInputFlag : 0) | |
1187 | (d->inFlags & selectAllOnFocus_InputWidgetFlag ? selectAll_SystemTextInputFlags : 0)); | 1187 | (flags_Widget(w) & alignRight_WidgetFlag ? alignRight_SystemTextInputFlag : 0) | |
1188 | (isAllowedToInsertNewline_InputWidget_(d) ? insertNewlines_SystemTextInputFlag : 0) | | ||
1189 | (d->inFlags & selectAllOnFocus_InputWidgetFlag ? selectAll_SystemTextInputFlags : 0)); | ||
1188 | setFont_SystemTextInput(d->sysCtrl, d->font); | 1190 | setFont_SystemTextInput(d->sysCtrl, d->font); |
1189 | setText_SystemTextInput(d->sysCtrl, &d->oldText, iFalse); | 1191 | setText_SystemTextInput(d->sysCtrl, &d->oldText, iFalse); |
1190 | setTextChangedFunc_SystemTextInput(d->sysCtrl, systemInputChanged_InputWidget_, d); | 1192 | setTextChangedFunc_SystemTextInput(d->sysCtrl, systemInputChanged_InputWidget_, d); |
@@ -2589,8 +2591,11 @@ static void draw_InputWidget_(const iInputWidget *d) { | |||
2589 | : isFocused /*&& !isEmpty_Array(&d->lines)*/ ? uiInputTextFocused_ColorId | 2591 | : isFocused /*&& !isEmpty_Array(&d->lines)*/ ? uiInputTextFocused_ColorId |
2590 | : uiInputText_ColorId; | 2592 | : uiInputText_ColorId; |
2591 | #if !LAGRANGE_USE_SYSTEM_TEXT_INPUT | 2593 | #if !LAGRANGE_USE_SYSTEM_TEXT_INPUT |
2592 | setClip_Paint(&p, adjusted_Rect(bounds, init_I2(d->leftPadding, 0), | 2594 | setClip_Paint(&p, |
2593 | init_I2(-d->rightPadding, w->flags & extraPadding_WidgetFlag ? -gap_UI / 2 : 0))); | 2595 | adjusted_Rect(bounds, |
2596 | init_I2(d->leftPadding, 0), | ||
2597 | init_I2(-d->rightPadding, | ||
2598 | w->flags & extraPadding_WidgetFlag ? -gap_UI / 2 : 0))); | ||
2594 | iWrapText wrapText = { | 2599 | iWrapText wrapText = { |
2595 | .maxWidth = d->maxLen == 0 ? width_Rect(contentBounds) : unlimitedWidth_InputWidget_, | 2600 | .maxWidth = d->maxLen == 0 ? width_Rect(contentBounds) : unlimitedWidth_InputWidget_, |
2596 | .mode = (d->inFlags & isUrl_InputWidgetFlag ? anyCharacter_WrapTextMode | 2601 | .mode = (d->inFlags & isUrl_InputWidgetFlag ? anyCharacter_WrapTextMode |
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index 15274987..fa0e16ea 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c | |||
@@ -223,8 +223,6 @@ static iLabelWidget *addActionButton_SidebarWidget_(iSidebarWidget *d, const cha | |||
223 | const char *command, int64_t flags) { | 223 | const char *command, int64_t flags) { |
224 | iLabelWidget *btn = addChildFlags_Widget(d->actions, | 224 | iLabelWidget *btn = addChildFlags_Widget(d->actions, |
225 | iClob(new_LabelWidget(label, command)), | 225 | iClob(new_LabelWidget(label, command)), |
226 | //(deviceType_App() != desktop_AppDeviceType ? | ||
227 | // extraPadding_WidgetFlag : 0) | | ||
228 | flags); | 226 | flags); |
229 | setFont_LabelWidget(btn, actionButtonFont_SidebarWidget_(d)); | 227 | setFont_LabelWidget(btn, actionButtonFont_SidebarWidget_(d)); |
230 | checkIcon_LabelWidget(btn); | 228 | checkIcon_LabelWidget(btn); |