From c4ebae385e551086a042e4c4b1d17bef462cf77e Mon Sep 17 00:00:00 2001 From: Jonas Date: Wed, 13 Sep 2023 12:51:17 +0200 Subject: [PATCH] fix(titlebar): align buttons to the right Also add same top and right margin to titlebar. Signed-off-by: Jonas --- cypress/e2e/pages.spec.js | 6 ++-- src/components/Collective.vue | 2 +- src/components/Page.vue | 52 +++++++++++++++++++---------------- src/css/editor.scss | 5 ++++ 4 files changed, 37 insertions(+), 28 deletions(-) diff --git a/cypress/e2e/pages.spec.js b/cypress/e2e/pages.spec.js index 48538ef38d..cba80712ed 100644 --- a/cypress/e2e/pages.spec.js +++ b/cypress/e2e/pages.spec.js @@ -272,8 +272,7 @@ describe('Page', function() { describe.only('Full width view', function() { it('Allows to toggle persistent full-width view', function() { cy.visit('/apps/collectives/Our%20Garden/Day%202') - cy.get('#titleform').should('have.css', 'max-width', '670px') - cy.get('#titleform').invoke('outerWidth').should('eq', 670) + cy.get('#titleform').should('have.css', 'max-width', '100%') cy.get('#read-only-editor').invoke('outerWidth').should('eq', 670) // Set full width mode @@ -282,12 +281,11 @@ describe('Page', function() { cy.contains('li.action', 'Full width') .click() cy.get('#titleform').should('have.css', 'max-width', 'none') - cy.get('#titleform').invoke('outerWidth').should('be.greaterThan', 700) cy.get('#read-only-editor').invoke('outerWidth').should('be.greaterThan', 700) // Reload to check persistence with browser storage cy.reload() - cy.get('#titleform').invoke('outerWidth').should('be.greaterThan', 700) + cy.get('#titleform').should('have.css', 'max-width', '100%') cy.get('#read-only-editor').invoke('outerWidth').should('be.greaterThan', 700) // Unset full width mode diff --git a/src/components/Collective.vue b/src/components/Collective.vue index 32493c8ed9..b3109ef28d 100644 --- a/src/components/Collective.vue +++ b/src/components/Collective.vue @@ -202,7 +202,7 @@ export default { .page-title { position: sticky; top: 0; - padding: 8px 0px 2px 8px; + padding: 8px 8px 2px 8px; display: flex; align-items: center; background-color: var(--color-main-background); diff --git a/src/components/Page.vue b/src/components/Page.vue index c1c1c4adbe..cc04e8a0ff 100644 --- a/src/components/Page.vue +++ b/src/components/Page.vue @@ -77,29 +77,31 @@ @blur="renamePage()"> - - - - - - - - - - +
+ + + + + + + + + + +
diff --git a/src/css/editor.scss b/src/css/editor.scss index da43166def..1274ed293a 100644 --- a/src/css/editor.scss +++ b/src/css/editor.scss @@ -7,6 +7,11 @@ max-width: var(--text-editor-max-width); margin: auto; + &.page-title { + max-width: 100%; + margin: 0 0 0 max(0px, calc(50% - (var(--text-editor-max-width) / 2))); + } + // Editor document status bar .document-status { max-width: var(--text-editor-max-width);