fix: lint

This commit is contained in:
Alex 2023-04-17 09:01:14 +02:00
parent 8be889c5aa
commit ede1d25440
3 changed files with 36 additions and 39 deletions

View File

@ -41,7 +41,6 @@ class Cava final: public ALabel {
void pause_resume();
// ModuleActionMap
static inline std::map<const std::string, void (waybar::modules::Cava::*const)()> actionMap_{
{"mode", &waybar::modules::Cava::pause_resume}
{"mode", &waybar::modules::Cava::pause_resume}};
};
};
}
} // namespace waybar::modules

View File

@ -190,8 +190,8 @@ auto waybar::modules::Backlight::update() -> void {
event_box_.show();
const uint8_t percent =
best->get_max() == 0 ? 100 : round(best->get_actual() * 100.0f / best->get_max());
std::string desc = fmt::format(fmt::runtime(format_),
fmt::arg("percent", std::to_string(percent)),
std::string desc =
fmt::format(fmt::runtime(format_), fmt::arg("percent", std::to_string(percent)),
fmt::arg("icon", getIcon(percent)));
label_.set_markup(desc);
getState(percent);
@ -201,8 +201,7 @@ auto waybar::modules::Backlight::update() -> void {
tooltip_format = config_["tooltip-format"].asString();
}
if (!tooltip_format.empty()) {
label_.set_tooltip_text(fmt::format(
fmt::runtime(tooltip_format),
label_.set_tooltip_text(fmt::format(fmt::runtime(tooltip_format),
fmt::arg("percent", std::to_string(percent)),
fmt::arg("icon", getIcon(percent))));
} else {

View File

@ -29,10 +29,12 @@ void active(void* data, zdwl_output_v1* zdwl_output_v1, uint32_t active) {
// Intentionally empty
}
static void set_tag(void* data, zdwl_output_v1* zdwl_output_v1, uint32_t tag, uint32_t state, uint32_t clients, uint32_t focused) {
static void set_tag(void *data, zdwl_output_v1 *zdwl_output_v1, uint32_t tag, uint32_t state,
uint32_t clients, uint32_t focused) {
static_cast<Tags *>(data)->handle_view_tags(tag, state, clients, focused);
num_tags = (state & ZDWL_OUTPUT_V1_TAG_STATE_ACTIVE) ? num_tags | (1 << tag) : num_tags & ~(1 << tag);
num_tags =
(state & ZDWL_OUTPUT_V1_TAG_STATE_ACTIVE) ? num_tags | (1 << tag) : num_tags & ~(1 << tag);
}
void set_layout_symbol(void *data, zdwl_output_v1 *zdwl_output_v1, const char *layout) {
@ -165,14 +167,12 @@ void Tags::handle_primary_clicked(uint32_t tag) {
bool Tags::handle_button_press(GdkEventButton *event_button, uint32_t tag) {
if (event_button->type == GDK_BUTTON_PRESS && event_button->button == 3) {
if (!output_status_) return true;
zdwl_output_v1_set_tags(output_status_, num_tags ^ tag, 0);
}
return true;
}
void Tags::handle_view_tags(uint32_t tag, uint32_t state, uint32_t clients, uint32_t focused) {
// First clear all occupied state
auto &button = buttons_[tag];
@ -193,7 +193,6 @@ void Tags::handle_view_tags(uint32_t tag, uint32_t state, uint32_t clients, uint
} else {
button.get_style_context()->remove_class("urgent");
}
}
} /* namespace waybar::modules::dwl */