From 4e1ae87a8e69056725ede066d6694e33f6083904 Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Sat, 10 Aug 2024 07:06:20 +0200 Subject: [PATCH] Del popup window --- src/text_editor/management.cpp | 1 - src/text_editor/window.cpp | 40 ---------------------------------- 2 files changed, 41 deletions(-) diff --git a/src/text_editor/management.cpp b/src/text_editor/management.cpp index 15ee68e..e67e41b 100644 --- a/src/text_editor/management.cpp +++ b/src/text_editor/management.cpp @@ -10,7 +10,6 @@ WindowID NullWindowID; BufferID NullBufferID; ViewID NullViewID; WindowID CommandWindowID; -WindowID PopupWindowID; WindowID DebugWindowID; WindowID ConsoleWindowID; diff --git a/src/text_editor/window.cpp b/src/text_editor/window.cpp index 40f9a68..b5160d9 100644 --- a/src/text_editor/window.cpp +++ b/src/text_editor/window.cpp @@ -217,28 +217,6 @@ void InitWindows() { CommandWindowID = window_id; } - { - Window *w = CreateWindow(); - WindowID window_id = w->id; - PopupWindowID = window_id; - w->draw_scrollbar = false; - w->draw_line_numbers = false; - w->visible = false; - w->dont_save_in_active_window_history = true; - w->invisible_when_inactive = true; - w->absolute_position = true; - w->deactivate_on_escape = true; - w->z = 2; - Buffer *b = CreateBuffer(sys_allocator, BuffCWD("+popup")); - b->no_history = true; - View *v = CreateView(b->id); - w->active_view = v->id; - - Window *titlebar = CreateTitlebar(window_id); - titlebar->z = 2; - SetVisibility(window_id, false); - } - SetActiveWindow({0}); } @@ -330,22 +308,4 @@ void LayoutWindows() { window->document_rect = window->total_rect; } } - - { - Window *window = GetWindow(PopupWindowID); - Rect2 screen_rect = GetScreenRectF(); - Vec2 size = GetSize(screen_rect); - - Rect2 a = CutRight(&screen_rect, 0.3f * size.x); - Rect2 b = CutBottom(&a, 0.15f * size.y); - Rect2 c = Shrink(b, 20); - - window->total_rect = ToRect2I(c); - - Window *title_bar_window = GetWindow(window->title_bar_window); - title_bar_window->total_rect = CutBottom(&window->total_rect, GetTitleBarSize(title_bar_window)); - title_bar_window->document_rect = title_bar_window->total_rect; - - window->document_rect = window->total_rect; - } } \ No newline at end of file