diff options
Diffstat (limited to 'src/client/views/nodes/ImageBox.tsx')
-rw-r--r-- | src/client/views/nodes/ImageBox.tsx | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx index 9223fc180..ec6ce8c2a 100644 --- a/src/client/views/nodes/ImageBox.tsx +++ b/src/client/views/nodes/ImageBox.tsx @@ -536,7 +536,17 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { ); } + protected _btnWidth = 50; + protected _inputWidth = 50; + protected _sideBtnMaxPanelPct = 0.12; + @observable _filterFunc: ((doc: Doc) => boolean) | undefined = undefined; + @computed get contentScaling() { return this.ScreenToLocalBoxXf().Scale; } // prettier-ignore + @computed get maxWidgetSize() { return Math.min(this._btnWidth * this.contentScaling, (this._props.fitWidth?.(this.Document) && this._props.PanelWidth() > NumCast(this.layoutDoc._width) ? 1 : this._sideBtnMaxPanelPct) * NumCast(this.layoutDoc.width, 1)); } // prettier-ignore + @computed get uiBtnScaling() { return this.maxWidgetSize / this._btnWidth; } // prettier-ignore + @computed get uiInputScaling() { return this.maxWidgetSize / this._inputWidth; } // prettier-ignore + componentAIViewHistory = () => { + const imgs: FireflyImageData[] = this.dataDoc.ai_firefly_history ? JSON.parse(StrCast(this.dataDoc.ai_firefly_history)) : []; return ( <div className="imageBox-aiView-history"> <Button text="Clear History" type={Type.SEC} size={Size.XSMALL} /> @@ -630,7 +640,13 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { <div className="imageBox-aiView-options-container"> <span className="imageBox-aiView-subtitle"> More Options: </span> <div className="imageBox-aiView-options"> + {showRegenerate && ( + <text className="imageBox-aiView-subtitle" style={{ transform: `scale(${this.uiBtnScaling})` }}> + More Options: + </text> + )} <Button + style={{ transform: `scale(${this.uiBtnScaling})` }} type={Type.TERT} text="Get Text" icon={<FontAwesomeIcon icon="font" />} @@ -646,11 +662,11 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { }} /> <Button + style={{ transform: `scale(${this.uiBtnScaling})` }} type={Type.TERT} text="Generative Fill" icon={<FontAwesomeIcon icon="fill" />} color={SettingsManager.userBackgroundColor} - // icon={this._isLoading && this._regenInput !== '' ? <ReactLoading type="spin" color={SettingsManager.userVariantColor} width={16} height={20} /> : <AiOutlineSend />} iconPlacement="right" onClick={action(() => { ImageEditorData.Open = true; @@ -660,11 +676,11 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { })} /> <Button + style={{ transform: `scale(${this.uiBtnScaling})` }} type={Type.TERT} text="Expand" icon={<FontAwesomeIcon icon="expand" />} color={SettingsManager.userBackgroundColor} - // icon={this._isLoading && this._regenInput !== '' ? <ReactLoading type="spin" color={SettingsManager.userVariantColor} width={16} height={20} /> : <AiOutlineSend />} iconPlacement="right" onClick={() => { Networking.PostToServer('/expandImage', { |