Open properties from context menu
This commit is contained in:
+18
-2
@@ -52,7 +52,6 @@ async function init() {
|
||||
}
|
||||
statusText.textContent = `${state.config.roots.length} Root, ${state.config.readOnly ? 'Read-only' : 'Schreibzugriff aktiv'} · ${APP_VERSION}`;
|
||||
openExplorer(state.config.roots[0].path);
|
||||
openProperties();
|
||||
openQueue();
|
||||
} catch (error) {
|
||||
statusText.textContent = error.message;
|
||||
@@ -82,7 +81,18 @@ function openExplorer(initialPath = state.config?.roots?.[0]?.path) {
|
||||
return win;
|
||||
}
|
||||
|
||||
function openProperties() {
|
||||
function openProperties(entry = state.selectedEntry) {
|
||||
if (entry) {
|
||||
state.selectedEntry = entry;
|
||||
}
|
||||
|
||||
const existing = state.windows.find((item) => item.kind === 'properties');
|
||||
if (existing) {
|
||||
focusWindow(existing);
|
||||
render();
|
||||
return existing;
|
||||
}
|
||||
|
||||
return createWindow('Eigenschaften', 'properties', {
|
||||
width: 420,
|
||||
height: 320,
|
||||
@@ -510,6 +520,11 @@ async function promptTransfer(win, entry, type) {
|
||||
await createJob(type, entry.path, `${targetDir.replace(/\/$/, '')}/${entry.name}`, []);
|
||||
}
|
||||
|
||||
function showPropertiesForEntry(win, entry) {
|
||||
selectEntry(win, entry);
|
||||
openProperties(entry);
|
||||
}
|
||||
|
||||
function showContextMenu(event, win, entry) {
|
||||
const rect = workspace.getBoundingClientRect();
|
||||
state.contextMenu = {
|
||||
@@ -535,6 +550,7 @@ function renderContextMenu() {
|
||||
if (entry.type === 'directory') {
|
||||
actions.push(['Öffnen', () => loadExplorer(win, entry.path)]);
|
||||
}
|
||||
actions.push(['Eigenschaften', () => showPropertiesForEntry(win, entry)]);
|
||||
actions.push(['Umbenennen', () => renameEntry(win, entry)]);
|
||||
actions.push(['Kopieren nach...', () => promptTransfer(win, entry, 'copy')]);
|
||||
actions.push(['Verschieben nach...', () => promptTransfer(win, entry, 'move')]);
|
||||
|
||||
Reference in New Issue
Block a user