Skip to content

Commit ec959ae

Browse files
authored
Merge pull request #329 from pennam/clear-widget
Use escape sequence \x1B to clear messenger widget
2 parents d771bd7 + ffc3d83 commit ec959ae

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

src/property/Property.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ Property::Property()
5555

5656
}
5757

58+
/******************************************************************************
59+
CONST
60+
******************************************************************************/
61+
namespace PropertyActions
62+
{
63+
const String CLEAR = "\x1b";
64+
}
65+
5866
/******************************************************************************
5967
PUBLIC MEMBER FUNCTIONS
6068
******************************************************************************/

src/property/Property.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@
5151
#define appendAttribute(x) appendAttributeReal(x, getAttributeName(#x, '.'), encoder)
5252
#define setAttribute(x) setAttributeReal(x, getAttributeName(#x, '.'))
5353

54+
/******************************************************************************
55+
CONST
56+
******************************************************************************/
57+
namespace PropertyActions
58+
{
59+
extern const String CLEAR;
60+
}
61+
5462
/******************************************************************************
5563
ENUM
5664
******************************************************************************/

src/property/types/CloudString.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ class CloudString : public Property {
4646
operator String() const {
4747
return _value;
4848
}
49+
void clear() {
50+
_value = PropertyActions::CLEAR;
51+
}
4952
virtual bool isDifferentFromCloud() {
5053
return _value != _cloud_value;
5154
}

0 commit comments

Comments
 (0)