Skip to content

Commit

Permalink
Zoom out: hide vertical toolbar when block is not full width (#63650)
Browse files Browse the repository at this point in the history
* hide toolbar when block is not full width

* fix unwanted centering, show regular toolbars on non full width blocks

Co-authored-by: MaggieCabrera <onemaggie@git.wordpress.org>
Co-authored-by: scruffian <scruffian@git.wordpress.org>
  • Loading branch information
3 people authored Jul 23, 2024
1 parent 3f7b260 commit 5673cb4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@ export function useShowBlockTools() {
editorMode === 'navigation';

const isZoomOut = editorMode === 'zoom-out';
const _showZoomOutToolbar =
isZoomOut &&
block?.attributes?.align === 'full' &&
! _showEmptyBlockSideInserter &&
! maybeShowBreadcrumb;
const _showBlockToolbarPopover =
! isZoomOut &&
! _showZoomOutToolbar &&
! getSettings().hasFixedToolbar &&
! _showEmptyBlockSideInserter &&
hasSelectedBlock &&
Expand All @@ -58,12 +63,7 @@ export function useShowBlockTools() {
showBreadcrumb:
! _showEmptyBlockSideInserter && maybeShowBreadcrumb,
showBlockToolbarPopover: _showBlockToolbarPopover,
showZoomOutToolbar:
hasSelectedBlock &&
isZoomOut &&
! _showEmptyBlockSideInserter &&
! maybeShowBreadcrumb &&
! _showBlockToolbarPopover,
showZoomOutToolbar: _showZoomOutToolbar,
};
}, [] );
}
2 changes: 1 addition & 1 deletion packages/block-editor/src/components/iframe/content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
display: flex;
flex-direction: column;

> .is-root-container {
> .is-root-container:not(.wp-block-post-content) {
flex: 1;
display: flex;
flex-direction: column;
Expand Down

1 comment on commit 5673cb4

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 5673cb4.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10057430024
📝 Reported issues:

Please sign in to comment.