GUI: no system file picker on Flatpak
portals bring too many issues to deal with issue #2490
This commit is contained in:
parent
0ea4310b22
commit
184b8efcc4
|
@ -5028,6 +5028,7 @@ bool FurnaceGUI::loop() {
|
|||
}
|
||||
|
||||
#ifndef NFD_NON_THREADED
|
||||
#ifndef FLATPAK_WORKAROUNDS
|
||||
if (fileDialog->isOpen() && settings.sysFileDialog) {
|
||||
ImGui::OpenPopup(_("System File Dialog Pending"));
|
||||
}
|
||||
|
@ -5040,6 +5041,7 @@ bool FurnaceGUI::loop() {
|
|||
dl->AddRectFilled(ImVec2(0.0f,0.0f),ImVec2(canvasW,canvasH),ImGui::ColorConvertFloat4ToU32(uiColors[GUI_COLOR_MODAL_BACKDROP]));
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (fileDialog->render(mobileUI?ImVec2(canvasW-(portrait?0:(60.0*dpiScale)),canvasH-60.0*dpiScale):ImVec2(600.0f*dpiScale,400.0f*dpiScale),ImVec2(canvasW-((mobileUI && !portrait)?(60.0*dpiScale):0),canvasH-(mobileUI?(60.0*dpiScale):0)))) {
|
||||
|
@ -5160,13 +5162,7 @@ bool FurnaceGUI::loop() {
|
|||
} else {
|
||||
fileName=fileDialog->getFileName()[0];
|
||||
}
|
||||
#ifdef FLATPAK_WORKAROUNDS
|
||||
// https://github.com/tildearrow/furnace/issues/2096
|
||||
// Flatpak Portals mangling our path hinders us from adding extension
|
||||
if (fileName!="" && !settings.sysFileDialog) {
|
||||
#else
|
||||
if (fileName!="") {
|
||||
#endif
|
||||
if (curFileDialog==GUI_FILE_SAVE) {
|
||||
checkExtension(".fur");
|
||||
}
|
||||
|
|
|
@ -1873,7 +1873,9 @@ class FurnaceGUI {
|
|||
int insFocusesPattern;
|
||||
int stepOnInsert;
|
||||
int unifiedDataView;
|
||||
#ifndef FLATPAK_WORKAROUNDS
|
||||
int sysFileDialog;
|
||||
#endif
|
||||
int roundedWindows;
|
||||
int roundedButtons;
|
||||
int roundedMenus;
|
||||
|
@ -2128,7 +2130,9 @@ class FurnaceGUI {
|
|||
insFocusesPattern(1),
|
||||
stepOnInsert(0),
|
||||
unifiedDataView(0),
|
||||
#ifndef FLATPAK_WORKAROUNDS
|
||||
sysFileDialog(1),
|
||||
#endif
|
||||
roundedWindows(1),
|
||||
roundedButtons(1),
|
||||
roundedMenus(0),
|
||||
|
|
|
@ -825,11 +825,13 @@ void FurnaceGUI::drawSettings() {
|
|||
// SUBSECTION FILE
|
||||
CONFIG_SUBSECTION(_("File"));
|
||||
|
||||
#ifndef FLATPAK_WORKAROUNDS
|
||||
bool sysFileDialogB=settings.sysFileDialog;
|
||||
if (ImGui::Checkbox(_("Use system file picker"),&sysFileDialogB)) {
|
||||
settings.sysFileDialog=sysFileDialogB;
|
||||
settingsChanged=true;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ImGui::InputInt(_("Number of recent files"),&settings.maxRecentFile,1,5)) {
|
||||
if (settings.maxRecentFile<0) settings.maxRecentFile=0;
|
||||
|
@ -4874,7 +4876,9 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
|
|||
settings.hiddenSystems=conf.getInt("hiddenSystems",0);
|
||||
settings.mswEnabled=conf.getInt("mswEnabled",0);
|
||||
settings.allowEditDocking=conf.getInt("allowEditDocking",1);
|
||||
#ifndef FLATPAK_WORKAROUNDS
|
||||
settings.sysFileDialog=conf.getInt("sysFileDialog",SYS_FILE_DIALOG_DEFAULT);
|
||||
#endif
|
||||
settings.displayAllInsTypes=conf.getInt("displayAllInsTypes",0);
|
||||
settings.displayPartial=conf.getInt("displayPartial",0);
|
||||
|
||||
|
@ -5284,7 +5288,9 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
|
|||
clampSetting(settings.insFocusesPattern,0,1);
|
||||
clampSetting(settings.stepOnInsert,0,1);
|
||||
clampSetting(settings.unifiedDataView,0,1);
|
||||
#ifndef FLATPAK_WORKAROUNDS
|
||||
clampSetting(settings.sysFileDialog,0,1);
|
||||
#endif
|
||||
clampSetting(settings.roundedWindows,0,1);
|
||||
clampSetting(settings.roundedButtons,0,1);
|
||||
clampSetting(settings.roundedMenus,0,1);
|
||||
|
@ -5470,7 +5476,9 @@ void FurnaceGUI::writeConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
|
|||
conf.set("hiddenSystems",settings.hiddenSystems);
|
||||
conf.set("mswEnabled",settings.mswEnabled);
|
||||
conf.set("allowEditDocking",settings.allowEditDocking);
|
||||
#ifndef FLATPAK_WORKAROUNDS
|
||||
conf.set("sysFileDialog",settings.sysFileDialog);
|
||||
#endif
|
||||
conf.set("displayAllInsTypes",settings.displayAllInsTypes);
|
||||
conf.set("displayPartial",settings.displayPartial);
|
||||
|
||||
|
@ -7207,7 +7215,11 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
|
|||
|
||||
if (updateFonts) {
|
||||
if (fileDialog!=NULL) delete fileDialog;
|
||||
#ifdef FLATPAK_WORKAROUNDS
|
||||
fileDialog=new FurnaceGUIFileDialog(false);
|
||||
#else
|
||||
fileDialog=new FurnaceGUIFileDialog(settings.sysFileDialog);
|
||||
#endif
|
||||
|
||||
fileDialog->mobileUI=mobileUI;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue