From d43d9d61d2bbcaaa73b62dd6d2159951c37574a9 Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Wed, 23 Dec 2020 21:02:52 +0300 Subject: [PATCH] [DE mobile] Added font color page (auto color, theme color, standart color) --- .../mobile/src/controller/edit/EditText.jsx | 8 +++ .../mobile/src/view/edit/Edit.jsx | 6 ++- .../mobile/src/view/edit/EditText.jsx | 52 ++++++++++++++++--- 3 files changed, 58 insertions(+), 8 deletions(-) diff --git a/apps/documenteditor/mobile/src/controller/edit/EditText.jsx b/apps/documenteditor/mobile/src/controller/edit/EditText.jsx index 21fdf96b7..a86f5cdcb 100644 --- a/apps/documenteditor/mobile/src/controller/edit/EditText.jsx +++ b/apps/documenteditor/mobile/src/controller/edit/EditText.jsx @@ -33,6 +33,13 @@ class EditTextController extends Component { } } + onTextColorAuto() { + const api = Common.EditorApi.get(); + const color = new Asc.asc_CColor(); + color.put_auto(true); + api.put_TextColor(color); + } + toggleBold(value) { const api = Common.EditorApi.get(); if (api) { @@ -174,6 +181,7 @@ class EditTextController extends Component { return ( { const isAndroid = Device.android; const { t } = useTranslation(); @@ -208,6 +210,37 @@ const PageLineSpacing = props => { ) }; +const PageFontColor = props => { + const { t } = useTranslation(); + const _t = t('Edit', {returnObjects: true}); + const [stateColor, setColor] = useState(); + const changeCurColor = (color) => { + setColor(color); + }; + const onAddCustomColor = () => { + console.log('add custom color'); + }; + return( + + + + { + props.onTextColorAuto(); + setColor('auto'); + }}> +
+
+
+
+
+ + + {onAddCustomColor()}}> + +
+ ) +}; + const EditText = props => { const isAndroid = Device.android; const { t } = useTranslation(); @@ -235,7 +268,9 @@ const EditText = props => { {props.toggleStrikethrough(!isStrikethrough)}} style={{textDecoration: "line-through"}}>S - + {!isAndroid && } @@ -305,9 +340,12 @@ const PageBulletsContainer = inject("storeTextSettings")(observer(PageBullets)); const PageNumbersContainer = inject("storeTextSettings")(observer(PageNumbers)); const PageLineSpacingContainer = inject("storeTextSettings")(observer(PageLineSpacing)); -export {EditTextContainer as EditText, - PageFontsContainer as PageFonts, - PageAddFormattingContainer as PageAdditionalFormatting, - PageBulletsContainer as PageBullets, - PageNumbersContainer as PageNumbers, - PageLineSpacingContainer as PageLineSpacing}; \ No newline at end of file +export { + EditTextContainer as EditText, + PageFontsContainer as PageFonts, + PageAddFormattingContainer as PageAdditionalFormatting, + PageBulletsContainer as PageBullets, + PageNumbersContainer as PageNumbers, + PageLineSpacingContainer as PageLineSpacing, + PageFontColor +}; \ No newline at end of file