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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-04-04 13:22:06 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-04-04 13:22:06 +0400
commitdfa3a6fc84dc6a4ffc1040f24e85a93e5058dde5 (patch)
treec9e85e39c46fcf57d05d8617feac5a4b48810d03 /source/blender/editors/gpencil
parentfad71850e4e434485bf77686974a37999bc6b86a (diff)
fix [#26774] Grease Pencil error?
own error with recent change to grease pencil.
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/gpencil_buttons.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c
index 8df89a29f28..67b732ffa5e 100644
--- a/source/blender/editors/gpencil/gpencil_buttons.c
+++ b/source/blender/editors/gpencil/gpencil_buttons.c
@@ -88,6 +88,14 @@ static void gp_ui_dellayer_cb (bContext *C, void *gpd, void *gpl)
WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work!
}
+static void gp_ui_actlayer_cb (bContext *C, void *gpd, void *gpl)
+{
+ /* make sure the layer we want to remove is the active one */
+ gpencil_layer_setactive(gpd, gpl);
+
+ WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work!
+}
+
/* ------- Drawing Code ------- */
/* draw the controls for a given layer */
@@ -122,9 +130,11 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, con
subrow= uiLayoutRow(row, 0);
/* active */
+ block= uiLayoutGetBlock(subrow);
icon= (gpl->flag & GP_LAYER_ACTIVE) ? ICON_RADIOBUT_ON : ICON_RADIOBUT_OFF;
- uiItemR(subrow, &ptr, "active", 0, "", icon);
-
+ but= uiDefIconBut(block, BUT, 0, icon, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Set active layer");
+ uiButSetFunc(but, gp_ui_activelayer_cb, gpd, gpl);
+
/* locked */
icon= (gpl->flag & GP_LAYER_LOCKED) ? ICON_LOCKED : ICON_UNLOCKED;
uiItemR(subrow, &ptr, "lock", 0, "", icon);