Skip to content

Commit 57ce58f

Browse files
authored
Merge pull request #186 from petterhs/musicUI
music: Symbols for the buttons
2 parents 2922b26 + 700af0b commit 57ce58f

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

src/displayapp/screens/Music.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
along with this program. If not, see <https://www.gnu.org/licenses/>.
1717
*/
1818
#include "Music.h"
19+
#include "Symbols.h"
1920
#include <cstdint>
2021
#include "../DisplayApp.h"
2122
#include "components/ble/MusicService.h"
@@ -58,7 +59,7 @@ Music::Music(Pinetime::Applications::DisplayApp *app, Pinetime::Controllers::Mus
5859
lv_obj_set_size(btnVolDown, LV_HOR_RES / 3, 80);
5960
lv_obj_align(btnVolDown, nullptr, LV_ALIGN_IN_BOTTOM_LEFT, 0, 0);
6061
label = lv_label_create(btnVolDown, nullptr);
61-
lv_label_set_text(label, "V-");
62+
lv_label_set_text(label, Symbols::volumDown);
6263
lv_obj_set_hidden(btnVolDown, !displayVolumeButtons);
6364

6465
btnVolUp = lv_btn_create(lv_scr_act(), nullptr);
@@ -67,7 +68,7 @@ Music::Music(Pinetime::Applications::DisplayApp *app, Pinetime::Controllers::Mus
6768
lv_obj_set_size(btnVolUp, LV_HOR_RES / 3, 80);
6869
lv_obj_align(btnVolUp, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
6970
label = lv_label_create(btnVolUp, nullptr);
70-
lv_label_set_text(label, "V+");
71+
lv_label_set_text(label, Symbols::volumUp);
7172
lv_obj_set_hidden(btnVolDown, !displayVolumeButtons);
7273

7374
btnPrev = lv_btn_create(lv_scr_act(), nullptr);
@@ -76,23 +77,23 @@ Music::Music(Pinetime::Applications::DisplayApp *app, Pinetime::Controllers::Mus
7677
lv_obj_set_size(btnPrev, LV_HOR_RES / 3, 80);
7778
lv_obj_align(btnPrev, nullptr, LV_ALIGN_IN_BOTTOM_LEFT, 0, 0);
7879
label = lv_label_create(btnPrev, nullptr);
79-
lv_label_set_text(label, "<<");
80+
lv_label_set_text(label, Symbols::stepBackward);
8081

8182
btnNext = lv_btn_create(lv_scr_act(), nullptr);
8283
btnNext->user_data = this;
8384
lv_obj_set_event_cb(btnNext, event_handler);
8485
lv_obj_set_size(btnNext, LV_HOR_RES / 3, 80);
8586
lv_obj_align(btnNext, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
8687
label = lv_label_create(btnNext, nullptr);
87-
lv_label_set_text(label, ">>");
88+
lv_label_set_text(label, Symbols::stepForward);
8889

8990
btnPlayPause = lv_btn_create(lv_scr_act(), nullptr);
9091
btnPlayPause->user_data = this;
9192
lv_obj_set_event_cb(btnPlayPause, event_handler);
9293
lv_obj_set_size(btnPlayPause, LV_HOR_RES / 3, 80);
9394
lv_obj_align(btnPlayPause, nullptr, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
9495
txtPlayPause = lv_label_create(btnPlayPause, nullptr);
95-
lv_label_set_text(txtPlayPause, ">");
96+
lv_label_set_text(txtPlayPause, Symbols::play);
9697

9798
txtTrackDuration = lv_label_create(lv_scr_act(), nullptr);
9899
lv_label_set_long_mode(txtTrackDuration, LV_LABEL_LONG_SROLL);
@@ -179,7 +180,7 @@ bool Music::Refresh() {
179180
}
180181

181182
if (playing == Pinetime::Controllers::MusicService::MusicStatus::Playing) {
182-
lv_label_set_text(txtPlayPause, "||");
183+
lv_label_set_text(txtPlayPause, Symbols::pause);
183184
if (xTaskGetTickCount() - 1024 >= lastIncrement) {
184185

185186
if (frameB) {
@@ -203,7 +204,7 @@ bool Music::Refresh() {
203204
UpdateLength();
204205
}
205206
} else {
206-
lv_label_set_text(txtPlayPause, ">");
207+
lv_label_set_text(txtPlayPause, Symbols::play);
207208
}
208209

209210
return running;

0 commit comments

Comments
 (0)