mirror of https://github.com/aristocratos/btop.git
Merge pull request #714 from tessus/fix/if-name-len
This commit is contained in:
commit
70dec20b23
|
@ -1361,6 +1361,7 @@ namespace Net {
|
||||||
int x = 1, y, width = 20, height;
|
int x = 1, y, width = 20, height;
|
||||||
int b_x, b_y, b_width, b_height, d_graph_height, u_graph_height;
|
int b_x, b_y, b_width, b_height, d_graph_height, u_graph_height;
|
||||||
bool shown = true, redraw = true;
|
bool shown = true, redraw = true;
|
||||||
|
const int MAX_IFNAMSIZ = 15;
|
||||||
string old_ip;
|
string old_ip;
|
||||||
std::unordered_map<string, Draw::Graph> graphs;
|
std::unordered_map<string, Draw::Graph> graphs;
|
||||||
string box;
|
string box;
|
||||||
|
@ -1381,7 +1382,7 @@ namespace Net {
|
||||||
out.reserve(width * height);
|
out.reserve(width * height);
|
||||||
const string title_left = Theme::c("net_box") + Fx::ub + Symbols::title_left;
|
const string title_left = Theme::c("net_box") + Fx::ub + Symbols::title_left;
|
||||||
const string title_right = Theme::c("net_box") + Fx::ub + Symbols::title_right;
|
const string title_right = Theme::c("net_box") + Fx::ub + Symbols::title_right;
|
||||||
const int i_size = min((int)selected_iface.size(), 10);
|
const int i_size = min((int)selected_iface.size(), MAX_IFNAMSIZ);
|
||||||
const long long down_max = (net_auto ? safeVal(graph_max, "download"s) : ((long long)(Config::getI("net_download")) << 20) / 8);
|
const long long down_max = (net_auto ? safeVal(graph_max, "download"s) : ((long long)(Config::getI("net_download")) << 20) / 8);
|
||||||
const long long up_max = (net_auto ? safeVal(graph_max, "upload"s) : ((long long)(Config::getI("net_upload")) << 20) / 8);
|
const long long up_max = (net_auto ? safeVal(graph_max, "upload"s) : ((long long)(Config::getI("net_upload")) << 20) / 8);
|
||||||
|
|
||||||
|
@ -1403,7 +1404,7 @@ namespace Net {
|
||||||
//? Interface selector and buttons
|
//? Interface selector and buttons
|
||||||
|
|
||||||
out += Mv::to(y, x+width - i_size - 9) + title_left + Fx::b + Theme::c("hi_fg") + "<b " + Theme::c("title")
|
out += Mv::to(y, x+width - i_size - 9) + title_left + Fx::b + Theme::c("hi_fg") + "<b " + Theme::c("title")
|
||||||
+ uresize(selected_iface, 10) + Theme::c("hi_fg") + " n>" + title_right
|
+ uresize(selected_iface, MAX_IFNAMSIZ) + Theme::c("hi_fg") + " n>" + title_right
|
||||||
+ Mv::to(y, x+width - i_size - 15) + title_left + Theme::c("hi_fg") + (safeVal(net.stat, "download"s).offset + safeVal(net.stat, "upload"s).offset > 0 ? Fx::b : "") + 'z'
|
+ Mv::to(y, x+width - i_size - 15) + title_left + Theme::c("hi_fg") + (safeVal(net.stat, "download"s).offset + safeVal(net.stat, "upload"s).offset > 0 ? Fx::b : "") + 'z'
|
||||||
+ Theme::c("title") + "ero" + title_right;
|
+ Theme::c("title") + "ero" + title_right;
|
||||||
Input::mouse_mappings["b"] = {y, x+width - i_size - 8, 1, 3};
|
Input::mouse_mappings["b"] = {y, x+width - i_size - 8, 1, 3};
|
||||||
|
|
Loading…
Reference in New Issue