Added 'row' and 'column' layout hints

This commit is contained in:
Bartek Kryza
2023-02-04 21:26:57 +01:00
parent edba233030
commit fbc4fadbb7
9 changed files with 210 additions and 28 deletions

View File

@@ -34,6 +34,12 @@ std::string to_string(const hint_t t)
return "left";
case hint_t::right:
return "right";
case hint_t::together:
return "together";
case hint_t::row:
return "row";
case hint_t::column:
return "column";
default:
assert(false);
return "";

View File

@@ -80,7 +80,7 @@ struct filter {
std::vector<std::filesystem::path> paths;
};
enum class hint_t { up, down, left, right, together };
enum class hint_t { up, down, left, right, together, row, column };
std::string to_string(hint_t t);

View File

@@ -472,6 +472,14 @@ template <> struct convert<layout_hint> {
rhs.hint = hint_t::together;
rhs.entity = node["together"].as<std::vector<std::string>>();
}
else if (node["row"]) {
rhs.hint = hint_t::row;
rhs.entity = node["row"].as<std::vector<std::string>>();
}
else if (node["column"]) {
rhs.hint = hint_t::column;
rhs.entity = node["column"].as<std::vector<std::string>>();
}
else
return false;