Create focus mode for windows
This commit is contained in:
parent
6bc3b0d79b
commit
8b7dac3c60
@ -13,9 +13,17 @@
|
|||||||
.FinderContent .ToolBar{
|
.FinderContent .ToolBar{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
|
border-bottom: 1px solid #555555;
|
||||||
border-bottom: 1px solid #000000;
|
background-color: #EEEEEE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.Focused .FinderContent .ToolBar{
|
||||||
|
border-bottom: 1px solid #000000;
|
||||||
|
background-color: #DDDDDD;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.FinderContent .FinderFileView{
|
.FinderContent .FinderFileView{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
.ContentBorder { /*TODO Delete */
|
.ContentBorder { /*TODO Delete, deprecated*/
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
/* background-color: #DDDDDD;
|
/* background-color: #DDDDDD;
|
||||||
@ -13,6 +13,8 @@
|
|||||||
width: auto;
|
width: auto;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
|
||||||
|
background-color: #DDDDDD;
|
||||||
|
|
||||||
border: 1px solid #000000;
|
border: 1px solid #000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
.ScrollbarPlace{
|
.ScrollbarPlace{
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
border-left: 1px solid #000000;
|
border-left: 1px solid #555555;
|
||||||
width: 14px;
|
width: 14px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
@ -25,8 +25,8 @@
|
|||||||
width: 14px;
|
width: 14px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
background-color: #AAAAAA;
|
background-color: #EEEEEE;
|
||||||
box-shadow: inset -1px 0px 0px rgba(255, 255, 255, 0.29), inset -2px 0px 0px rgba(255, 255, 255, 0.19), inset 1px 1px 0px rgba(0, 0, 0, 0.14), inset 2px 2px 0px rgba(0, 0, 0, 0.19);
|
|
||||||
|
|
||||||
/* Inside auto layout */
|
/* Inside auto layout */
|
||||||
flex: none;
|
flex: none;
|
||||||
@ -35,16 +35,32 @@
|
|||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.Focused .ScrollbarPlace{
|
||||||
|
border-left: 1px solid #000000;
|
||||||
|
background-color: #AAAAAA;
|
||||||
|
box-shadow: inset -1px 0px 0px rgba(255, 255, 255, 0.29),
|
||||||
|
inset -2px 0px 0px rgba(255, 255, 255, 0.19),
|
||||||
|
inset 1px 1px 0px rgba(0, 0, 0, 0.14),
|
||||||
|
inset 2px 2px 0px rgba(0, 0, 0, 0.19);
|
||||||
|
}
|
||||||
|
|
||||||
.ScrollBarScrollElement{
|
.ScrollBarScrollElement{
|
||||||
position: relative;
|
position: relative;
|
||||||
|
visibility: hidden;
|
||||||
width: 14px;
|
width: 14px;
|
||||||
height: 31px;
|
height: 31px;
|
||||||
|
|
||||||
background: #9999FF;
|
background: #9999FF;
|
||||||
|
|
||||||
box-shadow: 0px -1px 0px #000000, 0px 1px 0px #000000, 0px 2px 0px rgba(0, 0, 0, 0.13), 0px 3px 0px rgba(0, 0, 0, 0.19), inset 0px 1px 0px rgba(255, 255, 255, 0.5), inset 1px 0px 0px rgba(255, 255, 255, 0.5), inset -1px -1px 0px rgba(102, 102, 204, 0.91);
|
box-shadow: 0px -1px 0px #000000,
|
||||||
|
0px 1px 0px #000000,
|
||||||
|
0px 2px 0px rgba(0, 0, 0, 0.13),
|
||||||
|
0px 3px 0px rgba(0, 0, 0, 0.19),
|
||||||
|
inset 0px 1px 0px rgba(255, 255, 255, 0.5),
|
||||||
|
inset 1px 0px 0px rgba(255, 255, 255, 0.5),
|
||||||
|
inset -1px -1px 0px rgba(102, 102, 204, 0.91);
|
||||||
|
|
||||||
|
/* Auto layout */
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -53,6 +69,10 @@
|
|||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.Focused .ScrollBarScrollElement{
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
.ScrollBarScrollElementDrag{
|
.ScrollBarScrollElementDrag{
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
/* background-color: #0A4C95; */
|
/* background-color: #0A4C95; */
|
||||||
|
@ -150,6 +150,7 @@ class WebDesktopEnvironment{
|
|||||||
newWindow.style.height = height.toString() + "px"
|
newWindow.style.height = height.toString() + "px"
|
||||||
|
|
||||||
document.body.querySelector('#windows-layer').appendChild(newWindow)
|
document.body.querySelector('#windows-layer').appendChild(newWindow)
|
||||||
|
WindowsCompositor.bringWindowToFront(newWindow)
|
||||||
return newWindow
|
return newWindow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -249,11 +250,7 @@ class WindowsCompositor{
|
|||||||
let startDrag = function(event) {
|
let startDrag = function(event) {
|
||||||
let window = event.target.closest('.WindowFrame')
|
let window = event.target.closest('.WindowFrame')
|
||||||
WindowsCompositor.bringWindowToFront(window)
|
WindowsCompositor.bringWindowToFront(window)
|
||||||
let targetClasses = event.target.className.split(' ')
|
if (event.target.classList.contains("DragArea")){
|
||||||
if (targetClasses[targetClasses.length - 1] != 'DragArea'){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
let xPosInit = event.offsetX
|
let xPosInit = event.offsetX
|
||||||
let yPosInit = event.offsetY
|
let yPosInit = event.offsetY
|
||||||
let dragWindow = function(event){
|
let dragWindow = function(event){
|
||||||
@ -268,7 +265,7 @@ class WindowsCompositor{
|
|||||||
addEventListener('mousemove', dragWindow)
|
addEventListener('mousemove', dragWindow)
|
||||||
addEventListener('mouseup', stopDrag)
|
addEventListener('mouseup', stopDrag)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
WindowsCompositor.windowsLayer.addEventListener('mousedown', startDrag)
|
WindowsCompositor.windowsLayer.addEventListener('mousedown', startDrag)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -277,7 +274,10 @@ class WindowsCompositor{
|
|||||||
* @param {HTMLElement} window
|
* @param {HTMLElement} window
|
||||||
*/
|
*/
|
||||||
static bringWindowToFront(window){ //FIXME
|
static bringWindowToFront(window){ //FIXME
|
||||||
if (window != WindowsCompositor.windowsLayer.lastChild ){
|
if (!window.classList.contains("Focused")){
|
||||||
|
let previousWindow = WindowsCompositor.windowsLayer.lastChild
|
||||||
|
previousWindow.classList.remove("Focused")
|
||||||
|
window.classList.add("Focused")
|
||||||
WindowsCompositor.windowsLayer.insertBefore(WindowsCompositor.windowsLayer.lastChild, window)
|
WindowsCompositor.windowsLayer.insertBefore(WindowsCompositor.windowsLayer.lastChild, window)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,9 @@
|
|||||||
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
||||||
border: 1px solid #000000;
|
background: #DDDDDD;
|
||||||
|
border: 1px solid #555555;
|
||||||
|
|
||||||
|
|
||||||
/* Inside auto layout */
|
/* Inside auto layout */
|
||||||
flex: none;
|
flex: none;
|
||||||
@ -19,19 +21,31 @@
|
|||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TODO Add shadows to windows */
|
||||||
|
.WindowFrame.Focused{
|
||||||
|
border: 1px solid #000000;
|
||||||
|
background-color: #CCCCCC;
|
||||||
|
}
|
||||||
|
|
||||||
.WindowFrameShadow {
|
.WindowFrameShadow {
|
||||||
|
box-shadow: 2px 2px 0px #555555;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Focused .WindowFrameShadow {
|
||||||
box-shadow: 2px 2px 0px #000000;
|
box-shadow: 2px 2px 0px #000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ConvexElement {
|
.Focused .ConvexElement {
|
||||||
background: #CCCCCC;
|
|
||||||
|
|
||||||
box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.25),
|
box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.25),
|
||||||
inset -1px -1px 0px rgba(0, 0, 0, 0.27),
|
inset -1px -1px 0px rgba(0, 0, 0, 0.27),
|
||||||
inset 1px 1px 0px #FFFFFF;
|
inset 1px 1px 0px #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.AdjectiveElement {
|
.AdjectiveElement {
|
||||||
|
border: 1px solid #555555;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Focused .AdjectiveElement {
|
||||||
border: 1px solid #000000;
|
border: 1px solid #000000;
|
||||||
box-shadow: -1px -1px 0px rgba(0, 0, 0, 0.25),
|
box-shadow: -1px -1px 0px rgba(0, 0, 0, 0.25),
|
||||||
1px 1px 0px #FFFFFF;
|
1px 1px 0px #FFFFFF;
|
||||||
@ -55,7 +69,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: center;
|
||||||
gap: 5px;
|
gap: 5px;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
|
|
||||||
@ -67,12 +81,11 @@
|
|||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.WindowFrame .TitleBar .Lable {
|
.WindowFrame .TitleBar .Lable {
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 1px;
|
top: 1px;
|
||||||
/* font-size: 13px; */
|
/* font-size: 13px; */
|
||||||
|
color:#777777;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
||||||
@ -80,6 +93,10 @@
|
|||||||
letter-spacing: 0.35px;
|
letter-spacing: 0.35px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.WindowFrame.Focused .TitleBar .Lable {
|
||||||
|
color:#000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.WindowFrame .TitleBar .Button {
|
.WindowFrame .TitleBar .Button {
|
||||||
width: 11px;
|
width: 11px;
|
||||||
@ -87,6 +104,7 @@
|
|||||||
padding: 0%;
|
padding: 0%;
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 1px;
|
top: 1px;
|
||||||
|
visibility: hidden;
|
||||||
|
|
||||||
background: linear-gradient(135deg, #999999 18.18%, #FFFFFF 81.82%);
|
background: linear-gradient(135deg, #999999 18.18%, #FFFFFF 81.82%);
|
||||||
border: 1px solid #222222;
|
border: 1px solid #222222;
|
||||||
@ -94,13 +112,16 @@
|
|||||||
-0.5px -0.5px 0px 0.5px rgba(0, 0, 0, 0.25),
|
-0.5px -0.5px 0px 0.5px rgba(0, 0, 0, 0.25),
|
||||||
inset 1px 1px 0px rgba(255, 255, 255, 0.5),
|
inset 1px 1px 0px rgba(255, 255, 255, 0.5),
|
||||||
inset -1px -1px 0px rgba(0, 0, 0, 0.27);
|
inset -1px -1px 0px rgba(0, 0, 0, 0.27);
|
||||||
|
|
||||||
/* Inside auto layout */
|
/* Inside auto layout */
|
||||||
flex: none;
|
flex: none;
|
||||||
order: 0;
|
order: 0;
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.WindowFrame.Focused .TitleBar .Button {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
.WindowFrame .TitleBar .Button:active {
|
.WindowFrame .TitleBar .Button:active {
|
||||||
background-color: rgba(0, 0, 0, 0.4);
|
background-color: rgba(0, 0, 0, 0.4);
|
||||||
/* Green */
|
/* Green */
|
||||||
@ -108,7 +129,7 @@
|
|||||||
-0.5px -0.5px 0px 0.5px rgba(0, 0, 0, 0.25);
|
-0.5px -0.5px 0px 0.5px rgba(0, 0, 0, 0.25);
|
||||||
}
|
}
|
||||||
|
|
||||||
.WindowFrame .TitleBar .VisualDragArea {
|
.Focused .VisualDragArea {
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 11px;
|
height: 11px;
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
{{ define "finder/admin-app.tmpl" }}
|
{{ define "finder/admin-app.tmpl" }}
|
||||||
<div class="TitleBar DragArea">
|
<div class="TitleBar DragArea">
|
||||||
<button id="closeWindowButton" class="Button" title="Close Window"></button>
|
<button id="closeWindowButton" class="Button" title="Close Window"></button>
|
||||||
|
|
||||||
<div id="Drag" class="VisualDragArea"></div>
|
<div id="Drag" class="VisualDragArea"></div>
|
||||||
<div class="Lable">
|
<div class="Lable">
|
||||||
ADMIN FINDER
|
Admin Finder
|
||||||
</div>
|
</div>
|
||||||
<div id="Drag" class="VisualDragArea"></div>
|
<div id="Drag" class="VisualDragArea"></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="ContentBorder" class="ContentBorder AdjectiveElement">
|
<div id="ContentBorder" class="ContentBorder AdjectiveElement">
|
||||||
<div class="FinderContent">
|
<div class="FinderContent">
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
{{ define "finder/app.tmpl" }}
|
{{ define "finder/app.tmpl" }}
|
||||||
<div class="TitleBar DragArea">
|
<div class="TitleBar DragArea">
|
||||||
<button id="closeWindowButton" class="Button" title="Close Window"></button>
|
<button id="closeWindowButton" class="Button" title="Close Window"></button>
|
||||||
|
<div class="TitleBarTest">
|
||||||
<div id="Drag" class="VisualDragArea"></div>
|
<div id="Drag" class="VisualDragArea"></div>
|
||||||
<div class="Lable">
|
<div class="Lable">
|
||||||
Files
|
Files
|
||||||
</div>
|
</div>
|
||||||
<div id="Drag" class="VisualDragArea"></div>
|
<div id="Drag" class="VisualDragArea"></div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="ToolBar">
|
<div class="ToolBar">
|
||||||
<button id="BackButton">Back</button>
|
<button id="BackButton">Back</button>
|
||||||
<button id="HomeButton">Home</button>
|
<button id="HomeButton">Home</button>
|
||||||
|
Loading…
Reference in New Issue
Block a user