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:
authorTon Roosendaal <ton@blender.org>2011-06-04 21:03:46 +0400
committerTon Roosendaal <ton@blender.org>2011-06-04 21:03:46 +0400
commit88676349a473020937ba5f2637535bf5960059c9 (patch)
treecb02be5fea2f127b284430508fcab3de959c37d7 /source/blender/editors/physics
parent4a59928484b93a6c3876c0c8b065f6d313640804 (diff)
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
Diffstat (limited to 'source/blender/editors/physics')
-rw-r--r--source/blender/editors/physics/particle_edit.c58
1 files changed, 26 insertions, 32 deletions
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index c5ab840914e..6155929243b 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -3970,18 +3970,6 @@ int PE_undo_valid(Scene *scene)
return 0;
}
-static void PTCacheUndo_number(Scene *scene, PTCacheEdit *edit, int nr)
-{
- PTCacheUndo *undo;
- int a=1;
-
- for(undo= edit->undo.first; undo; undo= undo->next, a++) {
- if(a==nr) break;
- }
- edit->curundo= undo;
- PE_undo_step(scene, 0);
-}
-
static void PTCacheUndo_clear(PTCacheEdit *edit)
{
PTCacheUndo *undo;
@@ -4007,32 +3995,38 @@ void PE_redo(Scene *scene)
PE_undo_step(scene, -1);
}
-void PE_undo_menu(Scene *scene, Object *ob)
+void PE_undo_number(Scene *scene, int nr)
{
- PTCacheEdit *edit= PE_get_current(scene, ob);
+ PTCacheEdit *edit= PE_get_current(scene, OBACT);
PTCacheUndo *undo;
- DynStr *ds;
- short event=0;
- char *menu;
-
- if(!edit) return;
-
- ds= BLI_dynstr_new();
-
- BLI_dynstr_append(ds, "Particlemode Undo History %t");
+ int a=0;
- for(undo= edit->undo.first; undo; undo= undo->next) {
- BLI_dynstr_append(ds, "|");
- BLI_dynstr_append(ds, undo->name);
+ for(undo= edit->undo.first; undo; undo= undo->next, a++) {
+ if(a==nr) break;
}
+ edit->curundo= undo;
+ PE_undo_step(scene, 0);
+}
+
+
+/* get name of undo item, return null if no item with this index */
+/* if active pointer, set it to 1 if true */
+char *PE_undo_get_name(Scene *scene, int nr, int *active)
+{
+ PTCacheEdit *edit= PE_get_current(scene, OBACT);
+ PTCacheUndo *undo;
- menu= BLI_dynstr_get_cstring(ds);
- BLI_dynstr_free(ds);
-
-// XXX event= pupmenu_col(menu, 20);
- MEM_freeN(menu);
+ if(active) *active= 0;
- if(event>0) PTCacheUndo_number(scene, edit, event);
+ if(edit) {
+ undo= BLI_findlink(&edit->undo, nr);
+ if(undo) {
+ if(active && undo==edit->curundo)
+ *active= 1;
+ return undo->name;
+ }
+ }
+ return NULL;
}
/************************ utilities ******************************/