mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
disable search and sort when in profile editor
This commit is contained in:
parent
ea01e62936
commit
ffb0a0c41d
1 changed files with 42 additions and 41 deletions
|
|
@ -15,6 +15,7 @@ using Dalamud.Game.Command;
|
||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.Components;
|
using Dalamud.Interface.Components;
|
||||||
using Dalamud.Interface.Internal.Notifications;
|
using Dalamud.Interface.Internal.Notifications;
|
||||||
|
using Dalamud.Interface.Raii;
|
||||||
using Dalamud.Interface.Style;
|
using Dalamud.Interface.Style;
|
||||||
using Dalamud.Interface.Windowing;
|
using Dalamud.Interface.Windowing;
|
||||||
using Dalamud.Logging.Internal;
|
using Dalamud.Logging.Internal;
|
||||||
|
|
@ -219,7 +220,7 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
this.updatePluginCount = 0;
|
this.updatePluginCount = 0;
|
||||||
this.updatedPlugins = null;
|
this.updatedPlugins = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.profileManagerWidget.Reset();
|
this.profileManagerWidget.Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -482,54 +483,54 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
|
|
||||||
ImGui.SetCursorPosX(windowSize.X - sortSelectWidth - (style.ItemSpacing.X * 2) - searchInputWidth - searchClearButtonWidth);
|
ImGui.SetCursorPosX(windowSize.X - sortSelectWidth - (style.ItemSpacing.X * 2) - searchInputWidth - searchClearButtonWidth);
|
||||||
|
|
||||||
var searchTextChanged = false;
|
// Disable search if profile editor
|
||||||
ImGui.SetNextItemWidth(searchInputWidth);
|
using (ImRaii.Disabled(this.categoryManager.CurrentCategoryIdx == 14))
|
||||||
searchTextChanged |= ImGui.InputTextWithHint(
|
|
||||||
"###XlPluginInstaller_Search",
|
|
||||||
Locs.Header_SearchPlaceholder,
|
|
||||||
ref this.searchText,
|
|
||||||
100);
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
ImGui.SetCursorPosY(downShift);
|
|
||||||
|
|
||||||
ImGui.SetNextItemWidth(searchClearButtonWidth);
|
|
||||||
if (ImGuiComponents.IconButton(FontAwesomeIcon.Times))
|
|
||||||
{
|
{
|
||||||
this.searchText = string.Empty;
|
var searchTextChanged = false;
|
||||||
searchTextChanged = true;
|
ImGui.SetNextItemWidth(searchInputWidth);
|
||||||
}
|
searchTextChanged |= ImGui.InputTextWithHint(
|
||||||
|
"###XlPluginInstaller_Search",
|
||||||
|
Locs.Header_SearchPlaceholder,
|
||||||
|
ref this.searchText,
|
||||||
|
100);
|
||||||
|
|
||||||
if (searchTextChanged)
|
ImGui.SameLine();
|
||||||
this.UpdateCategoriesOnSearchChange();
|
ImGui.SetCursorPosY(downShift);
|
||||||
|
|
||||||
// Changelog group
|
ImGui.SetNextItemWidth(searchClearButtonWidth);
|
||||||
var isSortDisabled = this.categoryManager.CurrentGroupIdx == 3;
|
if (ImGuiComponents.IconButton(FontAwesomeIcon.Times))
|
||||||
if (isSortDisabled)
|
|
||||||
ImGui.BeginDisabled();
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
|
||||||
ImGui.SetCursorPosY(downShift);
|
|
||||||
ImGui.SetNextItemWidth(selectableWidth);
|
|
||||||
if (ImGui.BeginCombo(sortByText, this.filterText, ImGuiComboFlags.NoArrowButton))
|
|
||||||
{
|
|
||||||
foreach (var selectable in sortSelectables)
|
|
||||||
{
|
{
|
||||||
if (ImGui.Selectable(selectable.Localization))
|
this.searchText = string.Empty;
|
||||||
{
|
searchTextChanged = true;
|
||||||
this.sortKind = selectable.SortKind;
|
|
||||||
this.filterText = selectable.Localization;
|
|
||||||
|
|
||||||
lock (this.listLock)
|
|
||||||
this.ResortPlugins();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.EndCombo();
|
if (searchTextChanged)
|
||||||
|
this.UpdateCategoriesOnSearchChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isSortDisabled)
|
// Disable sort if changelogs or profile editor
|
||||||
ImGui.EndDisabled();
|
using (ImRaii.Disabled(this.categoryManager.CurrentGroupIdx == 3 || this.categoryManager.CurrentCategoryIdx == 14))
|
||||||
|
{
|
||||||
|
ImGui.SameLine();
|
||||||
|
ImGui.SetCursorPosY(downShift);
|
||||||
|
ImGui.SetNextItemWidth(selectableWidth);
|
||||||
|
if (ImGui.BeginCombo(sortByText, this.filterText, ImGuiComboFlags.NoArrowButton))
|
||||||
|
{
|
||||||
|
foreach (var selectable in sortSelectables)
|
||||||
|
{
|
||||||
|
if (ImGui.Selectable(selectable.Localization))
|
||||||
|
{
|
||||||
|
this.sortKind = selectable.SortKind;
|
||||||
|
this.filterText = selectable.Localization;
|
||||||
|
|
||||||
|
lock (this.listLock)
|
||||||
|
this.ResortPlugins();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui.EndCombo();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawFooter()
|
private void DrawFooter()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue