-
-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: enabled
window.titleBarStyle
on macOS
Signed-off-by: Akos Kitta <[email protected]>
- Loading branch information
Akos Kitta
committed
Feb 9, 2023
1 parent
65add68
commit 479628b
Showing
3 changed files
with
44 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
arduino-ide-extension/src/electron-browser/theia/core/electron-window-preferences.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { PreferenceContribution } from '@theia/core/lib/browser/preferences/preference-contribution'; | ||
import { PreferenceService } from '@theia/core/lib/browser/preferences/preference-service'; | ||
import { deepClone } from '@theia/core/lib/common/objects'; | ||
import { PreferenceSchema } from '@theia/core/lib/common/preferences/preference-schema'; | ||
import { | ||
createElectronWindowPreferences, | ||
ElectronWindowPreferenceContribution, | ||
ElectronWindowPreferences, | ||
electronWindowPreferencesSchema as theiaElectronWindowPreferencesSchema, | ||
} from '@theia/core/lib/electron-browser/window/electron-window-preferences'; | ||
import { interfaces } from '@theia/core/shared/inversify'; | ||
|
||
const copy = deepClone(theiaElectronWindowPreferencesSchema); | ||
copy.properties['window.titleBarStyle'].included = true; // https://github.com/eclipse-theia/theia/pull/10044#issuecomment-1423841453 | ||
const electronWindowPreferencesSchema: PreferenceSchema = copy; | ||
|
||
export function rebindWindowPreferences( | ||
bind: interfaces.Bind, | ||
rebind: interfaces.Rebind | ||
): void { | ||
rebind(ElectronWindowPreferences) | ||
.toDynamicValue((ctx) => { | ||
const preferences = | ||
ctx.container.get<PreferenceService>(PreferenceService); | ||
const contribution = ctx.container.get<PreferenceContribution>( | ||
ElectronWindowPreferenceContribution | ||
); | ||
return createElectronWindowPreferences(preferences, contribution.schema); | ||
}) | ||
.inSingletonScope(); | ||
rebind(ElectronWindowPreferenceContribution).toConstantValue({ | ||
schema: electronWindowPreferencesSchema, | ||
}); | ||
} |