[Bf-blender-cvs] [1f768bbe414] property-search-ui: Merge branch 'master' into property-search-ui
Hans Goudey
noreply at git.blender.org
Tue Jul 28 23:25:31 CEST 2020
Commit: 1f768bbe4145daed111636ca09dd53b25b8d29b5
Author: Hans Goudey
Date: Tue Jul 28 17:25:39 2020 -0400
Branches: property-search-ui
https://developer.blender.org/rB1f768bbe4145daed111636ca09dd53b25b8d29b5
Merge branch 'master' into property-search-ui
===================================================================
===================================================================
diff --cc source/blender/editors/space_buttons/buttons_ops.c
index 514b72d90da,a062b178fc8..f5efeabf2bf
--- a/source/blender/editors/space_buttons/buttons_ops.c
+++ b/source/blender/editors/space_buttons/buttons_ops.c
@@@ -53,89 -52,9 +53,98 @@@
#include "buttons_intern.h" /* own include */
- /********************** filter operator *********************/
- /* Note: Almost a duplicate of the file browser operator. */
++/* -------------------------------------------------------------------- */
++/** \name Start / Clear Seach Filter Operators
++ *
++ * \note Almost a duplicate of the file browser operator #FILE_OT_start_filter.
++ * \{ */
+
+static int buttons_start_filter_exec(bContext *C, wmOperator *UNUSED(op))
+{
+ SpaceProperties *space = CTX_wm_space_properties(C);
+ ScrArea *area = CTX_wm_area(C);
+ ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_HEADER);
+
+ ARegion *region_ctx = CTX_wm_region(C);
+ CTX_wm_region_set(C, region);
+ UI_textbutton_activate_rna(C, region, space, "filter_text");
+ CTX_wm_region_set(C, region_ctx);
+
+ return OPERATOR_FINISHED;
+}
+
+void BUTTONS_OT_start_filter(struct wmOperatorType *ot)
+{
+ /* Identifiers. */
+ ot->name = "Filter";
+ ot->description = "Start entering filter text";
+ ot->idname = "BUTTONS_OT_start_filter";
+
+ /* Callbacks. */
+ ot->exec = buttons_start_filter_exec;
+ ot->poll = ED_operator_buttons_active;
+}
+
- /********************** clear filter operator *********************/
-
+static int buttons_clear_filter_exec(bContext *C, wmOperator *UNUSED(op))
+{
+ ScrArea *area = CTX_wm_area(C);
+ SpaceProperties *space = CTX_wm_space_properties(C);
+
+ strcpy(space->search_string, "");
+
+ ED_area_tag_redraw(area);
+
+ return OPERATOR_FINISHED;
+}
+
+void BUTTONS_OT_clear_filter(struct wmOperatorType *ot)
+{
- /* identifiers */
++ /* Identifiers. */
+ ot->name = "Clear Filter";
+ ot->description = "Clear the search filter";
+ ot->idname = "BUTTONS_OT_clear_filter";
+
- /* api callbacks */
++ /* Callbacks. */
+ ot->exec = buttons_clear_filter_exec;
+ ot->poll = ED_operator_buttons_active;
+}
+
- /********************** pin id operator *********************/
++/** \} */
++
++/* -------------------------------------------------------------------- */
++/** \name Pin ID Operator
++ * \{ */
+
+static int toggle_pin_exec(bContext *C, wmOperator *UNUSED(op))
+{
+ SpaceProperties *sbuts = CTX_wm_space_properties(C);
+
+ sbuts->pinid = (sbuts->flag & SB_PIN_CONTEXT) ? NULL : buttons_context_id_path(C);
+
+ sbuts->flag ^= SB_PIN_CONTEXT;
+
+ ED_area_tag_redraw(CTX_wm_area(C));
+
+ return OPERATOR_FINISHED;
+}
+
+void BUTTONS_OT_toggle_pin(wmOperatorType *ot)
+{
- /* identifiers */
++ /* Identifiers. */
+ ot->name = "Toggle Pin ID";
+ ot->description = "Keep the current data-block displayed";
+ ot->idname = "BUTTONS_OT_toggle_pin";
+
- /* api callbacks */
++ /* Callbacks. */
+ ot->exec = toggle_pin_exec;
+ ot->poll = ED_operator_buttons_active;
+}
+
- /********************** context_menu operator *********************/
++/** \} */
++
+ /* -------------------------------------------------------------------- */
+ /** \name Context Menu Operator
+ * \{ */
static int context_menu_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event))
{
More information about the Bf-blender-cvs
mailing list