comparison src/menu.cc @ 80:2f1ecc1c5f72

Huge cleanup -- move some global variables into a struct.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 26 Sep 2011 17:39:49 +0300
parents a68786b9c74b
children 4580d53cefff
comparison
equal deleted inserted replaced
79:0602d9bf474a 80:2f1ecc1c5f72
702 width = 2 * BOX_BORDER + 2 * WIDE_HSPACING + width_chars * FONTW; 702 width = 2 * BOX_BORDER + 2 * WIDE_HSPACING + width_chars * FONTW;
703 height = 2 * BOX_BORDER + 2 * WIDE_VSPACING + title_height 703 height = 2 * BOX_BORDER + 2 * WIDE_VSPACING + title_height
704 + items.back().y + item_height; 704 + items.back().y + item_height;
705 705
706 if (user_ox0 < 0) 706 if (user_ox0 < 0)
707 ox0 = (ScrMaxX - width) / 2; 707 ox0 = (cfg.ScrMaxX - width) / 2;
708 else 708 else
709 ox0 = user_ox0; 709 ox0 = user_ox0;
710 ix0 = ox0 + BOX_BORDER; 710 ix0 = ox0 + BOX_BORDER;
711 ix1 = ix0 + 2 * WIDE_HSPACING + width_chars * FONTW - 1; 711 ix1 = ix0 + 2 * WIDE_HSPACING + width_chars * FONTW - 1;
712 ox1 = ix1 + BOX_BORDER; 712 ox1 = ix1 + BOX_BORDER;
713 if (ox1 > ScrMaxX) 713 if (ox1 > cfg.ScrMaxX)
714 { 714 {
715 int overlap = ox1 - ScrMaxX; 715 int overlap = ox1 - cfg.ScrMaxX;
716 ox0 -= overlap; 716 ox0 -= overlap;
717 ix0 -= overlap; 717 ix0 -= overlap;
718 ix1 -= overlap; 718 ix1 -= overlap;
719 ox1 -= overlap; 719 ox1 -= overlap;
720 } 720 }
721 721
722 if (user_oy0 < 0) 722 if (user_oy0 < 0)
723 oy0 = (ScrMaxY - height) / 2; 723 oy0 = (cfg.ScrMaxY - height) / 2;
724 else 724 else
725 oy0 = user_oy0; 725 oy0 = user_oy0;
726 iy0 = oy0 + BOX_BORDER; 726 iy0 = oy0 + BOX_BORDER;
727 ty0 = iy0 + FONTH / 2; // Title of menu 727 ty0 = iy0 + FONTH / 2; // Title of menu
728 ly0 = ty0 + title_height; // First item of menu 728 ly0 = ty0 + title_height; // First item of menu