made toolbar centered and window titlebar inset

pull/2/head
Michael Ochmann 3 years ago
parent 52b09bba59
commit 8d4cfcc8bb
  1. 6
      src/WindowManager.js
  2. 26
      src/ui/src/assets/css/_toolbar.scss
  3. 10
      src/ui/src/assets/css/_window.scss
  4. 25
      src/ui/src/components/Toolbar.js

@ -43,7 +43,11 @@ class WindowManager {
} }
init() { init() {
this.mainWindow = WindowManager._CreateWindow(); this.mainWindow = WindowManager._CreateWindow({
fullscreen : false,
fullscreenable : true,
titleBarStyle : "hiddenInset"
});
if (isDevelopment()) if (isDevelopment())
this.mainWindow.loadURL("http://localhost:3000"); this.mainWindow.loadURL("http://localhost:3000");

@ -0,0 +1,26 @@
.toolbar {
-webkit-app-region: drag;
display: flex;
align-items: center;
justify-content: center;
padding: 0.5rem;
background: color(mainBackground);
border-bottom: solid 1px color(background);
button {
-webkit-app-region: none;
padding: 0.5rem !important;
margin: 0;
font-size: 0.8rem;
background-color: color(sidebarBackground);
aspect-ratio: 1;
&:not(:last-child) {
margin-right: 0.5rem;
}
svg {
margin: 0;
}
}
}

@ -1,14 +1,23 @@
.window { .window {
display: grid; display: grid;
grid-template-columns: 20% auto; grid-template-columns: 20% auto;
grid-template-rows: 40px auto;
height: 100%; height: 100%;
width: 100%; width: 100%;
position: absolute; position: absolute;
.toolbar {
grid-column: 1 / span 2;
}
main { main {
background: color(mainBackground); background: color(mainBackground);
overflow-y: auto; overflow-y: auto;
transition: all 0.3s ease-in-out; transition: all 0.3s ease-in-out;
& > .slide:first-child {
margin: 2rem;
}
} }
&.fullscreen { &.fullscreen {
@ -17,6 +26,7 @@
main { main {
& > .slide:first-child { & > .slide:first-child {
position: absolute; position: absolute;
margin: 0;
top: 0; top: 0;
left: 0; left: 0;
width: 100vw; width: 100vw;

@ -0,0 +1,25 @@
import React, {useContext} from "react";
import {Folder2Open, Cast} from "react-bootstrap-icons";
import SlideContext from "../shared/SlideContext";
import Mode from "../models/Mode";
const Toolbar = ({openFile}) => {
const {setMode, setSlide} = useContext(SlideContext);
const present = () => {
setMode(Mode.PRESENT);
setSlide(0);
document.documentElement.requestFullscreen();
}
return (
<nav className="toolbar">
<button onClick={openFile} title="Open file"><Folder2Open /></button>
<button onClick={present} title="Start presentation [F5]"><Cast /></button>
</nav>
);
};
export default Toolbar;
Loading…
Cancel
Save