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-05-19 21:13:33 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-05-19 21:13:33 +0400
commit40ae17d2f6e2d5dbbe89321491572035c304872c (patch)
tree7f39fe42977a45878352e34d7bfdc1820ed980ff /source/blender/editors/space_view3d/view3d_toolbar.c
parent861398542f8ba71dd4783886adda21544d939763 (diff)
UI
* Fix buttons jumping around when resizing and zoom. Part of this was adding a tiny a 0.001f offset in UI_view2d_view_ortho, otherwise the rounding is unpredictable (used to be 0.375f, but that was disabled). * Fix various issues with zooming, panning panels. V2D_LOCKOFS_X/Y is now taken into account in more places in the view2d code, to avoid zooming into the center or panning out of the view. * Remove "Free" align mode in buttons window (it's not really useful). * View3D/Graph/Image editors now use the same PanelType system as the buttons window, means some deprecated panel code could be removed. * Some small visual tweaks for panels. * View 2D Reset operator (Home key), to reset zoom and panning for panels. * Added argument to set number buttons as sliders (slider=True for itemR). * Ignore labels for button alignment (doesn't look right). * Fix some use of context.main in py scripts, should get data from active object instead. * Fix autotexspace -> auto_texspace in py script.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_toolbar.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_toolbar.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c
index 9f16e124f77..c7cd5a92ebf 100644
--- a/source/blender/editors/space_view3d/view3d_toolbar.c
+++ b/source/blender/editors/space_view3d/view3d_toolbar.c
@@ -118,18 +118,16 @@ static void redo_cb(bContext *C, void *arg_op, void *arg2)
}
}
-static void view3d_panel_operator_redo(const bContext *C, ARegion *ar, short cntrl)
+static void view3d_panel_operator_redo(const bContext *C, Panel *pa)
{
/* XXX temp */
- extern int uiDefAutoButsRNA_single(const bContext *C, uiBlock *block, PointerRNA *ptr);
+ extern void uiDefAutoButsRNA_single(const bContext *C, uiLayout *layout, PointerRNA *ptr);
wmWindowManager *wm= CTX_wm_manager(C);
wmOperator *op;
PointerRNA ptr;
uiBlock *block;
- int height = 0;
- block= uiBeginBlock(C, ar, "view3d_panel_operator_redo", UI_EMBOSS);
- if(uiNewPanel(C, ar, block, "Operator", "View3d", 0, 10, 120, height)==0) return;
+ block= uiLayoutBlock(pa->layout);
/* only for operators that are registered and did an undo push */
for(op= wm->operators.last; op; op= op->prev)
@@ -149,23 +147,19 @@ static void view3d_panel_operator_redo(const bContext *C, ARegion *ar, short cnt
}
RNA_pointer_create(&wm->id, op->type->srna, op->properties, &ptr);
- height= uiDefAutoButsRNA_single(C, block, &ptr);
-
- uiNewPanelHeight(block, height);
-
- uiEndBlock(C, block);
+ uiDefAutoButsRNA_single(C, pa->layout, &ptr);
}
-
-void view3d_tools_area_defbuts(const bContext *C, ARegion *ar)
+void view3d_toolbar_register(ARegionType *art)
{
- uiBeginPanels(C, ar);
-
- view3d_panel_operator_redo(C, ar, 0);
-
- uiEndPanels(C, ar);
-}
+ PanelType *pt;
+ pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel last operator");
+ strcpy(pt->idname, "VIEW3D_PT_last_operator");
+ strcpy(pt->label, "Last Operator");
+ pt->draw= view3d_panel_operator_redo;
+ BLI_addtail(&art->paneltypes, pt);
+}
static int view3d_toolbar(bContext *C, wmOperator *op)
{