Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2010-04-11 15:52:39 +0400
committerTon Roosendaal <ton@blender.org>2010-04-11 15:52:39 +0400
commit4c5fe03c9fedb50b1223933337df6d4a8a43db00 (patch)
tree96d68759d5802fcc20f518bcf16598e144696a28 /source
parent5c24ce16b2b340fcbd62cd6b1452c9023c6d54b9 (diff)
Long outstanding panel feature: press ENTER with mouse on header will
open/close it. Will allow quicker inspections without mouse strains.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface_panel.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 278dba13b6b..39283231b7c 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -956,7 +956,7 @@ static void ui_do_drag(const bContext *C, wmEvent *event, Panel *panel)
/* this function is supposed to call general window drawing too */
/* also it supposes a block has panel, and isnt a menu */
-static void ui_handle_panel_header(const bContext *C, uiBlock *block, int mx, int my)
+static void ui_handle_panel_header(const bContext *C, uiBlock *block, int mx, int my, int event)
{
ScrArea *sa= CTX_wm_area(C);
ARegion *ar= CTX_wm_region(C);
@@ -968,7 +968,9 @@ static void ui_handle_panel_header(const bContext *C, uiBlock *block, int mx, in
/* XXX weak code, currently it assumes layout style for location of widgets */
/* check open/collapsed button */
- if(block->panel->flag & PNL_CLOSEDX) {
+ if(event==RETKEY)
+ button= 1;
+ else if(block->panel->flag & PNL_CLOSEDX) {
if(my >= block->maxy) button= 1;
}
else if(block->panel->control & UI_PNL_CLOSE) {
@@ -1021,6 +1023,7 @@ static void ui_handle_panel_header(const bContext *C, uiBlock *block, int mx, in
}
}
+/* XXX should become modal keymap */
int ui_handler_panel_region(bContext *C, wmEvent *event)
{
ARegion *ar= CTX_wm_region(C);
@@ -1068,9 +1071,16 @@ int ui_handler_panel_region(bContext *C, wmEvent *event)
}
if(event->val==KM_PRESS) {
- if(event->type == LEFTMOUSE) {
+ /* open close on header */
+ if(ELEM(event->type, RETKEY, PADENTER)) {
+ if(inside_header) {
+ ui_handle_panel_header(C, block, mx, my, RETKEY);
+ break;
+ }
+ }
+ else if(event->type == LEFTMOUSE) {
if(inside_header) {
- ui_handle_panel_header(C, block, mx, my);
+ ui_handle_panel_header(C, block, mx, my, 0);
break;
}
else if(inside_scale && !(pa->flag & PNL_CLOSED)) {