feat(chat): put the channel header above both windows
Drawn before the scroll child in each, so it stays put while the log moves. The child's height is deliberately left alone: it is given as a negative value, and ImGui resolves those against the space still available from the current cursor -- which the header has already reduced. Subtracting it a second time would have opened a gap of exactly the header's height above the input row, in both windows. Where the name shows follows one rule: never twice on the same screen. The sidebar layout is the only place nothing else carries it, so that is the only place the header says it. The top-tab strip carries it, and a pop-out with its title bar on carries it in the title. The pop-out's plain title row is gone, replaced by the header. The comment it left behind is worth keeping in mind -- an earlier header row was removed exactly because it repeated the tab name one line below the title bar. That warning is now the rule rather than a reason to have no header at all. The trailing detail is the home world and the clock, and the clock follows the same Use24HourClock setting the message timestamps do. Two clock formats in one window, with the header sitting directly above a column of timestamps, would be a defect rather than a preference. Culture is pinned for the same reason it is pinned in the message list.
This commit is contained in:
@@ -388,6 +388,26 @@ internal sealed class MainWindow : Window, IFocusableChatWindow
|
||||
? Plugin.InputPreview.PreviewHeight
|
||||
: 0f;
|
||||
|
||||
// Before the child, so it does not scroll away with the log. The child's
|
||||
// height is left alone on purpose: it is given as a negative value, and
|
||||
// ImGui resolves those against the space still available from the current
|
||||
// cursor -- which the header has already reduced. Subtracting it a second
|
||||
// time would open a gap of exactly the header's height above the input row.
|
||||
if (_activeTab is { } headerTab)
|
||||
{
|
||||
var mode =
|
||||
Plugin.Config.MainWindowLayoutMode == MainWindowLayoutMode.TopTabs
|
||||
? StyleEngine.Widgets.ChannelHeaderMode.DetailOnly
|
||||
: StyleEngine.Widgets.ChannelHeaderMode.Full;
|
||||
|
||||
StyleEngine.Widgets.ChannelHeader.Draw(
|
||||
headerTab,
|
||||
mode,
|
||||
Plugin.Instance.FontManager,
|
||||
StyleEngine.Widgets.ChannelHeader.CurrentDetail()
|
||||
);
|
||||
}
|
||||
|
||||
using (
|
||||
var messages = ImRaii.Child(
|
||||
"##hellion-main-area",
|
||||
|
||||
Reference in New Issue
Block a user