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 /src/ui/widget.c | |
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 'src/ui/widget.c')
-rw-r--r-- | src/ui/widget.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ui/widget.c b/src/ui/widget.c index ddb3f092..b60c67e3 100644 --- a/src/ui/widget.c +++ b/src/ui/widget.c | |||
@@ -149,6 +149,8 @@ void setPos_Widget(iWidget *d, iInt2 pos) { | |||
149 | } | 149 | } |
150 | 150 | ||
151 | void setSize_Widget(iWidget *d, iInt2 size) { | 151 | void setSize_Widget(iWidget *d, iInt2 size) { |
152 | if (size.x < 0) size.x = d->rect.size.x; | ||
153 | if (size.y < 0) size.y = d->rect.size.y; | ||
152 | d->rect.size = size; | 154 | d->rect.size = size; |
153 | setFlags_Widget(d, fixedSize_WidgetFlag, iTrue); | 155 | setFlags_Widget(d, fixedSize_WidgetFlag, iTrue); |
154 | } | 156 | } |