Skip to content

Commit 4512d52

Browse files
committed
Add shrink button to jupyter applet
1 parent 35251db commit 4512d52

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/ui/blackboard/jupyterhublet.jsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ import {
2424
faArrowsAlt,
2525
faCamera,
2626
faChevronLeft,
27-
faChevronRight
27+
faChevronRight,
28+
faArrowsLeftRight
2829
} from '@fortawesome/free-solid-svg-icons'
2930
import { fiSteer } from '../icons/icons.jsx'
3031
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
@@ -1173,6 +1174,24 @@ export class JupyterHublet extends Component {
11731174
tooltip='Steer applet state'
11741175
/>
11751176
)}
1177+
{master && this.props.pos.width + this.props.pos.x > 1.0 && (
1178+
<AppletButton
1179+
icon={<FontAwesomeIcon icon={faArrowsLeftRight} />}
1180+
key='shrinkbutton'
1181+
onClick={() => {
1182+
const aspect = this.props.pos.width / this.props.pos.height
1183+
const newwidth = Math.max(0.9 - this.props.pos.x, 0.1)
1184+
this.props.submitAppPosition(
1185+
this.props.pos.x,
1186+
this.props.pos.y,
1187+
newwidth,
1188+
newwidth / aspect,
1189+
this.props.deactivated
1190+
)
1191+
}}
1192+
tooltip='Shrink width to visible'
1193+
/>
1194+
)}
11761195
</div>
11771196
<div style={{ position: 'absolute', right: '0px', bottom: '0px' }}>
11781197
{!this.props.isnotepad && (

0 commit comments

Comments
 (0)