2.5 filebrowser
* Hide dot operator (HKEY) for theeth
This commit is contained in:
@@ -60,6 +60,7 @@ void FILE_OT_select_border(struct wmOperatorType *ot);
|
||||
void FILE_OT_select_bookmark(struct wmOperatorType *ot);
|
||||
void FILE_OT_add_bookmark(struct wmOperatorType *ot);
|
||||
void FILE_OT_delete_bookmark(struct wmOperatorType *ot);
|
||||
void FILE_OT_hidedot(struct wmOperatorType *ot);
|
||||
void FILE_OT_loadimages(struct wmOperatorType *ot);
|
||||
void FILE_OT_exec(struct wmOperatorType *ot);
|
||||
void FILE_OT_cancel(struct wmOperatorType *ot);
|
||||
|
||||
@@ -606,6 +606,33 @@ void FILE_OT_refresh(struct wmOperatorType *ot)
|
||||
ot->poll= ED_operator_file_active; /* <- important, handler is on window level */
|
||||
}
|
||||
|
||||
int file_hidedot_exec(bContext *C, wmOperator *unused)
|
||||
{
|
||||
SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C);
|
||||
|
||||
if(sfile->params) {
|
||||
sfile->params->flag ^= FILE_HIDE_DOT;
|
||||
filelist_free(sfile->files);
|
||||
sfile->params->active_file = -1;
|
||||
WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL);
|
||||
}
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void FILE_OT_hidedot(struct wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name= "Toggle Hide Dot Files";
|
||||
ot->idname= "FILE_OT_hidedot";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec= file_hidedot_exec;
|
||||
ot->poll= ED_operator_file_active; /* <- important, handler is on window level */
|
||||
}
|
||||
|
||||
struct ARegion *file_buttons_region(struct ScrArea *sa)
|
||||
{
|
||||
ARegion *ar, *arnew;
|
||||
|
||||
@@ -294,6 +294,7 @@ void file_operatortypes(void)
|
||||
WM_operatortype_append(FILE_OT_bookmark_toggle);
|
||||
WM_operatortype_append(FILE_OT_add_bookmark);
|
||||
WM_operatortype_append(FILE_OT_delete_bookmark);
|
||||
WM_operatortype_append(FILE_OT_hidedot);
|
||||
}
|
||||
|
||||
/* NOTE: do not add .blend file reading on this level */
|
||||
@@ -307,8 +308,9 @@ void file_keymap(struct wmWindowManager *wm)
|
||||
WM_keymap_add_item(keymap, "FILE_OT_highlight", MOUSEMOVE, KM_ANY, 0, 0);
|
||||
WM_keymap_add_item(keymap, "FILE_OT_parent", PKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "FILE_OT_add_bookmark", BKEY, KM_PRESS, KM_CTRL, 0);
|
||||
WM_keymap_add_item(keymap, "FILE_OT_hidedot", HKEY, KM_PRESS, 0, 0);
|
||||
WM_keymap_add_item(keymap, "FILE_OT_loadimages", TIMER1, KM_ANY, KM_ANY, 0);
|
||||
|
||||
|
||||
keymap= WM_keymap_listbase(wm, "FileBookmark", SPACE_FILE, 0);
|
||||
WM_keymap_add_item(keymap, "FILE_OT_select_bookmark", LEFTMOUSE, KM_PRESS, 0, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user