diff --git a/src/app/bookmarks/bookmarks.tsx b/src/app/bookmarks/bookmarks.tsx index 31177134..e3c21d2c 100644 --- a/src/app/bookmarks/bookmarks.tsx +++ b/src/app/bookmarks/bookmarks.tsx @@ -180,6 +180,11 @@ class Bookmark extends React.Component { @mobxReact.observer class BookmarksView extends React.Component<{}, {}> { + @boundMethod + handleClose() { + GlobalModel.bookmarksModel.closeView(); + } + render() { const isHidden = GlobalModel.activeMainView.get() != "bookmarks"; if (isHidden) { @@ -188,7 +193,7 @@ class BookmarksView extends React.Component<{}, {}> { let bookmarks = GlobalModel.bookmarksModel.bookmarks; let bookmark: BookmarkType = null; return ( - +
diff --git a/src/app/clientsettings/clientsettings.tsx b/src/app/clientsettings/clientsettings.tsx index 3403a960..5763e529 100644 --- a/src/app/clientsettings/clientsettings.tsx +++ b/src/app/clientsettings/clientsettings.tsx @@ -129,6 +129,11 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove return clientData?.clientopts?.globalshortcut ?? ""; } + @boundMethod + handleClose() { + GlobalModel.clientSettingsViewModel.closeView(); + } + render() { const isHidden = GlobalModel.activeMainView.get() != "clientsettings"; if (isHidden) { @@ -145,11 +150,7 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove const curFontFamily = GlobalModel.getTermFontFamily(); return ( - +
Term Font Size
diff --git a/src/app/common/elements/mainview.tsx b/src/app/common/elements/mainview.tsx index de15d3c5..75c13f03 100644 --- a/src/app/common/elements/mainview.tsx +++ b/src/app/common/elements/mainview.tsx @@ -16,11 +16,13 @@ class MainView extends React.Component<{ children: React.ReactNode; }> { render() { - // TODO: This is a workaround for History view not honoring the sidebar width. This is rooted in the table width for the history view, which uses `calc(100%-20px)`. To properly fix this, History view needs a full overhaul. - const width = window.innerWidth - 6 - GlobalModel.mainSidebarModel.getWidth(); - + const sidebarModel = GlobalModel.mainSidebarModel; + const maxWidthSubtractor = sidebarModel.getCollapsed() ? 0 : sidebarModel.getWidth(); return ( -
+
{this.props.title}
diff --git a/src/app/connections/connections.tsx b/src/app/connections/connections.tsx index fa1dd532..f5c715b8 100644 --- a/src/app/connections/connections.tsx +++ b/src/app/connections/connections.tsx @@ -98,6 +98,11 @@ class ConnectionsView extends React.Component<{ model: RemotesModel }, { hovered } } + @boundMethod + handleClose() { + GlobalModel.connectionViewModel.closeView(); + } + componentDidMount() { if (this.tableRef.current != null) { this.tableRszObs = new ResizeObserver(this.handleTableResize.bind(this)); @@ -126,7 +131,7 @@ class ConnectionsView extends React.Component<{ model: RemotesModel }, { hovered let item: RemoteType = null; return ( - + { })(); } + @boundMethod + handleClose() { + GlobalModel.historyViewModel.closeView(); + } + render() { let isHidden = GlobalModel.activeMainView.get() != "history"; if (isHidden) { @@ -408,7 +413,7 @@ class HistoryView extends React.Component<{}, {}> { let remoteId: string = null; return ( - +
{ } render() { - const mainSidebar = GlobalModel.mainSidebarModel; - const isCollapsed = mainSidebar.getCollapsed(); + const sidebarWidth = GlobalModel.mainSidebarModel.getWidth(); + return ( { {(toggleCollapse) => (
+
+ 215}> + + + + + +