Skip to content

Commit b6d928b

Browse files
committed
Some tweaks
1 parent 710429b commit b6d928b

File tree

18 files changed

+395
-416
lines changed

18 files changed

+395
-416
lines changed

public/vid/quicktime/sample.mp4

455 KB
Binary file not shown.

src/app/Applications/Browser/Browser.tsx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import ClassicyApp from '@/app/SystemFolder/SystemResources/App/ClassicyApp'
2-
import { quitAppHelper } from '@/app/SystemFolder/SystemResources/App/ClassicyAppUtils'
31
import { useDesktopDispatch } from '@/app/SystemFolder/ControlPanels/AppManager/ClassicyAppManagerContext'
2+
import ClassicyApp from '@/app/SystemFolder/SystemResources/App/ClassicyApp'
3+
import { quitMenuItemHelper } from '@/app/SystemFolder/SystemResources/App/ClassicyAppUtils'
44
import ClassicyButton from '@/app/SystemFolder/SystemResources/Button/ClassicyButton'
55
import ClassicyControlGroup from '@/app/SystemFolder/SystemResources/ControlGroup/ClassicyControlGroup'
66
import ClassicyInput from '@/app/SystemFolder/SystemResources/Input/ClassicyInput'
@@ -21,21 +21,11 @@ const Browser = () => {
2121
setIframeUrl(refAddressBar.current.value)
2222
}
2323

24-
const quitApp = () => {
25-
desktopEventDispatch(quitAppHelper(appId, appName, appIcon))
26-
}
27-
2824
const appMenu = [
2925
{
3026
id: 'file',
3127
title: 'File',
32-
menuChildren: [
33-
{
34-
id: appId + '_quit',
35-
title: 'Quit',
36-
onClickFunc: quitApp,
37-
},
38-
],
28+
menuChildren: [quitMenuItemHelper(appId, appName, appIcon)],
3929
},
4030
]
4131

src/app/Applications/Demo/Demo.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import ClassicyApp from '@/app/SystemFolder/SystemResources/App/ClassicyApp'
2-
import { quitAppHelper } from '@/app/SystemFolder/SystemResources/App/ClassicyAppUtils'
31
import { useDesktopDispatch } from '@/app/SystemFolder/ControlPanels/AppManager/ClassicyAppManagerContext'
2+
import ClassicyApp from '@/app/SystemFolder/SystemResources/App/ClassicyApp'
3+
import { quitAppHelper, quitMenuItemHelper } from '@/app/SystemFolder/SystemResources/App/ClassicyAppUtils'
44
import ClassicyButton from '@/app/SystemFolder/SystemResources/Button/ClassicyButton'
55
import ClassicyCheckbox from '@/app/SystemFolder/SystemResources/Checkbox/ClassicyCheckbox'
66
import ClassicyControlGroup from '@/app/SystemFolder/SystemResources/ControlGroup/ClassicyControlGroup'
7+
import ClassicyControlLabel from '@/app/SystemFolder/SystemResources/ControlLabel/ClassicyControlLabel'
78
import ClassicyDisclosure from '@/app/SystemFolder/SystemResources/Disclosure/ClassicyDisclosure'
89
import ClassicyInput from '@/app/SystemFolder/SystemResources/Input/ClassicyInput'
910
import ClassicyPopUpMenu from '@/app/SystemFolder/SystemResources/PopUpMenu/ClassicyPopUpMenu'
1011
import ClassicyProgressBar from '@/app/SystemFolder/SystemResources/ProgressBar/ClassicyProgressBar'
1112
import ClassicyRadioInput from '@/app/SystemFolder/SystemResources/RadioInput/ClassicyRadioInput'
1213
import ClassicyWindow from '@/app/SystemFolder/SystemResources/Window/ClassicyWindow'
1314
import React from 'react'
14-
import ClassicyControlLabel from '@/app/SystemFolder/SystemResources/ControlLabel/ClassicyControlLabel'
1515

1616
const Demo: React.FC = () => {
1717
const appName = 'Demo'
@@ -40,13 +40,7 @@ const Demo: React.FC = () => {
4040
{
4141
id: 'file',
4242
title: 'File',
43-
menuChildren: [
44-
{
45-
id: appId + '_quit',
46-
title: 'Quit',
47-
onClickFunc: quitApp,
48-
},
49-
],
43+
menuChildren: [quitMenuItemHelper(appId, appName, appIcon)],
5044
},
5145
]
5246

src/app/Applications/EPG/EPG.module.scss

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,16 @@
1717
font-size: calc(var(--ui-font-size) * 0.85);
1818
display: flex;
1919
align-items: center;
20-
flex-direction: row;
2120
@include appearance.platinumWindowUndepressable;
21+
flex-direction: row;
2222
height: calc(var(--window-control-size) * 3);
2323
padding: var(--window-padding-size);
2424
border: 0 !important;
2525
border-radius: 0 !important;
26+
27+
& > * {
28+
z-index: 100;
29+
}
2630
}
2731

