diff options
author | Yash Dabhade <yashdabhade5@gmail.com> | 2022-08-18 09:32:18 +0300 |
---|---|---|
committer | Yash Dabhade <yashdabhade5@gmail.com> | 2022-08-18 09:32:18 +0300 |
commit | 8cd76bff475c5f6bc95e4df28c8003907eb0af56 (patch) | |
tree | 290e39825df9f2937b55732ef08905ec613c846d /source/blender/makesrna | |
parent | 9d1cfd9dde3d23d39ba869fada295ea579231490 (diff) |
UI: Select regions of text and toggle its style
1)Text can be selected along the mouse pointer by dragging the cursor .
2) After the selection we can toggle the style of the selected region.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_curve.c | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index fff3f479a3f..ac3b8c7b8cd 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -837,6 +837,50 @@ static bool rna_Curve_is_editmode_get(PointerRNA *ptr) } } +static bool rna_Curve_is_select_underline_get(PointerRNA *ptr) +{ + Curve *cu= (Curve *)ptr->owner_id; + if(cu->editfont != NULL) + return cu->editfont->select_is_underline; + else + return false; +} + +static bool rna_Curve_is_select_bold_get(PointerRNA *ptr) +{ + Curve *cu= (Curve *)ptr->owner_id; + if(cu->editfont != NULL) + return cu->editfont->select_is_bold; + else + return false; +} + +static bool rna_Curve_is_select_italics_get(PointerRNA *ptr) +{ + Curve *cu= (Curve *)ptr->owner_id; + if(cu->editfont != NULL) + return cu->editfont->select_is_italics; + else + return false; +} + +static bool rna_Curve_is_select_smallcaps_get(PointerRNA *ptr) +{ + Curve *cu= (Curve *)ptr->owner_id; + if(cu->editfont != NULL) + return cu->editfont->select_is_smallcaps; + else + return false; +} +static bool rna_Curve_is_selected(PointerRNA *ptr) +{ + Curve *cu= (Curve *)ptr->owner_id; + if(cu->editfont != NULL) + return cu->editfont->is_selected; + else + return false; +} + #else static const float tilt_limit = DEG2RADF(21600.0f); @@ -1271,6 +1315,41 @@ static void rna_def_font(BlenderRNA *UNUSED(brna), StructRNA *srna) RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FAST); RNA_def_property_ui_text(prop, "Fast Editing", "Don't fill polygons while editing"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + + prop = RNA_def_property(srna, "select_is_underline", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_Curve_is_select_underline_get", NULL); + RNA_def_property_ui_text(prop, "bold sig", "Checks for bold"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); + RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + + prop = RNA_def_property(srna, "select_is_bold", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_Curve_is_select_bold_get", NULL); + RNA_def_property_ui_text(prop, "bold sig", "Checks for bold"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); + RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + + prop = RNA_def_property(srna, "select_is_italics", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_Curve_is_select_italics_get", NULL); + RNA_def_property_ui_text(prop, "bold sig", "Checks for bold"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); + RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + + prop = RNA_def_property(srna, "select_is_smallcaps", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_Curve_is_select_smallcaps_get", NULL); + RNA_def_property_ui_text(prop, "bold sig", "Checks for bold"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); + RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + + prop = RNA_def_property(srna, "is_selected", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_Curve_is_selected", NULL); + RNA_def_property_ui_text(prop, "bold sig", "Checks for bold"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); + RNA_def_property_update(prop, 0, "rna_Curve_update_data"); } static void rna_def_textbox(BlenderRNA *brna) |