Fix clang-format
This commit is contained in:
@@ -193,7 +193,8 @@ auto waybar::modules::Custom::update() -> void {
|
|||||||
auto str = fmt::format(fmt::runtime(format_), fmt::arg("text", text_), fmt::arg("alt", alt_),
|
auto str = fmt::format(fmt::runtime(format_), fmt::arg("text", text_), fmt::arg("alt", alt_),
|
||||||
fmt::arg("icon", getIcon(percentage_, alt_)),
|
fmt::arg("icon", getIcon(percentage_, alt_)),
|
||||||
fmt::arg("percentage", percentage_));
|
fmt::arg("percentage", percentage_));
|
||||||
if ((config_["hide-empty-text"].asBool() && text_.empty()) || (str.empty() && image_path_.empty() && image_name_.empty())) {
|
if ((config_["hide-empty-text"].asBool() && text_.empty()) ||
|
||||||
|
(str.empty() && image_path_.empty() && image_name_.empty())) {
|
||||||
event_box_.hide();
|
event_box_.hide();
|
||||||
} else {
|
} else {
|
||||||
label_.set_markup(str);
|
label_.set_markup(str);
|
||||||
@@ -232,16 +233,15 @@ auto waybar::modules::Custom::update() -> void {
|
|||||||
image_style->add_class("image-button");
|
image_style->add_class("image-button");
|
||||||
event_box_.show();
|
event_box_.show();
|
||||||
if (!image_path_.empty()) {
|
if (!image_path_.empty()) {
|
||||||
auto pixbuf = Gdk::Pixbuf::create_from_file(image_path_, app_icon_size_, app_icon_size_);
|
auto pixbuf = Gdk::Pixbuf::create_from_file(image_path_, app_icon_size_, app_icon_size_);
|
||||||
image_.set(pixbuf);
|
image_.set(pixbuf);
|
||||||
} else if (!image_name_.empty()) {
|
} else if (!image_name_.empty()) {
|
||||||
image_.set_from_icon_name(image_name_, Gtk::ICON_SIZE_INVALID);
|
image_.set_from_icon_name(image_name_, Gtk::ICON_SIZE_INVALID);
|
||||||
image_.set_pixel_size(app_icon_size_);
|
image_.set_pixel_size(app_icon_size_);
|
||||||
}
|
}
|
||||||
|
|
||||||
image_.set_visible(!image_name_.empty() || !image_path_.empty());
|
image_.set_visible(!image_name_.empty() || !image_path_.empty());
|
||||||
label_.set_visible(!str.empty());
|
label_.set_visible(!str.empty());
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (const fmt::format_error& e) {
|
} catch (const fmt::format_error& e) {
|
||||||
if (std::strcmp(e.what(), "cannot switch from manual to automatic argument indexing") != 0)
|
if (std::strcmp(e.what(), "cannot switch from manual to automatic argument indexing") != 0)
|
||||||
@@ -251,9 +251,6 @@ auto waybar::modules::Custom::update() -> void {
|
|||||||
"mixing manual and automatic argument indexing is no longer supported; "
|
"mixing manual and automatic argument indexing is no longer supported; "
|
||||||
"try replacing \"{}\" with \"{text}\" in your format specifier");
|
"try replacing \"{}\" with \"{text}\" in your format specifier");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// Call parent update
|
// Call parent update
|
||||||
AIconLabel::update();
|
AIconLabel::update();
|
||||||
|
|||||||
Reference in New Issue
Block a user