feat: filesystem and Files app support for >64 file entries, 64-bit sizes, async ops, GUI toolkit improvements to devexplorer app
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include <montauk/heap.h>
|
||||
#include <gui/gui.hpp>
|
||||
#include <gui/truetype.hpp>
|
||||
#include <gui/mtk/widgets.hpp>
|
||||
|
||||
extern "C" {
|
||||
#include <string.h>
|
||||
@@ -107,6 +108,25 @@ struct DisplayRow {
|
||||
|
||||
static constexpr int MAX_DISPLAY_ROWS = MAX_TOTAL_DEVS + NUM_CATEGORIES;
|
||||
|
||||
// ============================================================================
|
||||
// Scroll metrics (pixel-space) — shared by render and input handling so the
|
||||
// draggable MTK scrollbar and the row layout stay in sync.
|
||||
// ============================================================================
|
||||
|
||||
struct ScrollMetrics {
|
||||
int list_y; // top of the scrollable list area
|
||||
int list_h; // viewport height (view extent)
|
||||
int total_h; // total content height (content extent)
|
||||
int max_scroll_px; // maximum pixel scroll offset
|
||||
int scroll_px; // current pixel scroll offset (derived from scroll_y)
|
||||
};
|
||||
|
||||
// Bounds of the toolbar "Refresh" button — shared by render and hit-testing.
|
||||
inline Rect refresh_button_rect() {
|
||||
constexpr int btn_w = 80, btn_h = 26;
|
||||
return { 8, (TOOLBAR_H - btn_h) / 2, btn_w, btn_h };
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Disk detail window
|
||||
// ============================================================================
|
||||
@@ -142,6 +162,14 @@ struct DevExplorerState {
|
||||
int last_click_row;
|
||||
uint64_t last_click_ms;
|
||||
|
||||
// Draggable MTK scrollbar interaction state
|
||||
int mouse_x, mouse_y; // last known pointer position (for hover)
|
||||
bool sb_hover; // pointer is over the scrollbar track
|
||||
bool sb_dragging; // thumb is being dragged
|
||||
int sb_drag_offset; // pointer offset from thumb top when drag began
|
||||
|
||||
bool btn_hover; // pointer is over the Refresh button
|
||||
|
||||
DiskDetailState detail;
|
||||
};
|
||||
|
||||
@@ -152,6 +180,7 @@ struct DevExplorerState {
|
||||
extern int g_win_w, g_win_h;
|
||||
extern DevExplorerState g_state;
|
||||
extern TrueTypeFont* g_font;
|
||||
extern mtk::Theme g_theme;
|
||||
|
||||
// ============================================================================
|
||||
// Function declarations — render.cpp
|
||||
@@ -165,6 +194,10 @@ void render(uint32_t* pixels);
|
||||
|
||||
int build_display_rows(DevExplorerState* de, DisplayRow* rows);
|
||||
int append_printer_devices(Montauk::DevInfo* out, int max_count);
|
||||
ScrollMetrics compute_scroll_metrics(DevExplorerState* de,
|
||||
const DisplayRow* rows, int row_count);
|
||||
void set_scroll_from_px(DevExplorerState* de, const DisplayRow* rows,
|
||||
int row_count, int target_px);
|
||||
|
||||
// ============================================================================
|
||||
// Function declarations — diskdetail.cpp
|
||||
|
||||
Reference in New Issue
Block a user