Skip to content

Commit

Permalink
Merge pull request '[VE] Fix styles' (#154) from fix/bugfix into rele…
Browse files Browse the repository at this point in the history
…ase/v8.3.0
  • Loading branch information
Julia Radzhabova committed Dec 2, 2024
2 parents 88dca17 + d29a7f6 commit 2aaf892
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 10 deletions.
7 changes: 6 additions & 1 deletion apps/common/main/lib/controller/Themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ define([
"toolbar-header-spreadsheet",
"toolbar-header-presentation",
"toolbar-header-pdf",
"toolbar-header-visio",

"text-toolbar-header-on-background-document",
"text-toolbar-header-on-background-spreadsheet",
"text-toolbar-header-on-background-presentation",
"text-toolbar-header-on-background-pdf",
"text-toolbar-header-on-background-visio",

"background-normal",
"background-toolbar",
Expand All @@ -120,10 +122,12 @@ define([
"highlight-toolbar-tab-underline-spreadsheet",
"highlight-toolbar-tab-underline-presentation",
"highlight-toolbar-tab-underline-pdf",
"highlight-toolbar-tab-underline-visio",
"highlight-header-tab-underline-document",
"highlight-header-tab-underline-spreadsheet",
"highlight-header-tab-underline-presentation",
"highlight-header-tab-underline-pdf",
"highlight-header-tab-underline-visio",

"border-toolbar",
"border-divider",
Expand Down Expand Up @@ -258,6 +262,7 @@ define([
_css_array.push('--', c + '-spreadsheet', ':', colors[c], ';');
_css_array.push('--', c + '-presentation', ':', colors[c], ';');
_css_array.push('--', c + '-pdf', ':', colors[c], ';');
_css_array.push('--', c + '-visio', ':', colors[c], ';');
console.log("Obsolete: The 'highlight-toolbar-tab-underline' color for interface themes is deprecated. Please use 'highlight-toolbar-tab-underline-document', 'highlight-toolbar-tab-underline-presentation', etc. instead.");
} else
_css_array.push('--', c, ':', colors[c], ';');
Expand Down Expand Up @@ -443,7 +448,7 @@ define([

return {
init: function (api) {
['toolbar-header-document', 'toolbar-header-spreadsheet', 'toolbar-header-presentation', 'toolbar-header-pdf']
['toolbar-header-document', 'toolbar-header-spreadsheet', 'toolbar-header-presentation', 'toolbar-header-pdf', 'toolbar-header-visio']
.forEach(function (i) {
document.documentElement.style.removeProperty('--' + i);
});
Expand Down
6 changes: 3 additions & 3 deletions apps/common/main/lib/util/themeinit.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@

inject_style_tag(':root .theme-dark {' +
'--toolbar-header-document: #2a2a2a; --toolbar-header-spreadsheet: #2a2a2a;' +
'--toolbar-header-presentation: #2a2a2a; --toolbar-header-pdf: #2a2a2a;}' +
'--toolbar-header-presentation: #2a2a2a; --toolbar-header-pdf: #2a2a2a; --toolbar-header-visio: #2a2a2a;}' +
':root .theme-contrast-dark {' +
'--toolbar-header-document: #1e1e1e; --toolbar-header-spreadsheet: #1e1e1e;' +
'--toolbar-header-presentation: #1e1e1e; --toolbar-header-pdf: #1e1e1e;}');
'--toolbar-header-presentation: #1e1e1e; --toolbar-header-pdf: #1e1e1e; --toolbar-header-visio: #1e1e1e;}');

let objtheme = window.uitheme.colors ? window.uitheme : localstorage.getItem("ui-theme");
const header_tokens = ['toolbar-header-document', 'toolbar-header-spreadsheet', 'toolbar-header-presentation', 'toolbar-header-pdf'];
const header_tokens = ['toolbar-header-document', 'toolbar-header-spreadsheet', 'toolbar-header-presentation', 'toolbar-header-pdf', 'toolbar-header-visio'];
if ( !!objtheme ) {
if ( typeof(objtheme) == 'string' && objtheme.lastIndexOf("{", 0) === 0 &&
objtheme.indexOf("}", objtheme.length - 1) !== -1 )
Expand Down
6 changes: 4 additions & 2 deletions apps/common/main/lib/view/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ define([
var _tabStyle = 'fill', _logoImage = '';
var isPDFEditor = !!window.PDFE,
isDocEditor = !!window.DE,
isSSEEditor = !!window.SSE;
isSSEEditor = !!window.SSE,
isVisioEditor = !!window.VE;

var templateUserItem =
'<li id="<%= user.get("iid") %>" class="<% if (!user.get("online")) { %> offline <% } if (user.get("view")) {%> viewmode <% } %>">' +
Expand Down Expand Up @@ -1088,7 +1089,8 @@ define([
tabBackground = tabBackground || Common.Utils.InternalSettings.get("settings-tab-background") || 'header';
if (!Common.Utils.isIE) {
var header_color = Common.UI.Themes.currentThemeColor(isDocEditor && config.isPDFForm || isPDFEditor ? '--toolbar-header-pdf' :
isDocEditor ? '--toolbar-header-document' : isSSEEditor ? '--toolbar-header-spreadsheet' : '--toolbar-header-presentation'),
isDocEditor ? '--toolbar-header-document' : isSSEEditor ? '--toolbar-header-spreadsheet' :
isVisioEditor ? '--toolbar-header-visio' : '--toolbar-header-presentation'),
toolbar_color = Common.UI.Themes.currentThemeColor('--background-toolbar'),
logo_type = (!config.twoLevelHeader || config.compactHeader) && (tabBackground==='toolbar') ? toolbar_color : header_color;
isDark = (new Common.Utils.RGBColor(logo_type)).isDark();
Expand Down
4 changes: 4 additions & 0 deletions apps/common/main/resources/less/colors-table-classic.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
--toolbar-header-spreadsheet: #40865c;
--toolbar-header-presentation: #BE664F;
--toolbar-header-pdf: #AA5252;
--toolbar-header-visio: #444796;

--text-toolbar-header-on-background-document: #38567A;
--text-toolbar-header-on-background-spreadsheet: #336B49;
--text-toolbar-header-on-background-presentation: #854535;
--text-toolbar-header-on-background-pdf: #8D4444;
--text-toolbar-header-on-background-visio: #444796;

--background-normal: #fff;
--background-toolbar: #f1f1f1;
Expand Down Expand Up @@ -40,11 +42,13 @@
--highlight-header-tab-underline-spreadsheet: var(--text-toolbar-header);
--highlight-header-tab-underline-presentation: var(--text-toolbar-header);
--highlight-header-tab-underline-pdf: var(--text-toolbar-header);
--highlight-header-tab-underline-visio: var(--text-toolbar-header);

--highlight-toolbar-tab-underline-document: #446995;
--highlight-toolbar-tab-underline-spreadsheet: #40865c;
--highlight-toolbar-tab-underline-presentation: #BE664F;
--highlight-toolbar-tab-underline-pdf: #AA5252;
--highlight-toolbar-tab-underline-visio: #444796;

--border-toolbar: #cbcbcb;
--border-divider: #cbcbcb;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
--toolbar-header-spreadsheet: #1e1e1e;
--toolbar-header-presentation: #1e1e1e;
--toolbar-header-pdf: #1e1e1e;
--toolbar-header-visio: #1e1e1e;

--text-toolbar-header-on-background-document: #2a2a2a;
--text-toolbar-header-on-background-spreadsheet: #2a2a2a;
--text-toolbar-header-on-background-presentation: #2a2a2a;
--text-toolbar-header-on-background-pdf: #2a2a2a;
--text-toolbar-header-on-background-visio: #2a2a2a;

--background-normal: #212121;
--background-toolbar: #2a2a2a;
Expand Down Expand Up @@ -76,11 +78,13 @@
--highlight-header-tab-underline-spreadsheet: #40865c;
--highlight-header-tab-underline-presentation: #BE664F;
--highlight-header-tab-underline-pdf: #AA5252;
--highlight-header-tab-underline-visio: #444796;

--highlight-toolbar-tab-underline-document: #446995;
--highlight-toolbar-tab-underline-spreadsheet: #40865c;
--highlight-toolbar-tab-underline-presentation: #BE664F;
--highlight-toolbar-tab-underline-pdf: #AA5252;
--highlight-toolbar-tab-underline-visio: #444796;

// Canvas

Expand Down
4 changes: 4 additions & 0 deletions apps/common/main/resources/less/colors-table-dark.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
--toolbar-header-spreadsheet: #2a2a2a;
--toolbar-header-presentation: #2a2a2a;
--toolbar-header-pdf: #2a2a2a;
--toolbar-header-visio: #2a2a2a;

--text-toolbar-header-on-background-document: #2a2a2a;
--text-toolbar-header-on-background-spreadsheet: #2a2a2a;
--text-toolbar-header-on-background-presentation: #2a2a2a;
--text-toolbar-header-on-background-pdf: #2a2a2a;
--text-toolbar-header-on-background-visio: #2a2a2a;

--background-normal: #333;
--background-toolbar: #404040;
Expand Down Expand Up @@ -76,11 +78,13 @@
--highlight-header-tab-underline-spreadsheet: #40865c;
--highlight-header-tab-underline-presentation: #BE664F;
--highlight-header-tab-underline-pdf: #AA5252;
--highlight-header-tab-underline-visio: #444796;

--highlight-toolbar-tab-underline-document: #446995;
--highlight-toolbar-tab-underline-spreadsheet: #40865c;
--highlight-toolbar-tab-underline-presentation: #BE664F;
--highlight-toolbar-tab-underline-pdf: #AA5252;
--highlight-toolbar-tab-underline-visio: #444796;

// Canvas

Expand Down
4 changes: 4 additions & 0 deletions apps/common/main/resources/less/colors-table-gray.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
--toolbar-header-spreadsheet: #f7f7f7;
--toolbar-header-presentation: #f7f7f7;
--toolbar-header-pdf: #f7f7f7;
--toolbar-header-visio: #f7f7f7;

--text-toolbar-header-on-background-document: #FFFFFF;
--text-toolbar-header-on-background-spreadsheet: #FFFFFF;
--text-toolbar-header-on-background-presentation: #FFFFFF;
--text-toolbar-header-on-background-pdf: #FFFFFF;
--text-toolbar-header-on-background-visio: #FFFFFF;

--background-normal: #fff;
--background-toolbar: #f7f7f7;
Expand Down Expand Up @@ -78,11 +80,13 @@
--highlight-header-tab-underline-spreadsheet: #40865c;
--highlight-header-tab-underline-presentation: #BE664F;
--highlight-header-tab-underline-pdf: #AA5252;
--highlight-header-tab-underline-visio: #444796;

--highlight-toolbar-tab-underline-document: #446995;
--highlight-toolbar-tab-underline-spreadsheet: #40865c;
--highlight-toolbar-tab-underline-presentation: #BE664F;
--highlight-toolbar-tab-underline-pdf: #AA5252;
--highlight-toolbar-tab-underline-visio: #444796;

// Canvas

Expand Down
3 changes: 2 additions & 1 deletion apps/common/mobile/lib/controller/VersionHistory.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const VersionHistoryController = inject('storeAppOptions', 'storeVersionHistory'
const fileTypes = {
de: 'docx',
pe: 'pptx',
sse: 'xslx'
sse: 'xslx',
ve: 'vsdx'
};
const fileType = fileTypes[window.editorType];
const { t } = useTranslation();
Expand Down
3 changes: 3 additions & 0 deletions apps/common/mobile/lib/pages/CollaborationPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ switch (window.asceditor) {
case 'cell':
storeInfo = 'storeSpreadsheetInfo';
break;
case 'visio':
storeInfo = 'storeVisioInfo';
break;
}

const Collaboration = inject('storeAppOptions', 'users', storeInfo)(observer(CollaborationPage));
Expand Down
3 changes: 2 additions & 1 deletion apps/common/mobile/lib/view/About.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ const PageAbout = props => {
const editors = {
de: 'DOCUMENT EDITOR',
pe: 'PRESENTATION EDITOR',
sse: 'SPREADSHEET EDITOR'
sse: 'SPREADSHEET EDITOR',
ve: 'VISIO EDITOR'
};

const nameEditor = (_t.textEditor || editors[editorType]).toUpperCase();
Expand Down
2 changes: 1 addition & 1 deletion apps/presentationeditor/main/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@
if (!(isIEBrowser && ieVer && parseFloat(ieVer[1]) < 11.0)) {
var docstyle = getComputedStyle(document.body),
header_color = docstyle.getPropertyValue('--toolbar-header-presentation'),
toolbar_color = docstyle.getPropertyValue('--background-toolbar')
toolbar_color = docstyle.getPropertyValue('--background-toolbar');
logo_type = (view || compact) && (tabBackground==='toolbar') ? toolbar_color : header_color;
isDark = logo_type ? isDarkColor(logo_type) : isDarkTheme ? true : !((view || compact) && (tabBackground==='toolbar'));
image = isDark ? logoDark || logo || logoLight : logoLight || logo || logoDark;
Expand Down
2 changes: 1 addition & 1 deletion apps/visioeditor/main/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@
if (!(isIEBrowser && ieVer && parseFloat(ieVer[1]) < 11.0)) {
var docstyle = getComputedStyle(document.body),
header_color = docstyle.getPropertyValue('--toolbar-header-visio'),
toolbar_color = docstyle.getPropertyValue('--background-toolbar')
toolbar_color = docstyle.getPropertyValue('--background-toolbar');
logo_type = (view || compact) && (tabBackground==='toolbar') ? toolbar_color : header_color;
isDark = logo_type ? isDarkColor(logo_type) : isDarkTheme ? true : !((view || compact) && (tabBackground==='toolbar'));
image = isDark ? logoDark || logo || logoLight : logoLight || logo || logoDark;
Expand Down

0 comments on commit 2aaf892

Please sign in to comment.