2.5:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 10 Jul 2009 18:10:40 +0000 (18:10 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 10 Jul 2009 18:10:40 +0000 (18:10 +0000)
* Fix missing update when browsing to different text.
* Fix wrong spacing in font size 15 drawing in the text editor.
* Fix numbers not updating in color picker buttons.

source/blender/editors/interface/interface_regions.c
source/blender/editors/space_text/text_draw.c
source/blender/makesrna/intern/rna_space.c

index 1b96850891862686b7922d96291eec121026407f..e0c6fbd713455b1c7919ad170e677fdfff8e8a38 100644 (file)
@@ -1460,11 +1460,10 @@ static void update_picker_hex(uiBlock *block, float *rgb)
        // this updates button strings, is hackish... but button pointers are on stack of caller function
 
        for(bt= block->buttons.first; bt; bt= bt->next) {
-               if(strcmp(bt->str, "Hex: ")==0) {
+               if(strcmp(bt->str, "Hex: ")==0)
                        strcpy(bt->poin, col);
-                       ui_check_but(bt);
-                       break;
-               }
+
+               ui_check_but(bt);
        }
 }
 
@@ -1506,6 +1505,8 @@ void ui_update_block_buts_hsv(uiBlock *block, float *hsv)
                                ui_set_but_val(bt, hsv[2]);
                        }
                }               
+
+               ui_check_but(bt);
        }
 }
 
@@ -1547,6 +1548,8 @@ static void ui_update_block_buts_hex(uiBlock *block, char *hexcol)
                                ui_set_but_val(bt, v);
                        }
                }
+
+               ui_check_but(bt);
        }
 }
 
index 48c14804b13c5bc99343ce1d1f4e608c441554de..f58af47a6bdc76b13519c205892fdf59c8b7d918 100644 (file)
@@ -101,7 +101,7 @@ static int text_font_draw_character(SpaceText *st, int x, int y, char c)
 int text_font_width_character(SpaceText *st)
 {
        // XXX need quick BLF function, or cache it somewhere
-       return (st->lheight == 12)? 7: 8;
+       return (st->lheight == 12)? 7: 9;
 }
 
 int text_font_width(SpaceText *st, char *str)
index f1a58ba058a37106fad2065905721f586179af5a..996e54384e264f2b7a909a1d2f9d6525efeda56e 100644 (file)
@@ -800,8 +800,8 @@ static void rna_def_space_text(BlenderRNA *brna)
        PropertyRNA *prop;
 
        static EnumPropertyItem font_size_items[] = {
-               {12, "SCREEN_12", 0, "Screen 12", ""},
-               {15, "SCREEN_15", 0, "Screen 15", ""},
+               {12, "12", 0, "12", ""},
+               {15, "15", 0, "15", ""},
                {0, NULL, 0, NULL, NULL}};
 
        srna= RNA_def_struct(brna, "SpaceTextEditor", "Space");
@@ -813,7 +813,7 @@ static void rna_def_space_text(BlenderRNA *brna)
        RNA_def_property_flag(prop, PROP_EDITABLE);
        RNA_def_property_ui_text(prop, "Text", "Text displayed and edited in this space.");
        RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceTextEditor_text_set", NULL);
-       RNA_def_property_update(prop, NC_TEXT|NA_EDITED, NULL);
+       RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL);
 
        /* display */
        prop= RNA_def_property(srna, "syntax_highlight", PROP_BOOLEAN, PROP_NONE);