Title bar
title_bar draws the whole strip, with a title, a status line and three window controls, and returns a ui::chrome saying which control was pressed or whether the strip is being dragged. With isolen_app_desc::chrome on, the shell already calls it every frame before your view runs, so an app under isolen_run never calls it. It is public for a host that drives ui::begin and ui::end itself and wants the same strip.
The short overload draws the bar with the kit's own buttons, as a borderless window needs. A second overload takes a ui::chrome_frame for native chrome: its mode says whether the kit draws the buttons (chrome_drawn), leaves room for the mac traffic lights (chrome_os_buttons) or paints buttons the system hit tests on Windows (chrome_kit_buttons), and its left, right and bar_h keep the title clear of the system buttons on their physical side, even in a right to left ui. The returned ui::chrome also carries drag_box, min_box, max_box and close_box, which a host passes to window_set_caption. See window chrome for the full frame and a host that fills it.
float ui::title_bar_height(const ctx* u, const chrome_frame& f) is the height of the whole bar with its rule, known before the bar is declared. The shell uses it at the start of each frame to set the overlay area below the bar.
#include "isolenui/ui/ui.h"
#include "isolenui/kit/kit.h"
// isolen_app_desc::chrome true, the default, already makes the engine call
// title_bar itself once per frame, so a view under isolen_run never calls
// this. it is here for a host that drives ui::begin and ui::end on its own,
// outside isolen_app entirely, and wants the same title bar
static void host_frame_chrome(ui::ctx* u, bool* quit, gfx_svg minimise_icon,
gfx_svg maximise_icon, gfx_svg close_icon)
{
const ui::chrome c = ui::title_bar(u, "isolen ui", "vulkan, 60 fps",
minimise_icon, maximise_icon,
close_icon);
if (c.close) {
*quit = true;
}
}