From cf19cfd1c1a8248f5018ebe5f5cd56abb812b38b Mon Sep 17 00:00:00 2001 From: MatthewColvin Date: Wed, 18 Oct 2023 20:27:29 -0500 Subject: [PATCH] Clean Up text showing in wifi Settings --- .../OmoteUI/UIs/BasicRefactored/page/WifiSettings.cpp | 3 ++- Platformio/OmoteUI/core/widget/Label.cpp | 6 ++++++ Platformio/OmoteUI/core/widget/Label.hpp | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Platformio/OmoteUI/UIs/BasicRefactored/page/WifiSettings.cpp b/Platformio/OmoteUI/UIs/BasicRefactored/page/WifiSettings.cpp index 480631e..b262c7c 100644 --- a/Platformio/OmoteUI/UIs/BasicRefactored/page/WifiSettings.cpp +++ b/Platformio/OmoteUI/UIs/BasicRefactored/page/WifiSettings.cpp @@ -16,6 +16,7 @@ WifiSettings::WifiSettings(std::shared_ptr aWifi) std::make_unique("Scanning..."))), mWifiNetworks(AddElement(std::make_unique())), mPasswordGetter(nullptr) { + // Set Handler for when the wifi scan is done mScanCompleteHandler = [this](auto aWifiInfos) { mScanningText->SetText("Networks Found"); @@ -59,7 +60,7 @@ WifiSettings::WifiSettings(std::shared_ptr aWifi) void WifiSettings::SetHeight(lv_coord_t aHeight) { Base::SetHeight(aHeight); mScanningText->AlignTo(this, LV_ALIGN_TOP_MID); - mScanningText->SetHeight(15); + mScanningText->SetHeight(20); const auto padding = 10; mWifiNetworks->AlignTo(mScanningText, LV_ALIGN_OUT_BOTTOM_MID, 0, padding); mWifiNetworks->SetHeight(GetContentHeight() - mScanningText->GetBottom() - diff --git a/Platformio/OmoteUI/core/widget/Label.cpp b/Platformio/OmoteUI/core/widget/Label.cpp index ca61935..7c40554 100644 --- a/Platformio/OmoteUI/core/widget/Label.cpp +++ b/Platformio/OmoteUI/core/widget/Label.cpp @@ -14,4 +14,10 @@ Label::Label(std::string aText) void Label::SetText(std::string aText) { auto lock = LvglResourceManager::GetInstance().scopeLock(); lv_label_set_text(LvglSelf(), aText.c_str()); + SetLongMode(LV_LABEL_LONG_SCROLL); +} + +void Label::SetLongMode(lv_label_long_mode_t aLongMode) { + auto lock = LvglResourceManager::GetInstance().scopeLock(); + lv_label_set_long_mode(LvglSelf(), aLongMode); } \ No newline at end of file diff --git a/Platformio/OmoteUI/core/widget/Label.hpp b/Platformio/OmoteUI/core/widget/Label.hpp index 47c482d..1ed5a30 100644 --- a/Platformio/OmoteUI/core/widget/Label.hpp +++ b/Platformio/OmoteUI/core/widget/Label.hpp @@ -9,6 +9,8 @@ public: Label(std::string aText); void SetText(std::string aText); + + void SetLongMode(lv_label_long_mode_t aLongMode); }; } // namespace UI::Widget