mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
Add {flag} format replacement
This commit is contained in:
parent
9fa7bfc0cb
commit
0472d279e4
@ -32,6 +32,12 @@ class Language : public ALabel, public sigc::trackable {
|
||||
std::string short_name;
|
||||
std::string variant;
|
||||
std::string short_description;
|
||||
std::string country_flag() const {
|
||||
static std::string result = "\xf0\x9f\x87\xff\xf0\x9f\x87\xff";
|
||||
result[3] = short_name[0] - 0xbb;
|
||||
result[7] = short_name[1] - 0xbb;
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
class XKBContext {
|
||||
|
@ -99,7 +99,8 @@ auto Language::update() -> void {
|
||||
fmt::arg("short", layout_.short_name),
|
||||
fmt::arg("shortDescription", layout_.short_description),
|
||||
fmt::arg("long", layout_.full_name),
|
||||
fmt::arg("variant", layout_.variant)));
|
||||
fmt::arg("variant", layout_.variant),
|
||||
fmt::arg("flag", layout_.country_flag())));
|
||||
label_.set_markup(display_layout);
|
||||
if (tooltipEnabled()) {
|
||||
if (tooltip_format_ != "") {
|
||||
|
Loading…
Reference in New Issue
Block a user