feat(window): wire move/resize flags and consolidate the duplicate toggle

This commit is contained in:
2026-05-30 17:54:15 +02:00
parent 336f722eef
commit caacb87a6a
5 changed files with 98 additions and 13 deletions
+18 -3
View File
@@ -66,9 +66,6 @@ internal sealed class MainWindow : Window
MinimumSize = new Vector2(MinWidth, MinHeight),
MaximumSize = new Vector2(float.MaxValue, float.MaxValue),
};
// The message list owns its own scroll inside the body child;
// the outer window must not show a second scrollbar.
Flags = ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse;
IsOpen = Plugin.Config.MainWindowOpen;
RespectCloseHotkey = false;
}
@@ -80,6 +77,22 @@ internal sealed class MainWindow : Window
internal float ResolveBgAlpha(bool isFocused) =>
isFocused ? Plugin.Config.WindowOpacity : Plugin.Config.WindowOpacityInactive;
// B1-2: rebuild flags from a fresh base every frame so toggling CanMove/
// CanResize back on actually CLEARS NoMove/NoResize (not accumulating).
// Move/resize toggle logic as 1.5.6 (ChatLogWindow.PreOpenCheck
// 1d3b429:703-707); base flags = today's MainWindow set (NoScrollbar|
// NoScrollWithMouse — the message list owns its own scroll; 1.5.6's
// NoFocusOnAppearing/NoTitleBar are deliberately not restored).
internal static ImGuiWindowFlags ResolveFlags(bool canMove, bool canResize)
{
var flags = ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse;
if (!canMove)
flags |= ImGuiWindowFlags.NoMove;
if (!canResize)
flags |= ImGuiWindowFlags.NoResize;
return flags;
}
public override void PreDraw()
{
// Dalamud's WindowHost turns Window.BgAlpha into SetNextWindowBgAlpha
@@ -100,6 +113,8 @@ internal sealed class MainWindow : Window
else
BgAlpha = null;
}
Flags = ResolveFlags(Plugin.Config.CanMove, Plugin.Config.CanResize);
}
public Tab? ActiveTab => _activeTab;