Skip to content

Commit

Permalink
Remove touchbar support (#2206)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbieTheWagner authored Sep 11, 2024
1 parent 60020e0 commit 5c68bf7
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 97 deletions.
20 changes: 0 additions & 20 deletions app/components/kuler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ export default class KulerComponent extends Component<KulerSignature> {

this.ipcRenderer = ipcRenderer;

this._updateTouchbar();

this.ipcRenderer.on(
'selectKulerColor',
async (_event: unknown, colorIndex: number) => {
Expand Down Expand Up @@ -174,8 +172,6 @@ export default class KulerComponent extends Component<KulerSignature> {
this.selectedPalette.colors.mapBy('hex'),
palette.selectedColorIndex,
);

this._updateTouchbar();
}
}

Expand Down Expand Up @@ -206,8 +202,6 @@ export default class KulerComponent extends Component<KulerSignature> {
this.selectedPalette.colors.mapBy('hex'),
this.selectedPalette.selectedColorIndex,
);

this._updateTouchbar();
}

@action
Expand Down Expand Up @@ -265,20 +259,6 @@ export default class KulerComponent extends Component<KulerSignature> {
this.colorPicker.on('color:change', this._debouncedColorChange);
this.colorPicker.on('color:setActive', this._onColorSetActive);
}

@action
_updateTouchbar(): void {
if (this.ipcRenderer) {
const itemsToShow = {
colorPicker: true,
kulerColors: {
colors: this.selectedPalette.colors,
},
};

this.ipcRenderer.send('setTouchbar', itemsToShow);
}
}
}

declare module '@glint/environment-ember-loose/registry' {
Expand Down
18 changes: 0 additions & 18 deletions app/routes/-private/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,13 @@ import { service } from '@ember/service';

import type Session from 'ember-simple-auth/services/session';

import type { IpcRenderer } from 'electron';

import type DataService from 'swach/services/data';

export default class ApplicationRoute extends Route {
@service declare data: DataService;
@service declare router: Router;
@service declare session: Session;

declare ipcRenderer: IpcRenderer;

constructor() {
super(...arguments);

if (typeof requireNode !== 'undefined') {
const { ipcRenderer } = requireNode('electron');

this.ipcRenderer = ipcRenderer;

this.router.on('routeDidChange', () => {
this.ipcRenderer.send('setTouchbar', []);
});
}
}

async beforeModel(): Promise<void> {
await this.session.setup();

Expand Down
5 changes: 0 additions & 5 deletions electron-app/src/ipc-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const fs = require('fs');

const { launchPicker } = require('./color-picker');
const { restartDialog } = require('./dialogs');
const { setTouchbar } = require('./touchbar');

function setupEventHandlers(mb, store) {
ipcMain.on('copyColorToClipboard', (channel, color) => {
Expand Down Expand Up @@ -66,10 +65,6 @@ function setupEventHandlers(mb, store) {
await launchPicker(mb);
});

ipcMain.on('setTouchbar', (event, itemsToShow) => {
setTouchbar(mb, itemsToShow);
});

ipcMain.on('setShowDockIcon', async (channel, showDockIcon) => {
store.set('showDockIcon', showDockIcon);
await restartDialog();
Expand Down
54 changes: 0 additions & 54 deletions electron-app/src/touchbar.js

This file was deleted.

0 comments on commit 5c68bf7

Please sign in to comment.