[Bf-blender-cvs] [faaf20c3a21] greasepencil-object: UI changes for color picker
Antonio Vazquez
noreply at git.blender.org
Thu Feb 1 17:11:11 CET 2018
Commit: faaf20c3a21fcdd89698b0daa0b4dfaa6db42813
Author: Antonio Vazquez
Date: Thu Feb 1 17:11:03 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rBfaaf20c3a21fcdd89698b0daa0b4dfaa6db42813
UI changes for color picker
* Colors have labels, so previews don't need to be as big, GP_BOX_SIZE set to 32.
* More padding between items, they are too close to each other at the moment GP_BOX_GAP set to 24.
* Round boxes are a bit less round to match the rest of the UI 0.2f (before used 0.4f)
* Cursor should not change to color picker. We are performing an action (selecting an item), not picking UI colors per se.
Thanks Pablo Vazquez for the feedback
===================================================================
M source/blender/editors/gpencil/gpencil_colorpick.c
===================================================================
diff --git a/source/blender/editors/gpencil/gpencil_colorpick.c b/source/blender/editors/gpencil/gpencil_colorpick.c
index de18e164f13..187262ccc09 100644
--- a/source/blender/editors/gpencil/gpencil_colorpick.c
+++ b/source/blender/editors/gpencil/gpencil_colorpick.c
@@ -75,8 +75,8 @@
#include "gpencil_intern.h"
-#define GP_BOX_SIZE (40 * U.ui_scale)
-#define GP_BOX_GAP (18 * U.ui_scale)
+#define GP_BOX_SIZE (32 * U.ui_scale)
+#define GP_BOX_GAP (24 * U.ui_scale)
/* draw color name using default font */
static void gp_draw_color_name(tGPDpick *tgpk, tGPDpickColor *col, const uiFontStyle *fstyle, bool focus)
@@ -130,7 +130,7 @@ static void gpencil_draw_color_table(const bContext *UNUSED(C), tGPDpick *tgpk)
const uiFontStyle *fstyle = UI_FSTYLE_WIDGET;
float ink[4];
float line[4];
- float radius = (0.4f * U.widget_unit);
+ float radius = (0.2f * U.widget_unit);
float wcolor[4] = { 0.9f, 0.9f, 0.9f, 0.8f };
/* boxes for stroke and fill color */
@@ -389,9 +389,6 @@ static void gpencil_colorpick_exit(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
Object *ob = CTX_data_active_object(C);
- /* restore cursor to indicate end */
- WM_cursor_modal_restore(CTX_wm_window(C));
-
tGPDpick *tgpk = op->customdata;
/* don't assume that operator data exists at all */
@@ -504,16 +501,6 @@ static int gpencil_colorpick_modal(bContext *C, wmOperator *op, const wmEvent *e
case RIGHTMOUSE:
estate = OPERATOR_CANCELLED;
break;
- case MOUSEMOVE:
- if ((event->mval[0] >= tgpk->panel.xmin) && (event->mval[0] <= tgpk->panel.xmax) &&
- (event->mval[1] >= tgpk->panel.ymin) && (event->mval[1] <= tgpk->panel.ymax))
- {
- WM_cursor_modal_set(tgpk->win, BC_EYEDROPPER_CURSOR);
- }
- else {
- WM_cursor_modal_set(tgpk->win, CURSOR_STD);
- }
- break;
case LEFTMOUSE:
if (set_color(event, tgpk) == true) {
estate = OPERATOR_FINISHED;
More information about the Bf-blender-cvs
mailing list