From 73c8166d5c8b397c166ee9ece0173f2b278b6ddb Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Thu, 11 Feb 2021 21:53:31 +0200 Subject: Windows: Experimenting with a custom window frame and title bar Added the build option ENABLE_CUSTOM_FRAME that causes the window to be created as borderless. Lagrange's own UI widgets are used to draw the title bar elements, including the window buttons. There is plenty of sizing behavior still missing, for instance snapping to fullscreen left/right side, double-clicking the frame edges, and proper maximize mode that doesn't cover the entire screen. The window system menu is also missing, but that can be shown manually when appropriate. A command-line option should also be provided to disable winbar in case the default title bar is required. --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index f8b0dd9b..38d36377 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,7 @@ option (ENABLE_RELATIVE_EMBED "Resources should always be found via relative p option (ENABLE_WINDOWPOS_FIX "Set position after showing window (workaround for SDL bug)" OFF) option (ENABLE_IDLE_SLEEP "While idle, sleep in the main thread instead of waiting for events" ON) option (ENABLE_DOWNLOAD_EDIT "Allow changing the Downloads directory" ON) +option (ENABLE_CUSTOM_FRAME "Draw a custom window frame (Windows)" OFF) include (BuildType.cmake) include (res/Embed.cmake) @@ -220,6 +221,9 @@ endif () if (ENABLE_DOWNLOAD_EDIT) target_compile_definitions (app PUBLIC LAGRANGE_DOWNLOAD_EDIT=1) endif () +if (ENABLE_CUSTOM_FRAME AND MSYS) + target_compile_definitions (app PUBLIC LAGRANGE_CUSTOM_FRAME=1) +endif () target_link_libraries (app PUBLIC the_Foundation::the_Foundation) target_link_libraries (app PUBLIC ${SDL2_LDFLAGS}) if (APPLE) @@ -233,7 +237,7 @@ if (APPLE) target_link_options (app PUBLIC -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}) endif () if (XCODE_DEVELOPMENT_TEAM) - set_property (TARGET app PROPERTY + set_property (TARGET app PROPERTY XCODE_ATTRIBUTE_DEVELOPMENT_TEAM ${XCODE_DEVELOPMENT_TEAM} ) endif () -- cgit v1.2.3