feat(settings): per-tab icon combobox in Tabs section

This commit is contained in:
2026-05-05 19:28:04 +02:00
parent c28c972ae3
commit e629518550
4 changed files with 61 additions and 0 deletions
+5
View File
@@ -276,6 +276,11 @@ internal class HellionStrings
internal static string Tabs_Presets_Linkshell => Get(nameof(Tabs_Presets_Linkshell)); internal static string Tabs_Presets_Linkshell => Get(nameof(Tabs_Presets_Linkshell));
internal static string Tabs_Presets_Linkshell_Hint => Get(nameof(Tabs_Presets_Linkshell_Hint)); internal static string Tabs_Presets_Linkshell_Hint => Get(nameof(Tabs_Presets_Linkshell_Hint));
// Hellion Chat — v1.2.0 per-tab icon override
internal static string Tabs_Icon_Label => Get(nameof(Tabs_Icon_Label));
internal static string Tabs_Icon_HelpMarker => Get(nameof(Tabs_Icon_HelpMarker));
internal static string Tabs_Icon_DefaultOption => Get(nameof(Tabs_Icon_DefaultOption));
// Hellion Chat — v0.6.0 chat colour presets (display labels) // Hellion Chat — v0.6.0 chat colour presets (display labels)
internal static string ChatColourPresets_Default => Get(nameof(ChatColourPresets_Default)); internal static string ChatColourPresets_Default => Get(nameof(ChatColourPresets_Default));
internal static string ChatColourPresets_HighContrast => Get(nameof(ChatColourPresets_HighContrast)); internal static string ChatColourPresets_HighContrast => Get(nameof(ChatColourPresets_HighContrast));
@@ -561,6 +561,17 @@
<data name="Tabs_Presets_Linkshell_Hint" xml:space="preserve"> <data name="Tabs_Presets_Linkshell_Hint" xml:space="preserve">
<value>Wenn du mehrere Linkshells benutzt, empfiehlt der Maintainer einen Tab pro Shell für eine sauberere Übersicht. Tab duplizieren und je Kopie die Kanalauswahl einschränken.</value> <value>Wenn du mehrere Linkshells benutzt, empfiehlt der Maintainer einen Tab pro Shell für eine sauberere Übersicht. Tab duplizieren und je Kopie die Kanalauswahl einschränken.</value>
</data> </data>
<!-- Hellion Chat — v1.2.0 per-tab icon override -->
<data name="Tabs_Icon_Label" xml:space="preserve">
<value>Tab-Icon</value>
</data>
<data name="Tabs_Icon_HelpMarker" xml:space="preserve">
<value>FontAwesome-Glyph für die Sidebar. Default greift auf Tab-Name oder Channel-Typ.</value>
</data>
<data name="Tabs_Icon_DefaultOption" xml:space="preserve">
<value>(Default-Mapping)</value>
</data>
<data name="ChatColourPresets_Default" xml:space="preserve"> <data name="ChatColourPresets_Default" xml:space="preserve">
<value>Klassik (Chat 2 Default)</value> <value>Klassik (Chat 2 Default)</value>
</data> </data>
+11
View File
@@ -561,6 +561,17 @@
<data name="Tabs_Presets_Linkshell_Hint" xml:space="preserve"> <data name="Tabs_Presets_Linkshell_Hint" xml:space="preserve">
<value>If you use multiple linkshells, the maintainer recommends one tab per shell for cleaner readability. Duplicate this tab and narrow the channel selection per copy.</value> <value>If you use multiple linkshells, the maintainer recommends one tab per shell for cleaner readability. Duplicate this tab and narrow the channel selection per copy.</value>
</data> </data>
<!-- Hellion Chat — v1.2.0 per-tab icon override -->
<data name="Tabs_Icon_Label" xml:space="preserve">
<value>Tab-Icon</value>
</data>
<data name="Tabs_Icon_HelpMarker" xml:space="preserve">
<value>FontAwesome-Glyph für die Sidebar. Default greift auf Tab-Name oder Channel-Typ.</value>
</data>
<data name="Tabs_Icon_DefaultOption" xml:space="preserve">
<value>(Default-Mapping)</value>
</data>
<data name="ChatColourPresets_Default" xml:space="preserve"> <data name="ChatColourPresets_Default" xml:space="preserve">
<value>Klassik (Chat 2 Default)</value> <value>Klassik (Chat 2 Default)</value>
</data> </data>
+34
View File
@@ -91,6 +91,40 @@ internal sealed class Tabs : ISettingsTab
} }
ImGui.InputText(Language.Options_Tabs_Name, ref tab.Name, 512, ImGuiInputTextFlags.EnterReturnsTrue); ImGui.InputText(Language.Options_Tabs_Name, ref tab.Name, 512, ImGuiInputTextFlags.EnterReturnsTrue);
// v1.2.0 — Per-Tab Icon-Override. Default-Mapping greift falls nichts gesetzt.
ImGui.TextUnformatted(HellionStrings.Tabs_Icon_Label);
ImGui.SameLine();
ImGuiUtil.HelpMarker(HellionStrings.Tabs_Icon_HelpMarker);
var iconCurrent = string.IsNullOrEmpty(tab.Icon) ? "" : tab.Icon;
var iconPreview = iconCurrent.Length == 0
? HellionStrings.Tabs_Icon_DefaultOption
: iconCurrent;
using (var combo = ImRaii.Combo($"##icon-{i}", iconPreview))
{
if (combo.Success)
{
// Erste Option: Default (löscht Icon, lässt Mapping greifen).
if (ImGui.Selectable(HellionStrings.Tabs_Icon_DefaultOption, iconCurrent.Length == 0))
{
tab.Icon = null;
}
ImGui.Separator();
// Pool-Optionen aus TabIconGlyphResolver.PickerOptions (Single-Source-of-Truth).
foreach (var option in TabIconGlyphResolver.PickerOptions)
{
var isSelected = string.Equals(iconCurrent, option, StringComparison.OrdinalIgnoreCase);
if (ImGui.Selectable(option, isSelected))
{
tab.Icon = option;
}
}
}
}
ImGui.Checkbox(Language.Options_Tabs_ShowTimestamps, ref tab.DisplayTimestamp); ImGui.Checkbox(Language.Options_Tabs_ShowTimestamps, ref tab.DisplayTimestamp);
ImGui.Checkbox(Language.Options_Tabs_PopOut, ref tab.PopOut); ImGui.Checkbox(Language.Options_Tabs_PopOut, ref tab.PopOut);
if (tab.PopOut) if (tab.PopOut)