Skip to content

Commit

Permalink
merge scrollable code from at9 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
PhracturedBlue committed May 16, 2016
1 parent 02de471 commit bf5b575
Show file tree
Hide file tree
Showing 2 changed files with 192 additions and 141 deletions.
5 changes: 4 additions & 1 deletion src/gui/gui.h
Expand Up @@ -200,7 +200,7 @@ typedef struct guiScrollable {
struct guiHeader header;
u8 item_count;
u8 row_height;
u8 num_selectable;
u8 selectable_rows;
u8 cur_row;
u8 visible_rows;
u8 max_visible_rows;
Expand Down Expand Up @@ -275,6 +275,7 @@ typedef struct guiRect {
#define OBJ_IS_TRANSPARENT(x) ((x)->flags & 0x10) /* bool: UI element has transparency */
#define OBJ_IS_SELECTABLE(x) ((x)->flags & 0x20) /* bool: UI element can be selected */
#define OBJ_IS_SCROLLABLE(x) ((x)->flags & 0x40) /* bool: UI element is part of a scrollable container */
#define OBJ_IS_ROWSTART(x) ((x)->flags & 0x80) /* bool: UI element is the 1st element in a selectable row */
#define OBJ_SET_FLAG(obj,flag,set) ((guiObject_t *)(obj))->flags = (set) \
? ((guiObject_t *)(obj))->flags | (flag) \
: ((guiObject_t *)(obj))->flags & ~(flag)
Expand All @@ -285,6 +286,7 @@ typedef struct guiRect {
#define OBJ_SET_TRANSPARENT(x,y) OBJ_SET_FLAG(x, 0x10, y)
#define OBJ_SET_SELECTABLE(x,y) OBJ_SET_FLAG(x, 0x20, y)
#define OBJ_SET_SCROLLABLE(x,y) OBJ_SET_FLAG(x, 0x40, y)
#define OBJ_SET_ROWSTART(x,y) OBJ_SET_FLAG(x, 0x80, y)
#define CLEAR_OBJ(x) memset((x), 0, sizeof(*(x)))

#define DRAW_NORMAL 0
Expand Down Expand Up @@ -502,4 +504,5 @@ s8 GUI_GetViewId(s16 x, s16 y);
void GUI_ViewInit();
int GUI_IsEmpty();
void GUI_SelectionNotify(void (*notify_cb)(guiObject_t *obj));
unsigned GUI_GetRemappedButtons();
#endif /* GUI_H_ */

1 comment on commit bf5b575

@goebish
Copy link
Member

@goebish goebish commented on bf5b575 May 19, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit broke telemetry monitor for FrSky protocols on 7e (crash when entering telemetry monitor page, can be reproduced on emu_7e).
edit: seems latest hexfet PR (#10) fixes the problem.

Please sign in to comment.