From b93cdd8f4cfc367e3959b0dba0bc936eb7083ca5 Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Thu, 1 Aug 2024 08:20:58 +0200 Subject: [PATCH] Title bar adjust looks --- build_file.cpp | 7 ++++--- src/text_editor/generated.cpp | 12 ++++++------ src/text_editor/window.cpp | 18 +++++++++--------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/build_file.cpp b/build_file.cpp index d436e43..51d0468 100644 --- a/build_file.cpp +++ b/build_file.cpp @@ -373,9 +373,10 @@ void GenerateConfig() { colors.add({"ScrollbarScroller" , "GruvboxLight1"}); colors.add({"ScrollbarScrollerSelected", "GruvboxLight0Hard"}); - colors.add({"TitleBarText" , "GruvboxDark0Hard"}); - colors.add({"TitleBarBackground" , "GruvboxLight2"}); - colors.add({"TitleBarSelection" , "GruvboxLight1"}); + colors.add({"TitleBarText" , "GruvboxDark2"}); + colors.add({"TitleBarBackground" , "GruvboxLight1"}); + colors.add({"TitleBarSelection" , "GruvboxLight3"}); + // clang-format on { diff --git a/src/text_editor/generated.cpp b/src/text_editor/generated.cpp index 4367139..a2c4906 100644 --- a/src/text_editor/generated.cpp +++ b/src/text_editor/generated.cpp @@ -47,9 +47,9 @@ Color ColorWhitespaceDuringSelection = GruvboxLight4; Color ColorScrollbarBackground = GruvboxLight2; Color ColorScrollbarScroller = GruvboxLight1; Color ColorScrollbarScrollerSelected = GruvboxLight0Hard; -Color ColorTitleBarText = GruvboxDark0Hard; -Color ColorTitleBarBackground = GruvboxLight2; -Color ColorTitleBarSelection = GruvboxLight1; +Color ColorTitleBarText = GruvboxDark2; +Color ColorTitleBarBackground = GruvboxLight1; +Color ColorTitleBarSelection = GruvboxLight3; String BaseLuaConfig = R"==( local GruvboxDark0Hard = 0x1d2021ff local GruvboxDark0 = 0x282828ff @@ -101,9 +101,9 @@ Color.WhitespaceDuringSelection = GruvboxLight4 Color.ScrollbarBackground = GruvboxLight2 Color.ScrollbarScroller = GruvboxLight1 Color.ScrollbarScrollerSelected = GruvboxLight0Hard -Color.TitleBarText = GruvboxDark0Hard -Color.TitleBarBackground = GruvboxLight2 -Color.TitleBarSelection = GruvboxLight1 +Color.TitleBarText = GruvboxDark2 +Color.TitleBarBackground = GruvboxLight1 +Color.TitleBarSelection = GruvboxLight3 -- @todo: should we rewrite linux paths to windows on windows and vice-versa? diff --git a/src/text_editor/window.cpp b/src/text_editor/window.cpp index 0fcaf8b..123465d 100644 --- a/src/text_editor/window.cpp +++ b/src/text_editor/window.cpp @@ -7,9 +7,9 @@ Array GetWindowZOrder(Allocator allocator) { } Window *CreateInfobar(Window *parent_window) { - Window *window = CreateWindow(); - window->draw_scrollbar = false; - window->draw_line_numbers = false; + Window *window = CreateWindow(); + window->draw_scrollbar = false; + // window->draw_line_numbers = false; window->dont_save_in_active_window_history = true; window->deactivate_on_escape = true; window->is_title_bar = true; @@ -34,10 +34,10 @@ void InitWindows(View *null_view) { Allocator sys_allocator = GetSystemAllocator(); { - Window *window = CreateWindow(); - window->draw_line_numbers = false; - Buffer *buffer = CreateBuffer(sys_allocator, "*load_text_a*"); - View *view = CreateView(buffer->id); + Window *window = CreateWindow(); + // window->draw_line_numbers = false; + Buffer *buffer = CreateBuffer(sys_allocator, "*load_text_a*"); + View *view = CreateView(buffer->id); LoadTextA(buffer); LoadUnicode(buffer); window->active_view = view->id; @@ -138,7 +138,7 @@ void LayoutWindows() { int i = 0; Windows[i].total_rect = CutLeft(&screen_rect, (Int)((double)sizex * 0.5)); Window *title_bar_window = GetWindow(Windows[i].title_bar_window); - title_bar_window->total_rect = CutTop(&Windows[i].total_rect, FontLineSpacing); + title_bar_window->total_rect = CutBottom(&Windows[i].total_rect, FontLineSpacing); Windows[i].document_rect = Windows[i].total_rect; title_bar_window->document_rect = title_bar_window->total_rect; if (Windows[i].draw_scrollbar) Windows[i].scrollbar_rect = CutRight(&Windows[i].document_rect, (Int)ScrollBarSize); @@ -148,7 +148,7 @@ void LayoutWindows() { int i = 2; Windows[i].total_rect = CutLeft(&screen_rect, (Int)((double)sizex)); Window *title_bar_window = GetWindow(Windows[i].title_bar_window); - title_bar_window->total_rect = CutTop(&Windows[i].total_rect, FontLineSpacing); + title_bar_window->total_rect = CutBottom(&Windows[i].total_rect, FontLineSpacing); title_bar_window->document_rect = title_bar_window->total_rect; Windows[i].document_rect = Windows[i].total_rect; if (Windows[i].draw_scrollbar) Windows[i].scrollbar_rect = CutRight(&Windows[i].document_rect, (Int)ScrollBarSize);