mirror of
https://github.com/polybar/polybar.git
synced 2026-05-01 03:43:40 +00:00
refactor(clang-tidy): Apply fixes
This commit is contained in:
@ -250,7 +250,7 @@ void builder::node(const label_t& label, bool add_space) {
|
||||
/**
|
||||
* Repeat text string n times
|
||||
*/
|
||||
void builder::node_repeat(string str, size_t n, bool add_space) {
|
||||
void builder::node_repeat(const string& str, size_t n, bool add_space) {
|
||||
string text;
|
||||
while (n--) {
|
||||
text += str;
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
#include <csignal>
|
||||
|
||||
#include "components/eventloop.hpp"
|
||||
#include "components/types.hpp"
|
||||
#include "components/signals.hpp"
|
||||
#include "components/types.hpp"
|
||||
#include "utils/string.hpp"
|
||||
#include "utils/time.hpp"
|
||||
#include "x11/color.hpp"
|
||||
|
||||
@ -2,11 +2,11 @@
|
||||
#include <thread>
|
||||
|
||||
#include "components/config.hpp"
|
||||
#include "components/eventloop.hpp"
|
||||
#include "components/logger.hpp"
|
||||
#include "components/screen.hpp"
|
||||
#include "components/types.hpp"
|
||||
#include "components/signals.hpp"
|
||||
#include "components/eventloop.hpp"
|
||||
#include "components/types.hpp"
|
||||
#include "x11/connection.hpp"
|
||||
#include "x11/randr.hpp"
|
||||
#include "x11/winspec.hpp"
|
||||
|
||||
@ -15,10 +15,12 @@ namespace {
|
||||
|
||||
uint32_t make_mask(bspwm_state s1, bspwm_state s2 = bspwm_state::NONE) {
|
||||
uint32_t mask{0U};
|
||||
if (static_cast<uint32_t>(s1))
|
||||
if (static_cast<uint32_t>(s1)) {
|
||||
mask |= 1 << (static_cast<uint32_t>(s1) - 1);
|
||||
if (static_cast<uint32_t>(s2))
|
||||
}
|
||||
if (static_cast<uint32_t>(s2)) {
|
||||
mask |= 1 << (static_cast<uint32_t>(s2) - 1);
|
||||
}
|
||||
return mask;
|
||||
}
|
||||
|
||||
@ -327,16 +329,21 @@ namespace modules {
|
||||
auto label = m_statelabels.at(workspace_mask)->clone();
|
||||
|
||||
if (!m_monitors.back()->focused) {
|
||||
if (m_statelabels[make_mask(state::DIMMED)])
|
||||
if (m_statelabels[make_mask(state::DIMMED)]) {
|
||||
label->replace_defined_values(m_statelabels[make_mask(state::DIMMED)]);
|
||||
if (workspace_mask & make_mask(state::EMPTY))
|
||||
}
|
||||
if (workspace_mask & make_mask(state::EMPTY)) {
|
||||
label->replace_defined_values(m_statelabels[make_mask(state::DIMMED, state::EMPTY)]);
|
||||
if (workspace_mask & make_mask(state::OCCUPIED))
|
||||
}
|
||||
if (workspace_mask & make_mask(state::OCCUPIED)) {
|
||||
label->replace_defined_values(m_statelabels[make_mask(state::DIMMED, state::OCCUPIED)]);
|
||||
if (workspace_mask & make_mask(state::FOCUSED))
|
||||
}
|
||||
if (workspace_mask & make_mask(state::FOCUSED)) {
|
||||
label->replace_defined_values(m_statelabels[make_mask(state::DIMMED, state::FOCUSED)]);
|
||||
if (workspace_mask & make_mask(state::URGENT))
|
||||
}
|
||||
if (workspace_mask & make_mask(state::URGENT)) {
|
||||
label->replace_defined_values(m_statelabels[make_mask(state::DIMMED, state::URGENT)]);
|
||||
}
|
||||
}
|
||||
|
||||
label->reset_tokens();
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
#include <utility>
|
||||
|
||||
#include "components/builder.hpp"
|
||||
#include "modules/meta/base.hpp"
|
||||
#include "drawtypes/label.hpp"
|
||||
#include "modules/meta/base.hpp"
|
||||
|
||||
POLYBAR_NS
|
||||
|
||||
|
||||
@ -3,9 +3,9 @@
|
||||
#include "drawtypes/iconset.hpp"
|
||||
#include "drawtypes/label.hpp"
|
||||
#include "modules/xworkspaces.hpp"
|
||||
#include "utils/math.hpp"
|
||||
#include "x11/atoms.hpp"
|
||||
#include "x11/connection.hpp"
|
||||
#include "utils/math.hpp"
|
||||
|
||||
#include "modules/meta/base.inl"
|
||||
#include "modules/meta/static_module.inl"
|
||||
|
||||
@ -677,7 +677,6 @@ void tray_manager::notify_clients_delayed(chrono::duration<double, std::milli> d
|
||||
this_thread::sleep_for(delay);
|
||||
notify_clients();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user