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_),
|
||||
fmt::arg("icon", getIcon(percentage_, alt_)),
|
||||
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();
|
||||
} else {
|
||||
label_.set_markup(str);
|
||||
@@ -232,16 +233,15 @@ auto waybar::modules::Custom::update() -> void {
|
||||
image_style->add_class("image-button");
|
||||
event_box_.show();
|
||||
if (!image_path_.empty()) {
|
||||
auto pixbuf = Gdk::Pixbuf::create_from_file(image_path_, app_icon_size_, app_icon_size_);
|
||||
image_.set(pixbuf);
|
||||
auto pixbuf = Gdk::Pixbuf::create_from_file(image_path_, app_icon_size_, app_icon_size_);
|
||||
image_.set(pixbuf);
|
||||
} else if (!image_name_.empty()) {
|
||||
image_.set_from_icon_name(image_name_, Gtk::ICON_SIZE_INVALID);
|
||||
image_.set_pixel_size(app_icon_size_);
|
||||
image_.set_from_icon_name(image_name_, Gtk::ICON_SIZE_INVALID);
|
||||
image_.set_pixel_size(app_icon_size_);
|
||||
}
|
||||
|
||||
image_.set_visible(!image_name_.empty() || !image_path_.empty());
|
||||
label_.set_visible(!str.empty());
|
||||
|
||||
}
|
||||
} catch (const fmt::format_error& e) {
|
||||
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; "
|
||||
"try replacing \"{}\" with \"{text}\" in your format specifier");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
// Call parent update
|
||||
AIconLabel::update();
|
||||
|
||||
Reference in New Issue
Block a user