mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-22 19:53:48 +08:00
refactor(editor): render presentation toolbar on demand (#9442)
This commit is contained in:
@@ -657,17 +657,18 @@ export class EdgelessToolbarWidget extends WidgetComponent<
|
|||||||
@mousedown=${stopPropagation}
|
@mousedown=${stopPropagation}
|
||||||
@pointerdown=${stopPropagation}
|
@pointerdown=${stopPropagation}
|
||||||
>
|
>
|
||||||
<presentation-toolbar
|
${this.isPresentMode
|
||||||
.visible=${this.isPresentMode}
|
? html`<presentation-toolbar
|
||||||
.edgeless=${this.block}
|
.edgeless=${this.block}
|
||||||
.settingMenuShow=${this.presentSettingMenuShow}
|
.settingMenuShow=${this.presentSettingMenuShow}
|
||||||
.frameMenuShow=${this.presentFrameMenuShow}
|
.frameMenuShow=${this.presentFrameMenuShow}
|
||||||
.setSettingMenuShow=${(show: boolean) =>
|
.setSettingMenuShow=${(show: boolean) =>
|
||||||
(this.presentSettingMenuShow = show)}
|
(this.presentSettingMenuShow = show)}
|
||||||
.setFrameMenuShow=${(show: boolean) =>
|
.setFrameMenuShow=${(show: boolean) =>
|
||||||
(this.presentFrameMenuShow = show)}
|
(this.presentFrameMenuShow = show)}
|
||||||
.containerWidth=${this.containerWidth}
|
.containerWidth=${this.containerWidth}
|
||||||
></presentation-toolbar>
|
></presentation-toolbar>`
|
||||||
|
: nothing}
|
||||||
${this.isPresentMode ? nothing : this._renderContent()}
|
${this.isPresentMode ? nothing : this._renderContent()}
|
||||||
</div>
|
</div>
|
||||||
</smooth-corner>
|
</smooth-corner>
|
||||||
|
|||||||
+1
-4
@@ -322,7 +322,7 @@ export class PresentationToolbar extends EdgelessToolbarToolMixin(
|
|||||||
return html`
|
return html`
|
||||||
<style>
|
<style>
|
||||||
:host {
|
:host {
|
||||||
display: ${this.visible ? 'flex' : 'none'};
|
display: flex;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<edgeless-tool-icon-button
|
<edgeless-tool-icon-button
|
||||||
@@ -442,9 +442,6 @@ export class PresentationToolbar extends EdgelessToolbarToolMixin(
|
|||||||
|
|
||||||
@property({ type: Boolean })
|
@property({ type: Boolean })
|
||||||
accessor settingMenuShow = false;
|
accessor settingMenuShow = false;
|
||||||
|
|
||||||
@property({ attribute: true, type: Boolean })
|
|
||||||
accessor visible = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
Reference in New Issue
Block a user