mirror of https://github.com/cy384/ssheven.git
draw resize box
This commit is contained in:
parent
155caa5629
commit
96bb885279
|
@ -97,6 +97,19 @@ void draw_screen(Rect* r)
|
|||
TextFont(save_font);
|
||||
TextSize(save_font_size);
|
||||
TextFace(save_font_face);
|
||||
|
||||
// draw the grow icon in the bottom right corner, but not the scroll bars
|
||||
// yes, this is really awkward
|
||||
MacRegion bottom_right_corner = { 10, con.win->portRect};
|
||||
MacRegion* brc = &bottom_right_corner;
|
||||
MacRegion** old = con.win->clipRgn;
|
||||
|
||||
bottom_right_corner.rgnBBox.top = bottom_right_corner.rgnBBox.bottom - 15;
|
||||
bottom_right_corner.rgnBBox.left = bottom_right_corner.rgnBBox.right - 15;
|
||||
|
||||
con.win->clipRgn = &brc;
|
||||
DrawGrowIcon(con.win);
|
||||
con.win->clipRgn = old;
|
||||
}
|
||||
|
||||
void ruler(Rect* r)
|
||||
|
|
|
@ -270,6 +270,7 @@ void resize_con_window(WindowPtr eventWin, EventRecord event)
|
|||
Rect window_limits = { .top = con.cell_height*2 + 2, .bottom = con.cell_height*100 + 2, .left = con.cell_width*10 + 4, .right = con.cell_width*200 + 4 };
|
||||
|
||||
long growResult = GrowWindow(eventWin, event.where, &window_limits);
|
||||
|
||||
if (growResult != 0)
|
||||
{
|
||||
int height = growResult >> 16;
|
||||
|
@ -280,7 +281,8 @@ void resize_con_window(WindowPtr eventWin, EventRecord event)
|
|||
int next_width = width - ((width - 4) % con.cell_width);
|
||||
|
||||
SizeWindow(eventWin, next_width, next_height, true);
|
||||
// don't need to erase and invalidate, since vterm callbacks on resize
|
||||
EraseRect(&(con.win->portRect));
|
||||
InvalRect(&(con.win->portRect));
|
||||
|
||||
con.size_x = (next_width - 4)/con.cell_width;
|
||||
con.size_y = (next_height - 2)/con.cell_height;
|
||||
|
|
Loading…
Reference in New Issue