Skip to content

Commit 0eaea50

Browse files
authored
🎨 [Frontend] (Too) light buttons (#8274)
1 parent c6c1d60 commit 0eaea50

File tree

16 files changed

+33
-13
lines changed

16 files changed

+33
-13
lines changed

services/static-webserver/client/source/class/osparc/jobs/RunsTable.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ qx.Class.define("osparc.jobs.RunsTable", {
4444

4545
Object.values(this.self().COLS).forEach(col => columnModel.setColumnWidth(col.column, col.width));
4646

47-
const iconPathStop = "osparc/icons/circle-xmark-text.svg";
4847
const shouldShowCancel = cellInfo => {
4948
if (cellInfo && cellInfo.rowData && cellInfo.rowData["state"]) {
5049
return [
@@ -53,10 +52,10 @@ qx.Class.define("osparc.jobs.RunsTable", {
5352
}
5453
return false;
5554
}
55+
const iconPathStop = osparc.ui.switch.ThemeSwitcher.isLight() ? "osparc/icons/circle-xmark-black.svg" : "osparc/icons/circle-xmark-white.svg";
5656
const fontButtonRendererStop = new osparc.ui.table.cellrenderer.ImageButtonRenderer("cancel", iconPathStop, shouldShowCancel);
5757
columnModel.setDataCellRenderer(this.self().COLS.ACTION_CANCEL.column, fontButtonRendererStop);
5858

59-
const iconPathInfo = "osparc/icons/circle-info-text.svg";
6059
const jobsStore =osparc.store.Jobs.getInstance();
6160
const shouldShowInfo = cellInfo => {
6261
if (cellInfo && cellInfo.rowData && cellInfo.rowData["collectionRunId"]) {
@@ -68,6 +67,7 @@ qx.Class.define("osparc.jobs.RunsTable", {
6867
}
6968
return false;
7069
}
70+
const iconPathInfo = osparc.ui.switch.ThemeSwitcher.isLight() ? "osparc/icons/circle-info-black.svg" : "osparc/icons/circle-info-white.svg";
7171
const fontButtonRendererInfo = new osparc.ui.table.cellrenderer.ImageButtonRenderer("info", iconPathInfo, shouldShowInfo);
7272
columnModel.setDataCellRenderer(this.self().COLS.ACTION_INFO.column, fontButtonRendererInfo);
7373

@@ -166,8 +166,9 @@ qx.Class.define("osparc.jobs.RunsTable", {
166166
this.addListener("cellTap", e => {
167167
const rowIdx = e.getRow();
168168
const target = e.getOriginalTarget();
169-
if (target.closest(".qx-material-button") && (target.tagName === "IMG" || target.tagName === "DIV")) {
170-
const action = target.closest(".qx-material-button").getAttribute("data-action");
169+
const closestItems = osparc.ui.table.cellrenderer.ImageButtonRenderer.getClosestItems(target);
170+
if (closestItems && (target.tagName === "IMG" || target.tagName === "DIV")) {
171+
const action = closestItems.getAttribute("data-action");
171172
if (action) {
172173
this.__handleButtonClick(action, rowIdx);
173174
}

services/static-webserver/client/source/class/osparc/jobs/SubRunsTable.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ qx.Class.define("osparc.jobs.SubRunsTable", {
3737

3838
Object.values(this.self().COLS).forEach(col => columnModel.setColumnWidth(col.column, col.width));
3939

40-
const iconPathInfo = "osparc/icons/circle-info-text.svg";
40+
const iconPathInfo = osparc.ui.switch.ThemeSwitcher.isLight() ? "osparc/icons/circle-info-black.svg" : "osparc/icons/circle-info-white.svg";
4141
const fontButtonRendererInfo = new osparc.ui.table.cellrenderer.ImageButtonRenderer("info", iconPathInfo);
4242
columnModel.setDataCellRenderer(this.self().COLS.INFO.column, fontButtonRendererInfo);
4343

44-
const iconPathLogs = "osparc/icons/file-download-text.svg";
44+
const iconPathLogs = osparc.ui.switch.ThemeSwitcher.isLight() ? "osparc/icons/file-download-black.svg" : "osparc/icons/file-download-white.svg";
4545
const fontButtonRendererLogs = new osparc.ui.table.cellrenderer.ImageButtonRenderer("logs", iconPathLogs);
4646
columnModel.setDataCellRenderer(this.self().COLS.LOGS.column, fontButtonRendererLogs);
4747

@@ -136,8 +136,9 @@ qx.Class.define("osparc.jobs.SubRunsTable", {
136136
this.addListener("cellTap", e => {
137137
const row = e.getRow();
138138
const target = e.getOriginalTarget();
139-
if (target.closest(".qx-material-button") && (target.tagName === "IMG" || target.tagName === "DIV")) {
140-
const action = target.closest(".qx-material-button").getAttribute("data-action");
139+
const closestItems = osparc.ui.table.cellrenderer.ImageButtonRenderer.getClosestItems(target);
140+
if (closestItems && (target.tagName === "IMG" || target.tagName === "DIV")) {
141+
const action = closestItems.getAttribute("data-action");
141142
if (action) {
142143
this.__handleButtonClick(action, row);
143144
}

services/static-webserver/client/source/class/osparc/theme/ColorDark.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ qx.Theme.define("osparc.theme.ColorDark", {
3535
"navigation_bar_background_color": "rgba(1, 18, 26, 0.8)",
3636
"fab_text": "contrasted-text-dark",
3737
"fab-background": "rgba(255, 255, 255, 0.2)",
38-
"input_background": "#213248",
38+
"input_background": "rgb(33, 50, 72)",
3939
"input_background_disable": "rgba(113, 157, 181, 0.25)",
4040
"hint-background": "rgba(82, 82, 82, 1)",
4141
"transparent_overlay": "rgba(1, 18, 26, 0.1)",

services/static-webserver/client/source/class/osparc/theme/ColorLight.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ qx.Theme.define("osparc.theme.ColorLight", {
3434

3535
"navigation_bar_background_color": "rgba(229, 229, 229, 0.8)",
3636
"fab_text": "contrasted-text-dark",
37-
"fab-background": "rgba(255, 255, 255, 0.2)",
37+
"fab-background": "rgba(0, 0, 0, 0.2)",
3838
"input_background": "rgba(209, 214, 218, 1)",
3939
"input_background_disable": "rgba(113, 157, 181, 0.04)",
4040
"hint-background": "rgba(201, 201, 201, 1)",

services/static-webserver/client/source/class/osparc/ui/basic/SVGImage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ qx.Class.define("osparc.ui.basic.SVGImage", {
6868
filter = "invert(66%) sepia(24%) saturate(5763%) hue-rotate(188deg) brightness(101%) contrast(101%)";
6969
break;
7070
case "text": // light or dark
71-
if (qx.theme.manager.Meta.getInstance().getTheme().basename === "ThemeLight") {
71+
if (osparc.ui.switch.ThemeSwitcher.isLight()) {
7272
// ThemeLight #282828
7373
filter = "invert(10%) sepia(4%) saturate(19%) hue-rotate(354deg) brightness(102%) contrast(86%)";
7474
} else {

services/static-webserver/client/source/class/osparc/ui/switch/ThemeSwitcher.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ qx.Class.define("osparc.ui.switch.ThemeSwitcher", {
1313
type: "static",
1414

1515
statics: {
16+
isLight: function() {
17+
const currentTheme = qx.theme.manager.Meta.getInstance().getTheme();
18+
return currentTheme.basename === "ThemeLight";
19+
},
20+
1621
getValidThemes: function() {
1722
return Object.values(qx.Theme.getAll()).filter(theme => theme.type === "meta");
1823
},

services/static-webserver/client/source/class/osparc/ui/table/cellrenderer/ButtonRenderer.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ qx.Class.define("osparc.ui.table.cellrenderer.ButtonRenderer", {
3838
}
3939
},
4040

41+
statics: {
42+
BUTTON_CLASS: "qx-material-button",
43+
},
44+
4145
members: {
4246
// Override
4347
_getContentHtml: function(cellInfo) {
@@ -46,7 +50,7 @@ qx.Class.define("osparc.ui.table.cellrenderer.ButtonRenderer", {
4650

4751
// Return the button with the image
4852
return `
49-
<div class="qx-material-button"
53+
<div class="${this.self().BUTTON_CLASS}"
5054
data-action="${clickAction}" data-row="${cellInfo.row}"
5155
style="cursor:pointer; padding:2px 2px; width:26px; height:18px; display:flex; align-items:center; justify-content:center;"
5256
>

services/static-webserver/client/source/class/osparc/ui/table/cellrenderer/ImageButtonRenderer.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ qx.Class.define("osparc.ui.table.cellrenderer.ImageButtonRenderer", {
3636
},
3737
},
3838

39+
statics: {
40+
getClosestItems: function(target, className = osparc.ui.table.cellrenderer.ButtonRenderer.BUTTON_CLASS) {
41+
return target.closest("."+className)
42+
},
43+
},
44+
3945
members: {
4046
__imageCache: null,
4147
__shouldShowFn: null,

services/static-webserver/client/source/class/osparc/widget/logger/LoggerModel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ qx.Class.define("osparc.widget.logger.LoggerModel", {
8989
iconSource = "osparc/icons/circle-exclamation-solid.svg";
9090
break;
9191
case logLevels.ERROR:
92-
iconSource = "osparc/icons/circle-xmark-solid.svg";
92+
iconSource = "osparc/icons/circle-xmark-red.svg";
9393
break;
9494
}
9595
return iconSource;
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)