From 8721d7f910239f6a0ba32b324e594f7c9c7c479c Mon Sep 17 00:00:00 2001 From: Astra Date: Tue, 26 Sep 2023 19:39:15 +0900 Subject: [PATCH] HEX input UI improvements --- .../services/gui/modules/byte_input.c | 24 ++++++++++++++---- assets/icons/Common/Hashmark_7x7.png | Bin 0 -> 957 bytes assets/icons/Common/arrow_nano_down.png | Bin 0 -> 2311 bytes assets/icons/Common/arrow_nano_up.png | Bin 0 -> 949 bytes 4 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 assets/icons/Common/Hashmark_7x7.png create mode 100644 assets/icons/Common/arrow_nano_down.png create mode 100644 assets/icons/Common/arrow_nano_up.png diff --git a/applications/services/gui/modules/byte_input.c b/applications/services/gui/modules/byte_input.c index 3bca8fc744d..e0cbbb779d0 100644 --- a/applications/services/gui/modules/byte_input.c +++ b/applications/services/gui/modules/byte_input.c @@ -177,6 +177,12 @@ static void byte_input_draw_input(Canvas* canvas, ByteInputModel* model) { if(i == model->selected_byte) { canvas_draw_frame(canvas, text_x + byte_position * 14, text_y - 9, 15, 11); + if(model->selected_row == -2) { + canvas_draw_icon( + canvas, text_x + 6 + byte_position * 14, text_y - 14, &I_arrow_nano_up); + canvas_draw_icon( + canvas, text_x + 6 + byte_position * 14, text_y + 5, &I_arrow_nano_down); + } if(model->selected_high_nibble) { canvas_draw_glyph( @@ -233,6 +239,7 @@ static void byte_input_draw_input(Canvas* canvas, ByteInputModel* model) { } if(draw_index_line) { + canvas_draw_icon(canvas, 1, text_y + 8, &I_Hashmark_7x7); canvas_draw_glyph( canvas, text_x + 2 + byte_position * 14, text_y2, num_to_char[(i + 1) / 10]); @@ -600,9 +607,6 @@ static void byte_input_view_draw_callback(Canvas* canvas, void* _model) { canvas_clear(canvas); canvas_set_color(canvas, ColorBlack); - - canvas_draw_str(canvas, 2, 9, model->header); - canvas_set_font(canvas, FontKeyboard); if(model->selected_row == -1) { @@ -613,9 +617,19 @@ static void byte_input_view_draw_callback(Canvas* canvas, void* _model) { if(model->selected_row == -2) { canvas_set_font(canvas, FontSecondary); - canvas_draw_icon(canvas, 3, 52, &I_Pin_back_arrow_10x8); - canvas_draw_str_aligned(canvas, 16, 60, AlignLeft, AlignBottom, "back to keyboard"); + canvas_draw_icon(canvas, 3, 1, &I_Pin_back_arrow_10x8); + canvas_draw_str_aligned(canvas, 16, 9, AlignLeft, AlignBottom, "back to keyboard"); + elements_button_center(canvas, "Save"); } else { + // Draw the header + canvas_set_font(canvas, FontSecondary); + if(model->selected_row == -1) { + canvas_draw_str(canvas, 10, 9, "Move up for alternate input"); + canvas_draw_icon(canvas, 3, 4, &I_SmallArrowUp_3x5); + } else { + canvas_draw_str(canvas, 2, 9, model->header); + } + canvas_set_font(canvas, FontKeyboard); // Draw keyboard for(uint8_t row = 0; row < keyboard_row_count; row++) { const uint8_t column_count = byte_input_get_row_size(row); diff --git a/assets/icons/Common/Hashmark_7x7.png b/assets/icons/Common/Hashmark_7x7.png new file mode 100644 index 0000000000000000000000000000000000000000..93fb147be235c2030fb85ba55859cfc66d32b1fa GIT binary patch literal 957 zcmaJ=zi-n(7_}%0RYhmiPA7LM67l(0NbJT`Nt{wkbrhvW&De{5Nvy;^V_%4qfq@N) zKZ1>oxe^12je&`cjlX~au~iD^G)@@^C)wY3r}y6X-QBy_?bg%Xo&6n-<94l6v%})O z?AzXA|6gz3{a|5_HoNqk^yw7En5%iDhk+HK0q$Vr&7Ob3RgT*_^qns4+Gn~;0s&igZ<^}bZO|Yw2AUuhT~U-kSrbsjQ_Ceq)gA#^ zloco{P*#ePqKhS6ErHeGS;5%r>mBoCRgTRJen@GgLpYsIg{dNtcmO3$)1W9rSuQd} zF`0!FrNuBg$Q4YSxUnBmpM)S&L_IR02G5$k*+meoWy553QtZrNiXtcpVz#RsXxsmX z2EiJg&t-CMOJE>B1z3=UCn0onpSC?sFiX(=bFTw z1URHQ*SqB^8@ZVwf{0Z%aqPdq-bqXXu-vuoZ|+6hsJG&Jn|qNqav^I5W_SD7UFS>8 zKv}v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1J{T*KkYZwX(Cqu8%SquPy zo{x(f5K~a}nlvrS*9TFp7JOW`sF_rX)dWioqVAAJQ9@w^r1&vd3>H;LqEILTM3u~! ziMKDn@wXtV8pCvaCNm==gOTCOfRPj?J1{Vi$>K0M96D}6M>DmULQmJCwC5x*c*G#8 zL?9go!CH!iSCIs#V?k7^#nIxm5T`~bl`gu{q6>N988Y<>9h1#qF*O?IYDg55flEQI zibSI`bs$p)qHsE*1aWiPYD9S9{(k_gfiNifCC)8htZ^^a1W#FjJCREHVpy530kxP! zEW{NI6{O;`MLd5Vhvmm(`-#}>u&@9znyYur$A89Qqmymi<&Oa(UPWhQ~1!zczikBKyj!z zl*baYR!?&UbSa)CX4Ojz$bEUH&zYA&mzWo;yOgT69iE?3OL_UB2&lkdBpQa(gg@8F zR=WQ|EOTW!82m^C!uMZcX$>J;z+9nQuoo~beY32Oo;Rsgi+8DzgnN3?@j{X=a?TAO w0vjY^QMCPUl&ZwU8D~@C)&I-~=dC+Ic+<&l&ZGLhe9N4WghhzYg(Uv*zqIRhbpQYW literal 0 HcmV?d00001 diff --git a/assets/icons/Common/arrow_nano_up.png b/assets/icons/Common/arrow_nano_up.png new file mode 100644 index 0000000000000000000000000000000000000000..4a1d5be85cf83a3a1767d3b422054285f978c9eb GIT binary patch literal 949 zcmaJ=J#W)M7`9pos!AP@SYSH2OOS}qpGj=RR3VqPk?JT)Es-%7`;u6xea5~JClg|W zAHd4Q(gBH?ftjCBBz^;b04bdFRfYsh_Ir1JpXYt<-sj%8TNfwCPmcvbIB8y@4v&ZY zJvhq0x3?b)JUn5IF1w}!HpK}MYCi1~&3AHzo}9$uNj)@%OjyA_#n2d}TPY6W7ToxSS{Cdfsxq`Pegk@$3btW)>$1 z3Bw=@Z=%%7Y;nnJ@o~NkMX*d^V_RH_>N;&urwIY3q!c|_RzTU5aK+clhNhd(fhwyS zlr^YoMMbk@!_p0~eneg{@ds81ov+LBnJtbOi!BJJ)2TGoB$^DNVwxtDRj8^(o>5F^ z5yM$AN>4Woh@@T;#4Ml@$Qf~;PM9rnv8!E#@s>79*C)l#3}!fniX`W|+9W#8|5L+o zo1L-_x!1dsICW<+fgO_4N#gO|4Nmh?u~kn9W;Agrz1bXOdqf#cM>GbiE|oyR!CnyM zE6PsIp-wrJABN8Wp6-sAAM~T{ktPsT(Y!-XtUu z+hF~BY-ukxH$)io%7`Sv8{(fQGz80CTfq)3nyQ