Skip to content

Commit 78631d2

Browse files
authored
Theming (#1656)
* Readded osparc specific decorations and appearances * Brought back the fonts * Finished theme refactor with the colors * Updated theme version and relocated common Color theme * Saving last selected theme in localStorage for future recovery
1 parent 4159b89 commit 78631d2

File tree

19 files changed

+952
-42
lines changed

19 files changed

+952
-42
lines changed

services/web/client/Manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@qooxdoo/compiler": "^1.0.0-beta",
4141
"@qooxdoo/framework": "^6.0.0-beta",
4242
"ITISFoundation/qx-iconfont-fontawesome5": "^0.2.0",
43-
"ITISFoundation/qx-osparc-theme": "^0.5.4",
43+
"ITISFoundation/qx-osparc-theme": "^0.5.5",
4444
"qooxdoo/qxl.testtapper": "^0.4.3",
4545
"qooxdoo/qxl.apiviewer": "^1.0.0-beta",
4646
"ITISFoundation/qx-iconfont-material": "^0.1.5"

services/web/client/compile.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@
2121
"applications": [
2222
{
2323
"class": "osparc.Application",
24-
"theme": "osparc.theme.Theme",
24+
"theme": "osparc.theme.ThemeDark",
2525
"name": "osparc",
2626
"title": "oSPARC",
2727
"default": true,
2828
"include": [
2929
"iconfont.material.Load",
3030
"iconfont.fontawesome5.Load",
31-
"osparc.theme.OSparcLight"
31+
"osparc.theme.ThemeLight"
3232
],
3333
"bootPath": "source/boot"
3434
},
3535
{
3636
"class": "explorer.Application",
37-
"theme": "osparc.theme.Theme",
37+
"theme": "osparc.theme.ThemeDark",
3838
"name": "explorer",
3939
"title": "oSPARC Explorer",
4040
"include": [
@@ -67,7 +67,7 @@
6767
{
6868
"class": "qxl.testtapper.Application",
6969
"name": "testtapper",
70-
"theme": "osparc.theme.Theme",
70+
"theme": "osparc.theme.ThemeDark",
7171
"title": "Qooxdoo TestTAPper",
7272
"environment": {
7373
"qx.icontheme": "Tango"

services/web/client/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
{
3232
"APPLICATION" : "osparc",
3333
"QOOXDOO_PATH" : "../qooxdoo-sdk/",
34-
"QXTHEME" : "qx.theme.Modern",
34+
"QXTHEME" : "osparc.theme.ThemeDark",
3535
"API_EXCLUDE" : ["qx.*", "${APPLICATION}.theme.*", "${APPLICATION}.test.*"],
3636
"LOCALES" : [ "en" ],
3737
"ROOT" : "."

services/web/client/qx-lock.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
},
1111
{
1212
"library_name": "qx-osparc-theme",
13-
"library_version": "0.5.4",
14-
"path": "qx_packages/ITISFoundation_qx-osparc-theme_v0_5_4",
13+
"library_version": "0.5.5",
14+
"path": "qx_packages/ITISFoundation_qx-osparc-theme_v0_5_5",
1515
"uri": "ITISFoundation/qx-osparc-theme",
1616
"repo_name": "ITISFoundation/qx-osparc-theme",
17-
"repo_tag": "v0.5.4"
17+
"repo_tag": "v0.5.5"
1818
},
1919
{
2020
"library_name": "qx-iconfont-material",

services/web/client/source/class/osparc/Application.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ qx.Class.define("osparc.Application", {
4141
main: function() {
4242
// Call super class
4343
this.base();
44+
45+
// Load user preferred theme if present
46+
if (window.localStorage.getItem("themeName") &&
47+
window.localStorage.getItem("themeName") !== qx.theme.manager.Meta.getInstance().getTheme().name) {
48+
qx.theme.manager.Meta.getInstance().setTheme(
49+
qx.Theme.getByName(window.localStorage.getItem("themeName"))
50+
);
51+
}
52+
4453
this.__preventAutofillBrowserSyles();
4554

4655
// Enable logging in debug variant

services/web/client/source/class/osparc/component/workbench/WorkbenchUI.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,15 +838,15 @@ qx.Class.define("osparc.component.workbench.WorkbenchUI", {
838838
if (oldId) {
839839
if (this.__isSelectedItemAnEdge()) {
840840
const unselectedEdge = this.__getEdgeUI(oldId);
841-
const unselectedColor = osparc.theme.Color.colors["workbench-edge-comp-active"];
841+
const unselectedColor = qx.theme.manager.Color.getInstance().getTheme().colors["workbench-edge-comp-active"];
842842
this.__svgWidgetLinks.updateColor(unselectedEdge.getRepresentation(), unselectedColor);
843843
}
844844
}
845845

846846
this.__selectedItemId = newID;
847847
if (this.__isSelectedItemAnEdge()) {
848848
const selectedEdge = this.__getEdgeUI(newID);
849-
const selectedColor = osparc.theme.Color.colors["workbench-edge-selected"];
849+
const selectedColor = qx.theme.manager.Color.getInstance().getTheme().colors["workbench-edge-selected"];
850850
this.__svgWidgetLinks.updateColor(selectedEdge.getRepresentation(), selectedColor);
851851
} else if (newID) {
852852
this.fireDataEvent("changeSelectedNode", newID);

services/web/client/source/class/osparc/desktop/NavigationBar.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ qx.Class.define("osparc.desktop.NavigationBar", {
178178
this._add(control);
179179
break;
180180
case "theme-switch":
181-
control = new osparc.ui.switch.ThemeSwitcher();
181+
control = new osparc.ui.switch.ThemeSwitcher().set({
182+
checked: qx.theme.manager.Meta.getInstance().getTheme().name === "osparc.theme.ThemeLight"
183+
});
182184
this._add(control);
183185
break;
184186
case "user-menu":

0 commit comments

Comments
 (0)