GUI; mobile file dialog improvements

This commit is contained in:
tildearrow 2022-12-02 16:52:47 -05:00
parent dc7aec2dc1
commit 4e88a677d0
9 changed files with 60 additions and 22 deletions

View file

@ -79,6 +79,8 @@ SOFTWARE.
#include <algorithm>
#include <iostream>
#define DOUBLE_CLICKED ((singleClickSel && ImGui::IsMouseReleased(0)) || (!singleClickSel && ImGui::IsMouseDoubleClicked(0)))
#ifdef USE_THUMBNAILS
#ifndef DONT_DEFINE_AGAIN__STB_IMAGE_IMPLEMENTATION
#ifndef STB_IMAGE_IMPLEMENTATION
@ -3319,7 +3321,7 @@ namespace IGFD
//// FILE DIALOG CONSTRUCTOR / DESTRUCTOR ///////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
IGFD::FileDialog::FileDialog() : BookMarkFeature(), KeyExplorerFeature(), ThumbnailFeature() {DpiScale=1.0f;}
IGFD::FileDialog::FileDialog() : BookMarkFeature(), KeyExplorerFeature(), ThumbnailFeature() {DpiScale=1.0f; singleClickSel=false;}
IGFD::FileDialog::~FileDialog() = default;
//////////////////////////////////////////////////////////////////////////////////////////////////
@ -3972,7 +3974,7 @@ namespace IGFD
}
else // no nav system => classic behavior
{
if (ImGui::IsMouseDoubleClicked(0)) // 0 -> left mouse button double click
if (DOUBLE_CLICKED) // 0 -> left mouse button double click
{
isSelectingDir=true;
fdi.puPathClicked = fdi.SelectDirectory(vInfos);
@ -3987,7 +3989,7 @@ namespace IGFD
}
else
{
if (ImGui::IsMouseDoubleClicked(0)) {
if (DOUBLE_CLICKED) {
fdi.SelectFileName(prFileDialogInternal, vInfos);
prFileDialogInternal.puIsOk = true;
return 2;

View file

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