vshell.h Header
Apps › Core
Types
| struct | TabPane | A tab that an app adds to the shell, paired with the pane that it shows, for wire_main_window_shell(). |
| class | WindowTabs | Controller that keeps one window tab active and shows only that tab's pane. |
Functions
| std::shared_ptr<WindowTabs> | wire_main_window_shell(VApp & app, const std::string & root = "App", const std::string & window_name = "Main Window", const std::vector<TabPane> & extra_tabs = {}, const std::vector<TabPane> & extra_settings_tabs = {}) |
| void | wire_update_prompt(VApp & app, const std::string & root = "App", const std::string & window_name = "Main Window") |
| void | build_app(VApp & app) |
Function Documentation
std::shared_ptr<WindowTabs> wire_main_window_shell(VApp & app, const std::string & root = "App", const std::string & window_name = "Main Window", const std::vector<TabPane> & extra_tabs = {}, const std::vector<TabPane> & extra_settings_tabs = {})
Wires the shell that every Vortex app shares: the Main Window's tabs, its Settings Menu, and the dialogs beside the window.
Call it from build_app(), then add the
app's own content and handlers. It wires:
App Pane and Settings Menuwire_update_prompt()Both tab groups start on their App tab. The dialogs are top-level widgets that the app adds beside its window in its root style, and an app can leave either one out:
App << Vortex/App:
Demo Window << Demo Window
Theme Directories Dialog << Vortex/Theme Directories Dialog
Update Dialog << Vortex/Update Dialog
Returns the titlebar's WindowTabs, so that the
app can add the tabs that it creates at runtime. An app that only has
fixed tabs can ignore it.
root is the name of the app's root style.window_name is the name of the window under root, a style that
inherits Vortex/Main Window, like "Demo Window".extra_tabs are the app's own titlebar tabs. Each tab goes under
the window's Titlebar/Right Tabs, and its pane goes directly
under the window.extra_settings_tabs are the app's own Settings Menu tabs. Each
tab goes under the menu's Sidebar, and its pane goes directly
under the Settings Menu. They appear after the App and
Appearance tabs.void wire_update_prompt(VApp & app, const std::string & root = "App", const std::string & window_name = "Main Window")
Wires the update prompt: the Update Dialog, and the Version section of the Settings Menu's App pane.
wire_main_window_shell()
calls this, so only an app that skips the shell needs to manually call
it. root and window_name work the same as there.
The Version section shows the app's version, like "Version 1.2.0",
or "Development Build" when
VApp::app_version() is empty.
Update checks only run when the app sets a manifest URL, like
updateManifestUrl in
DesktopAppConfig. Without one, the
section's Check for Updates button is hidden and nothing is fetched.
With one:
updateCheckHours, and opens the dialog only for a newer release
that the user hasn't skipped| Dialog button | Action |
|---|---|
| Download | Opens the download URL and closes the dialog |
| Release Notes | Opens the release notes URL |
| Skip This Version | Saves the version as skipped and closes |
| Later or Close | Closes the dialog |
void build_app(VApp & app)
Builds the app's UI, once at startup.
Each app defines this function, and each platform's runner calls it,
like run_desktop() on desktop. A
definition sets the root style, wires the shell, and then adds the
app's own content and handlers, like the demo app's does:
void Vortex::build_app(VApp& app)
{
app.set_root_style("App");
wire_main_window_shell(app, "App", "Demo Window");
}