2832
.epgEntryIcon {
@@ -62,9 +66,12 @@
6266
font-family: var(--body-font), sans-serif;
6367
font-size: calc(var(--ui-font-size) * 0.85);
6468
position: relative;
69+
z-index: 100;
6570
width: 100%;
6671
padding-top: calc(var(--window-border-size) * 2);
72+
6773
border-left: calc(var(--window-border-size) * 2) solid var(--color-theme-05);
74+
6875
}
6976

7077
.epgHeaderTimeInner {
@@ -105,19 +112,22 @@
105112

106113
.epgIndicatorHolder {
107114
position: absolute;
115+
z-index: 10;
108116
height: 100%;
109117
}
110118

111119
.epgIndicator {
120+
z-index: 1;
112121
top: 0;
113122
right: 0;
114-
width: var(--window-border-size);
115-
background-color: var(--color-theme-02);
123+
width: 100%;
124+
opacity: .5;
125+
background-color: var(--color-theme-03);
116126
}
117127

118128
.epgGridSetupBorder {
119-
width: calc(100% - var(--window-border-size) * 2);
120129
@include appearance.platinumWindowControlBoxBorder;
130+
width: calc(100% - var(--window-border-size) * 2);
121131
}
122132

123133
.epgHolder {

src/app/Applications/EPG/EPG.tsx

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useDesktop, useDesktopDispatch } from '@/app/SystemFolder/ControlPanels/AppManager/ClassicyAppManagerContext'
22
import ClassicyApp from '@/app/SystemFolder/SystemResources/App/ClassicyApp'
3-
import { quitAppHelper } from '@/app/SystemFolder/SystemResources/App/ClassicyAppUtils'
3+
import { quitMenuItemHelper } from '@/app/SystemFolder/SystemResources/App/ClassicyAppUtils'
44
import ClassicyButton from '@/app/SystemFolder/SystemResources/Button/ClassicyButton'
55
import ClassicyWindow from '@/app/SystemFolder/SystemResources/Window/ClassicyWindow'
66
import classNames from 'classnames'
@@ -9,9 +9,9 @@ import epgStyles from './EPG.module.scss'
99
import data from './testdata.json' with { type: 'json' }
1010

1111
interface ClassicyEPGProps {
12-
minutesPerGrid?: number // Minutes
13-
gridTimeWidth?: number // Minutes
14-
gridWidth?: number // Minutes
12+
minutesPerGrid?: number // in Minutes
13+
gridTimeWidth?: number // in Minutes
14+
gridWidth?: number // in Minutes
1515
gridStart?: Date
1616
channelHeaderWidth?: number
1717
}
@@ -30,7 +30,7 @@ export type EPGChannel = {
3030
name: string
3131
title?: string
3232
number: string
33-
callsign: string
33+
callSign: string
3434
location: string
3535
icon: string
3636
grid: EPGProgram[]
@@ -65,10 +65,6 @@ const EPG: React.FC<ClassicyEPGProps> = ({
6565
return endTime
6666
}, [gridStartTime, gridWidth])
6767

68-
const quitApp = () => {
69-
desktopEventDispatch(quitAppHelper(appId, appName, appIcon))
70-
}
71-
7268
const testClick = (e) => {
7369
alert(e.target.id)
7470
}
@@ -77,17 +73,12 @@ const EPG: React.FC<ClassicyEPGProps> = ({
7773
{
7874
id: 'file',
7975
title: 'File',
80-
menuChildren: [
81-
{
82-
id: appId + '_quit',
83-
title: 'Quit',
84-
onClickFunc: quitApp,
85-
},
86-
],
76+
menuChildren: [quitMenuItemHelper(appId, appName, appIcon)],
8777
},
8878
]
8979

9080
const gridData = data as EPGChannel[]
81+
const defaultDocumentIcon = `${process.env.NEXT_PUBLIC_BASE_PATH || ''}/img/icons/system/quicktime/movie.png`
9182

9283
const getProgramData = (channel: EPGChannel, channelIndex: number) => {
9384
return channel.grid.map((gridItem) => {
@@ -200,7 +191,7 @@ const EPG: React.FC<ClassicyEPGProps> = ({
200191
<img
201192
className={epgStyles.epgChannelIcon}
202193
src={`${process.env.NEXT_PUBLIC_BASE_PATH || ''}/img/icons/applications/epg/channels/${channel.icon}`}
203-
alt={channel.number + ' ' + channel.callsign + ' - ' + channel.location}
194+
alt={channel.number + ' ' + channel.callSign + ' - ' + channel.location}
204195
/>
205196
{channel.name}
206197
</div>
@@ -252,17 +243,20 @@ const EPG: React.FC<ClassicyEPGProps> = ({
252243
<div
253244
className={classNames(epgStyles.epgGridSetup, epgStyles.epgIndicatorHolder)}
254245
style={{
246+
pointerEvents: 'none',
255247
gridTemplateColumns: `${channelHeaderWidth}fr repeat(${gridWidth / minutesPerGrid}, 1fr)`,
256248
}}
257249
>
258250
<div
259251
className={epgStyles.epgIndicator}
260252
style={{ gridColumnStart: indicator + 2, gridColumnEnd: indicator + 3 }}
261-
></div>
253+
>
254+
&nbsp;
255+
</div>
262256
</div>
263257
)}
264258
<div
265-
className={epgStyles.epgGridSetup}
259+
className={classNames(epgStyles.epgGridSetup)}
266260
style={{
267261
gridTemplateColumns: `${channelHeaderWidth}fr repeat(${gridWidth / minutesPerGrid}, 1fr)`,
268262
backgroundColor: 'var(--color-white)',

src/app/Applications/EPG/testdata.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
"name": "ABC",
44
"number": "3",
5-
"callsign": "WABC",
5+
"callSign": "WABC",
66
"location": "New York, NY",
77
"icon": "wjla.png",
88
"grid": [
@@ -88,7 +88,7 @@
8888
{
8989
"name": "CBS",
9090
"number": "3",
91-
"callsign": "WABC",
91+
"callSign": "WABC",
9292
"location": "New York, NY",
9393
"icon": "wjla.png",
9494
"grid": [
@@ -152,7 +152,7 @@
152152
{
153153
"name": "NBC",
154154
"number": "3",
155-
"callsign": "WABC",
155+
"callSign": "WABC",
156156
"location": "New York, NY",
157157
"icon": "wjla.png",
158158
"grid": [
@@ -238,7 +238,7 @@
238238
{
239239
"name": "FOX",
240240
"number": "3",
241-
"callsign": "WABC",
241+
"callSign": "WABC",
242242
"location": "New York, NY",
243243
"icon": "wjla.png",
244244
"grid": [

src/app/Applications/QuickTime/QuickTimeContext.tsx

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { QuickTimeAppInfo } from '@/app/Applications/QuickTime/QuickTimeMoviePlayer'
22
import { classicyAppEventHandler, ClassicyStore } from '@/app/SystemFolder/ControlPanels/AppManager/ClassicyAppManager'
33

4-
type classicyQuickTimeDocument = {
4+
export type ClassicyQuickTimeDocument = {
55
url: string
66
name?: string
77
options?: any
@@ -10,8 +10,8 @@ type classicyQuickTimeDocument = {
1010
}
1111
type classicyQuickTimeEvent = {
1212
type: string
13-
document?: classicyQuickTimeDocument
14-
documents?: classicyQuickTimeDocument[]
13+
document?: ClassicyQuickTimeDocument
14+
documents?: ClassicyQuickTimeDocument[]
1515
}
1616

1717
export const classicyQuickTimeEventHandler = (ds: ClassicyStore, action: classicyQuickTimeEvent) => {
@@ -22,12 +22,15 @@ export const classicyQuickTimeEventHandler = (ds: ClassicyStore, action: classic
2222
app: QuickTimeAppInfo,
2323
})
2424
}
25+
2526
if (!ds.System.Manager.App.apps[appId]?.hasOwnProperty('data')) {
2627
ds.System.Manager.App.apps[appId].data = {}
2728
}
29+
2830
if (!ds.System.Manager.App.apps[appId]?.data?.hasOwnProperty('openFiles')) {
2931
ds.System.Manager.App.apps[appId].data['openFiles'] = []
3032
}
33+
3134
const openDocUrls = ds.System.Manager.App.apps[appId].data['openFiles'].map((app) => app.url)
3235

3336
switch (action.type) {
@@ -36,20 +39,31 @@ export const classicyQuickTimeEventHandler = (ds: ClassicyStore, action: classic
3639
ds.System.Manager.App.apps[appId].data['openFiles'] = Array.from(
3740
new Set([...ds.System.Manager.App.apps[appId].data['openFiles'], action.document])
3841
)
42+
ds = classicyAppEventHandler(ds, {
43+
type: 'ClassicyAppOpen',
44+
app: QuickTimeAppInfo,
45+
})
3946
}
4047
break
4148
}
4249
case 'ClassicyAppQuickTimeOpenDocuments': {
43-
const docs = action.documents.filter((doc) => !openDocUrls.includes(doc.url))
50+
const docs = action.documents?.filter((doc) => !openDocUrls.includes(doc.url))
51+
if (!docs) {
52+
break
53+
}
4454
ds.System.Manager.App.apps[appId].data['openFiles'] = Array.from(
4555
new Set([...ds.System.Manager.App.apps[appId].data['openFiles'], ...docs])
4656
)
57+
ds = classicyAppEventHandler(ds, {
58+
type: 'ClassicyAppOpen',
59+
app: QuickTimeAppInfo,
60+
})
4761
break
4862
}
4963
case 'ClassicyAppQuickTimeCloseDocument': {
5064
ds.System.Manager.App.apps[appId].data['openFiles'] = ds.System.Manager.App.apps[appId].data[
5165
'openFiles'
52-
].filter((p: classicyQuickTimeDocument) => p.url != action.document.url)
66+
].filter((p: ClassicyQuickTimeDocument) => p.url != action.document.url)
5367
break
5468
}
5569
}

0 commit comments

Comments
 (0)