Skip to content

Commit 2d17303

Browse files
committed
Wider proc box option
1 parent 64476b5 commit 2d17303

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

src/btop_config.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ namespace Config {
117117
{"proc_info_smaps", "#* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate)"},
118118

119119
{"proc_left", "#* Show proc box on left side of screen instead of right."},
120+
121+
{"proc_box_wide", "#* Make the proc box wider when Net and Mem boxes are shown."},
120122

121123
{"proc_filter_kernel", "#* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop)."},
122124

@@ -340,6 +342,7 @@ namespace Config {
340342
{"proc_follow_detailed", true},
341343
{"follow_process", false},
342344
{"update_following", false},
345+
{"proc_box_wide", false},
343346
#ifdef GPU_SUPPORT
344347
{"nvml_measure_pcie_speeds", true},
345348
{"rsmi_measure_pcie_speeds", true},

src/btop_draw.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2347,7 +2347,7 @@ namespace Draw {
23472347
auto swap_disk = Config::getB("swap_disk");
23482348
auto mem_graphs = Config::getB("mem_graphs");
23492349

2350-
width = round((double)Term::width * (Proc::shown ? width_p : 100) / 100);
2350+
width = Config::getB("proc_box_wide") ? min_width : round((double)Term::width * (Proc::shown ? width_p : 100) / 100);
23512351
#ifdef GPU_SUPPORT
23522352
height = ceil((double)Term::height * (100 - Net::height_p * Net::shown*4 / ((Gpu::shown != 0 and Cpu::shown) + 4)) / 100) - Cpu::height - Gpu::total_height;
23532353
#else
@@ -2411,7 +2411,7 @@ namespace Draw {
24112411
//* Calculate and draw net box outlines
24122412
if (Net::shown) {
24132413
using namespace Net;
2414-
width = round((double)Term::width * (Proc::shown ? width_p : 100) / 100);
2414+
width = Config::getB("proc_box_wide") ? min_width : round((double)Term::width * (Proc::shown ? width_p : 100) / 100);
24152415
#ifdef GPU_SUPPORT
24162416
height = Term::height - Cpu::height - Gpu::total_height - Mem::height;
24172417
#else

src/btop_menu.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,11 @@ namespace Menu {
795795
"",
796796
"Show proc box on left side of screen",
797797
"instead of right."},
798+
{"proc_box_wide",
799+
"Wider proc box.",
800+
"",
801+
"The proc box with be wider when the",
802+
"net or mem boxes are shown."},
798803
{"graph_symbol_proc",
799804
"Graph symbol to use for graphs in proc box.",
800805
"",

0 commit comments

Comments
 (0)