feat: add popped-out tab opacity
This commit is contained in:
+13
-1
@@ -875,13 +875,25 @@ internal sealed class ChatLog : IUiComponent {
|
||||
}
|
||||
|
||||
private void DrawPopOut(Tab tab) {
|
||||
var flags = ImGuiWindowFlags.None;
|
||||
if (!this.Ui.Plugin.Config.ShowPopOutTitleBar) {
|
||||
flags |= ImGuiWindowFlags.NoTitleBar;
|
||||
}
|
||||
|
||||
var alpha = tab.IndependentOpacity ? tab.Opacity / 100f : this.Ui.Plugin.Config.WindowAlpha;
|
||||
ImGui.SetNextWindowBgAlpha(alpha);
|
||||
ImGui.SetNextWindowSize(new Vector2(350, 350) * ImGuiHelpers.GlobalScale, ImGuiCond.FirstUseEver);
|
||||
if (!ImGui.Begin($"{tab.Name}##popout", ref tab.PopOut)) {
|
||||
if (!ImGui.Begin($"{tab.Name}##popout", ref tab.PopOut, flags)) {
|
||||
goto End;
|
||||
}
|
||||
|
||||
ImGui.PushID($"popout-{tab.Name}");
|
||||
|
||||
if (!this.Ui.Plugin.Config.ShowPopOutTitleBar) {
|
||||
ImGui.TextUnformatted(tab.Name);
|
||||
ImGui.Separator();
|
||||
}
|
||||
|
||||
this.DrawMessageLog(tab, ImGui.GetContentRegionAvail().Y, false);
|
||||
|
||||
ImGui.PopID();
|
||||
|
||||
@@ -88,6 +88,9 @@ internal sealed class Display : ISettingsTab {
|
||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.ShowTitleBar, Language.Options_ShowTitleBar_Name);
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGuiUtil.OptionCheckbox(ref this.Mutable.ShowPopOutTitleBar, Language.Options_ShowPopOutTitleBar_Name);
|
||||
ImGui.Spacing();
|
||||
|
||||
ImGui.PopTextWrapPos();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +75,13 @@ internal sealed class Tabs : ISettingsTab {
|
||||
|
||||
ImGui.InputText(Language.Options_Tabs_Name, ref tab.Name, 512, ImGuiInputTextFlags.EnterReturnsTrue);
|
||||
ImGui.Checkbox(Language.Options_Tabs_ShowTimestamps, ref tab.DisplayTimestamp);
|
||||
ImGui.Checkbox(Language.Options_Tabs_PopOut, ref tab.PopOut);
|
||||
if (tab.PopOut) {
|
||||
ImGui.Checkbox(Language.Options_Tabs_IndependentOpacity, ref tab.IndependentOpacity);
|
||||
if (tab.IndependentOpacity) {
|
||||
ImGuiUtil.DragFloatVertical(Language.Options_Tabs_Opacity, ref tab.Opacity, 0.1f, 0f, 100f);
|
||||
}
|
||||
}
|
||||
|
||||
if (ImGuiUtil.BeginComboVertical(Language.Options_Tabs_UnreadMode, tab.UnreadMode.Name())) {
|
||||
foreach (var mode in Enum.GetValues<UnreadMode>()) {
|
||||
|
||||
Reference in New Issue
Block a user