1
0
mirror of synced 2025-01-18 00:56:49 +01:00

impr: Update ImGui to use new shadows branch

This commit is contained in:
WerWolv 2023-11-24 15:31:27 +01:00
parent d6d379108b
commit fb00f688a8
15 changed files with 63309 additions and 62069 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,7 @@
"header": "#6666E572", "header": "#6666E572",
"header-active": "#8787DDCC", "header-active": "#8787DDCC",
"header-hovered": "#7272E5CC", "header-hovered": "#7272E5CC",
"menu-bar-background": "#66668CCC", "menu-bar-background": "#535371FF",
"modal-window-dim-background": "#33333359", "modal-window-dim-background": "#33333359",
"nav-highlight": "#7272E5CC", "nav-highlight": "#7272E5CC",
"nav-windowing-background": "#CCCCCC33", "nav-windowing-background": "#CCCCCC33",
@ -53,10 +53,11 @@
"text": "#E5E5E5FF", "text": "#E5E5E5FF",
"text-disabled": "#999999FF", "text-disabled": "#999999FF",
"text-selected-background": "#0000FF59", "text-selected-background": "#0000FF59",
"title-background": "#66668CCC", "title-background": "#535371FF",
"title-background-active": "#66668CCC", "title-background-active": "#535371FF",
"title-background-collapse": "#66668CCC", "title-background-collapse": "#535371FF",
"window-background": "#000000FF" "window-background": "#000000FF",
"window-shadow": "#000000FF"
}, },
"imhex": { "imhex": {
"blur-background": "#00000000", "blur-background": "#00000000",
@ -67,7 +68,7 @@
"IEEE-tool-sign": "#5D5D7FFF", "IEEE-tool-sign": "#5D5D7FFF",
"IEEE-tool-exp": "#5D7F5DFF", "IEEE-tool-exp": "#5D7F5DFF",
"IEEE-tool-mantissa": "#7F5D5DFF", "IEEE-tool-mantissa": "#7F5D5DFF",
"toolbar-blue": "#06539BFF", "toolbar-blue": "#55A5F6FF",
"toolbar-brown": "#DBB377FF", "toolbar-brown": "#DBB377FF",
"toolbar-gray": "#E6E6E6FF", "toolbar-gray": "#E6E6E6FF",
"toolbar-green": "#388B42FF", "toolbar-green": "#388B42FF",
@ -224,7 +225,10 @@
"window-title-align": [ "window-title-align": [
0.0, 0.0,
0.5 0.5
] ],
"window-shadow-size": 64.0,
"window-shadow-offset": 0.0,
"window-shadow-angle": 0.0
}, },
"imnodes": { "imnodes": {
"grid-spacing": 24.0, "grid-spacing": 24.0,

View File

@ -56,7 +56,8 @@
"title-background": "#232323FF", "title-background": "#232323FF",
"title-background-active": "#232323FF", "title-background-active": "#232323FF",
"title-background-collapse": "#232323FF", "title-background-collapse": "#232323FF",
"window-background": "#0F0F0FFF" "window-background": "#0F0F0FFF",
"window-shadow": "#000000FF"
}, },
"imhex": { "imhex": {
"blur-background": "#00000000", "blur-background": "#00000000",
@ -224,7 +225,10 @@
"window-title-align": [ "window-title-align": [
0.0, 0.0,
0.5 0.5
] ],
"window-shadow-size": 64.0,
"window-shadow-offset": 0.0,
"window-shadow-angle": 0.0
}, },
"imnodes": { "imnodes": {
"grid-spacing": 24.0, "grid-spacing": 24.0,

View File

@ -56,7 +56,8 @@
"title-background": "#DBDBDBFF", "title-background": "#DBDBDBFF",
"title-background-active": "#DBDBDBFF", "title-background-active": "#DBDBDBFF",
"title-background-collapse": "#DBDBDBFF", "title-background-collapse": "#DBDBDBFF",
"window-background": "#EFEFEFFF" "window-background": "#EFEFEFFF",
"window-shadow": "#00000055"
}, },
"imhex": { "imhex": {
"blur-background": "#00000000", "blur-background": "#00000000",
@ -224,7 +225,10 @@
"window-title-align": [ "window-title-align": [
0.0, 0.0,
0.5 0.5
] ],
"window-shadow-size": 64.0,
"window-shadow-offset": 0.0,
"window-shadow-angle": 0.0
}, },
"imnodes": { "imnodes": {
"grid-spacing": 24.0, "grid-spacing": 24.0,

View File

@ -74,7 +74,8 @@ namespace hex::plugin::builtin {
{ "nav-highlight", ImGuiCol_NavHighlight }, { "nav-highlight", ImGuiCol_NavHighlight },
{ "nav-windowing-highlight", ImGuiCol_NavWindowingHighlight }, { "nav-windowing-highlight", ImGuiCol_NavWindowingHighlight },
{ "nav-windowing-background", ImGuiCol_NavWindowingDimBg }, { "nav-windowing-background", ImGuiCol_NavWindowingDimBg },
{ "modal-window-dim-background", ImGuiCol_ModalWindowDimBg } { "modal-window-dim-background", ImGuiCol_ModalWindowDimBg },
{ "window-shadow", ImGuiCol_WindowShadow }
}; };
ThemeManager::addThemeHandler("imgui", ImGuiColorMap, ThemeManager::addThemeHandler("imgui", ImGuiColorMap,
@ -256,31 +257,34 @@ namespace hex::plugin::builtin {
{ {
auto &style = ImGui::GetStyle(); auto &style = ImGui::GetStyle();
const static ThemeManager::StyleMap ImGuiStyleMap = { const static ThemeManager::StyleMap ImGuiStyleMap = {
{ "alpha", { &style.Alpha, 0.1F, 1.0F, false } }, { "alpha", { &style.Alpha, 0.1F, 1.0F, false } },
{ "disabled-alpha", { &style.DisabledAlpha, 0.0F, 1.0F, false } }, { "disabled-alpha", { &style.DisabledAlpha, 0.0F, 1.0F, false } },
{ "window-padding", { &style.WindowPadding, 0.0F, 20.0F, true } }, { "window-padding", { &style.WindowPadding, 0.0F, 20.0F, true } },
{ "window-rounding", { &style.WindowRounding, 0.0F, 12.0F, true } }, { "window-rounding", { &style.WindowRounding, 0.0F, 12.0F, true } },
{ "window-border-size", { &style.WindowBorderSize, 0.0F, 1.0F, true } }, { "window-border-size", { &style.WindowBorderSize, 0.0F, 1.0F, true } },
{ "window-min-size", { &style.WindowMinSize, 0.0F, 1000.0F, true } }, { "window-min-size", { &style.WindowMinSize, 0.0F, 1000.0F, true } },
{ "window-title-align", { &style.WindowTitleAlign, 0.0F, 1.0F , false } }, { "window-title-align", { &style.WindowTitleAlign, 0.0F, 1.0F , false } },
{ "child-rounding", { &style.ChildRounding, 0.0F, 12.0F, true } }, { "child-rounding", { &style.ChildRounding, 0.0F, 12.0F, true } },
{ "child-border-size", { &style.ChildBorderSize, 0.0F, 1.0F , true } }, { "child-border-size", { &style.ChildBorderSize, 0.0F, 1.0F , true } },
{ "popup-rounding", { &style.PopupRounding, 0.0F, 12.0F, true } }, { "popup-rounding", { &style.PopupRounding, 0.0F, 12.0F, true } },
{ "popup-border-size", { &style.PopupBorderSize, 0.0F, 1.0F, true } }, { "popup-border-size", { &style.PopupBorderSize, 0.0F, 1.0F, true } },
{ "frame-padding", { &style.FramePadding, 0.0F, 20.0F, true } }, { "frame-padding", { &style.FramePadding, 0.0F, 20.0F, true } },
{ "frame-rounding", { &style.FrameRounding, 0.0F, 12.0F, true } }, { "frame-rounding", { &style.FrameRounding, 0.0F, 12.0F, true } },
{ "frame-border-size", { &style.FrameBorderSize, 0.0F, 1.0F, true } }, { "frame-border-size", { &style.FrameBorderSize, 0.0F, 1.0F, true } },
{ "item-spacing", { &style.ItemSpacing, 0.0F, 20.0F, true } }, { "item-spacing", { &style.ItemSpacing, 0.0F, 20.0F, true } },
{ "item-inner-spacing", { &style.ItemInnerSpacing, 0.0F, 20.0F, true } }, { "item-inner-spacing", { &style.ItemInnerSpacing, 0.0F, 20.0F, true } },
{ "indent-spacing", { &style.IndentSpacing, 0.0F, 30.0F, true } }, { "indent-spacing", { &style.IndentSpacing, 0.0F, 30.0F, true } },
{ "cell-padding", { &style.CellPadding, 0.0F, 20.0F, true } }, { "cell-padding", { &style.CellPadding, 0.0F, 20.0F, true } },
{ "scrollbar-size", { &style.ScrollbarSize, 0.0F, 20.0F, true } }, { "scrollbar-size", { &style.ScrollbarSize, 0.0F, 20.0F, true } },
{ "scrollbar-rounding", { &style.ScrollbarRounding, 0.0F, 12.0F, true } }, { "scrollbar-rounding", { &style.ScrollbarRounding, 0.0F, 12.0F, true } },
{ "grab-min-size", { &style.GrabMinSize, 0.0F, 20.0F, true } }, { "grab-min-size", { &style.GrabMinSize, 0.0F, 20.0F, true } },
{ "grab-rounding", { &style.GrabRounding, 0.0F, 12.0F, true } }, { "grab-rounding", { &style.GrabRounding, 0.0F, 12.0F, true } },
{ "tab-rounding", { &style.TabRounding, 0.0F, 12.0F, true } }, { "tab-rounding", { &style.TabRounding, 0.0F, 12.0F, true } },
{ "button-text-align", { &style.ButtonTextAlign, 0.0F, 1.0F, false } }, { "button-text-align", { &style.ButtonTextAlign, 0.0F, 1.0F, false } },
{ "selectable-text-align", { &style.SelectableTextAlign, 0.0F, 1.0F, false } }, { "selectable-text-align", { &style.SelectableTextAlign, 0.0F, 1.0F, false } },
{ "window-shadow-size", { &style.WindowShadowSize, 0.0F, 100.0F, true } },
{ "window-shadow-offset", { &style.WindowShadowOffsetDist, 0.0F, 100.0F, true } },
{ "window-shadow-angle", { &style.WindowShadowOffsetAngle, 0.0F, 10.0F, false } },
}; };
ThemeManager::addStyleHandler("imgui", ImGuiStyleMap); ThemeManager::addStyleHandler("imgui", ImGuiStyleMap);

View File

@ -356,6 +356,7 @@ namespace hex::plugin::builtin {
} }
static void drawWelcomeScreen() { static void drawWelcomeScreen() {
ImGui::PushStyleColor(ImGuiCol_WindowShadow, 0x00);
if (ImGui::Begin("ImHexDockSpace")) { if (ImGui::Begin("ImHexDockSpace")) {
if (!ImHexApi::Provider::isValid()) { if (!ImHexApi::Provider::isValid()) {
static std::array<char, 256> title; static std::array<char, 256> title;
@ -377,6 +378,7 @@ namespace hex::plugin::builtin {
} }
} }
ImGui::End(); ImGui::End();
ImGui::PopStyleColor();
} }
/** /**
* @brief Draw some default background if there are no views available in the current layout * @brief Draw some default background if there are no views available in the current layout