diff options
Diffstat (limited to 'src/ui/translation.c')
-rw-r--r-- | src/ui/translation.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ui/translation.c b/src/ui/translation.c index 3ffa961b..b86e6e52 100644 --- a/src/ui/translation.c +++ b/src/ui/translation.c | |||
@@ -136,7 +136,8 @@ static void draw_TranslationProgressWidget_(const iTranslationProgressWidget *d) | |||
136 | get_Color(palette[palCur]), get_Color(palette[palNext]), palPos - (int) palPos); | 136 | get_Color(palette[palCur]), get_Color(palette[palNext]), palPos - (int) palPos); |
137 | SDL_SetRenderDrawColor(renderer_Window(get_Window()), back.r, back.g, back.b, p.alpha); | 137 | SDL_SetRenderDrawColor(renderer_Window(get_Window()), back.r, back.g, back.b, p.alpha); |
138 | SDL_RenderFillRect(renderer_Window(get_Window()), | 138 | SDL_RenderFillRect(renderer_Window(get_Window()), |
139 | &(SDL_Rect){ pos.x, pos.y, spr->size.x, spr->size.y }); | 139 | &(SDL_Rect){ pos.x + origin_Paint.x, pos.y + origin_Paint.y, |
140 | spr->size.x, spr->size.y }); | ||
140 | if (fg >= 0) { | 141 | if (fg >= 0) { |
141 | setOpacity_Text(opacity * 2); | 142 | setOpacity_Text(opacity * 2); |
142 | drawRange_Text(d->font, addX_I2(pos, spr->xoff), fg, range_String(&spr->text)); | 143 | drawRange_Text(d->font, addX_I2(pos, spr->xoff), fg, range_String(&spr->text)); |
@@ -424,19 +425,18 @@ static iBool processResult_Translation_(iTranslation *d) { | |||
424 | } | 425 | } |
425 | 426 | ||
426 | static iLabelWidget *acceptButton_Translation_(const iTranslation *d) { | 427 | static iLabelWidget *acceptButton_Translation_(const iTranslation *d) { |
427 | iWidget *buttonParent = findChild_Widget(d->dlg, "dialogbuttons"); | 428 | return dialogAcceptButton_Widget(d->dlg); |
428 | // if (!buttonParent) { | ||
429 | // buttonParent = findChild_Widget(d->dlg, "panel.back"); | ||
430 | // } | ||
431 | return (iLabelWidget *) lastChild_Widget(buttonParent); | ||
432 | } | 429 | } |
433 | 430 | ||
434 | iBool handleCommand_Translation(iTranslation *d, const char *cmd) { | 431 | iBool handleCommand_Translation(iTranslation *d, const char *cmd) { |
435 | iWidget *w = as_Widget(d->doc); | 432 | iWidget *w = as_Widget(d->doc); |
436 | if (equalWidget_Command(cmd, w, "translation.submit")) { | 433 | if (equalWidget_Command(cmd, w, "translation.submit")) { |
437 | if (status_TlsRequest(d->request) == initialized_TlsRequestStatus) { | 434 | if (status_TlsRequest(d->request) == initialized_TlsRequestStatus) { |
438 | iWidget *langs = findChild_Widget(d->dlg, "xlt.langs"); | 435 | iWidget *langs = findChild_Widget(d->dlg, "xlt.langs"); |
439 | setFlags_Widget(langs, hidden_WidgetFlag, iTrue); | 436 | // setFlags_Widget(langs, hidden_WidgetFlag, iTrue); |
437 | setFlags_Widget(findChild_Widget(d->dlg, "xlt.from"), hidden_WidgetFlag, iTrue); | ||
438 | setFlags_Widget(findChild_Widget(d->dlg, "xlt.to"), hidden_WidgetFlag, iTrue); | ||
439 | if (!langs) langs = d->dlg; | ||
440 | iLabelWidget *acceptButton = acceptButton_Translation_(d); | 440 | iLabelWidget *acceptButton = acceptButton_Translation_(d); |
441 | updateTextCStr_LabelWidget(acceptButton, "00:00"); | 441 | updateTextCStr_LabelWidget(acceptButton, "00:00"); |
442 | setFlags_Widget(as_Widget(acceptButton), disabled_WidgetFlag, iTrue); | 442 | setFlags_Widget(as_Widget(acceptButton), disabled_WidgetFlag, iTrue); |