Skip to content

Commit

Permalink
Merge pull request #293 from mfs12/fix-message-title-display
Browse files Browse the repository at this point in the history
Fix message title display
  • Loading branch information
mfs12 committed Apr 21, 2023
2 parents c423b01 + 93cc780 commit 4c0cb55
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 15 deletions.
22 changes: 11 additions & 11 deletions src/PanelDue.cpp
Expand Up @@ -1050,6 +1050,17 @@ static void EndReceivedMessage()
}
FileManager::EndReceivedMessage();

// alert event handling
if (currentAlert.flags.IsBitSet(Alert::GotMode) && currentAlert.mode == Alert::Mode::None)
{
UI::ClearAlert();
}
else if (currentAlert.mode != Alert::Mode::None && currentAlert.seq != lastAlertSeq)
{
UI::ProcessAlert(currentAlert);
lastAlertSeq = currentAlert.seq;
}

if (thumbnailContext.parseErr != 0 || thumbnailContext.err != 0)
{
dbg("thumbnail parseErr %d err %d.\n",
Expand Down Expand Up @@ -2562,17 +2573,6 @@ int main(void)
}
}

// alert event handling
if (currentAlert.flags.IsBitSet(Alert::GotMode) && currentAlert.mode == Alert::Mode::None)
{
UI::ClearAlert();
}
else if (currentAlert.mode > Alert::Mode::None && currentAlert.seq != lastAlertSeq)
{
UI::ProcessAlert(currentAlert);
lastAlertSeq = currentAlert.seq;
}

// refresh the display
UpdateDebugInfo();
mgr.Refresh(false);
Expand Down
5 changes: 3 additions & 2 deletions src/UI/Popup.cpp
Expand Up @@ -42,9 +42,10 @@ void AlertPopup::Set(const char *title, const char *text, int32_t mode, uint32_t
text += splitPoint;
alertText3.copy(text);

closeButton->Show(mode == Alert::Mode::InfoConfirm);
closeButton->Show(mode == Alert::Mode::InfoClose);

okButton->Show(mode == Alert::Mode::ConfirmCancel ||
okButton->Show(mode == Alert::Mode::InfoConfirm ||
mode == Alert::Mode::ConfirmCancel ||
mode == Alert::Mode::NumberInt ||
mode == Alert::Mode::NumberFloat ||
mode == Alert::Mode::Text);
Expand Down
2 changes: 1 addition & 1 deletion src/Version.hpp
Expand Up @@ -8,7 +8,7 @@
#ifndef SRC_VERSION_HPP_
#define SRC_VERSION_HPP_

#define VERSION_MAIN "3.4.1"
#define VERSION_MAIN "3.5.0-rc1"

#ifdef SUPPORT_ENCODER
#define VERSION_ENCODER "+enc"
Expand Down
1 change: 1 addition & 0 deletions tests/test-m291-s0.g
@@ -0,0 +1 @@
M291 P"test message mode 0" R"test mode S0" S0
1 change: 1 addition & 0 deletions tests/test-m291-s1.g
@@ -0,0 +1 @@
M291 P"test message mode 1" R"test mode S1" S1
1 change: 1 addition & 0 deletions tests/test-m291-s2.g
@@ -0,0 +1 @@
M291 P"test message mode 2" R"test mode S2" S2
1 change: 1 addition & 0 deletions tests/test-m291-s3.g
@@ -0,0 +1 @@
M291 P"test message mode 3" R"test mode S3" S3
1 change: 1 addition & 0 deletions tests/test-m291-s4.g
@@ -0,0 +1 @@
M291 P"select a choice" R"test mode 4" S4 K{"choice1", "choice2", "choice3", "choice4", "choice5", "choice6", "choice7", "choice8", "choice9", "choice10" }
1 change: 1 addition & 0 deletions tests/test-m291-s5.g
@@ -0,0 +1 @@
M291 P"enter an integer number" R"test mode 5" S5 L10 H100 F50
1 change: 1 addition & 0 deletions tests/test-m291-s6.g
@@ -0,0 +1 @@
M291 P"enter a float number" R"test mode 6" S6 L0.1 H1.0 F0.5
1 change: 1 addition & 0 deletions tests/test-m291-s7.g
@@ -0,0 +1 @@
M291 P"enter a text" R"test mode 7" S7 L2 H20 F"abc"
4 changes: 4 additions & 0 deletions tests/test-m291.g
@@ -0,0 +1,4 @@
M291 P"test message mode 0" R"test title" S0
M291 P"test message mode 1" R"test title" S1
M291 P"test message mode 2" R"test title" S2
M291 P"test message mode 3" R"test title" S3

0 comments on commit 4c0cb55

Please sign in to comment.