3070{
3071 wxSize size = GetSize();
3072
3073 dc.SetPen(wxPen(*wxTRANSPARENT_PEN));
3075
3076
3077 int humidity_display_idx =
m_amsinfo.get_humidity_display_idx();
3078 if (1 <= humidity_display_idx && humidity_display_idx <= 5) {
3079
3080 dc.SetPen(wxPen(*wxTRANSPARENT_PEN));
3082 dc.DrawRoundedRectangle(0, 0, (size.x), (size.y), (size.y / 2));
3083
3084 wxPoint pot;
3086 {
3087 ScalableBitmap hum_img;
3088 if (!wxGetApp().dark_mode()) {
3090 } else {
3092 }
3093
3095 dc.DrawBitmap(hum_img.
bmp(), pot);
3097 }
3099 {
3100
3101 ScalableBitmap hum_img;
3102 if (!wxGetApp().dark_mode()) {
3104 } else {
3106 }
3107
3108 pot = wxPoint(FromDIP(5), ((size.y - hum_img.
GetBmpSize().y) / 2));
3109 dc.DrawBitmap(hum_img.
bmp(), pot);
3110 pot.x += hum_img.
GetBmpSize().x + FromDIP(3);
3111
3112
3113 wxString hum_percentage(std::to_string(
m_amsinfo.humidity_raw));
3114 dc.SetPen(wxPen(*wxTRANSPARENT_PEN));
3117
3119 auto tsize1 = dc.GetMultiLineTextExtent(hum_percentage);
3120 pot.y = (size.y - tsize1.y) / 2;
3121 dc.DrawText(hum_percentage, pot);
3122 pot.x += (tsize1.x + FromDIP(3));
3123
3124
3127 auto tsize2 = dc.GetMultiLineTextExtent(
_L(
"%"));
3128 pot.y = pot.y + ((tsize1.y - tsize2.y) / 2) + FromDIP(2);
3129 dc.DrawText(
_L(
"%"), pot);
3130
3131 pot.x += tsize2.x;
3132 }
3133
3135 {
3136 pot.x += FromDIP(2);
3137
3138
3139 dc.SetPen(wxPen(wxColour(194, 194, 194)));
3140 dc.SetBrush(wxBrush(wxColour(194, 194, 194)));
3141 dc.DrawLine(pot.x, GetSize().y / 2 - FromDIP(10), pot.x, GetSize().y / 2 + FromDIP(10));
3142
3143
3144 dc.SetPen(wxPen(*wxTRANSPARENT_PEN));
3145 pot.x += ((size.GetWidth() - pot.x) -
ams_drying_img.GetBmpWidth()) / 2;
3149 } else {
3150 pot.y = (size.y -
ams_sun_img.GetBmpHeight()) / 2;
3152 }
3153 }
3154 }
3155 else {
3156
3157 }
3158}
#define AMS_CONTROL_BLACK_COLOUR
Definition AMSItem.hpp:43
#define AMS_CONTROL_DEF_BLOCK_BK_COLOUR
Definition AMSItem.hpp:44
#define _L(s)
Definition OBJ.cpp:34
static wxFont Body_12
Definition Label.hpp:55
static wxFont Body_14
Definition Label.hpp:53
wxSize GetBmpSize() const
Definition wxExtensions.cpp:959
int GetBmpWidth() const
Definition wxExtensions.cpp:977
const wxBitmap & bmp() const
Definition wxExtensions.hpp:189
static void get_suitable_font_size(int max_height, wxDC &dc)
Definition WxFontUtils.cpp:309
@ GENERIC_AMS
Definition AMSItem.hpp:59