ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/main.C
(Generate patch)

Comparing rxvt-unicode/src/main.C (file contents):
Revision 1.303 by ayin, Sun Jan 27 22:48:33 2008 UTC vs.
Revision 1.306 by ayin, Mon Feb 18 09:58:04 2008 UTC

525 */ 525 */
526void 526void
527rxvt_term::window_calc (unsigned int newwidth, unsigned int newheight) 527rxvt_term::window_calc (unsigned int newwidth, unsigned int newheight)
528{ 528{
529 short recalc_x, recalc_y; 529 short recalc_x, recalc_y;
530 int x, y, sb_w, flags; 530 int x, y, flags;
531 unsigned int w, h; 531 unsigned int w, h;
532 unsigned int max_width, max_height; 532 unsigned int max_width, max_height;
533 533
534 szHint.flags = PMinSize | PResizeInc | PBaseSize | PWinGravity; 534 szHint.flags = PMinSize | PResizeInc | PBaseSize | PWinGravity;
535 szHint.win_gravity = NorthWestGravity; 535 szHint.win_gravity = NorthWestGravity;
592 max_width = MAX_COLS * fwidth; 592 max_width = MAX_COLS * fwidth;
593 max_height = MAX_ROWS * fheight; 593 max_height = MAX_ROWS * fheight;
594 594
595 szHint.base_width = szHint.base_height = 2 * int_bwidth; 595 szHint.base_width = szHint.base_height = 2 * int_bwidth;
596 596
597 sb_w = 0;
598 window_vt_x = window_vt_y = int_bwidth; 597 window_vt_x = window_vt_y = int_bwidth;
599 598
600 if (scrollBar.state) 599 if (scrollBar.state)
601 { 600 {
602 sb_w = scrollbar_TotalWidth (); 601 int sb_w = scrollBar.total_width ();
603 szHint.base_width += sb_w; 602 szHint.base_width += sb_w;
604 603
605 if (!option (Opt_scrollBar_right)) 604 if (!option (Opt_scrollBar_right))
606 window_vt_x += sb_w; 605 window_vt_x += sb_w;
607 } 606 }
630 else 629 else
631 { 630 {
632 min_it (height, max_height); 631 min_it (height, max_height);
633 szHint.height = szHint.base_height + height; 632 szHint.height = szHint.base_height + height;
634 } 633 }
635
636 if (scrollBar.state && option (Opt_scrollBar_right))
637 window_sb_x = szHint.width - sb_w;
638 634
639 if (recalc_x) 635 if (recalc_x)
640 szHint.x += DisplayWidth (dpy, display->screen) - szHint.width - 2 * ext_bwidth; 636 szHint.x += DisplayWidth (dpy, display->screen) - szHint.width - 2 * ext_bwidth;
641 637
642 if (recalc_y) 638 if (recalc_y)
801void 797void
802rxvt_term::set_window_color (int idx, const char *color) 798rxvt_term::set_window_color (int idx, const char *color)
803{ 799{
804#ifdef XTERM_COLOR_CHANGE 800#ifdef XTERM_COLOR_CHANGE
805 rxvt_color xcol; 801 rxvt_color xcol;
806 int i;
807 802
808 if (color == NULL || *color == '\0') 803 if (color == NULL || *color == '\0')
809 return; 804 return;
810 805
811 color = strdup (color); 806 color = strdup (color);
813 rs[Rs_color + idx] = color; 808 rs[Rs_color + idx] = color;
814 809
815 /* handle color aliases */ 810 /* handle color aliases */
816 if (isdigit (*color)) 811 if (isdigit (*color))
817 { 812 {
818 i = atoi (color); 813 int i = atoi (color);
819 814
820 if (i >= 8 && i <= 15) 815 if (i >= 8 && i <= 15)
821 { 816 {
822 /* bright colors */ 817 /* bright colors */
823 pix_colors_focused[idx] = pix_colors_focused[minBrightCOLOR + i - 8]; 818 pix_colors_focused[idx] = pix_colors_focused[minBrightCOLOR + i - 8];
983 fix_screen = ncol != prev_ncol || nrow != prev_nrow; 978 fix_screen = ncol != prev_ncol || nrow != prev_nrow;
984 979
985 if (fix_screen || newwidth != old_width || newheight != old_height) 980 if (fix_screen || newwidth != old_width || newheight != old_height)
986 { 981 {
987 if (scrollBar.state) 982 if (scrollBar.state)
988 {
989 XMoveResizeWindow (dpy, scrollBar.win,
990 window_sb_x, 0,
991 scrollbar_TotalWidth (), szHint.height);
992 resize_scrollbar (); 983 resize_scrollbar ();
993 }
994 984
995 XMoveResizeWindow (dpy, vt, 985 XMoveResizeWindow (dpy, vt,
996 window_vt_x, window_vt_y, 986 window_vt_x, window_vt_y,
997 width, height); 987 width, height);
998 988

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines