summaryrefslogtreecommitdiff
path: root/src/config/ConfigDataValues.hpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-03-04 10:36:32 +0000
committerVaxry <vaxry@vaxry.net>2024-03-04 10:36:38 +0000
commit12da0fc84f8b084f7b13702b811cbed7dae9854c (patch)
treea4e0ed427418847faeef39f1cb0c8e17a16e6c38 /src/config/ConfigDataValues.hpp
parent9d89b7109da9b58904caf7c53a7af4b6daed1696 (diff)
hyprctl: parse custom types in getoption
Diffstat (limited to 'src/config/ConfigDataValues.hpp')
-rw-r--r--src/config/ConfigDataValues.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/config/ConfigDataValues.hpp b/src/config/ConfigDataValues.hpp
index accc92ab..39c60a5a 100644
--- a/src/config/ConfigDataValues.hpp
+++ b/src/config/ConfigDataValues.hpp
@@ -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);
+ }
};