Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI: Add a fast-select "Zapper" mode for VarItemList #258

Open
wants to merge 25 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
format
  • Loading branch information
zxkmm committed Oct 14, 2024
commit d1e3b3cc9f3a305586f8b7289b6fbd5b6fa485b8
27 changes: 16 additions & 11 deletions applications/services/gui/modules/variable_item_list.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static void zapper_menu_draw(Canvas* canvas, VariableItemListModel* model) {

for(uint8_t i = start_option; i < end_option; i++) {
uint8_t item_position = i - start_option;

item->current_value_index = i;
if(item->change_callback) {
item->change_callback(item);
Expand All @@ -99,22 +99,27 @@ static void zapper_menu_draw(Canvas* canvas, VariableItemListModel* model) {
item->change_callback(item);
}

//scroll bar
#define SCROLL_BAR_HEIGHT 0
//scroll bar
#define SCROLL_BAR_HEIGHT 0
const uint8_t scroll_bar_y = canvas_height(canvas) - SCROLL_BAR_HEIGHT;
elements_scrollbar_horizontal(canvas, 0, scroll_bar_y, canvas_width(canvas), zapper_menu->current_page ,zapper_menu->total_pages);


//frame
#define GAP_SIZE_PX 1
#define FRAME_HEIGHT 14
elements_scrollbar_horizontal(
canvas,
0,
scroll_bar_y,
canvas_width(canvas),
zapper_menu->current_page,
zapper_menu->total_pages);

//frame
#define GAP_SIZE_PX 1
#define FRAME_HEIGHT 14
for(int i = 0; i < 4; i++) {
uint8_t y = i * (FRAME_HEIGHT + GAP_SIZE_PX);
canvas_draw_rframe(canvas, 0, y, canvas_width(canvas), FRAME_HEIGHT, 3);
}

//arrow
#define ARROR_SIZE 8
//arrow
#define ARROR_SIZE 8
const uint8_t arrow_x = canvas_width(canvas) - 9;
// ^
canvas_draw_triangle(
Expand Down
Loading