From 04ebd1e5331d29b2413c174ae0fe9d73566b3b8d Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 14 Mar 2021 22:57:56 +0900 Subject: Resize console dynamically --- src/console/components/Console.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/console/components') diff --git a/src/console/components/Console.tsx b/src/console/components/Console.tsx index 1c673fa..18a6632 100644 --- a/src/console/components/Console.tsx +++ b/src/console/components/Console.tsx @@ -13,6 +13,7 @@ import ColorScheme from "../../shared/ColorScheme"; import { LightTheme, DarkTheme } from "./Theme"; import styled from "./Theme"; import { ThemeProvider } from "styled-components"; +import ConsoleFrameClient from "../clients/ConsoleFrameClient"; const ConsoleWrapper = styled.div` border-top: 1px solid gray; @@ -30,6 +31,7 @@ class Console extends React.Component { private input: React.RefObject; private commandLineParser: CommandLineParser = new CommandLineParser(); + private consoleFrameClient = new ConsoleFrameClient(); constructor(props: Props) { super(props); @@ -130,6 +132,12 @@ class Console extends React.Component { } else if (prevProps.mode !== "find" && this.props.mode === "find") { this.focus(); } + + const { + scrollWidth: width, + scrollHeight: height, + } = document.getElementById("vimvixen-console")!; + this.consoleFrameClient.resize(width, height); } render() { -- cgit v1.2.3