From 8331cb36f8ae9d65ffdccdba7fe916b62d740f60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=A3=CF=84=CE=AD=CF=86=CE=B1=CE=BD=CE=BF=CF=82?= Date: Tue, 4 Oct 2022 17:33:53 +0300 Subject: [PATCH] More const bool cleanup --- src/btop_draw.cpp | 11 +++++++---- src/btop_draw.hpp | 6 +++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/btop_draw.cpp b/src/btop_draw.cpp index abb68fe..ec0750f 100644 --- a/src/btop_draw.cpp +++ b/src/btop_draw.cpp @@ -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))); @@ -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; diff --git a/src/btop_draw.hpp b/src/btop_draw.hpp index 6da4af5..59a0e69 100644 --- a/src/btop_draw.hpp +++ b/src/btop_draw.hpp @@ -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 {