mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-26 22:43:01 +00:00
ok so fix the file dialog
This commit is contained in:
parent
a5561f1899
commit
ef0e19413c
3 changed files with 5 additions and 3 deletions
6
extern/igfd/ImGuiFileDialog.cpp
vendored
6
extern/igfd/ImGuiFileDialog.cpp
vendored
|
@ -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())
|
||||
|
|
1
extern/igfd/ImGuiFileDialog.h
vendored
1
extern/igfd/ImGuiFileDialog.h
vendored
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue