summaryrefslogtreecommitdiff
path: root/src/displayapp/screens
diff options
context:
space:
mode:
Diffstat (limited to 'src/displayapp/screens')
-rw-r--r--src/displayapp/screens/BleIcon.cpp6
-rw-r--r--src/displayapp/screens/BleIcon.h2
-rw-r--r--src/displayapp/screens/PineTimeStyle.cpp7
-rw-r--r--src/displayapp/screens/Symbols.h1
-rw-r--r--src/displayapp/screens/WatchFaceDigital.cpp2
-rw-r--r--src/displayapp/screens/settings/SettingBluetooth.cpp (renamed from src/displayapp/screens/settings/SettingAirplaneMode.cpp)46
-rw-r--r--src/displayapp/screens/settings/SettingBluetooth.h (renamed from src/displayapp/screens/settings/SettingAirplaneMode.h)10
-rw-r--r--src/displayapp/screens/settings/Settings.cpp2
8 files changed, 35 insertions, 41 deletions
diff --git a/src/displayapp/screens/BleIcon.cpp b/src/displayapp/screens/BleIcon.cpp
index 019f8039..780a14cf 100644
--- a/src/displayapp/screens/BleIcon.cpp
+++ b/src/displayapp/screens/BleIcon.cpp
@@ -2,11 +2,7 @@
#include "displayapp/screens/Symbols.h"
using namespace Pinetime::Applications::Screens;
-const char* BleIcon::GetIcon(bool isRadioEnabled, bool isConnected) {
- if(!isRadioEnabled) {
- return Symbols::airplane;
- }
-
+const char* BleIcon::GetIcon(bool isConnected) {
if (isConnected) {
return Symbols::bluetooth;
}
diff --git a/src/displayapp/screens/BleIcon.h b/src/displayapp/screens/BleIcon.h
index d32dfad7..d9a46541 100644
--- a/src/displayapp/screens/BleIcon.h
+++ b/src/displayapp/screens/BleIcon.h
@@ -7,7 +7,7 @@ namespace Pinetime {
namespace Screens {
class BleIcon {
public:
- static const char* GetIcon(bool isRadioEnabled, bool isConnected);
+ static const char* GetIcon(bool isConnected);
};
}
}
diff --git a/src/displayapp/screens/PineTimeStyle.cpp b/src/displayapp/screens/PineTimeStyle.cpp
index 44bf47a4..e807289c 100644
--- a/src/displayapp/screens/PineTimeStyle.cpp
+++ b/src/displayapp/screens/PineTimeStyle.cpp
@@ -345,11 +345,10 @@ void PineTimeStyle::SetBatteryIcon() {
void PineTimeStyle::AlignIcons() {
- bool isBleIconVisible = IsBleIconVisible(bleRadioEnabled.Get(), bleState.Get());
- if (notificationState.Get() && isBleIconVisible) {
+ if (notificationState.Get() && bleState.Get()) {
lv_obj_align(bleIcon, sidebar, LV_ALIGN_IN_TOP_MID, 8, 25);
lv_obj_align(notificationIcon, sidebar, LV_ALIGN_IN_TOP_MID, -8, 25);
- } else if (notificationState.Get() && !isBleIconVisible) {
+ } else if (notificationState.Get() && !bleState.Get()) {
lv_obj_align(notificationIcon, sidebar, LV_ALIGN_IN_TOP_MID, 0, 25);
} else {
lv_obj_align(bleIcon, sidebar, LV_ALIGN_IN_TOP_MID, 0, 25);
@@ -375,7 +374,7 @@ void PineTimeStyle::Refresh() {
bleState = bleController.IsConnected();
bleRadioEnabled = bleController.IsRadioEnabled();
if (bleState.IsUpdated() || bleRadioEnabled.IsUpdated()) {
- lv_label_set_text(bleIcon, BleIcon::GetIcon(bleRadioEnabled.Get(), bleState.Get()));
+ lv_label_set_text(bleIcon, BleIcon::GetIcon(bleState.Get()));
AlignIcons();
}
diff --git a/src/displayapp/screens/Symbols.h b/src/displayapp/screens/Symbols.h
index 5ba8f953..e68a7af6 100644
--- a/src/displayapp/screens/Symbols.h
+++ b/src/displayapp/screens/Symbols.h
@@ -44,7 +44,6 @@ namespace Pinetime {
static constexpr const char* chartLine = "\xEF\x88\x81";
static constexpr const char* eye = "\xEF\x81\xAE";
static constexpr const char* home = "\xEF\x80\x95";
- static constexpr const char* airplane = "\xEF\x81\xB2";
// lv_font_sys_48.c
static constexpr const char* settings = "\xEE\xA4\x82"; // e902
diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp
index 59bde839..6a914884 100644
--- a/src/displayapp/screens/WatchFaceDigital.cpp
+++ b/src/displayapp/screens/WatchFaceDigital.cpp
@@ -121,7 +121,7 @@ void WatchFaceDigital::Refresh() {
bleState = bleController.IsConnected();
bleRadioEnabled = bleController.IsRadioEnabled();
if (bleState.IsUpdated() || bleRadioEnabled.IsUpdated()) {
- lv_label_set_text(bleIcon, BleIcon::GetIcon(bleRadioEnabled.Get(), bleState.Get()));
+ lv_label_set_text(bleIcon, BleIcon::GetIcon(bleState.Get()));
}
lv_obj_realign(batteryIcon);
lv_obj_realign(batteryPlug);
diff --git a/src/displayapp/screens/settings/SettingAirplaneMode.cpp b/src/displayapp/screens/settings/SettingBluetooth.cpp
index 85172787..ab1af223 100644
--- a/src/displayapp/screens/settings/SettingAirplaneMode.cpp
+++ b/src/displayapp/screens/settings/SettingBluetooth.cpp
@@ -1,4 +1,4 @@
-#include "displayapp/screens/settings/SettingAirplaneMode.h"
+#include "displayapp/screens/settings/SettingBluetooth.h"
#include <lvgl/lvgl.h>
#include "displayapp/DisplayApp.h"
#include "displayapp/Messages.h"
@@ -9,18 +9,18 @@
using namespace Pinetime::Applications::Screens;
namespace {
- static void OnAirplaneModeEnabledEvent(lv_obj_t* obj, lv_event_t event) {
- auto* screen = static_cast<SettingAirplaneMode*>(obj->user_data);
- screen->OnAirplaneModeEnabled(obj, event);
+ static void OnBluetoothDisabledEvent(lv_obj_t* obj, lv_event_t event) {
+ auto* screen = static_cast<SettingBluetooth*>(obj->user_data);
+ screen->OnBluetoothDisabled(obj, event);
}
- static void OnAirplaneModeDisabledEvent(lv_obj_t* obj, lv_event_t event) {
- auto* screen = static_cast<SettingAirplaneMode*>(obj->user_data);
- screen->OnAirplaneModeDisabled(obj, event);
+ static void OnBluetoothEnabledEvent(lv_obj_t* obj, lv_event_t event) {
+ auto* screen = static_cast<SettingBluetooth*>(obj->user_data);
+ screen->OnBluetoothEnabled(obj, event);
}
}
-SettingAirplaneMode::SettingAirplaneMode(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController)
+SettingBluetooth::SettingBluetooth(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::Settings& settingsController)
: Screen(app), settingsController {settingsController} {
lv_obj_t* container1 = lv_cont_create(lv_scr_act(), nullptr);
@@ -36,38 +36,38 @@ SettingAirplaneMode::SettingAirplaneMode(Pinetime::Applications::DisplayApp* app
lv_cont_set_layout(container1, LV_LAYOUT_COLUMN_LEFT);
lv_obj_t* title = lv_label_create(lv_scr_act(), nullptr);
- lv_label_set_text_static(title, "Airplane mode");
+ lv_label_set_text_static(title, "Bluetooth");
lv_label_set_align(title, LV_LABEL_ALIGN_CENTER);
lv_obj_align(title, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 15, 15);
lv_obj_t* icon = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(icon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_ORANGE);
- lv_label_set_text_static(icon, Symbols::airplane);
+ lv_label_set_text_static(icon, Symbols::bluetooth);
lv_label_set_align(icon, LV_LABEL_ALIGN_CENTER);
lv_obj_align(icon, title, LV_ALIGN_OUT_LEFT_MID, -10, 0);
cbEnabled = lv_checkbox_create(container1, nullptr);
- lv_checkbox_set_text(cbEnabled, " Enable");
+ lv_checkbox_set_text(cbEnabled, " Enabled");
cbEnabled->user_data = this;
- lv_obj_set_event_cb(cbEnabled, OnAirplaneModeEnabledEvent);
+ lv_obj_set_event_cb(cbEnabled, OnBluetoothEnabledEvent);
SetRadioButtonStyle(cbEnabled);
cbDisabled = lv_checkbox_create(container1, nullptr);
- lv_checkbox_set_text(cbDisabled, " Disable");
+ lv_checkbox_set_text(cbDisabled, " Disabled");
cbDisabled->user_data = this;
- lv_obj_set_event_cb(cbDisabled, OnAirplaneModeDisabledEvent);
+ lv_obj_set_event_cb(cbDisabled, OnBluetoothDisabledEvent);
SetRadioButtonStyle(cbDisabled);
if (settingsController.GetBleRadioEnabled()) {
- lv_checkbox_set_checked(cbDisabled, true);
+ lv_checkbox_set_checked(cbEnabled, true);
priorMode = true;
} else {
- lv_checkbox_set_checked(cbEnabled, true);
+ lv_checkbox_set_checked(cbDisabled, true);
priorMode = false;
}
}
-SettingAirplaneMode::~SettingAirplaneMode() {
+SettingBluetooth::~SettingBluetooth() {
lv_obj_clean(lv_scr_act());
// Do not call SaveSettings - see src/components/settings/Settings.h
if (priorMode != settingsController.GetBleRadioEnabled()) {
@@ -75,18 +75,18 @@ SettingAirplaneMode::~SettingAirplaneMode() {
}
}
-void SettingAirplaneMode::OnAirplaneModeEnabled(lv_obj_t* object, lv_event_t event) {
+void SettingBluetooth::OnBluetoothDisabled(lv_obj_t* object, lv_event_t event) {
if (event == LV_EVENT_VALUE_CHANGED) {
- lv_checkbox_set_checked(cbEnabled, true);
- lv_checkbox_set_checked(cbDisabled, false);
+ lv_checkbox_set_checked(cbEnabled, false);
+ lv_checkbox_set_checked(cbDisabled, true);
settingsController.SetBleRadioEnabled(false);
}
}
-void SettingAirplaneMode::OnAirplaneModeDisabled(lv_obj_t* object, lv_event_t event) {
+void SettingBluetooth::OnBluetoothEnabled(lv_obj_t* object, lv_event_t event) {
if (event == LV_EVENT_VALUE_CHANGED) {
- lv_checkbox_set_checked(cbEnabled, false);
- lv_checkbox_set_checked(cbDisabled, true);
+ lv_checkbox_set_checked(cbEnabled, true);
+ lv_checkbox_set_checked(cbDisabled, false);
settingsController.SetBleRadioEnabled(true);
}
}
diff --git a/src/displayapp/screens/settings/SettingAirplaneMode.h b/src/displayapp/screens/settings/SettingBluetooth.h
index b3478c64..12bb459a 100644
--- a/src/displayapp/screens/settings/SettingAirplaneMode.h
+++ b/src/displayapp/screens/settings/SettingBluetooth.h
@@ -12,13 +12,13 @@ namespace Pinetime {
namespace Applications {
namespace Screens {
- class SettingAirplaneMode : public Screen {
+ class SettingBluetooth : public Screen {
public:
- SettingAirplaneMode(DisplayApp* app, Pinetime::Controllers::Settings& settingsController);
- ~SettingAirplaneMode() override;
+ SettingBluetooth(DisplayApp* app, Pinetime::Controllers::Settings& settingsController);
+ ~SettingBluetooth() override;
- void OnAirplaneModeEnabled(lv_obj_t* object, lv_event_t event);
- void OnAirplaneModeDisabled(lv_obj_t* object, lv_event_t event);
+ void OnBluetoothEnabled(lv_obj_t* object, lv_event_t event);
+ void OnBluetoothDisabled(lv_obj_t* object, lv_event_t event);
private:
Controllers::Settings& settingsController;
diff --git a/src/displayapp/screens/settings/Settings.cpp b/src/displayapp/screens/settings/Settings.cpp
index dce0c071..bc7efcc2 100644
--- a/src/displayapp/screens/settings/Settings.cpp
+++ b/src/displayapp/screens/settings/Settings.cpp
@@ -64,7 +64,7 @@ std::unique_ptr<Screen> Settings::CreateScreen3() {
{Symbols::clock, "Chimes", Apps::SettingChimes},
{Symbols::tachometer, "Shake Calib.", Apps::SettingShakeThreshold},
{Symbols::check, "Firmware", Apps::FirmwareValidation},
- {Symbols::airplane, "Airplane mode", Apps::SettingAirplaneMode}
+ {Symbols::bluetooth, "Bluetooth", Apps::SettingBluetooth}
}};
return std::make_unique<Screens::List>(2, 4, app, settingsController, applications);