• Stars
    star
    115
  • Rank 299,235 (Top 7 %)
  • Language
    JavaScript
  • License
    GNU Lesser Genera...
  • Created almost 8 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Cool titlebar for electron apps for every system

electron-titlebar

Cool titlebar for electron apps for every system.

Screenshots

Windows

Windows Screenshot

Linux

Linux Screenshot

Usage

Install with NPM.

npm install electron-titlebar --save

Load electron-titlebar with require('electron-titlebar') in anywhere.

In HTML, the div whose id is electron-titlebar will become a titlebar, like

<div id="electron-titlebar"></div>

Drag

Add class drag to make the whole titlebar draggable. This means the user can drag the it to move the window.

<div id="electron-titlebar" class="drag"></div>

You can also specify the draggable area manually, add some divs with class="drag" inside.

<div id="electron-titlebar">
    <div class="drag" style="top: 0; left: 0; width: 100%; height: 100%; position: absolute; "></div>
</div>

Hide Control Buttons

Add classes no-maximize or no-minimize to hide the maximize or minimize button.

<div id="electron-titlebar" class="no-maximize no-minimize"></div>

Notice: If BrowserWindow.isResizable() or BrowserWindow.isMaximizable() is false, the maximize button will be hidden. If BrowserWindow.isMinimizable is false, the minimize button will be hidden.

Inset

Add class inset to get the control buttons more inset from the window edge. Like titleBarStyle: 'hidden-inset' on macOS.

<div id="electron-titlebar" class="inset"></div>

Custom

You can put custom elements on titlebar, such as displaying a title

<div id="electron-titlebar">
    <div style="width: 100%; height: 100%; text-align: center; line-height: 40px; ">Title</div>
</div>

Platform

On Windows, the control button is in the Windows 10 style. Each button is 45px x 29px without inset and 40px x 40px with inset.

On Linux, the control button is in the elementary style.

Add platform="linux" or platform="win32" to test the look for a specified platform.

<div id="electron-titlebar" platform="linux"></div>

Licenses

electron-titlebar is licensed under the LGPL-3.0 license.

The directory LICENSES contains the licenses that the .SVG files used.

caption-buttons.svg, which is used for Windows, is licensed under the MPL-2.0. It comes from Firefox.

close.svg, maximize.svg, minimize.svg and restore.svg, which are used for Linux, is (likely) licensed under the GPL-3.0 license. It comes from elementary-theme.

Report an issue if you find there's something wrong with their licenses.

More Repositories

1

vite-plugin-wasm

