[Bf-blender-cvs] [c2400ce] UI-experiments: Merge branch 'master' into UI-experiments
Julian Eisel
noreply at git.blender.org
Sun May 31 16:32:47 CEST 2015
Commit: c2400ced81bc7e27db956816d47ba8a7378b0e36
Author: Julian Eisel
Date: Sun May 31 14:43:31 2015 +0200
Branches: UI-experiments
https://developer.blender.org/rBc2400ced81bc7e27db956816d47ba8a7378b0e36
Merge branch 'master' into UI-experiments
===================================================================
===================================================================
diff --cc source/blender/editors/interface/interface_panel.c
index 376d2ac,e733b3c..1273b92
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@@ -567,11 -568,9 +568,13 @@@ void ui_draw_aligned_panel(uiStyle *sty
Panel *panel = block->panel;
rcti headrect;
rctf itemrect;
+ const bool draw_header = UI_GetThemeValue(TH_PANEL_SHOW_HEADER);
+ const bool draw_back = UI_GetThemeValue(TH_PANEL_SHOW_BACK);
+ const bool is_selected = panel->flag & PNL_SELECT;
+ const float alpha_fac = is_selected ? 0.7f : 1.0f;
int ofsx;
+ const bool is_closed_x = (panel->flag & PNL_CLOSEDX) ? true : false;
+ const bool is_closed_y = (panel->flag & PNL_CLOSEDY) ? true : false;
if (panel->paneltab) return;
if (panel->type && (panel->type->flag & PNL_NO_HEADER)) return;
@@@ -582,46 -581,9 +585,46 @@@
headrect.ymin = headrect.ymax;
headrect.ymax = headrect.ymin + floor(PNL_HEADER / block->aspect + 0.001f);
+ /* draw panel shadow */
+ if (draw_header == false && panel->flag & PNL_CLOSED) {
+ /* skip */
+ }
+ else if ((draw_header || draw_back)) {
+ rcti shadowrect = headrect;
+ float alpha_fac_tmp = 0.2f * alpha_fac;
+ int shadow_ofs = is_selected ? 2.0f * U.pixelsize : 1.0f * U.pixelsize;
+
+ if (!(panel->flag & PNL_CLOSED) && draw_back) {
+ shadowrect.ymin = rect->ymin;
+ }
+ if (draw_back && !draw_header) {
+ shadowrect.ymax = rect->ymax;
+ }
+
+ glEnable(GL_BLEND);
+
+ if (is_selected) {
+ UI_draw_box_shadow(alpha_fac * 255, shadowrect.xmin, shadowrect.ymin, shadowrect.xmax, shadowrect.ymax);
+ }
+ else {
+ int i;
+
+ for (i = 0; i < 2; i++) {
+ glColor4f(0.0f, 0.0f, 0.0f, alpha_fac_tmp);
+
+ glRectf(shadowrect.xmin + shadow_ofs, shadowrect.ymin - shadow_ofs,
+ shadowrect.xmax + shadow_ofs, shadowrect.ymax - shadow_ofs);
+
+ shadow_ofs += 1 * U.pixelsize;
+ alpha_fac_tmp *= 0.5f;
+ }
+ }
+ glDisable(GL_BLEND);
+ }
+
{
float minx = rect->xmin;
- float maxx = rect->xmax;
+ float maxx = is_closed_x ? (minx + PNL_HEADER / block->aspect) : rect->xmax;
float y = headrect.ymax;
glEnable(GL_BLEND);
More information about the Bf-blender-cvs
mailing list