Skip to content

Commit

Permalink
Merge branch 'nextbutton'
Browse files Browse the repository at this point in the history
  • Loading branch information
benma committed Feb 17, 2020
2 parents bc9f167 + 53d0046 commit e07176c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/ui/components/confirm_button.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "../event.h"
#include "../event_handler.h"
#include "confirm_gesture.h"
#include "icon_button.h"

static void _confirm(component_t* confirm_button)
{
Expand All @@ -26,10 +25,10 @@ static void _confirm(component_t* confirm_button)
emit_event(&event);
}

component_t* confirm_button_create(bool longtouch)
component_t* confirm_button_create(bool longtouch, icon_button_type_t button_type)
{
if (longtouch) {
return confirm_gesture_create(NULL);
}
return icon_button_create(top_slider, ICON_BUTTON_CHECK, _confirm);
return icon_button_create(top_slider, button_type, _confirm);
}
4 changes: 3 additions & 1 deletion src/ui/components/confirm_button.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
#ifndef _UI_CONFIRM_BUTTON_H_
#define _UI_CONFIRM_BUTTON_H_

#include "icon_button.h"
#include <ui/component.h>

#include <stdbool.h>

/**
* Creates a confirm button. Confirming emits the EVENT_CONFIRM event.
* @param[in] longtouch if true, hold gesture is required, otherwise a simple tap.
* @param[in] button_type if not longtouch, defines the icon to show.
*/
component_t* confirm_button_create(bool longtouch);
component_t* confirm_button_create(bool longtouch, icon_button_type_t button_type);

#endif
2 changes: 1 addition & 1 deletion src/ui/components/confirm_transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static component_t* _confirm_transaction_create(
ui_util_add_sub_component(confirm, icon_button_create(top_slider, ICON_BUTTON_CROSS, _cancel));

bool longtouch = verify_total;
ui_util_add_sub_component(confirm, confirm_button_create(longtouch));
ui_util_add_sub_component(confirm, confirm_button_create(longtouch, ICON_BUTTON_NEXT));

if (data->has_address) {
char addr[128];
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/trinary_input_string.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ static component_t* _create(
data->left_arrow_component = left_arrow_create(top_slider, component);
ui_util_add_sub_component(component, data->left_arrow_component);

data->confirm_component = confirm_button_create(longtouch);
data->confirm_component = confirm_button_create(longtouch, ICON_BUTTON_CHECK);
ui_util_add_sub_component(component, data->confirm_component);

if (wordlist == NULL) {
Expand Down

0 comments on commit e07176c

Please sign in to comment.