Add WebAssembly ESM integration (aka. Webpack's `asyncWebAssembly`) to Vite and support `wasm-pack` generated modules.
TypeScript
134
star
2

vite-plugin-top-level-await

Transform code to support top-level await in normal browsers for Vite.
TypeScript
117
star
3

simple-sandbox

A simple Linux sandbox with Node.js API.
C++
69
star
4

acme

Issue free SSL certs on GitHub Actions with acme.sh.
35
star
5

oi.men.ci

Menci 的 OI 博客(源代码与网站文件)
JavaScript
27
star
6

monaco-tree-sitter

Highlight your Monaco Editor with tree-sitter grammar.
TypeScript
26
star
7

hexo-deployer-upyun

UPYUN deployer for Hexo.
JavaScript
22
star
8

html-parser

The task of Advanced Programming class on 2019/03/28. C++ HTML parser that generates a simple DOM tree.
C++
18
star
9

docker-archlinuxarm

Docker image for Arch Linux (multiarch ARM64 + AMD64, daily updated with GitHub Actions)
Dockerfile
18
star
10

docker-sandbox

Run unsafe program in docker sandbox
C++
18
star
11

homebrew-libvirt-m1

Homebrew formulaes to install `virt-manager`, `virt-viewer` and `libvirtd` on macOS with Apple Silicon
Ruby
16
star
12

magpie

Bidirectional NDP proxy and route maintainer to relay an IPv6 SLAAC network.
C++
16
star
13

wastyle

AStyle code formatter compiled to WebAssembly, for Node.js and the browser.
C++
16
star
14

resume

个人简历
14
star
15

markdown-it-merge-cells

A markdown-it plugin to merge adjacent cells with same content in tables
JavaScript
13
star
16

deploy-certificate-to-aliyun

GitHub Action to Deploy SSL certificate to Aliyun Certificates Service (and use in CDN).
JavaScript
10
star
17

service-worker-redirect-origin

Redirect requests of current origin to another domain with Service Worker.
TypeScript
10
star
18

vite-plugin-public-path

Vite's equivalent of `__webpack_public_path__` in Webpack. Works for `index.html` and modern/legacy build.
TypeScript
9
star
19

search-engine-oop

The task of Advanced Programming class on 2019/04/23. Text search engine using inversed index and TF-IDF in C++.
C++
8
star
20

stego

数据隐写:将数据嵌入到到 BMP 数据中
C
8
star
21

tree-sitter-wasm-prebuilt

Prebuilt WASM binaries for tree-sitter's language parsers.
JavaScript
8
star
22

double

The task of Advanced Programming class on 2018/10/10. Implementation of IEEE 754 floating point number. Like `double` in C.
C
8
star
23

chroot-sandbox

Run unsafe program in chroot sandbox
C++
8
star
24

aur.men.ci

Menci's prebuilt AUR repo for Archlinux and Manjaro
TypeScript
8
star
25

bootloader

操作系统课作业:MBR 引导加载器
Assembly
8
star
26

pipeline

Pipelined MIPS processor in Verilog
SystemVerilog
7
star
27

TuringAdvancedProgramming19A

Code of tasks of Turing Class 2019's Advanced Programming (first term)
C
7
star
28

hexo-renderer-syzoj-renderer

Render Hexo's markdown documents with syzoj-renderer
JavaScript
6
star
29

Menci

My GitHub homepage
6
star
30

SummerProgrammingPractice2020

"Summer Programming Practice 2020" for RUC Turing Class 2019
HTML
6
star
31

Blog

My new blog
TypeScript
6
star
32

moemark-turndown

Convert hexo-renderer-moemark-pygments rendered HTML back to markdown
JavaScript
6
star
33

search-engine

The task of Advanced Programming class on 2019/04/16. Text search engine using inversed index and TF-IDF.
Python
6
star
34

avl-tree

The task of Advanced Programming class on 2018/12/05. Implementation of AVL tree and heap memory leak check in C.
C
5
star
35

FakeTPM.kext

Something you might need to run Windows 11 🤣
5
star
36

deploy-certificate-to-upyun

GitHub Action to Deploy SSL certificate to Upyun CDN or OSS.
TypeScript
5
star
37

build-archlinux-package

GitHub Action to build Archlinux / Manjaro package with Docker, for AMD64 or ARM64
Shell
5
star
38

mepage-2015-archive

很久很久以前(2015 年)设计的个人主页 MePage 的存档
JavaScript
5
star
39

upload-to-oss

GitHub Actions to sync files in a directory to Aliyun OSS with a prefix incrementally, with filename filter.
TypeScript
5
star
40

web-crawler

The task of Advanced Programming class on 2019/03/21. C++ web crawler with wget.
C++
4
star
41

xinu-vm

操作系统课作业 xinu
C
4
star
42

pipeline-tester

Random tests generator & runner for your pipelined MIPS processor (from @t123yh)
C#
4
star
43

avl-tree-zip

The task of Advanced Programming class on 2018/12/26. Compress and decompress an avl-tree with (1 `double` + 1 `char`) for each node, or its insert sequence.
C
3
star
44

men.ci-backup

Menci's personal homepage
3
star
45

syntect-js

Syntect (Syntax highlighter in Rust) for Node.js and WebAssembly
JavaScript
3
star
46

FlappyBird

JavaScript
3
star
47

deploy-certificate-to-azure-web-app

GitHub Action to deploy SSL certificate to Azure Web App (including Function App)
2
star
48

luogu-openapi

Luogu OpenAPI SDK (unofficial)
TypeScript
2
star
49

tkpl

The "Ka" Programming Language
2
star
50

karatsuba-algorithm

The fast big integer multiplication algorithm
C++
2
star
51

big-integer

The task of Advanced Programming class on 2019/04/04. C++ BigInteger class.
C++
2
star
52

ssh-certdeploy

Deploy certificate to servers with SSH.
Shell
2
star
53

arcaea-builder

Build your own Arcaea game client to play self-made or modified official charts!
TypeScript
2
star
54

qsort

The task of Advanced Programming class on 2018/10/10. Implementation of C library function qsort().
C
2
star
55

CompilationPrinciples

编译原理作业:基于 flex 和 bison 的 Pascal 到 Intel x86_64 Assembly 编译器
C++
1
star
56

tpm2-luks-helper

Shell
1
star
57

.dotfiles

My ~/.dotfiles on GNU/Linux and macOS
1
star
58

sf-mono-webfont

SF Mono webfont (WOFF & WOFF2) generated with FontSquirrel.
HTML
1
star
59

mdb

Menci DeBugger: Simple Linux x86_64 debugger with ptrace(2)
C++
1
star
60

ics2

RUC ICS2 Labs
C
1
star
61

docker-polyfill-service

Dockerized polyfill-service (https://github.com/Financial-Times/polyfill-service, aka. https://polyfill.io)
Dockerfile
1
star