aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--screen_ui.cpp12
-rw-r--r--screen_ui.h2
-rw-r--r--ui.cpp4
3 files changed, 15 insertions, 3 deletions
diff --git a/screen_ui.cpp b/screen_ui.cpp
index 849f6d1..46f4add 100644
--- a/screen_ui.cpp
+++ b/screen_ui.cpp
@@ -893,6 +893,18 @@ void ScreenRecoveryUI::SetHeadlessMode()
pthread_mutex_unlock(&updateMutex);
}
+void ScreenRecoveryUI::SetSysbarState(int state)
+{
+ if (HasBackKey()) {
+ state &= ~SYSBAR_BACK;
+ }
+ if (HasHomeKey()) {
+ state &= ~SYSBAR_HOME;
+ }
+ sysbar_state = state;
+ Redraw();
+}
+
void ScreenRecoveryUI::StartMenu(const char* const * headers, const char* const * items,
int initial_selection) {
pthread_mutex_lock(&updateMutex);
diff --git a/screen_ui.h b/screen_ui.h
index 9d7b263..78fcb9b 100644
--- a/screen_ui.h
+++ b/screen_ui.h
@@ -66,7 +66,7 @@ class ScreenRecoveryUI : public RecoveryUI {
// sysbar
int GetSysbarHeight() { return gr_get_height(sysbarBackHighlightIcon); }
int GetSysbarState() { return sysbar_state; }
- void SetSysbarState(int state) { sysbar_state = state; Redraw(); }
+ void SetSysbarState(int state);
// menu display
virtual int MenuItemStart() const { return menu_item_start_; }
diff --git a/ui.cpp b/ui.cpp
index 14f92b4..d28ede5 100644
--- a/ui.cpp
+++ b/ui.cpp
@@ -605,12 +605,12 @@ void RecoveryUI::handle_release(input_device* dev) {
int sysbar_state = GetSysbarState();
SetSysbarState(0);
- if (sysbar_state == 0x01) {
+ if (sysbar_state == SYSBAR_BACK) {
ProcessKey(dev, KEY_BACK, 1);
ProcessKey(dev, KEY_BACK, 0);
return;
}
- if (sysbar_state == 0x02) {
+ if (sysbar_state == SYSBAR_HOME) {
ProcessKey(dev, KEY_HOME, 1);
ProcessKey(dev, KEY_HOME, 0);
return;