blob: 4252c9ebbf7983cdb1bf573f3ac0bf149ce3842b [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#include "GPSIcon.h"
2
3namespace MGUI
4{
5
6GPSIcon::GPSIcon(ilixi::Widget* parent)
7 : SimpleIcon(parent),
8 _gpsState(GpsSearching)
9{
10 setGpsState(GpsOff);
11}
12
13GPSIcon::~GPSIcon()
14{
15}
16
17GpsState
18GPSIcon::getGpsState() const
19{
20 return _gpsState;
21}
22
23void
24GPSIcon::setGpsState(GpsState gpsState)
25{
26 if (_gpsState != gpsState)
27 {
28 _gpsState = gpsState;
29 switch (_gpsState)
30 {
31 case GpsOff:
32 setImage("gps_off");
33 break;
34 case GpsSearching:
35 setImage("gps_on");
36 break;
37 case GpsConnected:
38 setImage("gps_fixed");
39 break;
40 default:
41 break;
42 }
43 }
44}
45
46} /* namespace MGUI */