feat: screenshot app improvement, WIndow Server supports full-screen overlay, Disks app UI improvements
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "disks.h"
|
||||
#include <gui/mtk/settings.hpp>
|
||||
#include <gui/standalone.hpp>
|
||||
|
||||
// ============================================================================
|
||||
@@ -15,6 +16,7 @@ int g_win_w = INIT_W;
|
||||
int g_win_h = INIT_H;
|
||||
|
||||
DiskToolState g_state;
|
||||
Color g_accent = colors::ACCENT;
|
||||
|
||||
const Color part_colors[NUM_PART_COLORS] = {
|
||||
Color::from_rgb(0x42, 0x7A, 0xB5),
|
||||
@@ -73,7 +75,6 @@ static bool handle_toolbar_click(int mx, int my) {
|
||||
|
||||
auto& dt = g_state;
|
||||
if (dt.disk_count == 0) return false;
|
||||
bool has_sel = dt.selected_part >= 0;
|
||||
|
||||
// Disk selector buttons
|
||||
for (int i = 0; i < dt.disk_count; i++) {
|
||||
@@ -85,7 +86,16 @@ static bool handle_toolbar_click(int mx, int my) {
|
||||
}
|
||||
}
|
||||
|
||||
// Right-side buttons (must match render layout)
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool handle_action_click(int mx, int my) {
|
||||
if (my < g_win_h - STATUS_H) return false;
|
||||
|
||||
auto& dt = g_state;
|
||||
if (dt.disk_count == 0) return false;
|
||||
bool has_sel = dt.selected_part >= 0;
|
||||
|
||||
if (toolbar_refresh_button_rect().contains(mx, my)) {
|
||||
disktool_refresh();
|
||||
set_status("Refreshed");
|
||||
@@ -285,7 +295,9 @@ static bool handle_mouse(const Montauk::WinEvent& ev) {
|
||||
|
||||
bool clicked = (ev.mouse.buttons & 1) && !(ev.mouse.prev_buttons & 1);
|
||||
if (clicked) {
|
||||
if (handle_toolbar_click(ev.mouse.x, ev.mouse.y) || handle_content_click(ev.mouse.x, ev.mouse.y))
|
||||
if (handle_toolbar_click(ev.mouse.x, ev.mouse.y) ||
|
||||
handle_action_click(ev.mouse.x, ev.mouse.y) ||
|
||||
handle_content_click(ev.mouse.x, ev.mouse.y))
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -365,6 +377,8 @@ extern "C" void _start() {
|
||||
if (!fonts::init())
|
||||
montauk::exit(1);
|
||||
|
||||
g_accent = mtk::load_system_accent();
|
||||
|
||||
disktool_refresh();
|
||||
|
||||
WsWindow win;
|
||||
|
||||
Reference in New Issue
Block a user