From 6cf7cd267b50fa68d7531655911620f17dde4a63 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Mon, 29 Jul 2024 23:03:57 -0400 Subject: window moving and focusing --- applications/goldman/source/window.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'applications/goldman/source/window.cpp') diff --git a/applications/goldman/source/window.cpp b/applications/goldman/source/window.cpp index fe5212a..3f122ca 100644 --- a/applications/goldman/source/window.cpp +++ b/applications/goldman/source/window.cpp @@ -11,12 +11,16 @@ daguerre::hilbert_color border_color_not_top; daguerre::hilbert_color title_color; void window::set_size(int width, int height) { + int center_x = x + contents_with_decorations. width / 2; + int center_y = y + contents_with_decorations.height / 2; contents_with_decorations = daguerre::image(width + 4, height + 18); contents = daguerre::image( width, height, &contents_with_decorations.at(2, 16), contents_with_decorations.buffer_pitch, false); + x = center_x - contents_with_decorations. width / 2; + y = center_y - contents_with_decorations.height / 2; } void title_converter( @@ -40,6 +44,7 @@ void window::draw_decorations(bool top) { static_assert( decorations_extra_width == 4); static_assert(decorations_extra_height == 18); + static_assert( title_height == 16); auto border_color = top ? border_color_top : border_color_not_top; -- cgit v1.2.3