Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
chinonso098 committed Sep 22, 2024
1 parent 1248002 commit 9122ea6
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 12 deletions.
6 changes: 6 additions & 0 deletions src/app/shared/system-component/menu/menu.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
<div class="dm-empty-line-container" *ngIf="i === 2 || i === 4 || i === 6"></div>
</ng-container>

<ng-container *ngIf="menuOrder === defaultFolderMenuOrder">
<div class="dm-empty-line-container" *ngIf="i === 4 || i === 6 || i === 8"></div>
<div class="dm-line-container" *ngIf="i === 4 || i === 6 || i === 8"><div class="dm-line"></div></div>
<div class="dm-empty-line-container" *ngIf="i === 4 || i === 6 || i === 8"></div>
</ng-container>

</div>
<div class="dm-empty-line-container"></div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/system-component/menu/menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class MenuComponent implements OnChanges, OnDestroy{
readonly fileExplrMngrMenuOption = this._consts.FILE_EXPLORER_FILE_MANAGER_MENU_OPTION;
readonly tskBarMenuOption = this._consts.TASK_BAR_MENU_OPTION;
readonly defaultFileMenuOrder = this._consts.DEFAULT_FILE_MENU_ORDER;
readonly defaultFolderMenuOrder = this._consts.DEFAULT_FILE_MENU_ORDER;
readonly defaultFolderMenuOrder = this._consts.DEFAULT_FOLDER_MENU_ORDER;
readonly fileExplrFolderMenuOrder = this._consts.FILE_EXPLORER_FOLDER_MENU_ORDER;
readonly fileExplrFileMenuOrder = this._consts.FILE_EXPLORER_FILE_MENU_ORDER;
readonly fileExplrUniqueMenuOrder = this._consts.FILE_EXPLORER_UNIQUE_MENU_ORDER;
Expand Down
4 changes: 3 additions & 1 deletion src/app/system-apps/audioplayer/audioplayer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { Subscription } from 'rxjs';
import { ScriptService } from 'src/app/shared/system-service/script.services';
import * as htmlToImage from 'html-to-image';
import { TaskBarPreviewImage } from '../taskbarpreview/taskbar.preview';

// eslint-disable-next-line no-var
declare const Howl:any;
declare const SiriWave:any;
Expand Down Expand Up @@ -69,7 +70,8 @@ export class AudioPlayerComponent implements BaseComponent, OnInit, OnDestroy, A

name= 'audioplayer';
hasWindow = true;
icon = '/osdrive/Cheetah/System/Imageres/audioplayer.png';

icon = `${this._consts.IMAGE_BASE_PATH}audioplayer.png`;
processId = 0;
type = ComponentType.User;
displayName = 'Howlerjs';
Expand Down
20 changes: 16 additions & 4 deletions src/app/system-apps/fileexplorer/fileexplorer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1323,13 +1323,25 @@ export class FileExplorerComponent implements BaseComponent, OnInit, AfterViewIn
let horizontalShift = false;
let verticalShift = false;

if((horizontalDiff) >= 0 && (horizontalDiff) <= 10){
this.isShiftSubMenuLeft = true;
horizontalShift = true;
const menuWidth = 210;
const subMenuWidth = 205;

// if((horizontalDiff) >= 0 && (horizontalDiff) <= 10){
// this.isShiftSubMenuLeft = true;
// horizontalShift = true;

// xAxis = evt.clientX - rect.left - horizontalDiff;
// }

xAxis = evt.clientX - rect.left - horizontalDiff;
if((horizontalDiff) < menuWidth){
horizontalShift = true;
this.isShiftSubMenuLeft = true;
const diff = menuWidth - horizontalDiff;
xAxis = evt.clientX - rect.left - diff;
}



if((verticalDiff) >= 40 && (verticalDiff) <= menuHeight){
const shifMenuUpBy = menuHeight - verticalDiff;
verticalShift = true;
Expand Down
32 changes: 29 additions & 3 deletions src/app/system-apps/filemanager/filemanager.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { FileManagerService } from 'src/app/shared/system-service/file.manager.s
import { FormGroup, FormBuilder } from '@angular/forms';
import { MenuService } from 'src/app/shared/system-service/menu.services';
import { Constants } from 'src/app/system-files/constants';
import { GeneralMenu } from 'src/app/shared/system-component/menu/menu.item';


@Component({
Expand Down Expand Up @@ -76,19 +77,24 @@ export class FileManagerComponent implements BaseComponent, OnInit, AfterViewIni
directory ='/Users/Desktop';
files:FileInfo[] = [];

menuData = [
sourceData:GeneralMenu[] = [
{icon:'', label: 'Open', action: this.onTriggerRunProcess.bind(this) },
{icon:'', label: 'Pin to Quick access', action: this.doNothing.bind(this) },
{icon:'', label: 'Open in Terminal', action: this.doNothing.bind(this) },
{icon:'', label: 'Pin to Start', action: this.doNothing.bind(this) },
{icon:'', label: 'Pin to Taskbar', action: this.pinIconToTaskBar.bind(this) },
{icon:'', label: 'Cut', action: this.onCut.bind(this) },
{icon:'', label: 'Copy', action: this.onCopy.bind(this) },
{icon:'', label: 'Copy', action: this.onCopy.bind(this)},
{icon:'', label: 'Create shortcut', action: this.doNothing.bind(this)},
{icon:'', label: 'Delete', action: this.onDeleteFile.bind(this) },
{icon:'', label: 'Rename', action: this.onRenameFileTxtBoxShow.bind(this) },
{icon:'', label: 'Properties', action: this.doNothing.bind(this) }
];

menuData:GeneralMenu[] =[];

fileExplrMngrMenuOption = this._consts.FILE_EXPLORER_FILE_MANAGER_MENU_OPTION;
menuOrder = this._consts.DEFAULT_FILE_MENU_ORDER;
menuOrder = '';

constructor( processIdService:ProcessIDService, runningProcessService:RunningProcessService, fileInfoService:FileService,
triggerProcessService:TriggerProcessService, fileManagerService:FileManagerService, formBuilder: FormBuilder, menuService:MenuService) {
Expand Down Expand Up @@ -210,6 +216,7 @@ export class FileManagerComponent implements BaseComponent, OnInit, AfterViewIni
this._runningProcessService.addEventOriginator(uid);
this._menuService.hideContextMenus.next();

this.adjustContextMenuData(file);
this.selectedFile = file;
this.showCntxtMenu = !this.showCntxtMenu;

Expand All @@ -225,6 +232,25 @@ export class FileManagerComponent implements BaseComponent, OnInit, AfterViewIni
evt.preventDefault();
}

adjustContextMenuData(file:FileInfo):void{
this.menuData = [];

console.log('adjustContextMenuData - filename:',file.getCurrentPath);
if(file.getIsFile){
//files can not be opened in terminal, pinned to start, opened in new window, pin to Quick access
this.menuOrder = this._consts.DEFAULT_FILE_MENU_ORDER;
for(const x of this.sourceData) {
if(x.label === 'Open in Terminal' || x.label === 'Pin to Quick access' || x.label === 'Pin to Start'){ /*nothing*/}
else{
this.menuData.push(x);
}
}
}else{
this.menuOrder = this._consts.DEFAULT_FOLDER_MENU_ORDER;
this.menuData = this.sourceData;
}
}

doNothing():void{
console.log('do nothing called');
}
Expand Down
7 changes: 4 additions & 3 deletions src/app/system-apps/photoviewer/photoviewer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { Constants } from 'src/app/system-files/constants';
import * as htmlToImage from 'html-to-image';
import { TaskBarPreviewImage } from '../taskbarpreview/taskbar.preview';


@Component({
selector: 'cos-photoviewer',
templateUrl: './photoviewer.component.html',
Expand All @@ -39,14 +40,14 @@ export class PhotoViewerComponent implements BaseComponent, OnInit, OnDestroy, A
SECONDS_DELAY = 250;
name= 'photoviewer';
hasWindow = true;
icon = '/osdrive/Cheetah/System/Imageres/photoviewer.png';
icon = `${this._consts.IMAGE_BASE_PATH}photoviewer.png`;
isMaximizable = false;
processId = 0;
type = ComponentType.System;
displayName = 'PhotoViewer';
private defaultImg = '/osdrive/Pictures/Samples/no_img.jpeg';
private tst_imageList:string[] = ['/osdrive/Pictures/Samples/Chill on the Moon.jpg', '/osdrive/Pictures/Samples/Mystical.jpg',
'/osdrive/Pictures/Samples/Sparkling Water.jpg']
private tst_imageList:string[] = [`${this._consts.IMAGE_BASE_PATH}Chill on the Moon.jpg`, `${this._consts.IMAGE_BASE_PATH}Mystical.jpg`,
`${this._consts.IMAGE_BASE_PATH}Sparkling Water.jpg`]

imageList:string[] = []

Expand Down

0 comments on commit 9122ea6

Please sign in to comment.