Skip to content

Commit

Permalink
Merge pull request #27 from robbiebyrd/react
Browse files Browse the repository at this point in the history
Updates to appearance manager, modal windows
  • Loading branch information
robbiebyrd authored Feb 27, 2024
2 parents 8ee835c + b24f4e1 commit 80a49c0
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
NEXT_PUBLIC_BASE_PATH="/platinum"
NEXT_PUBLIC_BASE_PATH=""
26 changes: 26 additions & 0 deletions src/app/components/ControlPanels/AppearanceManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,32 @@ const AppearanceManager = () => {
/>
<PlatinumButton onClick={cleanupIcons}>Cleanup Icons</PlatinumButton>
</PlatinumWindow>
<PlatinumWindow
id="AppearanceManager_about"
appId={appId}
closable={false}
resizable={false}
zoomable={false}
scrollable={false}
collapsable={false}
initialSize={[300, 300]}
initialPosition={[50, 50]}
modalWindow={true}
appMenu={appMenu}
>
<div style={{alignContent: "center",
justifyContent: "center",
justifyItems: "center",
alignItems: "center",
display: "flex",
flexDirection: "column",
textAlign: "center",
fontFamily: "var(--header-font"}}>
<img src={appIcon} alt="About" />
<h1>Appearance Manager</h1>
<h5>Not Copyright 1998 Apple Computer, Inc.</h5>
</div>
</PlatinumWindow>
</PlatinumApp>
</PlatinumAppContext.Provider>
);
Expand Down
17 changes: 15 additions & 2 deletions src/app/components/PlatinumWindow.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@
color: black !important;
}

.platinumWindowTitleleft, .platinumWindowTitleright {
.platinumWindowTitleCenter {
background: assets.$title-bar-center;
}

.platinumWindowTitleLeft, .platinumWindowTitleRight {
background: assets.$title-bar-center;

&:after {
Expand Down Expand Up @@ -170,7 +174,15 @@
user-drag: none;
}

.platinumWindowTitleleft, .platinumWindowTitleright {
.platinumWindowTitleCenter {
flex-grow: 1;
width: auto;
height: var(--window-control-size);
margin: calc(var(--window-padding-size) / 2) var(--window-padding-size);
padding: 0;
}

.platinumWindowTitleLeft, .platinumWindowTitleRight {
flex-grow: 1;
width: auto;
height: var(--window-control-size);
Expand Down Expand Up @@ -255,6 +267,7 @@
@include appearance.platinumWindowBorder;
border-top: calc(var(--window-padding-size) / 4) solid var(--color-black) !important;
background-color: var(--color-window-frame) !important;
@include appearance.platinumBoxShadow;
}

.platinumWindowContentsModalInner {
Expand Down
35 changes: 22 additions & 13 deletions src/app/components/PlatinumWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface PlatinumWindowProps {

const PlatinumWindow: React.FC<PlatinumWindowProps> = ({
id,
title = "Untitled",
title = "",
icon = `${process.env.NEXT_PUBLIC_BASE_PATH || ""}/img/icons/document.png`,
appId,
hidden = false,
Expand Down Expand Up @@ -237,6 +237,26 @@ const PlatinumWindow: React.FC<PlatinumWindowProps> = ({
});
};

const titleBar = () => {
if (title !== "") {
return (
<>
<div className={platinumWindowStyle.platinumWindowTitleLeft}></div>
<div className={platinumWindowStyle.platinumWindowIcon}>
<img src={icon} alt={title}/>
</div>
<div className={platinumWindowStyle.platinumWindowTitleText}>
{title}
</div>
<div className={platinumWindowStyle.platinumWindowTitleRight}></div>
</>
)
}
return (
<div className={platinumWindowStyle.platinumWindowTitleCenter}></div>
)
}

return (
<>
{!hidden && (
Expand Down Expand Up @@ -307,18 +327,7 @@ const PlatinumWindow: React.FC<PlatinumWindowProps> = ({
className={platinumWindowStyle.platinumWindowTitle}
onMouseDown={startMoveWindow}
>
<div
className={platinumWindowStyle.platinumWindowTitleleft}
></div>
<div className={platinumWindowStyle.platinumWindowIcon}>
<img src={icon}/>
</div>
<div className={platinumWindowStyle.platinumWindowTitleText}>
{title}
</div>
<div
className={platinumWindowStyle.platinumWindowTitleright}
></div>
{titleBar()}
</div>
{collapsable && (
<div className={platinumWindowStyle.platinumWindowControlBox}>
Expand Down

0 comments on commit 80a49c0

Please sign in to comment.