gui2/file_dialog: Always reserve space for non-folder icons

This prevents the list's geometry from changing considerably when
navigating into a folder that has no subfolders of its own because of
the lack of icons. We use an empty icon of the same size as the folder
icon for this purpose.
This commit is contained in:
Iris Morelle 2020-02-03 19:14:51 -03:00
parent a80fe129a4
commit 390cc9953f

View file

@ -47,8 +47,10 @@ namespace fs = filesystem;
namespace
{
const std::string icon_dir = "misc/folder-icon.png";
const std::string icon_file = "";
const std::string icon_parent = "";
// Empty icons with the same size as the above to force the icon column to have a
// specific size even when there are no folders in the list.
const std::string icon_file = icon_dir + "~O(0)";
const std::string icon_parent = icon_dir + "~O(0)";
// NOTE: Does not need to be the same as PARENT_DIR! Use PARENT_DIR to build
// relative paths for non-presentational purposes instead.
const std::string label_parent = "..";