diff options
author | David Robillard <d@drobilla.net> | 2023-01-12 15:30:44 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-01-14 11:53:28 -0500 |
commit | 1e48f8bbfdb0f1ce2f9132d604405fb72d160d9d (patch) | |
tree | 2fbb2e70f5bf5e7f7e021dafb51dd508944426f2 /examples/pugl_management_demo.c | |
parent | bd4f79646f623e929e6aa22bea028952b515aeef (diff) | |
download | pugl-1e48f8bbfdb0f1ce2f9132d604405fb72d160d9d.tar.gz pugl-1e48f8bbfdb0f1ce2f9132d604405fb72d160d9d.tar.bz2 pugl-1e48f8bbfdb0f1ce2f9132d604405fb72d160d9d.zip |
Windows: Add PUGL_DARK_FRAME hint
This allows dark applications to visually integrate more nicely in Windows 10.
A little thing, but it really goes a long way to make programs not look out of
place and half-baked.
Diffstat (limited to 'examples/pugl_management_demo.c')
-rw-r--r-- | examples/pugl_management_demo.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/examples/pugl_management_demo.c b/examples/pugl_management_demo.c index 30a026e..766bee1 100644 --- a/examples/pugl_management_demo.c +++ b/examples/pugl_management_demo.c @@ -50,20 +50,20 @@ onExpose(PuglView* const view, const PuglExposeEvent* const event) cairo_clip_preserve(cr); // Draw background - cairo_set_source_rgb(cr, 0.2, 0.2, 0.2); + cairo_set_source_rgb(cr, 0.1, 0.1, 0.1); cairo_set_line_width(cr, 4.0); cairo_fill(cr); // Set up text renering char buf[128] = {0}; cairo_text_extents_t extents = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; - cairo_set_font_size(cr, 32.0); + cairo_set_font_size(cr, 30.0); // Draw time label snprintf(buf, sizeof(buf), "Draw time: %g", puglGetTime(world)); cairo_text_extents(cr, buf, &extents); cairo_move_to(cr, cx - extents.width / 2.0, cy + extents.height / 2.0 - 48.0); - cairo_set_source_rgb(cr, 1.0, 1.0, 1.0); + cairo_set_source_rgb(cr, 0.9, 0.9, 0.9); cairo_show_text(cr, buf); // Draw style label @@ -112,13 +112,15 @@ toggleDialog(DemoApp* const app) puglSetHandle(app->dialogView.view, &app->dialogView); puglSetTransientParent(app->dialogView.view, puglGetNativeView(app->mainView.view)); + + puglSetViewString(app->dialogView.view, PUGL_WINDOW_TITLE, "Dialog"); + puglSetViewHint(app->dialogView.view, PUGL_DARK_FRAME, PUGL_TRUE); puglSetSizeHint(app->dialogView.view, PUGL_DEFAULT_SIZE, 320, 240); puglSetSizeHint(app->dialogView.view, PUGL_MIN_SIZE, 160, 120); puglSetViewHint(app->dialogView.view, PUGL_IGNORE_KEY_REPEAT, true); puglSetViewHint(app->dialogView.view, PUGL_RESIZABLE, true); puglSetViewHint( app->dialogView.view, PUGL_VIEW_TYPE, PUGL_VIEW_TYPE_DIALOG); - puglSetViewString(app->dialogView.view, PUGL_WINDOW_TITLE, "Dialog"); } return puglShow(app->dialogView.view, PUGL_SHOW_RAISE); @@ -240,6 +242,7 @@ main(int argc, char** argv) puglSetHandle(app.mainView.view, &app.mainView); puglSetSizeHint(app.mainView.view, PUGL_DEFAULT_SIZE, 640, 480); puglSetSizeHint(app.mainView.view, PUGL_MIN_SIZE, 320, 240); + puglSetViewHint(app.mainView.view, PUGL_DARK_FRAME, PUGL_TRUE); puglSetViewHint(app.mainView.view, PUGL_IGNORE_KEY_REPEAT, true); puglSetViewHint(app.mainView.view, PUGL_RESIZABLE, true); puglSetViewHint(app.mainView.view, PUGL_VIEW_TYPE, PUGL_VIEW_TYPE_NORMAL); |