feat: expand Files features; add file associations
This commit is contained in:
1 parent
23cc56b933
commit
e047c1e0c0
22 files changed
+1359
-238
No files matched your search
@@ -49,6 +49,9 @@ void filemanager_do_paste(FileManagerState* fm) {
|
||||
|
||||
void filemanager_start_rename(FileManagerState* fm) {
|
||||
if (fm->selected < 0 || fm->selected >= fm->entry_count) return;
|
||||
// Rename is single-target; with several entries selected, `selected` is
|
||||
// only the focus and renaming it would be a surprise.
|
||||
if (fm->multi_count > 1) return;
|
||||
if (filemanager_is_computer_view(fm) || filemanager_is_virtual_view(fm) ||
|
||||
fm->entry_types[fm->selected] == FM_ENTRY_DRIVE) return;
|
||||
|
||||
@@ -228,10 +231,14 @@ void filemanager_open_ctx_menu(FileManagerState* fm, int local_x, int local_y, i
|
||||
fm->ctx_items[fm->ctx_item_count++] = CTX_OPEN;
|
||||
fm->ctx_items[fm->ctx_item_count++] = CTX_PROPERTIES;
|
||||
} else {
|
||||
bool several = fm->multi_count > 1;
|
||||
fm->ctx_items[fm->ctx_item_count++] = CTX_OPEN;
|
||||
if (!several && !fm->is_dir[target_idx])
|
||||
fm->ctx_items[fm->ctx_item_count++] = CTX_OPEN_WITH;
|
||||
fm->ctx_items[fm->ctx_item_count++] = CTX_COPY;
|
||||
fm->ctx_items[fm->ctx_item_count++] = CTX_CUT;
|
||||
fm->ctx_items[fm->ctx_item_count++] = CTX_RENAME;
|
||||
if (!several)
|
||||
fm->ctx_items[fm->ctx_item_count++] = CTX_RENAME;
|
||||
fm->ctx_items[fm->ctx_item_count++] = CTX_DELETE;
|
||||
fm->ctx_items[fm->ctx_item_count++] = CTX_PROPERTIES;
|
||||
}
|
||||
@@ -247,6 +254,13 @@ void filemanager_open_ctx_menu(FileManagerState* fm, int local_x, int local_y, i
|
||||
if (fm->clipboard_count > 0)
|
||||
fm->ctx_items[fm->ctx_item_count++] = CTX_PASTE;
|
||||
fm->ctx_items[fm->ctx_item_count++] = CTX_NEW_FOLDER;
|
||||
if (fm->entry_count > 0)
|
||||
fm->ctx_items[fm->ctx_item_count++] = CTX_SELECT_ALL;
|
||||
fm->ctx_items[fm->ctx_item_count++] = CTX_SORT_NAME;
|
||||
fm->ctx_items[fm->ctx_item_count++] = CTX_SORT_SIZE;
|
||||
fm->ctx_items[fm->ctx_item_count++] = CTX_SORT_TYPE;
|
||||
fm->ctx_items[fm->ctx_item_count++] = CTX_SORT_MODIFIED;
|
||||
fm->ctx_items[fm->ctx_item_count++] = CTX_REFRESH;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user