mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
top
This commit is contained in:
parent
66c25e7f29
commit
79dca12274
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"[javascript]": {
|
"[javascript]": {
|
||||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
"editor.defaultFormatter": "vscode.typescript-language-features"
|
||||||
},
|
},
|
||||||
"[json]": {
|
"[json]": {
|
||||||
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
||||||
|
@ -30,6 +30,9 @@ const TPL = `
|
|||||||
height: 40px;
|
height: 40px;
|
||||||
width: 40px;
|
width: 40px;
|
||||||
}
|
}
|
||||||
|
.title-bar-buttons .top-btn.active{
|
||||||
|
background-color:var(--accented-background-color);
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<!-- divs act as a hitbox for the buttons, making them clickable on corners -->
|
<!-- divs act as a hitbox for the buttons, making them clickable on corners -->
|
||||||
@ -54,10 +57,10 @@ export default class TitleBarButtonsWidget extends BasicWidget {
|
|||||||
const $closeBtn = this.$widget.find(".close-btn");
|
const $closeBtn = this.$widget.find(".close-btn");
|
||||||
|
|
||||||
//When the window is restarted, the window will not be reset when it is set to the top, so get the window status and set the icon background
|
//When the window is restarted, the window will not be reset when it is set to the top, so get the window status and set the icon background
|
||||||
(function() {
|
(function () {
|
||||||
const remote = utils.dynamicRequire('@electron/remote');
|
const remote = utils.dynamicRequire('@electron/remote');
|
||||||
if (remote.BrowserWindow.getFocusedWindow().isAlwaysOnTop()) {
|
if (remote.BrowserWindow.getFocusedWindow().isAlwaysOnTop()) {
|
||||||
$topBtn.css("background-color", "var(--accented-background-color)");
|
$topBtn.addClass('active');
|
||||||
}
|
}
|
||||||
}());
|
}());
|
||||||
$topBtn.on('click', () => {
|
$topBtn.on('click', () => {
|
||||||
@ -67,10 +70,10 @@ export default class TitleBarButtonsWidget extends BasicWidget {
|
|||||||
const isAlwaysOnTop = focusedWindow.isAlwaysOnTop()
|
const isAlwaysOnTop = focusedWindow.isAlwaysOnTop()
|
||||||
if (isAlwaysOnTop) {
|
if (isAlwaysOnTop) {
|
||||||
focusedWindow.setAlwaysOnTop(false)
|
focusedWindow.setAlwaysOnTop(false)
|
||||||
$topBtn.css("background-color", "");
|
$topBtn.removeClass('active');
|
||||||
} else {
|
} else {
|
||||||
focusedWindow.setAlwaysOnTop(true);
|
focusedWindow.setAlwaysOnTop(true);
|
||||||
$topBtn.css("background-color", "var(--accented-background-color)");
|
$topBtn.addClass('active');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user