mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
Add option to use native titlebar
This commit is contained in:
parent
e7ae65bfbb
commit
0df9689bd1
3 changed files with 9 additions and 4 deletions
8
main.js
8
main.js
|
@ -4,7 +4,11 @@ const path = require("path");
|
|||
const contextMenu = require("electron-context-menu");
|
||||
const os = require("os");
|
||||
require("v8-compile-cache");
|
||||
|
||||
if (require("./utils/ArmCord.js").Titlebar === "native") {
|
||||
var frame = true
|
||||
} else {
|
||||
var frame = false
|
||||
}
|
||||
|
||||
if (os.type() == 'Linux'){
|
||||
var iconformat = __dirname + "/discord.png"
|
||||
|
@ -31,7 +35,7 @@ function createWindow() {
|
|||
height: 600,
|
||||
icon: iconformat,
|
||||
title: "ArmCord",
|
||||
frame: false,
|
||||
frame: frame,
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, "preload.js"),
|
||||
enableRemoteModule: true,
|
||||
|
|
|
@ -5,10 +5,11 @@ const electronLocalshortcut = require("electron-localshortcut");
|
|||
const ArmCord = require("./utils/ArmCord.js");
|
||||
require("./utils/theme.js");
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
if (require("./utils/ArmCord.js").Titlebar === "native") {console.log("Using native titlebar")} else {
|
||||
new customTitlebar.Titlebar({
|
||||
backgroundColor: customTitlebar.Color.fromHex("#202225"),
|
||||
menu: false,
|
||||
});
|
||||
});}
|
||||
|
||||
electronLocalshortcut.register(currentWindow, "F5", () => {
|
||||
location.reload();
|
||||
|
|
|
@ -10,7 +10,7 @@ if (!fs.existsSync(settingsFile)) {
|
|||
console.log("Created settings.json file");
|
||||
}
|
||||
exports.Channel = require(settingsFile).channel;
|
||||
|
||||
exports.Titlebar = require(settingsFile).titlebar;
|
||||
exports.addStyle = function(styleString) {
|
||||
const style = document.createElement('style');
|
||||
style.textContent = styleString;
|
||||
|
|
Loading…
Reference in a new issue