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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-07-09 23:45:27 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-07-09 23:45:27 +0400
commitd091856486cffc4351d6ded86de3c33afb3155b4 (patch)
tree6188adcf6f80afcdac4f41cc9733ac5853443e02 /source/blender/editors/interface
parenta2a04bab8ae70b2f665eb308a62e15d31e88de87 (diff)
2.5: Buttons Window
* Fix poll() callback changes in recent commit, note that these have to work with pinned context too. * Hide header for context panels in py layout. * Don't jump back when collapsing a panel, allow the view to be over some empty space until you scroll back. * Fix follow context icon, order had to be reversed in icon file. * ID template now has icon as part of browse button instead of outside the buttons.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface_layout.c2
-rw-r--r--source/blender/editors/interface/interface_panel.c14
-rw-r--r--source/blender/editors/interface/interface_templates.c12
3 files changed, 20 insertions, 8 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 8bafc5ce1e8..0bf64f75552 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1261,7 +1261,7 @@ static void ui_litem_estimate_row(uiLayout *litem)
static int ui_litem_min_width(int itemw)
{
- return MIN2(UI_UNIT_X, itemw);
+ return MIN2(2*UI_UNIT_X, itemw);
}
static void ui_litem_layout_row(uiLayout *litem)
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 3e009b50045..a3c456c0a93 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -653,6 +653,14 @@ static int get_panel_header(Panel *pa)
return PNL_HEADER;
}
+static int get_panel_size_y(uiStyle *style, Panel *pa)
+{
+ if(pa->type && (pa->type->flag & PNL_NO_HEADER))
+ return pa->sizey;
+
+ return PNL_HEADER + pa->sizey + style->panelouter;
+}
+
/* this function is needed because uiBlock and Panel itself dont
change sizey or location when closed */
static int get_panel_real_ofsy(Panel *pa)
@@ -771,18 +779,18 @@ int uiAlignPanelStep(ScrArea *sa, ARegion *ar, float fac, int drag)
/* no smart other default start loc! this keeps switching f5/f6/etc compatible */
ps= panelsort;
ps->pa->ofsx= 0;
- ps->pa->ofsy= -ps->pa->sizey-get_panel_header(ps->pa)-style->panelouter;
+ ps->pa->ofsy= -get_panel_size_y(style, ps->pa);
for(a=0; a<tot-1; a++, ps++) {
psnext= ps+1;
if(align==BUT_VERTICAL) {
psnext->pa->ofsx= ps->pa->ofsx;
- psnext->pa->ofsy= get_panel_real_ofsy(ps->pa) - psnext->pa->sizey-get_panel_header(psnext->pa)-style->panelouter;
+ psnext->pa->ofsy= get_panel_real_ofsy(ps->pa) - get_panel_size_y(style, psnext->pa);
}
else {
psnext->pa->ofsx= get_panel_real_ofsx(ps->pa);
- psnext->pa->ofsy= ps->pa->ofsy + ps->pa->sizey + get_panel_header(ps->pa) - psnext->pa->sizey - get_panel_header(psnext->pa);
+ psnext->pa->ofsy= ps->pa->ofsy + get_panel_size_y(style, ps->pa) - get_panel_size_y(style, psnext->pa);
}
}
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 1ce352444e6..5fd84ad3c9f 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -211,11 +211,15 @@ static void template_ID(bContext *C, uiBlock *block, TemplateID *template, Struc
if(idptr.type)
type= idptr.type;
- if(type)
- uiDefIconBut(block, LABEL, 0, RNA_struct_ui_icon(type), 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
- if(flag & UI_ID_BROWSE)
- uiDefBlockButN(block, search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X, UI_UNIT_Y, "Browse ID data");
+ if(flag & UI_ID_BROWSE) {
+ but= uiDefBlockButN(block, search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*1.6, UI_UNIT_Y, "Browse ID data");
+ if(type) {
+ but->icon= RNA_struct_ui_icon(type);
+ but->flag|= UI_HAS_ICON;
+ but->flag|= UI_ICON_LEFT;
+ }
+ }
/* text button with name */
if(idptr.data) {