Skip to content

Commit

Permalink
refactor(editor): render presentation toolbar on demand
Browse files Browse the repository at this point in the history
  • Loading branch information
doodlewind committed Dec 31, 2024
1 parent 79e0064 commit d1fb81f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -657,17 +657,18 @@ export class EdgelessToolbarWidget extends WidgetComponent<
@mousedown=${stopPropagation}
@pointerdown=${stopPropagation}
>
<presentation-toolbar
.visible=${this.isPresentMode}
.edgeless=${this.block}
.settingMenuShow=${this.presentSettingMenuShow}
.frameMenuShow=${this.presentFrameMenuShow}
.setSettingMenuShow=${(show: boolean) =>
(this.presentSettingMenuShow = show)}
.setFrameMenuShow=${(show: boolean) =>
(this.presentFrameMenuShow = show)}
.containerWidth=${this.containerWidth}
></presentation-toolbar>
${this.isPresentMode
? html`<presentation-toolbar
.edgeless=${this.block}
.settingMenuShow=${this.presentSettingMenuShow}
.frameMenuShow=${this.presentFrameMenuShow}
.setSettingMenuShow=${(show: boolean) =>
(this.presentSettingMenuShow = show)}
.setFrameMenuShow=${(show: boolean) =>
(this.presentFrameMenuShow = show)}
.containerWidth=${this.containerWidth}
></presentation-toolbar>`
: nothing}
${this.isPresentMode ? nothing : this._renderContent()}
</div>
</smooth-corner>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ export class PresentationToolbar extends EdgelessToolbarToolMixin(
return html`
<style>
:host {
display: ${this.visible ? 'flex' : 'none'};
display: flex;
}
</style>
<edgeless-tool-icon-button
Expand Down Expand Up @@ -442,9 +442,6 @@ export class PresentationToolbar extends EdgelessToolbarToolMixin(

@property({ type: Boolean })
accessor settingMenuShow = false;

@property({ attribute: true, type: Boolean })
accessor visible = true;
}

declare global {
Expand Down

0 comments on commit d1fb81f

Please sign in to comment.