stuff
This commit is contained in:
parent
f9c6dc874d
commit
16c3247280
|
@ -65,7 +65,7 @@ module.exports = (_ => {
|
|||
onLoad () {
|
||||
patched = false;
|
||||
|
||||
electronWindow = BDFDB.LibraryRequires.electron.remote.getCurrentWindow();
|
||||
electronWindow = BDFDB.LibraryRequires.electron && BDFDB.LibraryRequires.electron.remote && BDFDB.LibraryRequires.electron.remote.getCurrentWindow();
|
||||
|
||||
this.defaults = {
|
||||
settings: {
|
||||
|
@ -171,18 +171,17 @@ module.exports = (_ => {
|
|||
onChange: isNativeTitlebarSetting ? value => {
|
||||
if (this.patchMainScreen(value)) {
|
||||
patched = !patched;
|
||||
document.querySelector("#OldTitleBarNotifyBar")?.close();
|
||||
if (patched) BDFDB.NotificationUtils.notice("Changed nativebar settings, relaunch to see changes:", {
|
||||
type: "danger",
|
||||
id: "OldTitleBarNotifyBar",
|
||||
buttons: [{
|
||||
contents: "Relaunch",
|
||||
onClick: _ => {
|
||||
let notifybar = document.querySelector("#OldTitleBarNotifyBar");
|
||||
if (notifybar) notifybar.querySelector(BDFDB.dotCN.noticedismiss).click();
|
||||
if (patched) {
|
||||
notifybar = BDFDB.NotificationUtils.notice("Changed nativebar settings, relaunch to see changes:", {type: "danger",btn: "Relaunch",id: "OldTitleBarNotifyBar"});
|
||||
notifybar.querySelector(BDFDB.dotCN.noticebutton).addEventListener("click", _ => {
|
||||
if (BDFDB.LibraryRequires.electron && BDFDB.LibraryRequires.electron.remote) {
|
||||
BDFDB.LibraryRequires.electron.remote.app.relaunch();
|
||||
BDFDB.LibraryRequires.electron.remote.app.quit();
|
||||
}
|
||||
}]
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
} : null
|
||||
}));
|
||||
|
@ -260,7 +259,7 @@ module.exports = (_ => {
|
|||
tooltipConfig: {type: "bottom"},
|
||||
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, {
|
||||
className: BDFDB.disCNS.channelheadericonwrapper + BDFDB.disCN.channelheadericonclickable,
|
||||
onClick: _ => {electronWindow.reload();},
|
||||
onClick: _ => {electronWindow && electronWindow.reload();},
|
||||
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
|
||||
className: BDFDB.disCN.channelheadericon,
|
||||
iconSVG: `<svg><path fill="currentColor" stroke="none" transform="translate(3,4)" d="M 17.061, 7.467 V 0 l -2.507, 2.507 C 13.013, 0.96, 10.885, 0, 8.528, 0 C 3.813, 0, 0.005, 3.819, 0.005, 8.533 s 3.808, 8.533, 8.523, 8.533 c 3.973, 0, 7.301 -2.72, 8.245 -6.4 h -2.219 c -0.88, 2.485 -3.237, 4.267 -6.027, 4.267 c -3.536, 0 -6.4 -2.864 -6.4 -6.4 s 2.864 -6.4, 6.4 -6.4 c 1.765, 0, 3.349, 0.736, 4.507, 1.893 l -3.44, 3.44 H 17.061 z"/></svg>`
|
||||
|
@ -271,7 +270,7 @@ module.exports = (_ => {
|
|||
};
|
||||
children.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, {
|
||||
className: BDFDB.disCNS.channelheadericonwrapper + BDFDB.disCN.channelheadericonclickable,
|
||||
onClick: _ => {electronWindow.minimize();},
|
||||
onClick: _ => {electronWindow && electronWindow.minimize();},
|
||||
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
|
||||
className: BDFDB.disCN.channelheadericon,
|
||||
iconSVG: `<svg width="26" height="26"><path stroke-width="2" stroke="currentColor" fill="none" d="M6 18 l13 0"/></svg>`
|
||||
|
@ -280,7 +279,8 @@ module.exports = (_ => {
|
|||
children.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, {
|
||||
className: BDFDB.disCNS.channelheadericonwrapper + BDFDB.disCN.channelheadericonclickable,
|
||||
onClick: _ => {
|
||||
if (electronWindow.isMaximized()) electronWindow.unmaximize();
|
||||
if (!electronWindow) return;
|
||||
else if (electronWindow.isMaximized()) electronWindow.unmaximize();
|
||||
else electronWindow.maximize();
|
||||
},
|
||||
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
|
||||
|
@ -290,7 +290,7 @@ module.exports = (_ => {
|
|||
}));
|
||||
children.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, {
|
||||
className: BDFDB.disCNS.channelheadericonwrapper + BDFDB.disCN.channelheadericonclickable,
|
||||
onClick: _ => {electronWindow.close();},
|
||||
onClick: _ => {electronWindow && electronWindow.close();},
|
||||
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
|
||||
className: BDFDB.disCN.channelheadericon,
|
||||
iconSVG: `<svg width="26" height="26"><path stroke-width="2" stroke="currentColor" fill="none" d="M6 6 l13 13 m0 -13 l-13 13"/></svg>`
|
||||
|
|
|
@ -933,6 +933,7 @@ module.exports = (_ => {
|
|||
callback();
|
||||
}
|
||||
});
|
||||
if (!sandbox) callback();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="black" d="m 14.392514,0.8598 c 0.342633,0.1713 0.664714,0.3636 0.96484,0.5723 0.910682,0.6324 1.625168,1.4361 2.121084,2.3867 0.51395,0.9867 0.792053,2.1329 0.828121,3.4082 v 0.016 0.016 9.4941 0.016 0.016 c -0.03478,1.2752 -0.312883,2.4215 -0.828121,3.4081 -0.495916,0.9507 -1.209112,1.7543 -2.121084,2.3868 -0.29111,0.2022 -0.602548,0.3872 -0.93359,0.5546 h 0.93359 c 4.459384,0.024 8.642539,-2.2045 8.642539,-7.3144 V 8.3535 C 24.024363,3.1431 19.840176,0.8613 15.38079,0.8613 Z M 0,0.8676 v 9.1972 l 5.693334,5.127 V 5.4399 h 3.310532 c 3.53582,0 3.53582,4.4433 0,4.4433 H 6.8163759 v 4.2441 H 9.003866 c 3.53582,0 3.53582,4.4414 0,4.4414 H 0 v 4.5703 h 8.9042572 c 4.5894828,0 8.1510738,-1.8365 8.2773068,-6.3886 0,-2.0945 -0.574111,-3.6596 -1.583977,-4.7481 1.009866,-1.0871 1.583977,-2.6516 1.583977,-4.746 C 17.056618,2.7041 13.495028,0.8676 8.9042572,0.8676 Z"/></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="black" d="M 15.46875 0.859375 C 15.772992 1.030675 16.059675 1.2229406 16.326172 1.4316406 C 17.134815 2.0640406 17.768634 2.8677594 18.208984 3.8183594 C 18.665347 4.8050594 18.913286 5.9512625 18.945312 7.2265625 L 18.945312 7.2421875 L 18.945312 7.2597656 L 18.945312 16.753906 L 18.945312 16.769531 L 18.945312 16.785156 C 18.914433 18.060356 18.666491 19.206759 18.208984 20.193359 C 17.768634 21.144059 17.135961 21.947578 16.326172 22.580078 C 16.06768 22.782278 15.790044 22.967366 15.496094 23.134766 L 16.326172 23.134766 C 20.285895 23.158766 24 20.930212 24 15.820312 L 24 8.3535156 C 24.021728 3.1431156 20.305428 0.86132812 16.345703 0.86132812 L 15.46875 0.859375 z M 0 0.8671875 L 0 10.064453 L 4.4492188 15.191406 L 4.4492188 5.4394531 L 8.4394531 5.4394531 C 11.753741 5.4394531 11.753741 9.8828125 8.4394531 9.8828125 L 7.0234375 9.8828125 L 7.0234375 14.126953 L 8.4394531 14.126953 C 11.753741 14.126953 11.753741 18.568359 8.4394531 18.568359 L 0 18.568359 L 0 23.138672 L 8.3457031 23.138672 C 12.647637 23.138672 15.987145 21.3021 16.105469 16.75 C 16.105469 14.6555 15.567688 13.090453 14.621094 12.001953 C 15.567688 10.914853 16.105469 9.3502594 16.105469 7.2558594 C 15.988351 2.7036594 12.648845 0.8671875 8.3457031 0.8671875 L 0 0.8671875 z"/></svg>
|
Before Width: | Height: | Size: 972 B After Width: | Height: | Size: 1.3 KiB |
Loading…
Reference in New Issue