Skip to content

Commit

Permalink
Fixed title bar position
Browse files Browse the repository at this point in the history
Added style prop for content
  • Loading branch information
Harshit Vishnoi authored and Harshit Vishnoi committed Aug 10, 2022
1 parent 7a35767 commit 93ac15f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ A floating window which can be dragged, minimized, maximized and moved across.
|**left**|number|0|✗|Left position of window with repect to parent element in px|
|**resizable**|boolean|false|✗|Make window resizable of not|
|**titleBar**|object| |✗|Refer [Title Bar props](./README.md#title-bar-properties)|
|**style**|object|{}|&cross|CSS styles applied to content window|

### Title Bar properties

Expand Down
7 changes: 3 additions & 4 deletions src/Window.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ div.window-container {
position: absolute;
border: solid 1px black;
--tilebar-height: 32px;
overflow: auto;
overflow: hidden;
display: flex;
flex-direction: column;
}
Expand All @@ -13,9 +13,7 @@ div.window-container > div.title-bar {
display: flex;
flex-direction: row;
cursor: default;
position: fixed;
top: 0;
left: 0;
position: static;
}

div.window-container > div.title-bar > span.icon {
Expand Down Expand Up @@ -68,4 +66,5 @@ div.window-container
div.window-container > div.content {
all: initial;
background-color: white;
overflow: scroll;
}
3 changes: 3 additions & 0 deletions src/Window.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ interface WindowProps {
close?: () => void;
};
};
style?: React.CSSProperties;
}

const nextZIndex: () => number = () => {
Expand Down Expand Up @@ -57,6 +58,7 @@ const Window: React.FC<WindowProps> = (props: WindowProps) => {
},
props.titleBar
),
style: {},
},
props
);
Expand Down Expand Up @@ -253,6 +255,7 @@ const Window: React.FC<WindowProps> = (props: WindowProps) => {
style={{
height: contentDisplay ? "auto" : 0,
opacity: visibility,
...properties.style,
}}
>
{properties.children}
Expand Down

0 comments on commit 93ac15f

Please sign in to comment.