- 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;
}

推薦閱讀
- Embedded Linux Projects Using Yocto Project Cookbook
- Learning Neo4j
- 復(fù)雜軟件設(shè)計(jì)之道:領(lǐng)域驅(qū)動(dòng)設(shè)計(jì)全面解析與實(shí)戰(zhàn)
- Flask Web開發(fā)入門、進(jìn)階與實(shí)戰(zhàn)
- x86匯編語言:從實(shí)模式到保護(hù)模式(第2版)
- C++新經(jīng)典
- OpenCV with Python By Example
- 代替VBA!用Python輕松實(shí)現(xiàn)Excel編程
- Visual Basic程序設(shè)計(jì)(第三版)
- JavaScript程序設(shè)計(jì):基礎(chǔ)·PHP·XML
- Natural Language Processing with Python Quick Start Guide
- Java 從入門到項(xiàng)目實(shí)踐(超值版)
- 硬件產(chǎn)品設(shè)計(jì)與開發(fā):從原型到交付
- Learning D
- 3ds Max 2018從入門到精通