- Timestamp:
- May 29, 2010, 1:14:57 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- d39f68c
- Parents:
- 6b93305
- git-author:
- David Benjamin <davidben@mit.edu> (05/27/10 13:19:26)
- git-committer:
- David Benjamin <davidben@mit.edu> (05/29/10 13:14:57)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
popwin.c
rd3814ff rd106110 9 9 int owl_popwin_up(owl_popwin *pw) 10 10 { 11 /* make them zero-size for now */ 12 pw->border = owl_window_new(0, 0, 0, 0, 0); 13 pw->content = owl_window_new(pw->border, 0, 0, 0, 0); 14 11 pw->border = owl_window_new(NULL); 12 pw->content = owl_window_new(pw->border); 15 13 owl_window_set_redraw_cb(pw->border, owl_popwin_draw_border, pw, 0); 16 owl_window_set_resize_cb(pw->border, owl_popwin_resize_content, pw, 0); 17 /* HACK */ 18 owl_window_set_resize_cb(owl_window_get_screen(), owl_popwin_reposition, pw, 0); 19 20 /* calculate position, THEN map the windows maybe setting a resize hook 21 * should just cause it to get called? */ 22 owl_popwin_reposition(owl_window_get_screen(), pw); 14 owl_window_set_size_cb(pw->border, owl_popwin_size_border, 0, 0); 15 owl_window_set_size_cb(pw->content, owl_popwin_size_content, 0, 0); 23 16 owl_window_map(pw->border, 1); 24 17 … … 27 20 } 28 21 29 void owl_popwin_ reposition(owl_window *screen, void *user_data)22 void owl_popwin_size_border(owl_window *border, void *user_data) 30 23 { 31 owl_popwin *pw = user_data;32 24 int lines, cols, startline, startcol; 33 25 int glines, gcols; 26 owl_window *parent = owl_window_get_parent(border); 34 27 35 owl_window_get_position( screen, &glines, &gcols, 0, 0);28 owl_window_get_position(parent, &glines, &gcols, 0, 0); 36 29 37 30 lines = owl_util_min(glines,24)*3/4 + owl_util_max(glines-24,0)/2; … … 40 33 startcol = (gcols-cols)/2; 41 34 42 owl_window_set_position( pw->border, lines, cols, startline, startcol);35 owl_window_set_position(border, lines, cols, startline, startcol); 43 36 } 44 37 45 void owl_popwin_ resize_content(owl_window *w, void *user_data)38 void owl_popwin_size_content(owl_window *content, void *user_data) 46 39 { 47 40 int lines, cols; 48 owl_ popwin *pw = user_data;49 owl_window_get_position( w, &lines, &cols, 0, 0);50 owl_window_set_position( pw->content, lines-2, cols-2, 1, 1);41 owl_window *parent = owl_window_get_parent(content); 42 owl_window_get_position(parent, &lines, &cols, 0, 0); 43 owl_window_set_position(content, lines-2, cols-2, 1, 1); 51 44 } 52 45 … … 76 69 pw->content = 0; 77 70 pw->active=0; 78 owl_window_set_resize_cb(owl_window_get_screen(), 0, 0, 0);79 71 return(0); 80 72 }
Note: See TracChangeset
for help on using the changeset viewer.