diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-11 21:53:31 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-02-11 21:53:31 +0200 |
commit | 73c8166d5c8b397c166ee9ece0173f2b278b6ddb (patch) | |
tree | c365e8d387a0d1a02e0de69209d3f80164443157 /CMakeLists.txt | |
parent | bfdda501cb01df95c968c9f5378bb91cd66eea87 (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.txt | 6 |
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 | |||
33 | option (ENABLE_WINDOWPOS_FIX "Set position after showing window (workaround for SDL bug)" OFF) | 33 | option (ENABLE_WINDOWPOS_FIX "Set position after showing window (workaround for SDL bug)" OFF) |
34 | option (ENABLE_IDLE_SLEEP "While idle, sleep in the main thread instead of waiting for events" ON) | 34 | option (ENABLE_IDLE_SLEEP "While idle, sleep in the main thread instead of waiting for events" ON) |
35 | option (ENABLE_DOWNLOAD_EDIT "Allow changing the Downloads directory" ON) | 35 | option (ENABLE_DOWNLOAD_EDIT "Allow changing the Downloads directory" ON) |
36 | option (ENABLE_CUSTOM_FRAME "Draw a custom window frame (Windows)" OFF) | ||
36 | 37 | ||
37 | include (BuildType.cmake) | 38 | include (BuildType.cmake) |
38 | include (res/Embed.cmake) | 39 | include (res/Embed.cmake) |
@@ -220,6 +221,9 @@ endif () | |||
220 | if (ENABLE_DOWNLOAD_EDIT) | 221 | if (ENABLE_DOWNLOAD_EDIT) |
221 | target_compile_definitions (app PUBLIC LAGRANGE_DOWNLOAD_EDIT=1) | 222 | target_compile_definitions (app PUBLIC LAGRANGE_DOWNLOAD_EDIT=1) |
222 | endif () | 223 | endif () |
224 | if (ENABLE_CUSTOM_FRAME AND MSYS) | ||
225 | target_compile_definitions (app PUBLIC LAGRANGE_CUSTOM_FRAME=1) | ||
226 | endif () | ||
223 | target_link_libraries (app PUBLIC the_Foundation::the_Foundation) | 227 | target_link_libraries (app PUBLIC the_Foundation::the_Foundation) |
224 | target_link_libraries (app PUBLIC ${SDL2_LDFLAGS}) | 228 | target_link_libraries (app PUBLIC ${SDL2_LDFLAGS}) |
225 | if (APPLE) | 229 | if (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 () |