@@ -89,6 +89,13 @@ qx.Class.define("qxapp.desktop.NavigationBar", {
89
89
"DashboardPressed" : "qx.event.type.Event"
90
90
} ,
91
91
92
+ properties : {
93
+ projectModel : {
94
+ check : "qxapp.data.model.ProjectModel" ,
95
+ nullable : true
96
+ }
97
+ } ,
98
+
92
99
members : {
93
100
__mainViewCaptionLayout : null ,
94
101
@@ -110,21 +117,28 @@ qx.Class.define("qxapp.desktop.NavigationBar", {
110
117
this . __mainViewCaptionLayout . add ( mainViewCaption ) ;
111
118
} ,
112
119
113
- __showMainViewCaptionAsButtons : function ( newLabels ) {
120
+ __showMainViewCaptionAsButtons : function ( nodeIds ) {
114
121
const navBarLabelFont = qx . bom . Font . fromConfig ( qxapp . theme . Font . fonts [ "nav-bar-label" ] ) ;
115
- for ( let i = 0 ; i < newLabels . length ; i ++ ) {
116
- const newLabel = newLabels [ i ] ;
117
- const label = Object . values ( newLabel ) [ 0 ] ;
118
- const nodeId = Object . keys ( newLabel ) [ 0 ] ;
119
- let btn = new qx . ui . form . Button ( label ) . set ( {
122
+ for ( let i = 0 ; i < nodeIds . length ; i ++ ) {
123
+ let btn = new qx . ui . form . Button ( ) . set ( {
120
124
maxHeight : NAVIGATION_BUTTON_HEIGHT
121
125
} ) ;
126
+ const nodeId = nodeIds [ i ] ;
127
+ if ( nodeId === "root" ) {
128
+ this . getProjectModel ( ) . bind ( "name" , btn , "label" ) ;
129
+ } else {
130
+ const nodeModel = this . getProjectModel ( ) . getWorkbenchModel ( )
131
+ . getNodeModel ( nodeId ) ;
132
+ if ( nodeModel ) {
133
+ nodeModel . bind ( "label" , btn , "label" ) ;
134
+ }
135
+ }
122
136
btn . addListener ( "execute" , function ( ) {
123
137
this . fireDataEvent ( "NodeDoubleClicked" , nodeId ) ;
124
138
} , this ) ;
125
139
this . __mainViewCaptionLayout . add ( btn ) ;
126
140
127
- if ( i < newLabels . length - 1 ) {
141
+ if ( i < nodeIds . length - 1 ) {
128
142
let mainViewCaption = this . __mainViewCaption = new qx . ui . basic . Label ( ">" ) . set ( {
129
143
font : navBarLabelFont
130
144
} ) ;
0 commit comments