Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-11-30 13:31:11 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-30 13:31:11 +0400
commit9e5b28cd42a3cf87ac76e3b27b52dce08071d244 (patch)
treeeb14ff117faf3f6c524ea0a09389da313044d105 /source/blender/editors/screen
parent274080025d315dc08f9291bddc6d4235ed0fc8e0 (diff)
parentc9edbab08a4854ad6e79abdfaaee65e0f9301ac0 (diff)
svn merge ^/trunk/blender -r42261:42290
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r--source/blender/editors/screen/area.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 24c26109502..7aacd9f7b86 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -1596,7 +1596,7 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *
if(pt->draw_header && !(pt->flag & PNL_NO_HEADER) && (open || vertical)) {
/* for enabled buttons */
panel->layout= uiBlockLayout(block, UI_LAYOUT_HORIZONTAL, UI_LAYOUT_HEADER,
- triangle, UI_UNIT_Y+style->panelspace, UI_UNIT_Y, 1, style);
+ triangle, UI_UNIT_Y+style->panelspace+2, UI_UNIT_Y, 1, style);
pt->draw_header(C, panel);
@@ -1776,3 +1776,38 @@ int ED_area_headersize(void)
{
return UI_UNIT_Y+6;
}
+
+void ED_region_info_draw(ARegion *ar, const char *text, int block, float alpha)
+{
+ const int header_height = 18;
+ uiStyle *style= UI_GetStyle();
+ int fontid= style->widget.uifont_id;
+ rcti rect;
+
+ BLF_size(fontid, 11.0f, 72);
+
+ /* background box */
+ rect= ar->winrct;
+ rect.xmin= 0;
+ rect.ymin= ar->winrct.ymax - ar->winrct.ymin - header_height;
+
+ if(block) {
+ rect.xmax= ar->winrct.xmax - ar->winrct.xmin;
+ }
+ else {
+ rect.xmax= rect.xmin + BLF_width(fontid, text) + 24;
+ }
+
+ rect.ymax= ar->winrct.ymax - ar->winrct.ymin;
+
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
+ glColor4f(0.0f, 0.0f, 0.0f, alpha);
+ glRecti(rect.xmin, rect.ymin, rect.xmax+1, rect.ymax+1);
+ glDisable(GL_BLEND);
+
+ /* text */
+ UI_ThemeColor(TH_TEXT_HI);
+ BLF_position(fontid, 12, rect.ymin + 5, 0.0f);
+ BLF_draw(fontid, text, strlen(text));
+}