@@ -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" ) ;
0 commit comments