fix: set NoBackground on scrolling child

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

View file

@ -1022,7 +1022,7 @@ namespace Dalamud.Interface.Internal.Windows
ImGui.PushStyleVar(ImGuiStyleVar.ScrollbarSize, 15); ImGui.PushStyleVar(ImGuiStyleVar.ScrollbarSize, 15);
ImGui.PushStyleColor(ImGuiCol.ScrollbarBg, Vector4.Zero); ImGui.PushStyleColor(ImGuiCol.ScrollbarBg, Vector4.Zero);
if (ImGui.BeginChild($"plugin{index}Scrolling", new Vector2(0, (PluginImageHeight / thumbFactor) + ImGui.GetStyle().ScrollbarSize), false, ImGuiWindowFlags.HorizontalScrollbar | ImGuiWindowFlags.NoScrollWithMouse)) if (ImGui.BeginChild($"plugin{index}ImageScrolling", new Vector2(0, (PluginImageHeight / thumbFactor) + ImGui.GetStyle().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 })
{ {
@ -1175,7 +1175,7 @@ namespace Dalamud.Interface.Internal.Windows
this.errorModalOnNextFrame = true; this.errorModalOnNextFrame = true;
} }
private async Task DownloadPluginIcon(PluginManifest manifest) private async Task DownloadPluginIconAsync(PluginManifest manifest)
{ {
var client = new HttpClient(); var client = new HttpClient();
@ -1221,27 +1221,23 @@ namespace Dalamud.Interface.Internal.Windows
data.EnsureSuccessStatusCode(); data.EnsureSuccessStatusCode();
var image = this.dalamud.InterfaceManager.LoadImage(await data.Content.ReadAsByteArrayAsync()); var image = this.dalamud.InterfaceManager.LoadImage(await data.Content.ReadAsByteArrayAsync());
if (image != null) if (image == null)
{ {
return;
}
if (image.Height != PluginImageHeight || image.Width != PluginImageWidth) if (image.Height != PluginImageHeight || image.Width != PluginImageWidth)
{ {
Log.Error($"Image at {manifest.ImageUrls[i]} was not of the correct resolution."); Log.Error($"Image at {manifest.ImageUrls[i]} was not of the correct resolution.");
return; return;
} }
pluginImages[i] = image; pluginImages[i] = image;
} }
else
{
return;
}
}
this.pluginImagesMap[manifest.InternalName] = (true, pluginImages); this.pluginImagesMap[manifest.InternalName] = (true, pluginImages);
} }
Log.Verbose($"Plugin images for {manifest.InternalName} downloaded"); Log.Verbose($"Plugin images for {manifest.InternalName} downloaded");
} }