mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-10 00:51:58 -07:00
hyprctl: parse custom types in getoption
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user