Smallcase folders part 1
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "Display/Graphics/Framebuffer.h"
|
||||
#include "Display/Graphics/Color.h"
|
||||
#include "Display/UI/Text/Renderer.h"
|
||||
#include "Display/UI/Bar/Bar.h"
|
||||
#include "Metrics/Host.h"
|
||||
|
||||
namespace display::ui::hostblock
|
||||
{
|
||||
// ===== Layout =====
|
||||
constexpr int BLOCK_WIDTH = 118; // 118
|
||||
constexpr int BLOCK_HEIGHT = 146; // 146
|
||||
constexpr int PADDING = 5; // 5
|
||||
|
||||
constexpr int HEADER_HEIGHT = 12; // 12
|
||||
constexpr std::string_view HEADER_FONT_NAME = "PixelFive-Regular";
|
||||
constexpr int HEADER_FONT_SIZE = 5; // 10
|
||||
constexpr int SECTION_GAP = 4; // 4
|
||||
|
||||
// ===== CPU bars =====
|
||||
constexpr int CPU_BAR_WIDTH = 10; // 10
|
||||
constexpr int CPU_BAR_GAP = 4; // 4
|
||||
constexpr int CPU_BAR_HEIGHT = 16; // 16
|
||||
constexpr int CPU_MAX_PER_ROW = 8; // 8
|
||||
constexpr int CPU_ROWS = 2; // 2
|
||||
|
||||
// ===== Memory bar =====
|
||||
constexpr int MEM_BAR_HEIGHT = 11; // 8
|
||||
constexpr int MEM_BAR_TEXT_PADDING_X = PADDING + 3;
|
||||
|
||||
class HostBlock
|
||||
{
|
||||
public:
|
||||
HostBlock();
|
||||
|
||||
static constexpr int width() { return BLOCK_WIDTH; }
|
||||
static constexpr int height() { return BLOCK_HEIGHT; }
|
||||
|
||||
void draw(
|
||||
display::graphics::Framebuffer &fb,
|
||||
display::ui::text::Renderer &text,
|
||||
int x, int y,
|
||||
const std::string &hostname,
|
||||
const metrics::Host &metrics);
|
||||
|
||||
private:
|
||||
display::ui::bar::Bar cpuBar;
|
||||
display::ui::bar::Bar memBar;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user