Skip to content

Commit

Permalink
More const bool cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanos82 committed Oct 4, 2022
1 parent afeef17 commit 8331cb3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions src/btop_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,13 @@ namespace Draw {
}

string createBox(const int x, const int y, const int width,
const int height, string line_color, const bool fill,
const int height, string line_color, bool fill,
const string title, const string title2, const int num) {
string out;
if (line_color.empty()) line_color = Theme::c("div_line");

if (line_color.empty())
line_color = Theme::c("div_line");

auto tty_mode = Config::getB("tty_mode");
auto rounded = Config::getB("rounded_corners");
const string numbering = (num == 0) ? "" : Theme::c("hi_fg") + (tty_mode ? std::to_string(num) : Symbols::superscript.at(clamp(num, 0, 9)));
Expand All @@ -243,12 +246,12 @@ namespace Draw {
out = Fx::reset + line_color;

//? Draw horizontal lines
for (const int& hpos : {y, y + height - 1}) {
for (const int& hpos : {y, y + height - 1}) {
out += Mv::to(hpos, x) + Symbols::h_line * (width - 1);
}

//? Draw vertical lines and fill if enabled
for (const int& hpos : iota(y + 1, y + height - 1)) {
for (const int& hpos : iota(y + 1, y + height - 1)) {
out += Mv::to(hpos, x) + Symbols::v_line
+ ((fill) ? string(width - 2, ' ') : Mv::r(width - 2))
+ Symbols::v_line;
Expand Down
6 changes: 3 additions & 3 deletions src/btop_draw.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ namespace Draw {

//* Create a box and return as a string
string createBox(const int x, const int y, const int width,
const int height, string line_color="", const bool fill=false,
const string title="", const string title2="", const int num=0);
const int height, string line_color = "", bool fill = false,
const string title = "", const string title2 = "", const int num = 0);

bool update_clock(bool force=false);
bool update_clock(bool force = false);

//* Class holding a percentage meter
class Meter {
Expand Down

0 comments on commit 8331cb3

Please sign in to comment.