From 88676349a473020937ba5f2637535bf5960059c9 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sat, 4 Jun 2011 17:03:46 +0000 Subject: Code holiday commit: - fix: user pref, window title was reset to 'Blender' on tab usage - Undo history menu back: - name "Undo History" - hotkey alt+ctrl+z (alt+apple+z for mac) - works like 2.4x, only for global undo, editmode and particle edit. - Menu scroll - for small windows or screens, popup menus now allow to display all items, using internal scrolling - works with a timer, scrolling 10 items per second when mouse is over the top or bottom arrow - if menu is too big to display, it now draws to top or bottom, based on largest available space. - also works for hotkey driven pop up menus. - User pref "DPI" follows widget/layout size - widgets & headers now become bigger and smaller, to match 'dpi' font sizes. Works well to match UI to monitor size. - note that icons can get fuzzy, we need better mipmaps for it --- source/blender/blenkernel/intern/blender.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'source/blender/blenkernel/intern/blender.c') diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index b852629e49c..20b44b3b899 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -620,7 +620,7 @@ void BKE_reset_undo(void) /* based on index nr it does a restore */ void BKE_undo_number(bContext *C, int nr) { - curundo= BLI_findlink(&undobase, nr - 1); + curundo= BLI_findlink(&undobase, nr); BKE_undo_step(C, 0); } @@ -646,6 +646,21 @@ int BKE_undo_valid(const char *name) return undobase.last != undobase.first; } +/* get name of undo item, return null if no item with this index */ +/* if active pointer, set it to 1 if true */ +char *BKE_undo_get_name(int nr, int *active) +{ + UndoElem *uel= BLI_findlink(&undobase, nr); + + if(active) *active= 0; + + if(uel) { + if(active && uel==curundo) + *active= 1; + return uel->name; + } + return NULL; +} char *BKE_undo_menu_string(void) { -- cgit v1.2.3