summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-02-11 21:53:31 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-02-11 21:53:31 +0200
commit73c8166d5c8b397c166ee9ece0173f2b278b6ddb (patch)
treec365e8d387a0d1a02e0de69209d3f80164443157 /CMakeLists.txt
parentbfdda501cb01df95c968c9f5378bb91cd66eea87 (diff)
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.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
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
33option (ENABLE_WINDOWPOS_FIX "Set position after showing window (workaround for SDL bug)" OFF) 33option (ENABLE_WINDOWPOS_FIX "Set position after showing window (workaround for SDL bug)" OFF)
34option (ENABLE_IDLE_SLEEP "While idle, sleep in the main thread instead of waiting for events" ON) 34option (ENABLE_IDLE_SLEEP "While idle, sleep in the main thread instead of waiting for events" ON)
35option (ENABLE_DOWNLOAD_EDIT "Allow changing the Downloads directory" ON) 35option (ENABLE_DOWNLOAD_EDIT "Allow changing the Downloads directory" ON)
36option (ENABLE_CUSTOM_FRAME "Draw a custom window frame (Windows)" OFF)
36 37
37include (BuildType.cmake) 38include (BuildType.cmake)
38include (res/Embed.cmake) 39include (res/Embed.cmake)
@@ -220,6 +221,9 @@ endif ()
220if (ENABLE_DOWNLOAD_EDIT) 221if (ENABLE_DOWNLOAD_EDIT)
221 target_compile_definitions (app PUBLIC LAGRANGE_DOWNLOAD_EDIT=1) 222 target_compile_definitions (app PUBLIC LAGRANGE_DOWNLOAD_EDIT=1)
222endif () 223endif ()
224if (ENABLE_CUSTOM_FRAME AND MSYS)
225 target_compile_definitions (app PUBLIC LAGRANGE_CUSTOM_FRAME=1)
226endif ()
223target_link_libraries (app PUBLIC the_Foundation::the_Foundation) 227target_link_libraries (app PUBLIC the_Foundation::the_Foundation)
224target_link_libraries (app PUBLIC ${SDL2_LDFLAGS}) 228target_link_libraries (app PUBLIC ${SDL2_LDFLAGS})
225if (APPLE) 229if (APPLE)
@@ -233,7 +237,7 @@ if (APPLE)
233 target_link_options (app PUBLIC -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}) 237 target_link_options (app PUBLIC -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET})
234 endif () 238 endif ()
235 if (XCODE_DEVELOPMENT_TEAM) 239 if (XCODE_DEVELOPMENT_TEAM)
236 set_property (TARGET app PROPERTY 240 set_property (TARGET app PROPERTY
237 XCODE_ATTRIBUTE_DEVELOPMENT_TEAM ${XCODE_DEVELOPMENT_TEAM} 241 XCODE_ATTRIBUTE_DEVELOPMENT_TEAM ${XCODE_DEVELOPMENT_TEAM}
238 ) 242 )
239 endif () 243 endif ()