[SSE mobile] Added Cell Settings

This commit is contained in:
SergeyEzhin 2021-02-09 15:24:35 +03:00
parent 7981bd1b43
commit 1456990fa9
3 changed files with 11 additions and 30 deletions

View file

@ -209,7 +209,7 @@ class MainController extends Component {
const styleSize = storeCellSettings.styleSize; const styleSize = storeCellSettings.styleSize;
this.api.asc_registerCallback('asc_onSelectionChanged', cellInfo => { this.api.asc_registerCallback('asc_onSelectionChanged', cellInfo => {
console.log(cellInfo); // console.log(cellInfo);
storeFocusObjects.resetCellInfo(cellInfo); storeFocusObjects.resetCellInfo(cellInfo);
storeCellSettings.initCellSettings(cellInfo); storeCellSettings.initCellSettings(cellInfo);
let selectedObjects = Common.EditorApi.get().asc_getGraphicObjectProps(); let selectedObjects = Common.EditorApi.get().asc_getGraphicObjectProps();
@ -227,7 +227,7 @@ class MainController extends Component {
}); });
this.api.asc_registerCallback('asc_onEditorSelectionChanged', fontObj => { this.api.asc_registerCallback('asc_onEditorSelectionChanged', fontObj => {
console.log(fontObj) // console.log(fontObj)
storeCellSettings.initFontInfo(fontObj); storeCellSettings.initFontInfo(fontObj);
}); });

View file

@ -39,9 +39,9 @@ export class storeCellSettings {
this.initFontSettings(xfs); this.initFontSettings(xfs);
let color = xfs.asc_getFillColor(); let color = xfs.asc_getFillColor();
console.log(color); // console.log(color);
let clr = this.resetColor(color); let clr = color.get_auto() ? 'transparent' : this.resetColor(color);
this.fillColor = clr; this.fillColor = clr;
this.styleName = cellInfo.asc_getStyleName(); this.styleName = cellInfo.asc_getStyleName();
@ -150,7 +150,6 @@ export class storeCellSettings {
if(color) { if(color) {
if (color.get_auto()) { if (color.get_auto()) {
// return clr;
clr = 'auto' clr = 'auto'
} else { } else {
if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) { if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {

View file

@ -14,7 +14,7 @@ const EditCell = props => {
const cellStyles = storeCellSettings.cellStyles; const cellStyles = storeCellSettings.cellStyles;
const styleName = storeCellSettings.styleName; const styleName = storeCellSettings.styleName;
console.log(storeCellSettings); // console.log(storeCellSettings);
const fontInfo = storeCellSettings.fontInfo; const fontInfo = storeCellSettings.fontInfo;
const fontName = fontInfo.name || _t.textFonts; const fontName = fontInfo.name || _t.textFonts;
@ -22,7 +22,8 @@ const EditCell = props => {
const fontColor = storeCellSettings.fontColor; const fontColor = storeCellSettings.fontColor;
const displaySize = typeof fontSize === 'undefined' ? _t.textAuto : fontSize + ' ' + _t.textPt; const displaySize = typeof fontSize === 'undefined' ? _t.textAuto : fontSize + ' ' + _t.textPt;
const fillColor = storeCellSettings.fillColor; const fillColor = storeCellSettings.fillColor;
console.log(fillColor);
// console.log(fillColor);
const isBold = storeCellSettings.isBold; const isBold = storeCellSettings.isBold;
const isItalic = storeCellSettings.isItalic; const isItalic = storeCellSettings.isItalic;
@ -32,7 +33,7 @@ const EditCell = props => {
<span className="color-preview" style={{ background: `#${(typeof fontColor === "object" ? fontColor.color : fontColor)}`}}></span> : <span className="color-preview" style={{ background: `#${(typeof fontColor === "object" ? fontColor.color : fontColor)}`}}></span> :
<span className="color-preview"></span>; <span className="color-preview"></span>;
const fillColorPreview = fillColor !== 'auto' ? const fillColorPreview = fillColor !== 'transparent' ?
<span className="color-preview" style={{ background: `#${(typeof fillColor === "object" ? fillColor.color : fillColor)}`}}></span> : <span className="color-preview" style={{ background: `#${(typeof fillColor === "object" ? fillColor.color : fillColor)}`}}></span> :
<span className="color-preview"></span>; <span className="color-preview"></span>;
@ -186,16 +187,10 @@ const PageFontsCell = props => {
const PageTextColorCell = props => { const PageTextColorCell = props => {
const { t } = useTranslation(); const { t } = useTranslation();
const _t = t("View.Edit", { returnObjects: true }); const _t = t("View.Edit", { returnObjects: true });
// const storeFocusObjects = props.storeFocusObjects;
// const slideObject = storeFocusObjects.slideObject;
const storePalette = props.storePalette; const storePalette = props.storePalette;
const storeCellSettings = props.storeCellSettings; const storeCellSettings = props.storeCellSettings;
const customColors = storePalette.customColors; const customColors = storePalette.customColors;
let fontColor = storeCellSettings.fontColor; const fontColor = storeCellSettings.fontColor;
if(typeof fontColor === 'object') {
fontColor = storeCellSettings.fontColor.color;
}
const changeColor = (color, effectId, effectValue) => { const changeColor = (color, effectId, effectValue) => {
if (color !== 'empty') { if (color !== 'empty') {
@ -233,18 +228,10 @@ const PageTextColorCell = props => {
const PageFillColorCell = props => { const PageFillColorCell = props => {
const { t } = useTranslation(); const { t } = useTranslation();
const _t = t("View.Edit", { returnObjects: true }); const _t = t("View.Edit", { returnObjects: true });
// const storeFocusObjects = props.storeFocusObjects;
// const slideObject = storeFocusObjects.slideObject;
const storePalette = props.storePalette; const storePalette = props.storePalette;
const storeCellSettings = props.storeCellSettings; const storeCellSettings = props.storeCellSettings;
const customColors = storePalette.customColors; const customColors = storePalette.customColors;
let fillColor = storeCellSettings.fillColor; const fillColor = storeCellSettings.fillColor;
if(typeof fillColor === 'object') {
fillColor = storeCellSettings.fillColor.color;
}
console.log(fillColor);
const changeColor = (color, effectId, effectValue) => { const changeColor = (color, effectId, effectValue) => {
if (color !== 'empty') { if (color !== 'empty') {
@ -569,14 +556,10 @@ const PageBorderColorCell = props => {
const storePalette = props.storePalette; const storePalette = props.storePalette;
const storeCellSettings = props.storeCellSettings; const storeCellSettings = props.storeCellSettings;
const borderInfo = storeCellSettings.borderInfo; const borderInfo = storeCellSettings.borderInfo;
let borderColor = borderInfo.color; const borderColor = borderInfo.color;
const borderStyle = storeCellSettings.borderStyle; const borderStyle = storeCellSettings.borderStyle;
const customColors = storePalette.customColors; const customColors = storePalette.customColors;
if(typeof borderColor === "object") {
borderColor = borderInfo.color.color;
}
const changeColor = (color, effectId, effectValue) => { const changeColor = (color, effectId, effectValue) => {
if (color !== 'empty') { if (color !== 'empty') {
if (effectId !== undefined ) { if (effectId !== undefined ) {
@ -645,7 +628,6 @@ const PageBorderSizeCell = props => {
const storeCellSettings = props.storeCellSettings; const storeCellSettings = props.storeCellSettings;
const borderInfo = storeCellSettings.borderInfo; const borderInfo = storeCellSettings.borderInfo;
const borderStyle = storeCellSettings.borderStyle; const borderStyle = storeCellSettings.borderStyle;
// const borderSizes = storeCellSettings.borderSizes;
const borderSizes = { const borderSizes = {
7: `${_t.textThin}`, 7: `${_t.textThin}`,