2016-09-16 74 views
0

我試圖實施GoldenLayout,但似乎無法更改放置在每個窗口標題內的標籤高度。黃金佈局:如何增加標題標籤高度

在原始主題.lm_header中有一個固定高度爲20px的CSS類,但在此之後,由JS直接設置高度爲內聯樣式

我嘗試以下規則

.lm_header { 
    height: 40px !important; 
} 

但它的JS風格的簡單替代,是因爲底部窗格的位置不完全(請參閱working example)。

是否有標準方法更改不同元素的大小?

回答

1

對於標籤的大小,你需要設置的configuration object傳遞給GoldenLayout,調整樣式表dimensions.headerHeight財產。

JS:

var myLayout = new GoldenLayout({ 
    dimensions: { 
      headerHeight: 46 
     }, 
     content:[{ 
      type: 'row', 
      content:[{ 
       type: 'component', 
       componentName: 'test-component' 
      },{ 
       type: 'component', 
       componentName: 'test-component' 
      }] 
     }] 
    }); 

CSS:

.lm_tab { 
    height: 40px !important; 
} 

最低限度: Updated Fiddle

更新

,使這一切看起來不錯,更新line-height.lm_tab,更改height.lm_close_tab,並更改top的位置.lm_controls

CSS:

.lm_tab { 
    height: 40px !important; 
    line-height:40px; 
} 

.lm_close_tab { 
    height: 35px !important; 
} 

.lm_controls { 
    top:13px; 
} 

Updated Fiddle 2

+0

有點棘手(需要手動設置內容頂部的CSS偏移,並在頭高度的CSS),但有效地運行......也許是有用還設置'line-height:40px;'不垂直對齊文字 –

+0

當然。爲了我的用途,我更新了一些樣式,使所有內容一致。查看我最近的更新。 – Joshua