extra file types
This commit is contained in:
parent
5110538c3f
commit
3bdfe541da
3 changed files with 29 additions and 8 deletions
|
|
@ -96,6 +96,15 @@ void FurnaceFilePicker::readDirectorySub() {
|
|||
case DT_SOCK:
|
||||
newEntry->type=FP_TYPE_SOCKET;
|
||||
break;
|
||||
case DT_FIFO:
|
||||
newEntry->type=FP_TYPE_PIPE;
|
||||
break;
|
||||
case DT_CHR:
|
||||
newEntry->type=FP_TYPE_CHARDEV;
|
||||
break;
|
||||
case DT_BLK:
|
||||
newEntry->type=FP_TYPE_BLOCKDEV;
|
||||
break;
|
||||
default:
|
||||
newEntry->type=FP_TYPE_UNKNOWN;
|
||||
break;
|
||||
|
|
@ -411,6 +420,10 @@ bool FurnaceFilePicker::draw() {
|
|||
} else {
|
||||
// TODO: path buttons
|
||||
ImGui::TextUnformatted(path.c_str());
|
||||
/*String nextButton;
|
||||
for (char i: path) {
|
||||
|
||||
}*/
|
||||
}
|
||||
|
||||
// search bar
|
||||
|
|
@ -561,11 +574,15 @@ bool FurnaceFilePicker::draw() {
|
|||
FileTypeStyle* style=&defaultTypeStyle[i->type];
|
||||
|
||||
// get style for this entry
|
||||
if (!i->ext.empty()) {
|
||||
for (FileTypeStyle& j: fileTypeRegistry) {
|
||||
if (i->ext==j.ext) {
|
||||
style=&j;
|
||||
break;
|
||||
if (i->isDir) {
|
||||
style=&defaultTypeStyle[FP_TYPE_DIR];
|
||||
} else {
|
||||
if (!i->ext.empty()) {
|
||||
for (FileTypeStyle& j: fileTypeRegistry) {
|
||||
if (i->ext==j.ext) {
|
||||
style=&j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ enum FileType {
|
|||
FP_TYPE_LINK,
|
||||
FP_TYPE_PIPE,
|
||||
FP_TYPE_SOCKET,
|
||||
FP_TYPE_CHARDEV,
|
||||
FP_TYPE_BLOCKDEV,
|
||||
|
||||
FP_TYPE_MAX
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6890,9 +6890,11 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
|
|||
newFilePicker->setTypeStyle(FP_TYPE_UNKNOWN,uiColors[GUI_COLOR_FILE_OTHER],ICON_FA_QUESTION);
|
||||
newFilePicker->setTypeStyle(FP_TYPE_NORMAL,uiColors[GUI_COLOR_FILE_OTHER],ICON_FA_FILE_O);
|
||||
newFilePicker->setTypeStyle(FP_TYPE_DIR,uiColors[GUI_COLOR_FILE_DIR],ICON_FA_FOLDER_O);
|
||||
newFilePicker->setTypeStyle(FP_TYPE_LINK,uiColors[GUI_COLOR_FILE_OTHER],ICON_FA_FILE_O);
|
||||
newFilePicker->setTypeStyle(FP_TYPE_PIPE,uiColors[GUI_COLOR_FILE_OTHER],ICON_FA_FILE_O);
|
||||
newFilePicker->setTypeStyle(FP_TYPE_SOCKET,uiColors[GUI_COLOR_FILE_OTHER],ICON_FA_FILE_O);
|
||||
newFilePicker->setTypeStyle(FP_TYPE_LINK,uiColors[GUI_COLOR_FILE_OTHER],ICON_FA_EXTERNAL_LINK);
|
||||
newFilePicker->setTypeStyle(FP_TYPE_PIPE,uiColors[GUI_COLOR_FILE_OTHER],ICON_FA_EXCHANGE);
|
||||
newFilePicker->setTypeStyle(FP_TYPE_SOCKET,uiColors[GUI_COLOR_FILE_OTHER],ICON_FA_PLUG);
|
||||
newFilePicker->setTypeStyle(FP_TYPE_CHARDEV,uiColors[GUI_COLOR_FILE_OTHER],ICON_FA_MICROCHIP);
|
||||
newFilePicker->setTypeStyle(FP_TYPE_BLOCKDEV,uiColors[GUI_COLOR_FILE_OTHER],ICON_FA_HDD_O);
|
||||
|
||||
newFilePicker->registerType(".fur",uiColors[GUI_COLOR_FILE_SONG_NATIVE],ICON_FA_FILE);
|
||||
newFilePicker->registerType(".fui",uiColors[GUI_COLOR_FILE_INSTR],ICON_FA_FILE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue