- Cross-platform Desktop Application Development:Electron,Node,NW.js,and React
- Dmitry Sheiko
- 99字
- 2021-07-15 17:36:25
Styling the title bar
Speaking of the view content, we are ready to populate the layout slots. We will start with the title bar:
./index.html
<header class="l-app__titlebar titlebar">
<span class="titlebar__path">/home/sheiko/Sites/file-explorer</span>
<a class="titlebar__btn" >_</a>
<a class="titlebar__btn is-hidden" > </a>
<a class="titlebar__btn" ></a>
<a class="titlebar__btn" ></a>
</header>
Basically, we want the current path to be displayed on the left and window controls on the right. It can be achieved with Flexbox. It's a tiny layout that won't be reused, so it won't hurt if we mix it in the component module:
./assets/css/Component/titlebar.css
.titlebar {
...
display: flex;
flex-flow: row nowrap;
align-items: stretch;
}
.titlebar__path {
flex: 1 1 auto;
}
.titlebar__btn {
flex: 0 0 25px;
cursor: pointer;
}

推薦閱讀
- Java軟件開發基礎
- Java項目實戰精編
- RISC-V體系結構編程與實踐(第2版)
- 自學Python:編程基礎、科學計算及數據分析(第2版)
- Django Design Patterns and Best Practices
- Moodle 3 Administration(Third Edition)
- Building Slack Bots
- OpenCV Android開發實戰
- 3ds Max 2018從入門到精通
- 數據庫技術及應用教程上機指導與習題(第2版)
- Learn C Programming
- jBPM6 Developer Guide
- Python自動化運維:技術與最佳實踐
- Test-Driven Java Development(Second Edition)
- Learning Akka