Skip to content

Commit

Permalink
window still in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
chinonso098 committed Nov 15, 2023
1 parent 8bba09b commit 2748ab4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/app/shared/system-service/running.process.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class RunningProcessService{
focusOnCurrentProcessNotify: Subject<number> = new Subject<number>();
focusOutOtherProcessNotify: Subject<number> = new Subject<number>();
restoreOrMinimizeWindowNotify: Subject<number> = new Subject<number>();
maximizeWindowNotify: Subject<void> = new Subject<void>();

constructor(){
this._runningProcesses = []
Expand Down
1 change: 1 addition & 0 deletions src/app/system-apps/window/window.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ import {openCloseAnimation, hideShowAnimation, minimizeMaximizeAnimation} from '
if(this.windowMaximize){
if(windowState.getPid == this.processId){
this.setWindowToFullScreen(this.processId, windowState.getZIndex);
this._runningProcessService.maximizeWindowNotify.next();
}
}
else if(!this.windowMaximize){
Expand Down
2 changes: 1 addition & 1 deletion src/app/user-apps/title/title.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<cos-window [runningProcessID]="this.processId" [processAppIcon]="this.icon" [processAppName]="this.name" (click)="setTitleWindowToFocus(this.processId)" >
<p class="title"> Hello, World! </p>
<p class="title" #ptag> Hello, World! </p>
</cos-window>


Expand Down
17 changes: 14 additions & 3 deletions src/app/user-apps/title/title.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Component } from '@angular/core';
import { Component, ElementRef, ViewChild } from '@angular/core';
import { Subscription } from 'rxjs';
import { ProcessIDService } from 'src/app/shared/system-service/process.id.service';
import { RunningProcessService } from 'src/app/shared/system-service/running.process.service';
import { BaseComponent } from 'src/app/system-base/base/base.component';
Expand All @@ -13,8 +14,11 @@ import { Process } from 'src/app/system-files/process';

export class TitleComponent implements BaseComponent{

private _processIdService;
private _runningProcessService;
@ViewChild('ptag', {static: true}) ptag!: ElementRef;

private _processIdService:ProcessIDService;
private _runningProcessService:RunningProcessService;
private _maximizeWindowSub!: Subscription;

hasWindow = true;
icon = 'osdrive/picture/favicon_nice.png';
Expand All @@ -29,9 +33,16 @@ export class TitleComponent implements BaseComponent{

this.processId = this._processIdService.getNewProcessId()
this._runningProcessService.addProcess(this.getComponentDetail());

this._maximizeWindowSub = this._runningProcessService.maximizeWindowNotify.subscribe(() =>{this.maximizeWindow();})
}


maximizeWindow():void{
console.log('maximize');
this.ptag.nativeElement.style.height = '1000px';
}

setTitleWindowToFocus(pid:number):void{
this._runningProcessService.focusOnCurrentProcessNotify.next(pid);
}
Expand Down

0 comments on commit 2748ab4

Please sign in to comment.