From deee687e577b8fd19dedb7924763a4e4391a6a91 Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Mon, 23 Nov 2020 14:40:52 +0300 Subject: [PATCH] [DE mobile] Add styles and icons --- .../mobile/resources/less/common-ios.less | 148 ++++++++++++++ .../mobile/src/css/icons-ios.less | 182 ++++++++++++++++++ .../mobile/src/css/icons-material.less | 115 +++++++++++ .../mobile/src/view/edit/Edit.jsx | 6 +- .../mobile/src/view/edit/EditChart.jsx | 46 +++-- .../mobile/src/view/edit/EditHeader.jsx | 4 +- .../mobile/src/view/edit/EditHyperlink.jsx | 2 +- .../mobile/src/view/edit/EditImage.jsx | 68 +++++-- .../mobile/src/view/edit/EditParagraph.jsx | 12 +- .../mobile/src/view/edit/EditShape.jsx | 62 ++++-- .../mobile/src/view/edit/EditTable.jsx | 54 ++++-- .../mobile/src/view/edit/EditText.jsx | 38 ++-- .../src/view/settings/DocumentSettings.jsx | 16 +- 13 files changed, 657 insertions(+), 96 deletions(-) diff --git a/apps/common/mobile/resources/less/common-ios.less b/apps/common/mobile/resources/less/common-ios.less index 332d7f089..273b3e04d 100644 --- a/apps/common/mobile/resources/less/common-ios.less +++ b/apps/common/mobile/resources/less/common-ios.less @@ -3,6 +3,8 @@ @black: #000000; .device-ios { + @blockTitleColor: #6d6d72; + --f7-navbar-link-color: @themeColor; --f7-navbar-text-color: @black; --f7-navbar-title-line-height: 44px; @@ -12,6 +14,12 @@ --f7-list-bg-color: @white; --f7-navbar-bg-color: #f7f7f8; + --f7-radio-active-color: @themeColor; + --f7-toggle-active-color: @themeColor; + --f7-range-bar-active-bg-color: @themeColor; + + --f7-list-button-text-color: @themeColor; + // Main Toolbar #editor-navbar.navbar .right a + a, #editor-navbar.navbar .left a + a { @@ -23,6 +31,9 @@ .title { font-weight: 600; } + .navbar-inner { + z-index: auto; + } } .popover__titled { @@ -146,4 +157,141 @@ } } } + + .list { + li.no-indicator { + .item-link { + .item-inner:before { + content: none; + } + } + } + .item-inner { + padding-top: 7px; + .item-after { + color: @black; + .after-start { + margin: 0 5px; + } + .segmented { + min-width: 90px; + margin-left: 10px; + } + } + } + .buttons { + .item-inner { + padding-top: 0; + padding-bottom: 0; + align-items: stretch; + > .row { + width: 100%; + align-items: stretch; + .button { + flex: 1; + border: none; + height: inherit; + border-radius: 0; + font-size: 17px; + display: flex; + align-items: center; + justify-content: center; + } + } + } + } + } + + .tab-buttons { + width: 100%; + display: flex; + flex-wrap: nowrap; + align-self: center; + .tab-link { + display: block; + width: 100%; + line-height: 26px; + position: relative; + overflow: hidden; + -webkit-box-flex: 1; + border: 1px solid @themeColor; + text-decoration: none; + text-align: center; + margin: 0; + padding: 0 1px; + height: 29px; + white-space: nowrap; + text-overflow: ellipsis; + font-size: 14px; + font-family: inherit; + cursor: pointer; + outline: 0; + font-weight: 600; + &:first-child { + border-radius: 5px 0 0 5px; + border-left-width: 1px; + border-left-style: solid; + } + &:last-child { + border-radius: 0 5px 5px 0; + } + &.tab-link-active { + background: @themeColor; + color: @white; + } + } + } + + .button { + border: 1px solid @themeColor; + color: @themeColor; + text-decoration: none; + text-align: center; + display: block; + border-radius: 5px; + line-height: 27px; + box-sizing: border-box; + background: 0 0; + padding: 0 10px; + margin: 0; + height: 29px; + white-space: nowrap; + position: relative; + overflow: hidden; + text-overflow: ellipsis; + font-size: 14px; + font-family: inherit; + cursor: pointer; + outline: 0; + &.active { + background: @themeColor; + color: @white; + i.icon { + background-color: @white; + } + } + } + + .red .list-button { + color: red; + } + + .block-title { + position: relative; + overflow: hidden; + margin: 0; + white-space: nowrap; + text-overflow: ellipsis; + font-size: 14px; + text-transform: uppercase; + line-height: 1; + color: @blockTitleColor; + margin: 35px 15px 10px; + } + + .shapes { + .page-content { + background: @white; + } + } } diff --git a/apps/documenteditor/mobile/src/css/icons-ios.less b/apps/documenteditor/mobile/src/css/icons-ios.less index c37b0255c..1defd0a90 100644 --- a/apps/documenteditor/mobile/src/css/icons-ios.less +++ b/apps/documenteditor/mobile/src/css/icons-ios.less @@ -25,6 +25,11 @@ height: 24px; .encoded-svg-background(''); } + &.icon-expand-down { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } //Settings &.icon-search { width: 22px; @@ -66,5 +71,182 @@ height: 22px; .encoded-svg-background(''); } + //Edit + &.icon-text-additional { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } + &.icon-bullets { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } + &.icon-numbers { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } + &.icon-linespacing { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } + // Align + &.icon-text-align-left { + width: 22px; + height: 22px; + .encoded-svg-mask(''); + } + &.icon-text-align-right { + width: 22px; + height: 22px; + .encoded-svg-mask(''); + } + &.icon-text-align-center { + width: 22px; + height: 22px; + .encoded-svg-mask(''); + } + &.icon-text-align-just { + width: 22px; + height: 22px; + .encoded-svg-mask(''); + } + &.icon-de-indent { + width: 22px; + height: 22px; + .encoded-svg-mask(''); + } + &.icon-in-indent { + width: 22px; + height: 22px; + .encoded-svg-mask(''); + } + // Table + &.icon-table-add-column-left { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } + &.icon-table-add-column-right { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } + &.icon-table-add-row-above { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } + &.icon-table-add-row-below { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } + &.icon-table-remove-column { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } + &.icon-table-remove-row { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } + // Reorder + &.icon-move-backward { + width: 28px; + height: 28px; + .encoded-svg-background(''); + } + &.icon-move-forward { + width: 28px; + height: 28px; + .encoded-svg-background(''); + } + &.icon-move-background { + width: 28px; + height: 28px; + .encoded-svg-background(''); + } + &.icon-move-foreground { + width: 28px; + height: 28px; + .encoded-svg-background(''); + } + // Wrap + &.icon-wrap-inline { + width: 28px; + height: 28px; + .encoded-svg-background(''); + } + &.icon-wrap-square { + width: 28px; + height: 28px; + .encoded-svg-background(''); + } + &.icon-wrap-tight { + width: 28px; + height: 28px; + .encoded-svg-background(''); + } + &.icon-wrap-through { + width: 28px; + height: 28px; + .encoded-svg-background(''); + } + &.icon-wrap-top-bottom { + width: 28px; + height: 28px; + .encoded-svg-background(''); + } + &.icon-wrap-infront { + width: 28px; + height: 28px; + .encoded-svg-background(''); + } + &.icon-wrap-behind { + width: 28px; + height: 28px; + .encoded-svg-background(''); + } + // Table Wrap + &.icon-wrap-table-inline { + width: 28px; + height: 28px; + .encoded-svg-background(''); + } + &.icon-wrap-table-flow { + width: 28px; + height: 28px; + .encoded-svg-background(''); + } + &.icon-block-align-left { + width: 28px; + height: 28px; + .encoded-svg-mask(''); + } + &.icon-block-align-center { + width: 28px; + height: 28px; + .encoded-svg-mask(''); + } + &.icon-block-align-right { + width: 28px; + height: 28px; + .encoded-svg-mask(''); + } + // Insert link/image-library + &.icon-link { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } + &.icon-image-library { + width: 22px; + height: 22px; + .encoded-svg-background('icons_for_svg'); + } } } \ No newline at end of file diff --git a/apps/documenteditor/mobile/src/css/icons-material.less b/apps/documenteditor/mobile/src/css/icons-material.less index 75c1388cf..2d8480742 100644 --- a/apps/documenteditor/mobile/src/css/icons-material.less +++ b/apps/documenteditor/mobile/src/css/icons-material.less @@ -29,6 +29,11 @@ } } i.icon { + &.icon-expand-down { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } //Settings &.icon-search { width: 22px; @@ -70,5 +75,115 @@ height: 22px; .encoded-svg-background(''); } + //Edit + &.icon-text-align-left { + width: 22px; + height: 22px; + .encoded-svg-mask(''); + } + &.icon-text-align-right { + width: 22px; + height: 22px; + .encoded-svg-mask(''); + } + &.icon-text-align-center { + width: 22px; + height: 22px; + .encoded-svg-mask(''); + } + &.icon-text-align-just { + width: 22px; + height: 22px; + .encoded-svg-mask(''); + } + &.icon-de-indent { + width: 22px; + height: 22px; + .encoded-svg-mask(''); + } + &.icon-in-indent { + width: 22px; + height: 22px; + .encoded-svg-mask(''); + } + // Table + &.icon-table-add-column-left { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } + &.icon-table-add-column-right { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } + &.icon-table-add-row-above { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } + &.icon-table-add-row-below { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } + &.icon-table-remove-column { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } + &.icon-table-remove-row { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } + // Reorder + &.icon-move-backward { + width: 28px; + height: 28px; + .encoded-svg-background(''); + } + &.icon-move-forward { + width: 28px; + height: 28px; + .encoded-svg-background(''); + } + &.icon-move-background { + width: 28px; + height: 28px; + .encoded-svg-background(''); + } + &.icon-move-foreground { + width: 28px; + height: 28px; + .encoded-svg-background(''); + } + // Table Wrap + &.icon-block-align-left { + width: 28px; + height: 28px; + .encoded-svg-mask(''); + } + &.icon-block-align-center { + width: 28px; + height: 28px; + .encoded-svg-mask(''); + } + &.icon-block-align-right { + width: 28px; + height: 28px; + .encoded-svg-mask(''); + } + // Insert link/image-library + &.icon-link { + width: 22px; + height: 22px; + .encoded-svg-background(''); + } + &.icon-image-library { + width: 24px; + height: 24px; + .encoded-svg-background(''); + } } } \ No newline at end of file diff --git a/apps/documenteditor/mobile/src/view/edit/Edit.jsx b/apps/documenteditor/mobile/src/view/edit/Edit.jsx index c4b383947..5f67b981d 100644 --- a/apps/documenteditor/mobile/src/view/edit/Edit.jsx +++ b/apps/documenteditor/mobile/src/view/edit/Edit.jsx @@ -123,12 +123,12 @@ const EditLayoutNavbar = ({ editors, inPopover }) => { { editors.length > 1 ? - +
{editors.map((item, index) => {item.caption})} - : +
: { editors[0].caption } } - { !inPopover && {_t.textClose} } + { !inPopover && }
) }; diff --git a/apps/documenteditor/mobile/src/view/edit/EditChart.jsx b/apps/documenteditor/mobile/src/view/edit/EditChart.jsx index 60600d0d4..9413c84e6 100644 --- a/apps/documenteditor/mobile/src/view/edit/EditChart.jsx +++ b/apps/documenteditor/mobile/src/view/edit/EditChart.jsx @@ -27,13 +27,27 @@ const PageWrap = props => { - {props.onWrapType('inline')}}> - {props.onWrapType('square')}}> - {props.onWrapType('tight')}}> - {props.onWrapType('through')}}> - {props.onWrapType('top-bottom')}}> - {props.onWrapType('infront')}}> - {props.onWrapType('behind')}}> + {props.onWrapType('inline')}}> + + + {props.onWrapType('square')}}> + + + {props.onWrapType('tight')}}> + + + {props.onWrapType('through')}}> + + + {props.onWrapType('top-bottom')}}> + + + {props.onWrapType('infront')}}> + + + {props.onWrapType('behind')}}> + + { wrapType !== 'inline' && @@ -97,10 +111,18 @@ const PageReorder = props => { - {props.onReorder('all-up')}}> - {props.onReorder('all-down')}}> - {props.onReorder('move-up')}}> - {props.onReorder('move-down')}}> + {props.onReorder('all-up')}} link='#' className='no-indicator'> + + + {props.onReorder('all-down')}} link='#' className='no-indicator'> + + + {props.onReorder('move-up')}} link='#' className='no-indicator'> + + + {props.onReorder('move-down')}} link='#' className='no-indicator'> + + ) @@ -125,7 +147,7 @@ const EditChart = props => { }}> - {props.onRemoveChart()}}/> + {props.onRemoveChart()}} className='red'/> ) diff --git a/apps/documenteditor/mobile/src/view/edit/EditHeader.jsx b/apps/documenteditor/mobile/src/view/edit/EditHeader.jsx index 30be11f4b..93b125f6f 100644 --- a/apps/documenteditor/mobile/src/view/edit/EditHeader.jsx +++ b/apps/documenteditor/mobile/src/view/edit/EditHeader.jsx @@ -38,8 +38,8 @@ const EditHeader = props => {
{_startAt}
- - + +
diff --git a/apps/documenteditor/mobile/src/view/edit/EditHyperlink.jsx b/apps/documenteditor/mobile/src/view/edit/EditHyperlink.jsx index b52021872..251e1dd09 100644 --- a/apps/documenteditor/mobile/src/view/edit/EditHyperlink.jsx +++ b/apps/documenteditor/mobile/src/view/edit/EditHyperlink.jsx @@ -42,7 +42,7 @@ const EditHyperlink = props => { { props.onEditLink(stateLink, stateDisplay, stateTip) }}> - {props.onRemoveLink()}}> + {props.onRemoveLink()}} className='red'/> ) diff --git a/apps/documenteditor/mobile/src/view/edit/EditImage.jsx b/apps/documenteditor/mobile/src/view/edit/EditImage.jsx index 0a6c42f39..ddc0abbfb 100644 --- a/apps/documenteditor/mobile/src/view/edit/EditImage.jsx +++ b/apps/documenteditor/mobile/src/view/edit/EditImage.jsx @@ -20,33 +20,53 @@ const PageWrap = props => { - {props.onWrapType('inline')}}> - {props.onWrapType('square')}}> - {props.onWrapType('tight')}}> - {props.onWrapType('through')}}> - {props.onWrapType('top-bottom')}}> - {props.onWrapType('infront')}}> - {props.onWrapType('behind')}}> + {props.onWrapType('inline')}}> + + + {props.onWrapType('square')}}> + + + {props.onWrapType('tight')}}> + + + {props.onWrapType('through')}}> + + + {props.onWrapType('top-bottom')}}> + + + {props.onWrapType('infront')}}> + + + {props.onWrapType('behind')}}> + + { wrapType !== 'inline' && {_t.textAlign} - + { props.onAlign(Asc.c_oAscAlignH.Left) - }}>left + }}> + + { props.onAlign(Asc.c_oAscAlignH.Center) - }}>center + }}> + + { props.onAlign(Asc.c_oAscAlignH.Right) - }}>right + }}> + + @@ -125,10 +145,14 @@ const PageReplace = props => { - {props.onReplaceByFile()}}> + {props.onReplaceByFile()}}> + + + }}> + + ) @@ -141,10 +165,18 @@ const PageReorder = props => { - {props.onReorder('all-up')}}> - {props.onReorder('all-down')}}> - {props.onReorder('move-up')}}> - {props.onReorder('move-down')}}> + {props.onReorder('all-up')}} className='no-indicator'> + + + {props.onReorder('all-down')}} className='no-indicator'> + + + {props.onReorder('move-up')}} className='no-indicator'> + + + {props.onReorder('move-down')}} className='no-indicator'> + + ) @@ -173,7 +205,7 @@ const EditImage = props => { {props.onDefaulSize()}}/> - {props.onRemoveImage()}}/> + {props.onRemoveImage()}} className='red'/> ) diff --git a/apps/documenteditor/mobile/src/view/edit/EditParagraph.jsx b/apps/documenteditor/mobile/src/view/edit/EditParagraph.jsx index 4745c1c82..0fc14cda8 100644 --- a/apps/documenteditor/mobile/src/view/edit/EditParagraph.jsx +++ b/apps/documenteditor/mobile/src/view/edit/EditParagraph.jsx @@ -35,8 +35,8 @@ const PageAdvancedSettings = props => {
{displayBefore}
- - + +
@@ -44,8 +44,8 @@ const PageAdvancedSettings = props => {
{displayAfter}
- - + +
@@ -53,8 +53,8 @@ const PageAdvancedSettings = props => {
{firstLine + ' ' + metricText}
- - + +
diff --git a/apps/documenteditor/mobile/src/view/edit/EditShape.jsx b/apps/documenteditor/mobile/src/view/edit/EditShape.jsx index 66e3befa2..58095486e 100644 --- a/apps/documenteditor/mobile/src/view/edit/EditShape.jsx +++ b/apps/documenteditor/mobile/src/view/edit/EditShape.jsx @@ -1,6 +1,6 @@ import React, {Fragment, useState} from 'react'; import {observer, inject} from "mobx-react"; -import {List, ListItem, ListItemCell, Icon, Row, Col, Button, Page, Navbar, Segmented, BlockTitle, Toggle, Range} from 'framework7-react'; +import {List, ListItem, Icon, Row, Page, Navbar, BlockTitle, Toggle, Range, ListButton} from 'framework7-react'; import { useTranslation } from 'react-i18next'; const PageStyle = props => { @@ -27,33 +27,53 @@ const PageWrap = props => { - {props.onWrapType('inline')}}> - {props.onWrapType('square')}}> - {props.onWrapType('tight')}}> - {props.onWrapType('through')}}> - {props.onWrapType('top-bottom')}}> - {props.onWrapType('infront')}}> - {props.onWrapType('behind')}}> + {props.onWrapType('inline')}}> + + + {props.onWrapType('square')}}> + + + {props.onWrapType('tight')}}> + + + {props.onWrapType('through')}}> + + + {props.onWrapType('top-bottom')}}> + + + {props.onWrapType('infront')}}> + + + {props.onWrapType('behind')}}> + + { wrapType !== 'inline' && {_t.textAlign} - + { props.onShapeAlign(Asc.c_oAscAlignH.Left) - }}>left + }}> + + { props.onShapeAlign(Asc.c_oAscAlignH.Center) - }}>center + }}> + + { props.onShapeAlign(Asc.c_oAscAlignH.Right) - }}>right + }}> + + @@ -125,10 +145,18 @@ const PageReorder = props => { - {props.onReorder('all-up')}}> - {props.onReorder('all-down')}}> - {props.onReorder('move-up')}}> - {props.onReorder('move-down')}}> + {props.onReorder('all-up')}} className='no-indicator'> + + + {props.onReorder('all-down')}} className='no-indicator'> + + + {props.onReorder('move-up')}} className='no-indicator'> + + + {props.onReorder('move-down')}} className='no-indicator'> + + ) @@ -156,7 +184,7 @@ const EditShape = props => { }}> - {props.onRemoveShape()}}/> + {props.onRemoveShape()}} className='red'/> ) diff --git a/apps/documenteditor/mobile/src/view/edit/EditTable.jsx b/apps/documenteditor/mobile/src/view/edit/EditTable.jsx index bb7499958..d169b8537 100644 --- a/apps/documenteditor/mobile/src/view/edit/EditTable.jsx +++ b/apps/documenteditor/mobile/src/view/edit/EditTable.jsx @@ -1,6 +1,6 @@ import React, {Fragment, useState} from 'react'; import {observer, inject} from "mobx-react"; -import {Page, Navbar, List, ListItem, ListButton, Row, BlockTitle, Range, Toggle} from 'framework7-react'; +import {Page, Navbar, List, ListItem, ListButton, Row, BlockTitle, Range, Toggle, Icon} from 'framework7-react'; import { useTranslation } from 'react-i18next'; const PageTableOptions = props => { @@ -67,8 +67,12 @@ const PageWrap = props => { - {props.onWrapType(c_tableWrap.TABLE_WRAP_NONE)}}> - {props.onWrapType(c_tableWrap.TABLE_WRAP_PARALLEL)}}> + {props.onWrapType(c_tableWrap.TABLE_WRAP_NONE)}}> + + + {props.onWrapType(c_tableWrap.TABLE_WRAP_PARALLEL)}}> + + @@ -80,20 +84,26 @@ const PageWrap = props => { {_t.textAlign} - + { props.onWrapAlign(c_tableAlign.TABLE_ALIGN_LEFT) - }}>left + }}> + + { props.onWrapAlign(c_tableAlign.TABLE_ALIGN_CENTER) - }}>center + }}> + + { props.onWrapAlign(c_tableAlign.TABLE_ALIGN_RIGHT) - }}>right + }}> + + @@ -137,21 +147,33 @@ const EditTable = props => { return ( - + - {props.onAddColumnLeft()}}>col-left - {props.onAddColumnRight()}}>col-right - {props.onAddRowAbove()}}>row-above - {props.onAddRowBelow()}}>row-below + {props.onAddColumnLeft()}}> + + + {props.onAddColumnRight()}}> + + + {props.onAddRowAbove()}}> + + + {props.onAddRowBelow()}}> + + - + - {props.onRemoveColumn()}}>remove-column - {props.onRemoveRow()}}>remove-row + {props.onRemoveColumn()}}> + + + {props.onRemoveRow()}}> + + - {props.onRemoveTable()}}> + {props.onRemoveTable()}} className='red'> {
{displaySize}
- - + +
@@ -88,8 +88,8 @@ const PageAdditionalFormatting = props => {
{letterSpacing + ' ' + Common.Utils.Metric.getCurrentMetricName()}
- - + +
@@ -213,7 +213,7 @@ const EditText = props => { changeFontSize: props.changeFontSize, changeFontFamily: props.changeFontFamily }}/> - + { props.toggleBold(!isBold)}}>B {props.toggleItalic(!isItalic)}}>I @@ -238,18 +238,30 @@ const EditText = props => {
- + - {props.onParagraphAlign('left')}}>left - {props.onParagraphAlign('center')}}>center - {props.onParagraphAlign('right')}}>right - {props.onParagraphAlign('just')}}>just + {props.onParagraphAlign('left')}}> + + + {props.onParagraphAlign('center')}}> + + + {props.onParagraphAlign('right')}}> + + + {props.onParagraphAlign('just')}}> + + - + - {props.onParagraphMove(true)}}>moveleft - {props.onParagraphMove(false)}}>moveright + {props.onParagraphMove(true)}}> + + + {props.onParagraphMove(false)}}> + + {
{parseFloat(Common.Utils.Metric.fnRecalcFromMM(stateTop).toFixed(2)) + ' ' + metricText}
- - + +
@@ -76,8 +76,8 @@ const PageDocumentMargins = props => {
{parseFloat(Common.Utils.Metric.fnRecalcFromMM(stateBottom).toFixed(2))+ ' ' + metricText}
- - + +
@@ -85,8 +85,8 @@ const PageDocumentMargins = props => {
{parseFloat(Common.Utils.Metric.fnRecalcFromMM(stateLeft).toFixed(2))+ ' ' + metricText}
- - + +
@@ -94,8 +94,8 @@ const PageDocumentMargins = props => {
{parseFloat(Common.Utils.Metric.fnRecalcFromMM(stateRight).toFixed(2))+ ' ' + metricText}
- - + +