1#ifndef YAZE_APP_GUI_CORE_UI_CONFIG_H_
2#define YAZE_APP_GUI_CORE_UI_CONFIG_H_
6#include "imgui/imgui.h"
100 const ImVec2 work = ImGui::GetMainViewport()->WorkSize;
101 return ImVec2(work.x * width_factor, work.y * height_factor);
111 float height_factor = 0.65f) {
131 float max_factor = 0.95f) {
132 const ImVec2 work = ImGui::GetMainViewport()->WorkSize;
133 ImVec2 max_size(work.x * max_factor, work.y * max_factor);
135 max_size.x = std::max(max_size.x, min_size.x);
136 max_size.y = std::max(max_size.y, min_size.y);
137 return {min_size, max_size};
148inline ImVec2
ScaledSize(
float base_width,
float base_height) {
149 const float scale = ImGui::GetIO().FontGlobalScale;
150 return ImVec2(base_width * scale, base_height * scale);
169 const ImVec2 avail = ImGui::GetContentRegionAvail();
170 return ImVec2(std::max(avail.x, min_size.x), std::max(avail.y, min_size.y));
Graphical User Interface (GUI) components for the application.
SizeConstraints ConstrainToViewport(ImVec2 min_size, float max_factor=0.95f)
ImVec2 ViewportRelativeSize(float width_factor, float height_factor)
Returns an ImVec2 sized as a fraction of the main viewport WorkSize.
ImVec2 ScaledSize(float base_width, float base_height)
Returns a DPI-scaled version of a fixed pixel size.
ImVec2 DialogSize(float width_factor=0.6f, float height_factor=0.65f)
Returns a standard dialog size as a fraction of the viewport.
ImVec2 GetContentRegionAvailClamped(const ImVec2 &min_size)
Returns content region available size clamped to a minimum.
Returns min/max size pair suitable for ImGui::SetNextWindowSizeConstraints.
Centralized UI dimension constants.
static constexpr float kPanelWidthSettings
static constexpr float kPanelWidthHelp
static constexpr float kPanelMinWidthProject
static constexpr float kHeaderButtonSpacing
static constexpr float kStatusBarHeight
static constexpr float kPanelMinWidthHelp
static constexpr float kIconButtonLarge
static constexpr float kContentMinHeightCanvas
static constexpr float kIconButtonSmall
static constexpr float kPanelWidthNotifications
static constexpr float kActivityBarIconWidth
static constexpr float kPanelWidthMedium
static constexpr float kAnimationSnapThreshold
static constexpr float kPanelMinWidthNotifications
static constexpr float kPanelMinWidthAgentChat
static constexpr float kContentMinHeightChat
static constexpr float kPanelPaddingSmall
static constexpr float kPanelPaddingLarge
static constexpr float kPanelWidthNarrow
static constexpr float kHeaderButtonGap
static constexpr float kMaxPanelWidthRatio
static constexpr float kActivityBarWidth
static constexpr float kAnimationSpeed
static constexpr float kPanelMinWidthSettings
static constexpr float kPanelPaddingMedium
static constexpr float kPanelWidthProject
static constexpr float kSplitterWidth
static constexpr float kIconButtonMedium
static constexpr float kPanelMinWidthProposals
static constexpr float kContentMinWidthSidebar
static constexpr float kPanelHeaderHeight
static constexpr float kPanelMinWidthAbsolute
static constexpr float kIconButtonToolbar
static constexpr float kPanelWidthWide
static constexpr float kContentMinHeightList
static constexpr float kPanelMinWidthProperties
static constexpr float kPanelWidthProposals
static constexpr float kActivityBarIconHeight
static constexpr float kPanelWidthProperties
static constexpr float kPanelWidthAgentChat