ui: Mae sure all theme scaling values are scaled correctly

This commit is contained in:
WerWolv
2023-03-18 10:52:50 +01:00
parent 1a1bf98905
commit 367bd76046
9 changed files with 86 additions and 86 deletions

View File

@@ -236,31 +236,31 @@ namespace hex::plugin::builtin {
{
auto &style = ImGui::GetStyle();
const static api::ThemeManager::StyleMap ImGuiStyleMap = {
{ "alpha", { &style.Alpha, 0.001F, 1.0F } },
{ "disabled-alpha", { &style.DisabledAlpha, 0.0F, 1.0F } },
{ "window-padding", { &style.WindowPadding, 0.0F, 20.0F } },
{ "window-rounding", { &style.WindowRounding, 0.0F, 12.0F } },
{ "window-border-size", { &style.WindowBorderSize, 0.0F, 1.0F } },
{ "window-min-size", { &style.WindowMinSize, 0.0F, 1000.0F } },
{ "window-title-align", { &style.WindowTitleAlign, 0.0F, 1.0F } },
{ "child-rounding", { &style.ChildRounding, 0.0F, 12.0F } },
{ "child-border-size", { &style.ChildBorderSize, 0.0F, 1.0F } },
{ "popup-rounding", { &style.PopupRounding, 0.0F, 12.0F } },
{ "popup-border-size", { &style.PopupBorderSize, 0.0F, 1.0F } },
{ "frame-padding", { &style.FramePadding, 0.0F, 20.0F } },
{ "frame-rounding", { &style.FrameRounding, 0.0F, 12.0F } },
{ "frame-border-size", { &style.FrameBorderSize, 0.0F, 1.0F } },
{ "item-spacing", { &style.ItemSpacing, 0.0F, 20.0F } },
{ "item-inner-spacing", { &style.ItemInnerSpacing, 0.0F, 20.0F } },
{ "indent-spacing", { &style.IndentSpacing, 0.0F, 30.0F } },
{ "cell-padding", { &style.CellPadding, 0.0F, 20.0F } },
{ "scrollbar-size", { &style.ScrollbarSize, 0.0F, 20.0F } },
{ "scrollbar-rounding", { &style.ScrollbarRounding, 0.0F, 12.0F } },
{ "grab-min-size", { &style.GrabMinSize, 0.0F, 20.0F } },
{ "grab-rounding", { &style.GrabRounding, 0.0F, 12.0F } },
{ "tab-rounding", { &style.TabRounding, 0.0F, 12.0F } },
{ "button-text-align", { &style.ButtonTextAlign, 0.0F, 1.0F } },
{ "selectable-text-align", { &style.SelectableTextAlign, 0.0F, 1.0F } },
{ "alpha", { &style.Alpha, 0.001F, 1.0F, false } },
{ "disabled-alpha", { &style.DisabledAlpha, 0.0F, 1.0F, false } },
{ "window-padding", { &style.WindowPadding, 0.0F, 20.0F, true } },
{ "window-rounding", { &style.WindowRounding, 0.0F, 12.0F, true } },
{ "window-border-size", { &style.WindowBorderSize, 0.0F, 1.0F, true } },
{ "window-min-size", { &style.WindowMinSize, 0.0F, 1000.0F, true } },
{ "window-title-align", { &style.WindowTitleAlign, 0.0F, 1.0F , false } },
{ "child-rounding", { &style.ChildRounding, 0.0F, 12.0F, true } },
{ "child-border-size", { &style.ChildBorderSize, 0.0F, 1.0F , true } },
{ "popup-rounding", { &style.PopupRounding, 0.0F, 12.0F, true } },
{ "popup-border-size", { &style.PopupBorderSize, 0.0F, 1.0F, true } },
{ "frame-padding", { &style.FramePadding, 0.0F, 20.0F, true } },
{ "frame-rounding", { &style.FrameRounding, 0.0F, 12.0F, true } },
{ "frame-border-size", { &style.FrameBorderSize, 0.0F, 1.0F, true } },
{ "item-spacing", { &style.ItemSpacing, 0.0F, 20.0F, true } },
{ "item-inner-spacing", { &style.ItemInnerSpacing, 0.0F, 20.0F, true } },
{ "indent-spacing", { &style.IndentSpacing, 0.0F, 30.0F, true } },
{ "cell-padding", { &style.CellPadding, 0.0F, 20.0F, true } },
{ "scrollbar-size", { &style.ScrollbarSize, 0.0F, 20.0F, true } },
{ "scrollbar-rounding", { &style.ScrollbarRounding, 0.0F, 12.0F, true } },
{ "grab-min-size", { &style.GrabMinSize, 0.0F, 20.0F, true } },
{ "grab-rounding", { &style.GrabRounding, 0.0F, 12.0F, true } },
{ "tab-rounding", { &style.TabRounding, 0.0F, 12.0F, true } },
{ "button-text-align", { &style.ButtonTextAlign, 0.0F, 1.0F, false } },
{ "selectable-text-align", { &style.SelectableTextAlign, 0.0F, 1.0F, false } },
};
api::ThemeManager::addStyleHandler("imgui", ImGuiStyleMap);
@@ -269,32 +269,32 @@ namespace hex::plugin::builtin {
{
auto &style = ImPlot::GetStyle();
const static api::ThemeManager::StyleMap ImPlotStyleMap = {
{ "line-weight", { &style.LineWeight, 0.0F, 5.0F } },
{ "marker-size", { &style.MarkerSize, 2.0F, 10.0F } },
{ "marker-weight", { &style.MarkerWeight, 0.0F, 5.0F } },
{ "fill-alpha", { &style.FillAlpha, 0.0F, 1.0F } },
{ "error-bar-size", { &style.ErrorBarSize, 0.0F, 10.0F } },
{ "error-bar-weight", { &style.ErrorBarWeight, 0.0F, 5.0F } },
{ "digital-bit-height", { &style.DigitalBitHeight, 0.0F, 20.0F } },
{ "digital-bit-gap", { &style.DigitalBitGap, 0.0F, 20.0F } },
{ "plot-border-size", { &style.PlotBorderSize, 0.0F, 2.0F } },
{ "minor-alpha", { &style.MinorAlpha, 0.0F, 1.0F } },
{ "major-tick-len", { &style.MajorTickLen, 0.0F, 20.0F } },
{ "minor-tick-len", { &style.MinorTickLen, 0.0F, 20.0F } },
{ "major-tick-size", { &style.MajorTickSize, 0.0F, 2.0F } },
{ "minor-tick-size", { &style.MinorTickSize, 0.0F, 2.0F } },
{ "major-grid-size", { &style.MajorGridSize, 0.0F, 2.0F } },
{ "minor-grid-size", { &style.MinorGridSize, 0.0F, 2.0F } },
{ "plot-padding", { &style.PlotPadding, 0.0F, 20.0F } },
{ "label-padding", { &style.LabelPadding, 0.0F, 20.0F } },
{ "legend-padding", { &style.LegendPadding, 0.0F, 20.0F } },
{ "legend-inner-padding", { &style.LegendInnerPadding, 0.0F, 10.0F } },
{ "legend-spacing", { &style.LegendSpacing, 0.0F, 5.0F } },
{ "mouse-pos-padding", { &style.MousePosPadding, 0.0F, 20.0F } },
{ "annotation-padding", { &style.AnnotationPadding, 0.0F, 5.0F } },
{ "fit-padding", { &style.FitPadding, 0.0F, 0.2F } },
{ "plot-default-size", { &style.PlotDefaultSize, 0.0F, 1000.0F } },
{ "plot-min-size", { &style.PlotMinSize, 0.0F, 300.0F } },
{ "line-weight", { &style.LineWeight, 0.0F, 5.0F, true } },
{ "marker-size", { &style.MarkerSize, 2.0F, 10.0F, true } },
{ "marker-weight", { &style.MarkerWeight, 0.0F, 5.0F, true } },
{ "fill-alpha", { &style.FillAlpha, 0.0F, 1.0F, false } },
{ "error-bar-size", { &style.ErrorBarSize, 0.0F, 10.0F, true } },
{ "error-bar-weight", { &style.ErrorBarWeight, 0.0F, 5.0F, true } },
{ "digital-bit-height", { &style.DigitalBitHeight, 0.0F, 20.0F, true } },
{ "digital-bit-gap", { &style.DigitalBitGap, 0.0F, 20.0F, true } },
{ "plot-border-size", { &style.PlotBorderSize, 0.0F, 2.0F, true } },
{ "minor-alpha", { &style.MinorAlpha, 0.0F, 1.0F, false } },
{ "major-tick-len", { &style.MajorTickLen, 0.0F, 20.0F, true } },
{ "minor-tick-len", { &style.MinorTickLen, 0.0F, 20.0F, true } },
{ "major-tick-size", { &style.MajorTickSize, 0.0F, 2.0F, true } },
{ "minor-tick-size", { &style.MinorTickSize, 0.0F, 2.0F, true } },
{ "major-grid-size", { &style.MajorGridSize, 0.0F, 2.0F, true } },
{ "minor-grid-size", { &style.MinorGridSize, 0.0F, 2.0F, true } },
{ "plot-padding", { &style.PlotPadding, 0.0F, 20.0F, true } },
{ "label-padding", { &style.LabelPadding, 0.0F, 20.0F, true } },
{ "legend-padding", { &style.LegendPadding, 0.0F, 20.0F, true } },
{ "legend-inner-padding", { &style.LegendInnerPadding, 0.0F, 10.0F, true } },
{ "legend-spacing", { &style.LegendSpacing, 0.0F, 5.0F, true } },
{ "mouse-pos-padding", { &style.MousePosPadding, 0.0F, 20.0F, true } },
{ "annotation-padding", { &style.AnnotationPadding, 0.0F, 5.0F, true } },
{ "fit-padding", { &style.FitPadding, 0.0F, 0.2F, true } },
{ "plot-default-size", { &style.PlotDefaultSize, 0.0F, 1000.0F, true } },
{ "plot-min-size", { &style.PlotMinSize, 0.0F, 300.0F, true } },
};
api::ThemeManager::addStyleHandler("implot", ImPlotStyleMap);
@@ -303,21 +303,21 @@ namespace hex::plugin::builtin {
{
auto &style = ImNodes::GetStyle();
const static api::ThemeManager::StyleMap ImNodesStyleMap = {
{ "grid-spacing", { &style.GridSpacing, 0.0F, 100.0F } },
{ "node-corner-rounding", { &style.NodeCornerRounding, 0.0F, 12.0F } },
{ "node-padding", { &style.NodePadding, 0.0F, 20.0F } },
{ "node-border-thickness", { &style.NodeBorderThickness, 0.0F, 1.0F } },
{ "link-thickness", { &style.LinkThickness, 0.0F, 10.0F } },
{ "link-line-segments-per-length", { &style.LinkLineSegmentsPerLength, 0.0F, 2.0F } },
{ "link-hover-distance", { &style.LinkHoverDistance, 0.0F, 20.0F } },
{ "pin-circle-radius", { &style.PinCircleRadius, 0.0F, 20.0F } },
{ "pin-quad-side-length", { &style.PinQuadSideLength, 0.0F, 20.0F } },
{ "pin-triangle-side-length", { &style.PinTriangleSideLength, 0.0F, 20.0F } },
{ "pin-line-thickness", { &style.PinLineThickness, 0.0F, 5.0F } },
{ "pin-hover-radius", { &style.PinHoverRadius, 0.0F, 20.0F } },
{ "pin-offset", { &style.PinOffset, -10.0F, 10.0F } },
{ "mini-map-padding", { &style.MiniMapPadding, 0.0F, 20.0F } },
{ "mini-map-offset", { &style.MiniMapOffset, -10.0F, 10.0F } },
{ "grid-spacing", { &style.GridSpacing, 0.0F, 100.0F, true } },
{ "node-corner-rounding", { &style.NodeCornerRounding, 0.0F, 12.0F, true } },
{ "node-padding", { &style.NodePadding, 0.0F, 20.0F, true } },
{ "node-border-thickness", { &style.NodeBorderThickness, 0.0F, 1.0F, true } },
{ "link-thickness", { &style.LinkThickness, 0.0F, 10.0F, true } },
{ "link-line-segments-per-length", { &style.LinkLineSegmentsPerLength, 0.0F, 2.0F, true } },
{ "link-hover-distance", { &style.LinkHoverDistance, 0.0F, 20.0F, true } },
{ "pin-circle-radius", { &style.PinCircleRadius, 0.0F, 20.0F, true } },
{ "pin-quad-side-length", { &style.PinQuadSideLength, 0.0F, 20.0F, true } },
{ "pin-triangle-side-length", { &style.PinTriangleSideLength, 0.0F, 20.0F, true } },
{ "pin-line-thickness", { &style.PinLineThickness, 0.0F, 5.0F, true } },
{ "pin-hover-radius", { &style.PinHoverRadius, 0.0F, 20.0F, true } },
{ "pin-offset", { &style.PinOffset, -10.0F, 10.0F, true } },
{ "mini-map-padding", { &style.MiniMapPadding, 0.0F, 20.0F, true } },
{ "mini-map-offset", { &style.MiniMapOffset, -10.0F, 10.0F, true } },
};
api::ThemeManager::addStyleHandler("imnodes", ImNodesStyleMap);