summaryrefslogtreecommitdiff
path: root/applications/goldman/source/window.cpp
diff options
context:
space:
mode:
authorBenji Dial <benji@benjidial.net>2024-07-29 23:03:57 -0400
committerBenji Dial <benji@benjidial.net>2024-07-29 23:03:57 -0400
commit6cf7cd267b50fa68d7531655911620f17dde4a63 (patch)
treee936ab19c3176d1c5eced6e17847550ed1f420e3 /applications/goldman/source/window.cpp
parentc34b9191f258ddc15c5b45c000cd0266aed9dead (diff)
downloadhilbert-os-6cf7cd267b50fa68d7531655911620f17dde4a63.tar.gz
window moving and focusing
Diffstat (limited to 'applications/goldman/source/window.cpp')
-rw-r--r--applications/goldman/source/window.cpp5
1 files changed, 5 insertions, 0 deletions
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<daguerre::hilbert_color>(width + 4, height + 18);
contents = daguerre::image<daguerre::hilbert_color>(
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;