From 7ce9973e6b21f0a9841c62ddd95699c5bc733f55 Mon Sep 17 00:00:00 2001 From: Alan Fleming <> Date: Mon, 11 Nov 2024 09:49:25 +1100 Subject: [PATCH] tweak css --- ipylab/widgets.py | 5 ++++- src/widgets/shell.ts | 1 + style/widget.css | 14 +++++--------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ipylab/widgets.py b/ipylab/widgets.py index c4129ba..40d8d18 100644 --- a/ipylab/widgets.py +++ b/ipylab/widgets.py @@ -6,7 +6,7 @@ import asyncio from typing import TYPE_CHECKING -from ipywidgets import Box, DOMWidget, TypedTuple, register, widget_serialization +from ipywidgets import Box, DOMWidget, Layout, TypedTuple, register, widget_serialization from ipywidgets.widgets.trait_types import InstanceDict from traitlets import Container, Dict, Instance, Unicode, observe @@ -108,6 +108,9 @@ class SplitPanel(Panel): _model_name = Unicode("SplitPanelModel").tag(sync=True) _view_name = Unicode("SplitPanelView").tag(sync=True) orientation = Unicode("vertical").tag(sync=True) + layout = InstanceDict(Layout, kw={"width": "100%", "height": "100%", "overflow": "hidden"}).tag( + sync=True, **widget_serialization + ) _force_update_in_progress = False # ============== Start temp fix ============= diff --git a/src/widgets/shell.ts b/src/widgets/shell.ts index 626f15e..8d9c0b9 100644 --- a/src/widgets/shell.ts +++ b/src/widgets/shell.ts @@ -79,6 +79,7 @@ export class ShellModel extends IpylabModel { if (args.asDocument && !(widget instanceof DocumentWidget)) { const jfem = await IpylabModel.JFEM.getModelByVpath(args.vpath); const context = jfem.context as any; + widget.addClass('ipylab-Document'); const w = (widget = new DocumentWidget({ context, content: widget })); w.node.removeChild(w.toolbar.node); } diff --git a/style/widget.css b/style/widget.css index 154dca5..f9c11fa 100644 --- a/style/widget.css +++ b/style/widget.css @@ -6,18 +6,15 @@ .ipylab-Panel { box-sizing: border-box; display: flex; - height: 100%; - width: 100%; + margin: 0; flex-direction: column; overflow: auto; } .ipylab-SplitPanel { box-sizing: border-box; + margin: 0; display: flex; - height: 100%; - width: 100%; - overflow: hidden; } /* Default Split Handle Color */ @@ -25,8 +22,7 @@ background-color: var(--jp-border-color2); } -.ipylab-MainArea { - box-sizing: border-box; - display: flex; - margin: 0; +.ipylab-Document { + height: 100%; + width: 100%; }