дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 03:05:40 +02:00
IDE zoom changed the toolbar height while the macOS window buttons stayed at a fixed vertical position. The buttons are now centred in the title bar using its measured height and the zoom, and repositioned after AppKit layout updates. Zooming out keeps enough room for them so they do not cover the project icon, and compact mode follows the same alignment. Windows align from the saved zoom and compact setting when they are built, so the buttons do not move once the page loads. The height uses the zoom the webview applies, so an out-of-range setting cannot misplace them.
8 рядки
333 B
TypeScript
8 рядки
333 B
TypeScript
export const ZOOM_LIMITS = { min: 50, max: 300 } as const;
|
|
|
|
/** The IDE zoom in percent that a settings value applies as. */
|
|
export function clampZoom(value: unknown): number {
|
|
if (typeof value !== "number" || !Number.isFinite(value)) return 100;
|
|
return Math.min(ZOOM_LIMITS.max, Math.max(ZOOM_LIMITS.min, Math.round(value)));
|
|
}
|