ok so fix the file dialog
This commit is contained in:
parent
a5561f1899
commit
ef0e19413c
6
extern/igfd/ImGuiFileDialog.cpp
vendored
6
extern/igfd/ImGuiFileDialog.cpp
vendored
|
|
@ -1105,7 +1105,7 @@ namespace IGFD
|
||||||
|
|
||||||
bool needToApllyNewFilter = false;
|
bool needToApllyNewFilter = false;
|
||||||
|
|
||||||
ImGui::PushItemWidth(FILTER_COMBO_WIDTH);
|
ImGui::PushItemWidth(FILTER_COMBO_WIDTH*FileDialog::Instance()->DpiScale);
|
||||||
if (ImGui::BeginCombo("##Filters", prSelectedFilter.filter.c_str(), ImGuiComboFlags_None))
|
if (ImGui::BeginCombo("##Filters", prSelectedFilter.filter.c_str(), ImGuiComboFlags_None))
|
||||||
{
|
{
|
||||||
intptr_t i = 0;
|
intptr_t i = 0;
|
||||||
|
|
@ -3279,7 +3279,7 @@ namespace IGFD
|
||||||
//// FILE DIALOG CONSTRUCTOR / DESTRUCTOR ///////////////////////////////////////////
|
//// FILE DIALOG CONSTRUCTOR / DESTRUCTOR ///////////////////////////////////////////
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
IGFD::FileDialog::FileDialog() : BookMarkFeature(), KeyExplorerFeature(), ThumbnailFeature() {}
|
IGFD::FileDialog::FileDialog() : BookMarkFeature(), KeyExplorerFeature(), ThumbnailFeature() {DpiScale=1.0f;}
|
||||||
IGFD::FileDialog::~FileDialog() = default;
|
IGFD::FileDialog::~FileDialog() = default;
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
@ -3829,7 +3829,7 @@ namespace IGFD
|
||||||
float width = ImGui::GetContentRegionAvail().x;
|
float width = ImGui::GetContentRegionAvail().x;
|
||||||
// fix this! fix this! fix this!
|
// fix this! fix this! fix this!
|
||||||
if (!fdFile.puDLGDirectoryMode)
|
if (!fdFile.puDLGDirectoryMode)
|
||||||
width -= FILTER_COMBO_WIDTH;
|
width -= FILTER_COMBO_WIDTH*DpiScale;
|
||||||
ImGui::PushItemWidth(width);
|
ImGui::PushItemWidth(width);
|
||||||
ImGui::InputText("##FileName", fdFile.puFileNameBuffer, MAX_FILE_DIALOG_NAME_BUFFER);
|
ImGui::InputText("##FileName", fdFile.puFileNameBuffer, MAX_FILE_DIALOG_NAME_BUFFER);
|
||||||
if (ImGui::GetItemID() == ImGui::GetActiveID())
|
if (ImGui::GetItemID() == ImGui::GetActiveID())
|
||||||
|
|
|
||||||
1
extern/igfd/ImGuiFileDialog.h
vendored
1
extern/igfd/ImGuiFileDialog.h
vendored
|
|
@ -1133,6 +1133,7 @@ namespace IGFD
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool puAnyWindowsHovered = false; // not remember why haha :) todo : to check if we can remove
|
bool puAnyWindowsHovered = false; // not remember why haha :) todo : to check if we can remove
|
||||||
|
double DpiScale;
|
||||||
|
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -3915,6 +3915,7 @@ bool dirExists(String what) {
|
||||||
|
|
||||||
void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) {
|
void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) {
|
||||||
if (!dirExists(workingDir)) workingDir=getHomeDir();
|
if (!dirExists(workingDir)) workingDir=getHomeDir();
|
||||||
|
ImGuiFileDialog::Instance()->DpiScale=dpiScale;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case GUI_FILE_OPEN:
|
case GUI_FILE_OPEN:
|
||||||
ImGuiFileDialog::Instance()->OpenModal("FileDialog","Open File","compatible files{.fur,.dmf},.*",workingDir);
|
ImGuiFileDialog::Instance()->OpenModal("FileDialog","Open File","compatible files{.fur,.dmf},.*",workingDir);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue