MCPcopy Create free account
hub / github.com/chieapp/chie / resizeToFitContentView

Method resizeToFitContentView

src/view/base-window.ts:97–109  ·  view source on GitHub ↗
(override: {width?: number, height?: number} = {})

Source from the content-addressed store, hash-verified

95
96 // Set window's size automatically to the preferred size of content view.
97 resizeToFitContentView(override: {width?: number, height?: number} = {}) {
98 let contentSize: gui.SizeF;
99 if (override.width && override.height) {
100 contentSize = override as gui.SizeF;
101 } else {
102 contentSize = Object.assign(this.contentView.getPreferredSize(), override);
103 if (override.width)
104 contentSize.height = this.contentView.getPreferredHeightForWidth(override.width);
105 else if (override.height)
106 contentSize.width = this.contentView.getPreferredWidthForHeight(override.height);
107 }
108 this.window.setContentSize(contentSize);
109 }
110
111 // Increase window size automatically to fit all content.
112 resizeVerticallyToFitContentView() {

Callers 5

constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80
constructorMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected