mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-27 08:12:22 +01:00
Merge current dev and refresh PR #6741 from the 7011 integration
This commit is contained in:
@@ -13,12 +13,23 @@ export const WORKSPACES = Object.freeze({
|
||||
photography: Object.freeze({ label: 'Photography', tab: 'histogram', width: 320, panels: Object.freeze(['layers', 'options', 'histogram', 'info', 'navigator', 'adjustments']) }),
|
||||
painting: Object.freeze({ label: 'Painting', tab: 'swatches', width: 300, panels: Object.freeze(['layers', 'options', 'swatches', 'gradients', 'patterns', 'character']) }),
|
||||
graphic: Object.freeze({ label: 'Graphic & Web', tab: 'options', width: 320, panels: Object.freeze(['layers', 'options', 'character', 'properties', 'adjustments', 'paths', 'info', 'history']) }),
|
||||
minimal: Object.freeze({ label: 'Minimal', tab: 'layers', width: 280, panels: Object.freeze(['layers', 'history']) }),
|
||||
});
|
||||
|
||||
export function applyWorkspace(name, { dock = null, rightPanel = null, setPanelVisible = null, persistKey = 'ge-right-panel-width' } = {}) {
|
||||
const workspace = WORKSPACES[name];
|
||||
let workspace = WORKSPACES[name];
|
||||
if (!workspace) {
|
||||
// A user-saved workspace ("Save Current") is stored in localStorage under
|
||||
// `ge-workspace-<name>` rather than in the frozen preset table.
|
||||
try {
|
||||
const raw = localStorage.getItem(`ge-workspace-${name}`);
|
||||
if (raw) workspace = JSON.parse(raw);
|
||||
} catch (error) {
|
||||
/* storage unavailable — ignore */
|
||||
}
|
||||
}
|
||||
if (!workspace) return false;
|
||||
if (dock && typeof dock.show === 'function') dock.show(workspace.tab);
|
||||
if (dock && typeof dock.show === 'function' && workspace.tab) dock.show(workspace.tab);
|
||||
if (rightPanel && Number.isFinite(workspace.width)) {
|
||||
rightPanel.style.width = `${workspace.width}px`;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user