From 90b7dd71a7c75872dd347a58a6c032fdb4f3eaab Mon Sep 17 00:00:00 2001 From: zhaohe Date: Wed, 30 Aug 2023 11:17:52 +0800 Subject: [PATCH] update --- components/dwin/var_icon.cpp | 15 +++++++++++++-- components/dwin/var_icon.hpp | 2 ++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/components/dwin/var_icon.cpp b/components/dwin/var_icon.cpp index 774efc2..6ca3144 100644 --- a/components/dwin/var_icon.cpp +++ b/components/dwin/var_icon.cpp @@ -88,16 +88,27 @@ void VarIcon::dumpinfo() { bool VarIcon::setVal(uint16_t val) { m_val = val; + if (m_hide) return true; return _setVal(val); } uint16_t VarIcon::getVal() { uint16_t val = 0xffff; + if(m_hide) return m_val; m_dwin_screen->read_varspace16(m_descript.m_VP, val, 100); return val; } -void VarIcon::hide() { _setVal(VARICON_VAL_HIDE); }; -void VarIcon::show() { _setVal(m_val); } +void VarIcon::hide() { // + _setVal(VARICON_VAL_HIDE); + /** + * @brief + */ + m_hide = true; +}; +void VarIcon::show() { + m_hide = false; + _setVal(m_val); +} VarIconDescript_t &VarIcon::getDescript() { return m_descript; } diff --git a/components/dwin/var_icon.hpp b/components/dwin/var_icon.hpp index 5a8fb80..5392ddd 100644 --- a/components/dwin/var_icon.hpp +++ b/components/dwin/var_icon.hpp @@ -37,6 +37,8 @@ class VarIcon { uint16_t m_val = 0xffff; + bool m_hide = false; + public: bool init(DwinScreen *dwin_screen, uint16_t descript_add); bool init(DwinScreen *dwin_screen);