From 4e59c3ec5347fa11b34d3795c0da3acc900a6594 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 13 May 2008 06:12:33 +0000 Subject: [PATCH] [#11152] [C] key shortcut is broken in UV/Image Editor Only allow this inside paint mode. --- source/blender/src/drawimage.c | 6 +++++- source/blender/src/header_image.c | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/source/blender/src/drawimage.c b/source/blender/src/drawimage.c index 09ba518565f..d8e94bd2ff7 100644 --- a/source/blender/src/drawimage.c +++ b/source/blender/src/drawimage.c @@ -1485,7 +1485,11 @@ static void image_panel_paint(short cntrl) // IMAGE_HANDLER_PAINT uiBlock *block; ID *id; int yco, xco, butw; - + + if ((G.sima->image && (G.sima->flag & SI_DRAWTOOL))==0) { + return; + } + block= uiNewBlock(&curarea->uiblocks, "image_panel_paint", UI_EMBOSS, UI_HELV, curarea->win); uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); uiSetPanelHandler(IMAGE_HANDLER_PAINT); // for close and esc diff --git a/source/blender/src/header_image.c b/source/blender/src/header_image.c index a93e79fa773..341cce30c4e 100644 --- a/source/blender/src/header_image.c +++ b/source/blender/src/header_image.c @@ -476,7 +476,9 @@ static uiBlock *image_viewmenu(void *arg_unused) uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "View Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Image Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Real-time Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Paint Tool...|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); + if (G.sima->image && (G.sima->flag & SI_DRAWTOOL)) { + uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Paint Tool...|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); + } uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Curves Tool...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, ""); uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Composite Preview...|Shift P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 12, "");