summaryrefslogtreecommitdiffstats
path: root/src/btop_tools.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/btop_tools.cpp')
-rw-r--r--src/btop_tools.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/btop_tools.cpp b/src/btop_tools.cpp
index 648cf64..75adae9 100644
--- a/src/btop_tools.cpp
+++ b/src/btop_tools.cpp
@@ -103,21 +103,27 @@ namespace Term {
bool mem = boxes.find("mem") != string::npos;
bool net = boxes.find("net") != string::npos;
bool proc = boxes.find("proc") != string::npos;
- int gpu = 0;
+ #ifdef GPU_SUPPORT
+ int gpu = 0;
if (not Gpu::gpu_names.empty())
for (char i = '0'; i <= '5'; ++i)
gpu += (boxes.find(std::string("gpu") + i) != string::npos);
+ #endif
int width = 0;
if (mem) width = Mem::min_width;
else if (net) width = Mem::min_width;
width += (proc ? Proc::min_width : 0);
if (cpu and width < Cpu::min_width) width = Cpu::min_width;
+ #ifdef GPU_SUPPORT
if (gpu != 0 and width < Gpu::min_width) width = Gpu::min_width;
+ #endif
int height = (cpu ? Cpu::min_height : 0);
if (proc) height += Proc::min_height;
else height += (mem ? Mem::min_height : 0) + (net ? Net::min_height : 0);
+ #ifdef GPU_SUPPORT
height += Gpu::min_height*gpu;
+ #endif
return { width, height };
}