261{
262
263 auto pre_clr = dc.GetTextForeground();
264 auto pre_pen = dc.GetPen();
265 dc.SetTextForeground(wxColour(172, 172, 172));
266 dc.SetPen(wxColour(166, 169, 170));
267
268 auto font = w->GetFont();
269 font.SetPointSize(font.GetPointSize() - 3);
270 dc.SetFont(font);
271
272 int spacing = w->FromDIP(8);
273
274 if (!split_text.empty())
275 {
276 int max_content_width = item_width - start_pt.x - 2 * spacing;
277 wxSize tSize = dc.GetMultiLineTextExtent(split_text);
278 if (tSize.x > max_content_width)
279 {
280 split_text = wxControl::Ellipsize(split_text, dc, wxELLIPSIZE_END, max_content_width);
281 tSize = dc.GetMultiLineTextExtent(split_text);
282 }
283
284 dc.SetFont(font);
285 dc.DrawText(split_text, start_pt);
286
287 int line_width = item_width - start_pt.x - tSize.x - 2 * spacing;
288 int line_y = start_pt.y + (tSize.GetHeight() / 2);
289 dc.DrawLine(start_pt.x + tSize.x + spacing, line_y, start_pt.x + tSize.x + line_width + spacing, line_y);
290 }
291 else
292 {
293 int line_y = start_pt.y + (item_height / 2);
294 int line_width = item_width - start_pt.x - spacing;
295 dc.DrawLine(start_pt.x, line_y, start_pt.x + line_width, line_y);
296 }
297
298
299 dc.SetTextForeground(pre_clr);
300 dc.SetPen(pre_pen);
301 dc.SetFont(w->GetFont());
302}