]>
Commit | Line | Data |
---|---|---|
ebad6e72 | 1 | --- src/Pager/Pager.c 2008-02-22 08:20:00.000000000 -0600 |
2 | +++ src/Pager/Pager.c 2008-03-25 12:54:44.000000000 -0500 | |
3 | @@ -105,7 +105,6 @@ | |
4 | ||
5 | int page_rows, page_columns ; | |
6 | /* x and y size of desktop */ | |
7 | - int vscaled_desk_width, vscaled_desk_height ; /* calculated in accordance to Scale param in database */ | |
8 | int desk_width, desk_height ; /* adjusted for the size of title */ | |
9 | /* area of the main window used up by labels, borders and other garbadge :*/ | |
10 | int wasted_width, wasted_height ; | |
11 | @@ -395,6 +394,7 @@ | |
12 | /***************************************************************************** | |
13 | * This routine is responsible for reading and parsing the config file | |
14 | ****************************************************************************/ | |
15 | + | |
16 | void | |
17 | CheckConfigSanity() | |
18 | { | |
19 | @@ -439,7 +439,7 @@ | |
20 | if (Config->geometry.width <= Config->columns ) | |
21 | clear_flags(Config->geometry.flags, WidthValue); | |
22 | if (!get_flags(Config->geometry.flags, WidthValue) ) | |
23 | - Config->geometry.width = PagerState.vscaled_desk_width*Config->columns ; | |
24 | + Config->geometry.width = (PagerState.vscreen_width*Config->columns)/Scr.VScale ; | |
25 | ||
26 | PagerState.desk_width = Config->geometry.width/Config->columns ; | |
27 | Config->geometry.width = PagerState.desk_width*Config->columns ; | |
28 | @@ -447,11 +447,11 @@ | |
29 | if (Config->geometry.height <= Config->rows ) | |
30 | clear_flags(Config->geometry.flags, HeightValue); | |
31 | if (!get_flags(Config->geometry.flags, HeightValue) || Config->geometry.height <= Config->rows ) | |
32 | - Config->geometry.height = PagerState.vscaled_desk_height*Config->rows ; | |
33 | + Config->geometry.height = (PagerState.vscreen_height*Config->rows)/Scr.VScale ; | |
34 | ||
35 | PagerState.desk_height = Config->geometry.height/Config->rows ; | |
36 | Config->geometry.height = PagerState.desk_height*Config->rows ; | |
37 | - | |
38 | + | |
39 | PagerState.wasted_width = PagerState.wasted_height = 0 ; | |
40 | ||
41 | if( !get_flags(Config->geometry.flags, XValue)) | |
42 | @@ -701,9 +701,6 @@ | |
43 | PagerState.vscreen_width = Scr.VxMax + Scr.MyDisplayWidth; | |
44 | PagerState.vscreen_height = Scr.VyMax + Scr.MyDisplayHeight; | |
45 | ||
46 | - PagerState.vscaled_desk_width = PagerState.vscreen_width/Scr.VScale; | |
47 | - PagerState.vscaled_desk_height = PagerState.vscreen_height/Scr.VScale; | |
48 | - | |
49 | SHOW_TIME("BaseConfigParsingTime",started); | |
50 | LOCAL_DEBUG_OUT("desk_size(%dx%d),vscreen_size(%dx%d),vscale(%d)", PagerState.desk_width, PagerState.desk_height, PagerState.vscreen_width, PagerState.vscreen_height, Scr.VScale ); | |
51 | } | |
52 | @@ -1031,7 +1028,7 @@ | |
53 | } | |
54 | ||
55 | ||
56 | -unsigned int | |
57 | +inline unsigned int | |
58 | calculate_desk_width( ASPagerDesk *d ) | |
59 | { | |
60 | unsigned int width = PagerState.desk_width; | |
61 | @@ -1158,7 +1155,7 @@ | |
62 | if( wa ) | |
63 | { | |
64 | register int p = PagerState.page_columns-1; | |
65 | - int pos_inc = Scr.MyDisplayWidth/Scr.VScale; | |
66 | + int pos_inc = (Scr.MyDisplayWidth * d->background->width)/PagerState.vscreen_width; | |
67 | /* d->background->width/PagerState.page_columns ; */ | |
68 | int pos = d->background->win_x+p*pos_inc; | |
69 | int size = d->background->height ; | |
70 | @@ -1177,7 +1174,8 @@ | |
71 | wa += PagerState.page_columns-1; | |
72 | wrecta += PagerState.page_columns-1; | |
73 | p = PagerState.page_rows-1; | |
74 | - pos_inc = Scr.MyDisplayHeight/Scr.VScale; | |
75 | + pos_inc = (Scr.MyDisplayHeight * d->background->height)/PagerState.vscreen_height; | |
76 | + /* Scr.MyDisplayHeight/PagerState.vscale_v; */ | |
77 | /* d->background->height/PagerState.page_rows ; */ | |
78 | pos = d->background->win_y + p*pos_inc; | |
79 | pos2 = d->background->win_x ; | |
80 | @@ -1206,8 +1204,10 @@ | |
81 | { | |
82 | int sel_x = sel_desk->background->win_x ; | |
83 | int sel_y = sel_desk->background->win_y ; | |
84 | - int page_width = Scr.MyDisplayWidth/Scr.VScale ; | |
85 | - int page_height = Scr.MyDisplayHeight/Scr.VScale ; | |
86 | + int page_width = /*Scr.MyDisplayWidth/PagerState.vscale_h ;*/ | |
87 | + (Scr.MyDisplayWidth * sel_desk->background->width)/PagerState.vscreen_width; | |
88 | + int page_height = /* Scr.MyDisplayHeight/PagerState.vscale_v ;*/ | |
89 | + (Scr.MyDisplayHeight * sel_desk->background->height)/PagerState.vscreen_height; | |
90 | int i = 4; | |
91 | ||
92 | sel_x += (Scr.Vx*page_width)/Scr.MyDisplayWidth ; | |
93 | @@ -1500,8 +1500,6 @@ | |
94 | if( height > row_height ) | |
95 | row_height = height; | |
96 | ||
97 | - LOCAL_DEBUG_OUT( " :RESIZING: desk = %d, size = %dx%d, all_size = %+d%+d", i, width, height, all_width, all_height ); | |
98 | - | |
99 | if( ++col >= Config->columns ) | |
100 | { | |
101 | if( all_width < x+width ) | |
102 | @@ -1513,6 +1511,8 @@ | |
103 | col = 0; | |
104 | }else | |
105 | x += width; | |
106 | + LOCAL_DEBUG_OUT( " :RESIZING: desk = %d, size = %dx%d, all_size = %+d%+d, +x+y = %+d%+d, row_height = %d", i, width, height, all_width, all_height, x, y, row_height ); | |
107 | + | |
108 | } | |
109 | if( all_width < x ) | |
110 | all_width = x ; | |
111 | @@ -1572,20 +1572,25 @@ | |
112 | * and then devide size of the main canvas by this number : */ | |
113 | for( col = 0 ; col < Config->columns ; ++col ) | |
114 | { | |
115 | - Bool unshaded = False ; | |
116 | unsigned int col_shaded_width = 0 ; | |
117 | int i ; | |
118 | ||
119 | for( i = col ; i < PagerState.desks_num ; i+= Config->columns ) | |
120 | { | |
121 | ASPagerDesk *d = &(PagerState.desks[i]); | |
122 | + | |
123 | if( !get_flags(d->flags, ASP_DeskShaded ) ) | |
124 | - unshaded = True ; | |
125 | - else if( col_shaded_width < d->title_width ) | |
126 | - col_shaded_width = d->title_width ; | |
127 | + { | |
128 | + ++unshaded_col_count ; | |
129 | + col_shaded_width = 0; | |
130 | + break; | |
131 | + }else | |
132 | + { | |
133 | + int dw = calculate_desk_width(d); | |
134 | + if( col_shaded_width < dw ) | |
135 | + col_shaded_width = dw; | |
136 | + } | |
137 | } | |
138 | - if( unshaded ) | |
139 | - ++unshaded_col_count ; | |
140 | shaded_width += col_shaded_width ; | |
141 | } | |
142 | ||
143 | @@ -1611,7 +1616,6 @@ | |
144 | * and then devide size of the main canvas by this number : */ | |
145 | for( row = 0 ; row < Config->rows ; ++row ) | |
146 | { | |
147 | - Bool unshaded = False ; | |
148 | unsigned int row_shaded_height = 0 ; | |
149 | int i, max_i = (row+1)*Config->columns ; | |
150 | ||
151 | @@ -1622,15 +1626,20 @@ | |
152 | { | |
153 | ASPagerDesk *d = &(PagerState.desks[i]); | |
154 | if( !get_flags(d->flags, ASP_DeskShaded ) ) | |
155 | - unshaded = True ; | |
156 | - else if( row_shaded_height < d->title_height ) | |
157 | - row_shaded_height = d->title_height ; | |
158 | + { | |
159 | + ++unshaded_row_count ; | |
160 | + row_shaded_height = 0; | |
161 | + break; | |
162 | + }else | |
163 | + { | |
164 | + int dh = calculate_desk_height(d); | |
165 | + if( row_shaded_height < dh ) | |
166 | + row_shaded_height = dh; | |
167 | + } | |
168 | } | |
169 | - if( unshaded ) | |
170 | - ++unshaded_row_count ; | |
171 | shaded_height += row_shaded_height ; | |
172 | } | |
173 | -LOCAL_DEBUG_OUT( "unshaded_row_count = %d", unshaded_row_count ); | |
174 | +LOCAL_DEBUG_OUT( "unshaded_row_count = %d, shaded_height = %d, main_height = %d", unshaded_row_count, shaded_height, main_height ); | |
175 | if( unshaded_row_count == 0 ) | |
176 | return PagerState.desk_height; | |
177 | return (main_height - shaded_height)/unshaded_row_count; | |
178 | @@ -2755,9 +2764,10 @@ | |
179 | if( new_desk_width != PagerState.desk_width || | |
180 | new_desk_height != PagerState.desk_height ) | |
181 | { | |
182 | - PagerState.desk_width = new_desk_width ; | |
183 | - PagerState.desk_height = new_desk_height ; | |
184 | - } | |
185 | + PagerState.desk_width = new_desk_width; | |
186 | + PagerState.desk_height = new_desk_height; | |
187 | + } | |
188 | + | |
189 | rearrange_pager_desks( True ); | |
190 | }else if( changes != 0 ) | |
191 | { |