Skip to content

Commit

Permalink
fix window controls on win10 for projects page
Browse files Browse the repository at this point in the history
  • Loading branch information
mafiosnik777 committed Apr 24, 2023
1 parent be670e6 commit d85f158
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/js/welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ if (process.platform == "win32" && !isWin11 || process.platform == "linux") {
document.getElementById('profile-container').style.top = '9.3%';
document.getElementById('close').style.top = '1%';
document.getElementById('minimize').style.top = '2%';

// Window controls
const minimize = document.getElementById("minimize");
minimize.addEventListener("click", function () {
ipcRenderer.send("minimize-window");
});
const close = document.getElementById("close");
close.addEventListener("click", function () {
ipcRenderer.send("close-window");
});
} else {
winControls.style.visibility = "hidden";
}
Expand Down
3 changes: 1 addition & 2 deletions src/pages/welcome.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<script defer src="../js/sysinfo.js"></script>
</head>

<body>
<body style="padding: 0">
<template id="recent-item-template">
<div class="recent animate__animated animate__fadeInRight animate__delay-1s">
<img draggable="false" class="history-file" src="../assets/enhancr-file.png" />
Expand All @@ -22,7 +22,6 @@
<div id="win-controls"><i class="fa-solid fa-xmark" id="close"></i><i class="fa-solid fa-window-minimize" id="minimize"></i></div>
<div id="win10-border"></div>
<div id="light-mode"></div>
<div id="title-bar" style="-webkit-app-region: drag;"></div>
<div id="recents-container">
<span id="no-recents">No recently used projects.</span>
</div>
Expand Down
18 changes: 18 additions & 0 deletions src/scss/projects.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@ $macosblue: #1e5cce;
}
}

body {
margin: 0;
padding: 0;
}

body > #win-controls {
padding-left: 1.5%;
padding-top: 1%;
-webkit-app-region: drag;
box-sizing: border-box;
display: flex;
}

body > #win-controls > i {
position: initial;
margin-right: 9px;
}

.project-side-container {
position: absolute;
background: rgba(0, 0, 0, 0.25);
Expand Down

0 comments on commit d85f158

Please sign in to comment.