feat(layout): add top-tabs layout mode and shared channel resolver
This commit is contained in:
@@ -25,6 +25,7 @@ internal sealed class MainWindow : Window
|
||||
|
||||
private readonly Components.HonorificHeader _honorific;
|
||||
private readonly Components.Sidebar _sidebar;
|
||||
private readonly Components.TopTabBar _topTabs;
|
||||
private readonly Components.MessageList _messages;
|
||||
private readonly Components.InputBar _input;
|
||||
private readonly Components.StatusBar _status;
|
||||
@@ -39,6 +40,7 @@ internal sealed class MainWindow : Window
|
||||
public MainWindow(
|
||||
Components.HonorificHeader honorific,
|
||||
Components.Sidebar sidebar,
|
||||
Components.TopTabBar topTabs,
|
||||
Components.MessageList messages,
|
||||
Components.InputBar input,
|
||||
Components.StatusBar status,
|
||||
@@ -48,6 +50,7 @@ internal sealed class MainWindow : Window
|
||||
{
|
||||
_honorific = honorific;
|
||||
_sidebar = sidebar;
|
||||
_topTabs = topTabs;
|
||||
_messages = messages;
|
||||
_input = input;
|
||||
_status = status;
|
||||
@@ -121,6 +124,17 @@ internal sealed class MainWindow : Window
|
||||
var bodyWidth = ImGui.GetContentRegionAvail().X;
|
||||
_honorific.Draw(bodyWidth);
|
||||
|
||||
if (Plugin.Config.MainWindowLayoutMode == MainWindowLayoutMode.TopTabs)
|
||||
{
|
||||
_topTabs.Draw(Plugin.Config.Tabs, ref _activeTab);
|
||||
using (ImRaii.Group())
|
||||
{
|
||||
DrawMainArea();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Sidebar layout (default).
|
||||
using (ImRaii.Group())
|
||||
{
|
||||
_sidebar.Draw(bodyWidth, Plugin.Config.Tabs, ref _activeTab);
|
||||
|
||||
Reference in New Issue
Block a user