IGFD: some changes
This commit is contained in:
parent
fe2da0019a
commit
7b30cfb1b7
|
@ -133,6 +133,9 @@ namespace IGFD
|
||||||
#ifndef resetButtonString
|
#ifndef resetButtonString
|
||||||
#define resetButtonString ICON_FA_REPEAT
|
#define resetButtonString ICON_FA_REPEAT
|
||||||
#endif // resetButtonString
|
#endif // resetButtonString
|
||||||
|
#ifndef homeButtonString
|
||||||
|
#define homeButtonString ICON_FA_HOME
|
||||||
|
#endif // bomeButtonString
|
||||||
#ifndef drivesButtonString
|
#ifndef drivesButtonString
|
||||||
#define drivesButtonString ICON_FA_HDD_O
|
#define drivesButtonString ICON_FA_HDD_O
|
||||||
#endif // drivesButtonString
|
#endif // drivesButtonString
|
||||||
|
@ -170,7 +173,7 @@ namespace IGFD
|
||||||
#define buttonEditPathString "Edit path\nYou can also right click on path buttons"
|
#define buttonEditPathString "Edit path\nYou can also right click on path buttons"
|
||||||
#endif // buttonEditPathString
|
#endif // buttonEditPathString
|
||||||
#ifndef buttonResetPathString
|
#ifndef buttonResetPathString
|
||||||
#define buttonResetPathString "Reset to current directory"
|
#define buttonResetPathString "Go to home directory"
|
||||||
#endif // buttonResetPathString
|
#endif // buttonResetPathString
|
||||||
#ifndef buttonParentDirString
|
#ifndef buttonParentDirString
|
||||||
#define buttonParentDirString "Go to parent directory"
|
#define buttonParentDirString "Go to parent directory"
|
||||||
|
@ -700,10 +703,8 @@ namespace IGFD
|
||||||
if (ImGui::IsItemHovered())
|
if (ImGui::IsItemHovered())
|
||||||
ImGui::SetTooltip(buttonResetSearchString);
|
ImGui::SetTooltip(buttonResetSearchString);
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::Text(searchString);
|
|
||||||
ImGui::SameLine();
|
|
||||||
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x);
|
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x);
|
||||||
bool edited = ImGui::InputText("##InputImGuiFileDialogSearchField", puSearchBuffer, MAX_FILE_DIALOG_NAME_BUFFER);
|
bool edited = ImGui::InputTextWithHint("##InputImGuiFileDialogSearchField", searchString, puSearchBuffer, MAX_FILE_DIALOG_NAME_BUFFER);
|
||||||
if (ImGui::GetItemID() == ImGui::GetActiveID())
|
if (ImGui::GetItemID() == ImGui::GetActiveID())
|
||||||
puSearchInputIsActive = true;
|
puSearchInputIsActive = true;
|
||||||
ImGui::PopItemWidth();
|
ImGui::PopItemWidth();
|
||||||
|
@ -2245,9 +2246,9 @@ namespace IGFD
|
||||||
|
|
||||||
void IGFD::FileManager::DrawPathComposer(const FileDialogInternal& vFileDialogInternal)
|
void IGFD::FileManager::DrawPathComposer(const FileDialogInternal& vFileDialogInternal)
|
||||||
{
|
{
|
||||||
if (IMGUI_BUTTON(resetButtonString))
|
if (IMGUI_BUTTON(homeButtonString))
|
||||||
{
|
{
|
||||||
SetCurrentPath(".");
|
SetCurrentPath(FileDialog::Instance()->homePath);
|
||||||
OpenCurrentPath(vFileDialogInternal);
|
OpenCurrentPath(vFileDialogInternal);
|
||||||
}
|
}
|
||||||
if (ImGui::IsItemHovered())
|
if (ImGui::IsItemHovered())
|
||||||
|
|
|
@ -878,6 +878,7 @@ namespace IGFD
|
||||||
bool fileListActuallyEmpty = false;
|
bool fileListActuallyEmpty = false;
|
||||||
|
|
||||||
std::string puDLGpath; // base path set by user when OpenDialog/OpenModal was called
|
std::string puDLGpath; // base path set by user when OpenDialog/OpenModal was called
|
||||||
|
std::string puError; // last error
|
||||||
std::string puDLGDefaultFileName; // base default file path name set by user when OpenDialog/OpenModal was called
|
std::string puDLGDefaultFileName; // base default file path name set by user when OpenDialog/OpenModal was called
|
||||||
size_t puDLGcountSelectionMax = 1U; // 0 for infinite // base max selection count set by user when OpenDialog/OpenModal was called
|
size_t puDLGcountSelectionMax = 1U; // 0 for infinite // base max selection count set by user when OpenDialog/OpenModal was called
|
||||||
bool puDLGDirectoryMode = false; // is directory mode (defiend like : puDLGDirectoryMode = (filters.empty()))
|
bool puDLGDirectoryMode = false; // is directory mode (defiend like : puDLGDirectoryMode = (filters.empty()))
|
||||||
|
@ -1145,6 +1146,7 @@ namespace IGFD
|
||||||
double DpiScale;
|
double DpiScale;
|
||||||
bool singleClickSel;
|
bool singleClickSel;
|
||||||
bool mobileMode;
|
bool mobileMode;
|
||||||
|
std::string homePath;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static FileDialog* Instance() // Singleton for easier accces form anywhere but only one dialog at a time
|
static FileDialog* Instance() // Singleton for easier accces form anywhere but only one dialog at a time
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "fileDialog.h"
|
#include "fileDialog.h"
|
||||||
#include "ImGuiFileDialog.h"
|
#include "ImGuiFileDialog.h"
|
||||||
|
#include "util.h"
|
||||||
#include "../ta-log.h"
|
#include "../ta-log.h"
|
||||||
|
|
||||||
#ifdef USE_NFD
|
#ifdef USE_NFD
|
||||||
|
@ -152,6 +153,7 @@ bool FurnaceGUIFileDialog::openLoad(String header, std::vector<String> filter, c
|
||||||
ImGuiFileDialog::Instance()->singleClickSel=mobileUI;
|
ImGuiFileDialog::Instance()->singleClickSel=mobileUI;
|
||||||
ImGuiFileDialog::Instance()->DpiScale=dpiScale;
|
ImGuiFileDialog::Instance()->DpiScale=dpiScale;
|
||||||
ImGuiFileDialog::Instance()->mobileMode=mobileUI;
|
ImGuiFileDialog::Instance()->mobileMode=mobileUI;
|
||||||
|
ImGuiFileDialog::Instance()->homePath=getHomeDir();
|
||||||
ImGuiFileDialog::Instance()->OpenModal("FileDialog",header,noSysFilter,path,allowMultiple?999:1,nullptr,0,clickCallback);
|
ImGuiFileDialog::Instance()->OpenModal("FileDialog",header,noSysFilter,path,allowMultiple?999:1,nullptr,0,clickCallback);
|
||||||
}
|
}
|
||||||
opened=true;
|
opened=true;
|
||||||
|
@ -235,6 +237,7 @@ bool FurnaceGUIFileDialog::openSave(String header, std::vector<String> filter, c
|
||||||
ImGuiFileDialog::Instance()->singleClickSel=false;
|
ImGuiFileDialog::Instance()->singleClickSel=false;
|
||||||
ImGuiFileDialog::Instance()->DpiScale=dpiScale;
|
ImGuiFileDialog::Instance()->DpiScale=dpiScale;
|
||||||
ImGuiFileDialog::Instance()->mobileMode=mobileUI;
|
ImGuiFileDialog::Instance()->mobileMode=mobileUI;
|
||||||
|
ImGuiFileDialog::Instance()->homePath=getHomeDir();
|
||||||
ImGuiFileDialog::Instance()->OpenModal("FileDialog",header,noSysFilter,path,1,nullptr,ImGuiFileDialogFlags_ConfirmOverwrite);
|
ImGuiFileDialog::Instance()->OpenModal("FileDialog",header,noSysFilter,path,1,nullptr,ImGuiFileDialogFlags_ConfirmOverwrite);
|
||||||
}
|
}
|
||||||
opened=true;
|
opened=true;
|
||||||
|
|
Loading…
Reference in New Issue