feat: screenshot app improvement, WIndow Server supports full-screen overlay, Disks app UI improvements

This commit is contained in:
2026-05-10 10:45:05 +02:00
parent 60ee905552
commit dcdbcac1e0
29 changed files with 1483 additions and 395 deletions
+15 -27
View File
@@ -25,29 +25,17 @@ using namespace gui;
static constexpr int INIT_W = 640;
static constexpr int INIT_H = 460;
static constexpr int TOOLBAR_H = 40;
static constexpr int HEADER_H = 26;
static constexpr int TOOLBAR_H = 44;
static constexpr int HEADER_H = 28;
static constexpr int ITEM_H = 32;
static constexpr int MAP_H = 48;
static constexpr int MAP_PAD = 16;
static constexpr int MAX_PARTS = 32;
static constexpr int MAX_DISKS = 8;
static constexpr int STATUS_H = 26;
static constexpr int STATUS_H = 44;
static constexpr int TB_BTN_Y = 7;
static constexpr int TB_BTN_H = 26;
static constexpr int TB_BTN_RAD = 6;
static constexpr Color BG_COLOR = Color::from_rgb(0xFF, 0xFF, 0xFF);
static constexpr Color TOOLBAR_BG = Color::from_rgb(0xF5, 0xF5, 0xF5);
static constexpr Color HEADER_BG = Color::from_rgb(0xF0, 0xF0, 0xF0);
static constexpr Color BORDER_COLOR = Color::from_rgb(0xCC, 0xCC, 0xCC);
static constexpr Color TEXT_COLOR = Color::from_rgb(0x22, 0x22, 0x22);
static constexpr Color DIM_TEXT = Color::from_rgb(0x66, 0x66, 0x66);
static constexpr Color FAINT_TEXT = Color::from_rgb(0x88, 0x88, 0x88);
static constexpr Color HOVER_BG = Color::from_rgb(0xE8, 0xF0, 0xF8);
static constexpr Color STATUS_BG_COL = Color::from_rgb(0xF0, 0xF0, 0xF0);
static constexpr Color WHITE = Color::from_rgb(0xFF, 0xFF, 0xFF);
static constexpr int TB_BTN_H = 30;
static constexpr int NUM_PART_COLORS = 8;
@@ -119,6 +107,7 @@ struct DiskToolState {
extern int g_win_w, g_win_h;
extern DiskToolState g_state;
extern Color g_accent;
// ============================================================================
// Partition colors
@@ -133,33 +122,34 @@ extern const Color part_colors[NUM_PART_COLORS];
inline int disk_button_width(int idx) {
char label[8];
snprintf(label, sizeof(label), "Disk %d", idx);
return text_width(label) + 16;
return text_width(label) + 20;
}
inline Rect toolbar_disk_button_rect(int idx) {
int bx = 8;
for (int i = 0; i < idx; i++)
bx += disk_button_width(i) + 6;
bx += disk_button_width(i) + 8;
return {bx, TB_BTN_Y, disk_button_width(idx), TB_BTN_H};
}
inline Rect toolbar_refresh_button_rect() {
return {g_win_w - 8 - 64, TB_BTN_Y, 64, TB_BTN_H};
int y = g_win_h - STATUS_H + (STATUS_H - TB_BTN_H) / 2;
return {g_win_w - 12 - 84, y, 84, TB_BTN_H};
}
inline Rect toolbar_mount_button_rect() {
Rect refresh = toolbar_refresh_button_rect();
return {refresh.x - 6 - 60, TB_BTN_Y, 60, TB_BTN_H};
return {refresh.x - 8 - 72, refresh.y, 72, TB_BTN_H};
}
inline Rect toolbar_format_button_rect() {
Rect mount = toolbar_mount_button_rect();
return {mount.x - 6 - 64, TB_BTN_Y, 64, TB_BTN_H};
return {mount.x - 8 - 72, mount.y, 72, TB_BTN_H};
}
inline Rect toolbar_newpart_button_rect() {
Rect format = toolbar_format_button_rect();
return {format.x - 6 - 74, TB_BTN_Y, 74, TB_BTN_H};
return {format.x - 8 - 96, format.y, 96, TB_BTN_H};
}
inline int content_title_y() {
@@ -188,15 +178,13 @@ inline Rect format_option_rect(int dialog_w, int index) {
inline Rect dialog_primary_button_rect(int dialog_w, int dialog_h) {
int btn_w = 90;
int btn_h = 30;
int gap = 16;
int total_w = btn_w * 2 + gap;
int bx = (dialog_w - total_w) / 2;
return {bx, dialog_h - btn_h - 16, btn_w, btn_h};
int bx = dialog_w - btn_w - 16;
return {bx, dialog_h - btn_h - 12, btn_w, btn_h};
}
inline Rect dialog_secondary_button_rect(int dialog_w, int dialog_h) {
Rect primary = dialog_primary_button_rect(dialog_w, dialog_h);
return {primary.x + primary.w + 16, primary.y, primary.w, primary.h};
return {primary.x - 8 - primary.w, primary.y, primary.w, primary.h};
}
// ============================================================================