Fix #35880: popup menus like F6 redo did not use the right theme color for

highlighted text, it should use the UI instead of 3D view color.
This commit is contained in:
Brecht Van Lommel
2013-06-26 12:24:36 +00:00
parent e11e30aadf
commit b7ca8cef35
2 changed files with 16 additions and 6 deletions

View File

@@ -632,6 +632,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
memset(&type, 0, sizeof(ARegionType));
type.draw = ui_tooltip_region_draw_cb;
type.free = ui_tooltip_region_free_cb;
type.regionid = RGN_TYPE_TEMPORARY;
ar->type = &type;
/* set font, get bb */
@@ -1159,6 +1160,7 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but)
memset(&type, 0, sizeof(ARegionType));
type.draw = ui_searchbox_region_draw_cb;
type.free = ui_searchbox_region_free_cb;
type.regionid = RGN_TYPE_TEMPORARY;
ar->type = &type;
/* create searchbox data */
@@ -1669,6 +1671,7 @@ uiPopupBlockHandle *ui_popup_block_create(bContext *C, ARegion *butregion, uiBut
memset(&type, 0, sizeof(ARegionType));
type.draw = ui_block_region_draw;
type.regionid = RGN_TYPE_TEMPORARY;
ar->type = &type;
UI_add_region_handlers(&ar->handlers);

View File

@@ -1014,17 +1014,24 @@ void ui_style_init_default(void)
void UI_SetTheme(int spacetype, int regionid)
{
if (spacetype == 0) { /* called for safety, when delete themes */
theme_active = U.themes.first;
theme_spacetype = SPACE_VIEW3D;
theme_regionid = RGN_TYPE_WINDOW;
}
else {
if (spacetype) {
/* later on, a local theme can be found too */
theme_active = U.themes.first;
theme_spacetype = spacetype;
theme_regionid = regionid;
}
else if (regionid) {
/* popups */
theme_active = U.themes.first;
theme_spacetype = SPACE_BUTS;
theme_regionid = regionid;
}
else {
/* for safety, when theme was deleted */
theme_active = U.themes.first;
theme_spacetype = SPACE_VIEW3D;
theme_regionid = RGN_TYPE_WINDOW;
}
}
bTheme *UI_GetTheme(void)