ok so fix the file dialog

This commit is contained in:
tildearrow 2022-02-22 22:41:37 -05:00
parent a5561f1899
commit ef0e19413c
3 changed files with 5 additions and 3 deletions

View file

@ -1105,7 +1105,7 @@ namespace IGFD
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))
{
intptr_t i = 0;
@ -3279,7 +3279,7 @@ namespace IGFD
//// FILE DIALOG CONSTRUCTOR / DESTRUCTOR ///////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
IGFD::FileDialog::FileDialog() : BookMarkFeature(), KeyExplorerFeature(), ThumbnailFeature() {}
IGFD::FileDialog::FileDialog() : BookMarkFeature(), KeyExplorerFeature(), ThumbnailFeature() {DpiScale=1.0f;}
IGFD::FileDialog::~FileDialog() = default;
//////////////////////////////////////////////////////////////////////////////////////////////////
@ -3829,7 +3829,7 @@ namespace IGFD
float width = ImGui::GetContentRegionAvail().x;
// fix this! fix this! fix this!
if (!fdFile.puDLGDirectoryMode)
width -= FILTER_COMBO_WIDTH;
width -= FILTER_COMBO_WIDTH*DpiScale;
ImGui::PushItemWidth(width);
ImGui::InputText("##FileName", fdFile.puFileNameBuffer, MAX_FILE_DIALOG_NAME_BUFFER);
if (ImGui::GetItemID() == ImGui::GetActiveID())

View file

@ -1133,6 +1133,7 @@ namespace IGFD
public:
bool puAnyWindowsHovered = false; // not remember why haha :) todo : to check if we can remove
double DpiScale;
public:
static FileDialog* Instance() // Singleton for easier accces form anywhere but only one dialog at a time

View file

@ -3915,6 +3915,7 @@ bool dirExists(String what) {
void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) {
if (!dirExists(workingDir)) workingDir=getHomeDir();
ImGuiFileDialog::Instance()->DpiScale=dpiScale;
switch (type) {
case GUI_FILE_OPEN:
ImGuiFileDialog::Instance()->OpenModal("FileDialog","Open File","compatible files{.fur,.dmf},.*",workingDir);