hyprctl: parse custom types in getoption
This commit is contained in:
parent
9d89b7109d
commit
12da0fc84f
2 changed files with 20 additions and 4 deletions
|
|
@ -14,6 +14,8 @@ class ICustomConfigValueData {
|
|||
virtual ~ICustomConfigValueData() = 0;
|
||||
|
||||
virtual eConfigValueDataTypes getDataType() = 0;
|
||||
|
||||
virtual std::string toString() = 0;
|
||||
};
|
||||
|
||||
class CGradientValueData : public ICustomConfigValueData {
|
||||
|
|
@ -51,6 +53,15 @@ class CGradientValueData : public ICustomConfigValueData {
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual std::string toString() {
|
||||
std::string result;
|
||||
for (auto& c : m_vColors) {
|
||||
result += std::format("{:x} ", c.getAsHex());
|
||||
}
|
||||
|
||||
result += std::format("{}deg", (int)(m_fAngle * 180.0 / M_PI));
|
||||
}
|
||||
};
|
||||
|
||||
class CCssGapData : public ICustomConfigValueData {
|
||||
|
|
@ -103,4 +114,8 @@ class CCssGapData : public ICustomConfigValueData {
|
|||
virtual eConfigValueDataTypes getDataType() {
|
||||
return CVD_TYPE_CSS_VALUE;
|
||||
}
|
||||
|
||||
virtual std::string toString() {
|
||||
return std::format("{} {} {} {}", top, right, bottom, left);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue