Add context menu to filebrowser

This commit is contained in:
jpirnay
2026-05-16 09:21:49 +02:00
parent 1395676674
commit 9bcc7b5e4f
32 changed files with 470 additions and 56 deletions
@@ -0,0 +1,33 @@
#pragma once
#include <string>
#include "../MenuListActivity.h"
// Context menu shown when the user long-presses the info button on a file in the file browser.
// The available actions depend on file type. The selected action is returned via MenuResult::action.
class FileContextMenuActivity final : public MenuListActivity {
public:
enum class Action {
None = -1,
Open = 0,
FetchAndOpen,
MarkAsRead,
Info,
DeleteCache,
SetAsSleepCover,
FlashFirmware,
Remove,
};
explicit FileContextMenuActivity(GfxRenderer& renderer, MappedInputManager& mappedInput,
const std::string& filePath);
void render(RenderLock&&) override;
private:
std::string filePath;
void onActionSelected(int index) override;
void onBackPressed() override;
};