84
84
if (header_visible && column_controller != null) {
85
85
PaintHeader (damage);
87
88
Theme.DrawFrameBorder (cairo_context, Allocation);
89
93
PaintDraggingColumn (damage);
91
95
((IDisposable)cairo_context.Target).Dispose ();
120
cell_area.X = column_cache[ci].X1 + Theme.TotalBorderWidth + header_rendering_alloc.X - (int)hadjustment.Value;
124
cell_area.X = column_cache[ci].X1 + Theme.TotalBorderWidth + header_rendering_alloc.X - HadjustmentValue;
121
125
cell_area.Width = column_cache[ci].Width;
122
126
PaintHeaderCell (cell_area, ci, false);
125
129
if (pressed_column_is_dragging && pressed_column_index >= 0) {
126
cell_area.X = pressed_column_x_drag + Allocation.X - (int)hadjustment.Value;
130
cell_area.X = pressed_column_x_drag + Allocation.X - HadjustmentValue;
127
131
cell_area.Width = column_cache[pressed_column_index].Width;
128
132
PaintHeaderCell (cell_area, pressed_column_index, true);
174
178
if (sort_column_index != -1 && (!pressed_column_is_dragging || pressed_column_index != sort_column_index)) {
175
179
CachedColumn col = column_cache[sort_column_index];
176
180
Theme.DrawRowRule (cairo_context,
177
list_rendering_alloc.X + col.X1 - (int)hadjustment.Value,
181
list_rendering_alloc.X + col.X1 - HadjustmentValue,
178
182
header_rendering_alloc.Bottom + Theme.BorderWidth,
179
183
col.Width, list_rendering_alloc.Height + Theme.InnerBorderWidth * 2);
186
190
cell_context.Clip = clip;
187
191
cell_context.TextAsForeground = false;
189
int vadjustment_value = (int)vadjustment.Value;
193
int vadjustment_value = VadjustmentValue;
190
194
int first_row = vadjustment_value / RowHeight;
191
195
int last_row = Math.Min (model.Count, first_row + RowsInView);
192
196
int offset = list_rendering_alloc.Y - vadjustment_value % RowHeight;
194
198
Rectangle selected_focus_alloc = Rectangle.Zero;
195
199
Rectangle single_list_alloc = new Rectangle ();
197
single_list_alloc.X = list_rendering_alloc.X - (int)(hadjustment.Value);
201
single_list_alloc.X = list_rendering_alloc.X - HadjustmentValue;
198
202
single_list_alloc.Y = offset;
199
203
single_list_alloc.Width = list_rendering_alloc.Width;
200
204
single_list_alloc.Height = RowHeight;
221
225
single_list_alloc.Width, single_list_alloc.Height);
224
if (ri == drag_reorder_row_index && Reorderable) {
225
cairo_context.Save ();
226
cairo_context.LineWidth = 1.0;
227
cairo_context.Antialias = Cairo.Antialias.None;
228
cairo_context.MoveTo (single_list_alloc.Left, single_list_alloc.Top);
229
cairo_context.LineTo (single_list_alloc.Right, single_list_alloc.Top);
230
cairo_context.Color = Theme.Colors.GetWidgetColor (GtkColorClass.Text, StateType.Normal);
231
cairo_context.Stroke ();
232
cairo_context.Restore ();
228
PaintReorderLine (ri, single_list_alloc);
235
230
if (Selection != null && Selection.FocusedIndex == ri && !Selection.Contains (ri) && HasFocus) {
236
231
CairoCorners corners = CairoCorners.All;
259
254
single_list_alloc.Y += single_list_alloc.Height;
257
// In case the user is dragging to the end of the list
258
PaintReorderLine (last_row, single_list_alloc);
262
260
if (selection_height > 0) {
263
261
Theme.DrawRowSelection (cairo_context, list_rendering_alloc.X, selection_y,
264
262
list_rendering_alloc.Width, selection_height);
279
277
cairo_context.ResetClip ();
280
private void PaintReorderLine (int row_index, Rectangle single_list_alloc)
282
if (row_index == drag_reorder_row_index && Reorderable) {
283
cairo_context.Save ();
284
cairo_context.LineWidth = 1.0;
285
cairo_context.Antialias = Cairo.Antialias.None;
286
cairo_context.MoveTo (single_list_alloc.Left, single_list_alloc.Top);
287
cairo_context.LineTo (single_list_alloc.Right, single_list_alloc.Top);
288
cairo_context.Color = Theme.Colors.GetWidgetColor (GtkColorClass.Text, StateType.Normal);
289
cairo_context.Stroke ();
290
cairo_context.Restore ();
282
294
private void PaintRow (int row_index, Rectangle area, StateType state)
288
300
object item = model[row_index];
289
301
bool sensitive = IsRowSensitive (item);
302
bool bold = IsRowBold (item);
291
304
Rectangle cell_area = new Rectangle ();
292
305
cell_area.Height = RowHeight;
300
313
cell_area.Width = column_cache[ci].Width;
301
314
cell_area.X = column_cache[ci].X1 + area.X;
302
PaintCell (item, ci, row_index, cell_area, sensitive, state, false);
315
PaintCell (item, ci, row_index, cell_area, sensitive, bold, state, false);
305
318
if (pressed_column_is_dragging && pressed_column_index >= 0) {
306
319
cell_area.Width = column_cache[pressed_column_index].Width;
307
320
cell_area.X = pressed_column_x_drag + list_rendering_alloc.X - list_interaction_alloc.X;
308
PaintCell (item, pressed_column_index, row_index, cell_area, sensitive, state, true);
321
PaintCell (item, pressed_column_index, row_index, cell_area, sensitive, bold, state, true);
312
private void PaintCell (object item, int column_index, int row_index, Rectangle area, bool sensitive,
325
private void PaintCell (object item, int column_index, int row_index, Rectangle area, bool sensitive, bool bold,
313
326
StateType state, bool dragging)
315
328
ColumnCell cell = column_cache[column_index].Column.GetCell (0);
316
329
cell.BindListItem (item);
317
330
ColumnCellDataProvider (cell, item);
332
ColumnCellText text_cell = cell as ColumnCellText;
333
if (text_cell != null) {
334
text_cell.FontWeight = bold ? Pango.Weight.Bold : Pango.Weight.Normal;
320
338
Cairo.Color fill_color = Theme.Colors.GetWidgetColor (GtkColorClass.Base, StateType.Normal);
321
339
fill_color.A = 0.5;
341
359
CachedColumn column = column_cache[pressed_column_index];
343
int x = pressed_column_x_drag + Allocation.X + 1 - (int)hadjustment.Value;
361
int x = pressed_column_x_drag + Allocation.X + 1 - HadjustmentValue;
345
363
Cairo.Color fill_color = Theme.Colors.GetWidgetColor (GtkColorClass.Base, StateType.Normal);
346
364
fill_color.A = 0.45;