Skip to content

Commit 6fccbee

Browse files
odeimaizmrnicegyu11
authored andcommitted
🎨 [Frontend] Make the Workspace UI element more distinguishable (ITISFoundation#6576)
1 parent 63469da commit 6fccbee

File tree

5 files changed

+95
-17
lines changed

5 files changed

+95
-17
lines changed

‎services/static-webserver/client/source/class/osparc/dashboard/FolderWithSharedIcon.js‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,28 @@ qx.Class.define("osparc.dashboard.FolderWithSharedIcon", {
2323

2424
this._setLayout(new qx.ui.layout.Canvas());
2525

26-
this._createChildControlImpl("folder-icon");
27-
this._createChildControlImpl("shared-icon");
26+
this.getChildControl("folder-icon");
27+
this.getChildControl("shared-icon");
2828
},
2929

3030
members: {
3131
_createChildControlImpl: function(id) {
3232
let control;
3333
switch (id) {
34-
case "folder-icon": {
35-
control = new qx.ui.basic.Image().set({
36-
source: "@FontAwesome5Solid/folder/26"
37-
});
38-
const iconContainer = new qx.ui.container.Composite(new qx.ui.layout.HBox().set({
34+
case "icon-container":
35+
control = new qx.ui.container.Composite(new qx.ui.layout.HBox().set({
3936
alignY: "middle"
4037
}));
41-
iconContainer.add(control);
42-
this._add(iconContainer, {
38+
this._add(control, {
4339
height: "100%"
4440
});
4541
break;
46-
}
42+
case "folder-icon":
43+
control = new qx.ui.basic.Image().set({
44+
source: "@FontAwesome5Solid/folder/26"
45+
});
46+
this.getChildControl("icon-container").add(control);
47+
break;
4748
case "shared-icon":
4849
control = new qx.ui.basic.Image().set({
4950
textColor: "strong-main",

‎services/static-webserver/client/source/class/osparc/dashboard/WorkspaceButtonBase.js‎

Lines changed: 79 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ qx.Class.define("osparc.dashboard.WorkspaceButtonBase", {
6868
ITEM_WIDTH: 190,
6969
ITEM_HEIGHT: 190,
7070
PADDING: 10,
71-
SPACING_IN: 5,
7271
SPACING: 15,
7372
HEADER_MAX_HEIGHT: 40, // two lines in Manrope
7473
ICON_SIZE: 60,
7574
POS: {
76-
HEADER: 0,
77-
BODY: 1,
78-
FOOTER: 2
75+
FOLDER_LOOK: 0,
76+
HEADER: 1,
77+
BODY: 2,
78+
FOOTER: 3
7979
},
8080
HPOS: {
8181
SHARED: 0,
@@ -107,10 +107,12 @@ qx.Class.define("osparc.dashboard.WorkspaceButtonBase", {
107107
let control;
108108
switch (id) {
109109
case "main-layout": {
110-
control = new qx.ui.container.Composite(new qx.ui.layout.VBox(this.self().SPACING_IN));
110+
control = new qx.ui.container.Composite(new qx.ui.layout.VBox());
111+
const folderLook = this.getChildControl("folder-look");
111112
const header = this.getChildControl("header");
112113
const body = this.getChildControl("body");
113114
const footer = this.getChildControl("footer");
115+
control.addAt(folderLook, this.self().POS.FOLDER_LOOK);
114116
control.addAt(header, this.self().POS.HEADER);
115117
control.addAt(body, this.self().POS.BODY, {
116118
flex: 1
@@ -124,9 +126,14 @@ qx.Class.define("osparc.dashboard.WorkspaceButtonBase", {
124126
});
125127
break;
126128
}
129+
case "folder-look": {
130+
control = this.__createFolderLookHeader();
131+
break;
132+
}
127133
case "header":
128134
control = new qx.ui.container.Composite(new qx.ui.layout.HBox(5)).set({
129-
backgroundColor: "background-card-overlay",
135+
backgroundColor: "background-workspace-card-overlay",
136+
opacity: 0.8,
130137
anonymous: true,
131138
maxWidth: this.self().ITEM_WIDTH,
132139
maxHeight: this.self().HEADER_MAX_HEIGHT,
@@ -135,7 +142,7 @@ qx.Class.define("osparc.dashboard.WorkspaceButtonBase", {
135142
});
136143
break;
137144
case "body":
138-
control = new qx.ui.container.Composite(new qx.ui.layout.VBox(5)).set({
145+
control = new qx.ui.container.Composite(new qx.ui.layout.VBox()).set({
139146
decorator: "main",
140147
allowGrowY: true,
141148
allowGrowX: true,
@@ -162,6 +169,7 @@ qx.Class.define("osparc.dashboard.WorkspaceButtonBase", {
162169
textColor: "contrasted-text-light",
163170
font: "text-14",
164171
allowGrowX: true,
172+
alignY: "middle",
165173
maxHeight: this.self().HEADER_MAX_HEIGHT
166174
});
167175
layout = this.getChildControl("header");
@@ -190,6 +198,70 @@ qx.Class.define("osparc.dashboard.WorkspaceButtonBase", {
190198
return control || this.base(arguments, id);
191199
},
192200

201+
__createFolderLookHeader: function() {
202+
const topHeight = 8;
203+
const grid = new qx.ui.layout.Grid(0, 0);
204+
grid.setColumnFlex(0, 1);
205+
grid.setColumnFlex(2, 1);
206+
grid.setRowHeight(0, topHeight);
207+
grid.setRowHeight(1, 4);
208+
const layout = new qx.ui.container.Composite(grid).set({
209+
backgroundColor: "background-main",
210+
});
211+
const spacer00 = new qx.ui.core.Widget().set({
212+
backgroundColor: "background-workspace-card-overlay"
213+
});
214+
const triangle = new qx.ui.core.Widget().set({
215+
width: topHeight,
216+
height: topHeight,
217+
});
218+
triangle.getContentElement().setStyles({
219+
"width": "0",
220+
"height": "0",
221+
"border-right": topHeight + "px solid transparent",
222+
});
223+
const colorTriangle = () => {
224+
const color = qx.theme.manager.Color.getInstance().resolve("background-workspace-card-overlay");
225+
triangle.getContentElement().setStyles({
226+
"border-bottom": topHeight + "px solid " + color,
227+
});
228+
};
229+
colorTriangle();
230+
qx.theme.manager.Color.getInstance().addListener("changeTheme", colorTriangle);
231+
const spacer01 = new qx.ui.core.Widget();
232+
const spacer10 = new qx.ui.core.Widget().set({
233+
backgroundColor: "background-workspace-card-overlay"
234+
});
235+
const spacer11 = new qx.ui.core.Widget().set({
236+
backgroundColor: "background-workspace-card-overlay"
237+
});
238+
spacer11.getContentElement().setStyles({
239+
"border-top-right-radius": "4px",
240+
});
241+
layout.add(spacer00, {
242+
row: 0,
243+
column: 0,
244+
});
245+
layout.add(triangle, {
246+
row: 0,
247+
column: 1,
248+
});
249+
layout.add(spacer01, {
250+
row: 0,
251+
column: 2,
252+
});
253+
layout.add(spacer10, {
254+
row: 1,
255+
column: 0,
256+
colSpan: 2,
257+
});
258+
layout.add(spacer11, {
259+
row: 1,
260+
column: 2,
261+
});
262+
return layout;
263+
},
264+
193265
// overridden
194266
_applyIcon: function(value) {
195267
const image = this.getChildControl("icon").getChildControl("image");

‎services/static-webserver/client/source/class/osparc/dashboard/WorkspaceButtonNew.js‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ qx.Class.define("osparc.dashboard.WorkspaceButtonNew", {
3939

4040
this.setIcon(osparc.dashboard.CardBase.NEW_ICON);
4141

42+
this.getChildControl("header").set({
43+
opacity: 1
44+
});
4245
this.getChildControl("footer").exclude();
4346
},
4447

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ qx.Theme.define("osparc.theme.ColorDark", {
3232
"background-main-5": "c06",
3333

3434
"background-card-overlay": "rgba(25, 33, 37, 0.8)",
35+
"background-workspace-card-overlay": "rgb(35, 93, 122)",
3536

3637
"primary-background-color": "rgba(0, 20, 46, 1)",
3738
"navigation_bar_background_color": "rgba(1, 18, 26, 0.8)",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ qx.Theme.define("osparc.theme.ColorLight", {
3232
"background-main-5": "c06",
3333

3434
"background-card-overlay": "rgba(229, 229, 229, 0.8)",
35+
"background-workspace-card-overlay": "rgb(165, 223, 252)",
3536

3637
"primary-background-color": "rgba(255, 255, 255, 1)",
3738
"navigation_bar_background_color": "rgba(229, 229, 229, 0.8)",

0 commit comments

Comments
 (0)