fix: comment out scrolling child for images

This commit is contained in:
goat 2021-08-09 21:59:45 +02:00
parent d23ed9020a
commit f0fe84230c
No known key found for this signature in database
GPG key ID: F18F057873895461

View file

@ -191,6 +191,8 @@ namespace Dalamud.Interface.Internal.Windows
private void DrawFooter() private void DrawFooter()
{ {
Log.Verbose(ImGui.GetWindowSize().X.ToString());
var windowSize = ImGui.GetWindowContentRegionMax(); var windowSize = ImGui.GetWindowContentRegionMax();
var placeholderButtonSize = GetButtonSize("placeholder"); var placeholderButtonSize = GetButtonSize("placeholder");
@ -562,7 +564,7 @@ namespace Dalamud.Interface.Internal.Windows
this.DrawPluginImages(manifest, index); this.DrawPluginImages(manifest, index);
ImGuiHelpers.ScaledDummy(10); ImGuiHelpers.ScaledDummy(5);
ImGui.Unindent(); ImGui.Unindent();
} }
@ -740,7 +742,7 @@ namespace Dalamud.Interface.Internal.Windows
this.DrawPluginImages(manifest, index); this.DrawPluginImages(manifest, index);
ImGuiHelpers.ScaledDummy(10); ImGuiHelpers.ScaledDummy(5);
ImGui.Unindent(); ImGui.Unindent();
} }
@ -1019,11 +1021,16 @@ namespace Dalamud.Interface.Internal.Windows
return; return;
const float thumbFactor = 2.7f; const float thumbFactor = 2.7f;
ImGui.PushStyleVar(ImGuiStyleVar.ScrollbarSize, 15);
var scrollBarSize = 15;
ImGui.PushStyleVar(ImGuiStyleVar.ScrollbarSize, scrollBarSize);
ImGui.PushStyleColor(ImGuiCol.ScrollbarBg, Vector4.Zero); ImGui.PushStyleColor(ImGuiCol.ScrollbarBg, Vector4.Zero);
if (ImGui.BeginChild($"plugin{index}ImageScrolling", new Vector2(0, (PluginImageHeight / thumbFactor) + ImGui.GetStyle().ScrollbarSize), false, ImGuiWindowFlags.HorizontalScrollbar | ImGuiWindowFlags.NoScrollWithMouse | ImGuiWindowFlags.NoBackground)) var width = ImGui.GetWindowWidth();
{
// TODO: This doesn't work, seems like a bug
// if (ImGui.BeginChild($"plugin{index}ImageScrolling", new Vector2(width, (PluginImageHeight / thumbFactor) + scrollBarSize), false, ImGuiWindowFlags.HorizontalScrollbar | ImGuiWindowFlags.NoScrollWithMouse | ImGuiWindowFlags.NoBackground))
// {
if (images.Textures != null && images.Textures is { Length: > 0 }) if (images.Textures != null && images.Textures is { Length: > 0 })
{ {
for (var i = 0; i < images.Textures.Length; i++) for (var i = 0; i < images.Textures.Length; i++)
@ -1047,10 +1054,9 @@ namespace Dalamud.Interface.Internal.Windows
ImGui.PushStyleVar(ImGuiStyleVar.FramePadding, Vector2.Zero); ImGui.PushStyleVar(ImGuiStyleVar.FramePadding, Vector2.Zero);
if (ImGui.ImageButton(image.ImGuiHandle, new Vector2(image.Width / thumbFactor, image.Height / thumbFactor))) if (ImGui.ImageButton(image.ImGuiHandle,
{ new Vector2(image.Width / thumbFactor, image.Height / thumbFactor)))
ImGui.OpenPopup(popupId); ImGui.OpenPopup(popupId);
}
ImGui.PopStyleVar(); ImGui.PopStyleVar();
@ -1062,8 +1068,8 @@ namespace Dalamud.Interface.Internal.Windows
} }
} }
ImGui.EndChild(); // ImGui.EndChild();
} // }
ImGui.PopStyleVar(); ImGui.PopStyleVar();
ImGui.PopStyleColor(); ImGui.PopStyleColor();