mirror of https://gitlab.com/nakst/essence
bugfixes
This commit is contained in:
parent
2e1327046c
commit
15cb0eeafd
|
@ -31,14 +31,21 @@ bool InstanceLoadFolder(Instance *instance, String path /* takes ownership */, i
|
|||
|
||||
instance->issuedPasteTask = nullptr;
|
||||
|
||||
InstanceRemoveContents(instance);
|
||||
FolderAttachInstance(instance, path, false);
|
||||
StringDestroy(&path);
|
||||
|
||||
Task task = {};
|
||||
task.context = historyMode;
|
||||
task.cDescription = interfaceString_FileManagerOpenFolderTask;
|
||||
|
||||
EsListViewIndex focusedIndex;
|
||||
|
||||
if (EsListViewGetFocusedItem(instance->list, nullptr, &focusedIndex)) {
|
||||
String name = instance->listContents[focusedIndex].entry->GetName();
|
||||
task.string = StringDuplicate(name);
|
||||
}
|
||||
|
||||
InstanceRemoveContents(instance);
|
||||
FolderAttachInstance(instance, path, false);
|
||||
StringDestroy(&path);
|
||||
|
||||
task.callback = [] (Instance *instance, Task *) {
|
||||
Folder *folder = instance->folder;
|
||||
EsMutexAcquire(&folder->modifyEntriesMutex);
|
||||
|
@ -70,13 +77,7 @@ bool InstanceLoadFolder(Instance *instance, String path /* takes ownership */, i
|
|||
|
||||
HistoryEntry historyEntry = {};
|
||||
historyEntry.path = instance->path;
|
||||
|
||||
EsListViewIndex focusedIndex;
|
||||
|
||||
if (EsListViewGetFocusedItem(instance->list, nullptr, &focusedIndex)) {
|
||||
String name = instance->listContents[focusedIndex].entry->GetName();
|
||||
historyEntry.focusedItem = StringDuplicate(name);
|
||||
}
|
||||
historyEntry.focusedItem = task->string;
|
||||
|
||||
if (historyMode == LOAD_FOLDER_BACK) {
|
||||
instance->pathForwardHistory.Add(historyEntry);
|
||||
|
|
|
@ -1573,10 +1573,10 @@ void EsCommandAddButton(EsCommand *command, EsButton *button) {
|
|||
Array<EsElement *> elements = { command->elements };
|
||||
elements.Add(button);
|
||||
command->elements = elements.array;
|
||||
EsButtonOnCommand(button, command->callback, command);
|
||||
button->state |= UI_STATE_COMMAND_BUTTON;
|
||||
EsElementSetEnabled(button, command->enabled);
|
||||
EsButtonSetCheck(button, command->check);
|
||||
EsButtonSetCheck(button, command->check); // Set the check before setting the callback, so that it doesn't get called.
|
||||
EsButtonOnCommand(button, command->callback, command);
|
||||
}
|
||||
|
||||
EsCommand *EsCommandRegister(EsCommand *command, EsInstance *_instance,
|
||||
|
|
Binary file not shown.
BIN
res/Theme.dat
BIN
res/Theme.dat
Binary file not shown.
Loading…
Reference in New Issue