Fixed touch handling with netloader msgbox. Swipe up can now be used to exit netloader. Added menuIsNetloaderActive().
This commit is contained in:
parent
784dbc3623
commit
8888bff85f
@ -83,6 +83,10 @@ void launchApplyThemeTask(menuEntry_s* arg) {
|
|||||||
computeFrontGradient(themeCurrent.frontWaveColor, 280);
|
computeFrontGradient(themeCurrent.frontWaveColor, 280);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool menuIsNetloaderActive(void) {
|
||||||
|
return hbmenu_state == HBMENU_NETLOADER_ACTIVE;
|
||||||
|
}
|
||||||
|
|
||||||
//Draws an RGB888 or RGBA8888 image.
|
//Draws an RGB888 or RGBA8888 image.
|
||||||
static void drawImage(int x, int y, int width, int height, const uint8_t *image, ImageMode mode) {
|
static void drawImage(int x, int y, int width, int height, const uint8_t *image, ImageMode mode) {
|
||||||
int tmpx, tmpy;
|
int tmpx, tmpy;
|
||||||
|
@ -110,6 +110,8 @@ char *menuGetRootBasePath(void);
|
|||||||
|
|
||||||
void menuHandleAButton(void);
|
void menuHandleAButton(void);
|
||||||
|
|
||||||
|
bool menuIsNetloaderActive(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -93,7 +93,9 @@ void handleTouch(menu_s* menu) {
|
|||||||
int x2 = touchInfo.prevTouch.px;
|
int x2 = touchInfo.prevTouch.px;
|
||||||
int y2 = touchInfo.prevTouch.py;
|
int y2 = touchInfo.prevTouch.py;
|
||||||
|
|
||||||
if (menuIsMsgBoxOpen()) {
|
bool netloader_active = menuIsNetloaderActive();
|
||||||
|
|
||||||
|
if (menuIsMsgBoxOpen() && !netloader_active) {
|
||||||
MessageBox currMsgBox = menuGetCurrentMsgBox();
|
MessageBox currMsgBox = menuGetCurrentMsgBox();
|
||||||
int start_x = 1280 / 2 - currMsgBox.width / 2;
|
int start_x = 1280 / 2 - currMsgBox.width / 2;
|
||||||
int start_y = (720 / 2 - currMsgBox.height / 2) + (currMsgBox.height - 80);
|
int start_y = (720 / 2 - currMsgBox.height / 2) + (currMsgBox.height - 80);
|
||||||
@ -103,7 +105,7 @@ void handleTouch(menu_s* menu) {
|
|||||||
if (x1 > start_x && x1 < end_x && y1 > start_y && y1 < end_y && touchInfo.isTap) {
|
if (x1 > start_x && x1 < end_x && y1 > start_y && y1 < end_y && touchInfo.isTap) {
|
||||||
menuCloseMsgBox();
|
menuCloseMsgBox();
|
||||||
}
|
}
|
||||||
} else if (touchInfo.isTap) {
|
} else if (touchInfo.isTap && !netloader_active) {
|
||||||
// App Icons
|
// App Icons
|
||||||
if (y1 > LISTING_START_Y && y1 < LISTING_END_Y) {
|
if (y1 > LISTING_START_Y && y1 < LISTING_END_Y) {
|
||||||
handleTappingOnApp(menu, touchInfo.prevTouch.px);
|
handleTappingOnApp(menu, touchInfo.prevTouch.px);
|
||||||
@ -138,4 +140,4 @@ void handleTouch(menu_s* menu) {
|
|||||||
|
|
||||||
touchInfo.gestureInProgress = false;
|
touchInfo.gestureInProgress = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user