Skip to content

Commit

Permalink
Merge github.com:jhonleeee/playground-macos
Browse files Browse the repository at this point in the history
  • Loading branch information
lilimul committed May 9, 2021
2 parents 8857d9f + 31e3b6e commit 33c66d8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
17 changes: 15 additions & 2 deletions src/components/Window.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ const ExitFullIcon = ({ size }) => {
);
};

const minMarginY = 24;
const minMarginX = 100;

const TrafficLights = ({ id, close, max, setMax, setMin }) => {
const closeWindow = (e) => {
e.stopPropagation();
Expand Down Expand Up @@ -132,8 +135,18 @@ export default class Window extends Component {
height: height
}}
position={{
x: this.props.max ? 0 : this.state.x,
y: this.props.max ? 0 : this.state.y
x: this.props.max
? 0
: Math.min(
window.innerWidth - minMarginX,
Math.max(-this.state.width + minMarginX, this.state.x)
),
y: this.props.max
? 0
: Math.min(
window.innerHeight - minMarginY,
Math.max(minMarginY, this.state.y)
)
}}
onDragStop={(e, d) => {
this.setState({ x: d.x, y: d.y });
Expand Down
2 changes: 1 addition & 1 deletion src/components/apps/Terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export default class Terminal extends Component {
const cmd = input[0];
const args = input[1];

// we can"t edit the past input
// we can't edit the past input
$input.setAttribute("readonly", true);

if (input_text.substr(0, 6) === "rm -rf") this.setState({ rmrf: true });
Expand Down
2 changes: 1 addition & 1 deletion src/components/dock/Dock.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function Dock({

return (
<div
className="dock w-full fixed bottom-0 overflow-x-scroll sm:overflow-x-visible"
className="dock w-full sm:w-max fixed left-0 right-0 mx-auto bottom-0 overflow-x-scroll sm:overflow-x-visible"
style={{
zIndex: hide ? 0 : 99999
}}
Expand Down
4 changes: 0 additions & 4 deletions src/components/menus/TopBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,6 @@ class TopBar extends Component {
this.props.sleepMac(e);
};

test = () => {
console.log("hi");
};

render() {
return (
<div className="nightwind-prevent w-full h-6 px-4 fixed top-0 flex flex-row justify-between items-center text-sm text-white bg-gray-500 bg-opacity-10 blur shadow transition">
Expand Down

0 comments on commit 33c66d8

Please sign in to comment.