From ad410280f9a1ace580a96e56682ae08f0bacfd20 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Wed, 26 Jun 2002 11:39:42 +0000 Subject: [PATCH] Changed the UL bullet to be a square -- I couldn't get it to show anywhere near nicely as an ellipse, under Windows at least. Previously the bullet showed up as what looked like a tiny asterisk. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15957 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/html/m_list.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/html/m_list.cpp b/src/html/m_list.cpp index 51488e2d3d..689a8ebc11 100644 --- a/src/html/m_list.cpp +++ b/src/html/m_list.cpp @@ -58,7 +58,12 @@ wxHtmlListmarkCell::wxHtmlListmarkCell(wxDC* dc, const wxColour& clr) : wxHtmlCe void wxHtmlListmarkCell::Draw(wxDC& dc, int x, int y, int WXUNUSED(view_y1), int WXUNUSED(view_y2)) { dc.SetBrush(m_Brush); - dc.DrawEllipse(x + m_PosX + m_Width / 4, y + m_PosY + m_Height / 4, m_Width / 2, m_Width / 2); + //dc.DrawEllipse(x + m_PosX + m_Width / 4, y + m_PosY + m_Height / 4, m_Width / 2, m_Width / 2); + // This looks better IMHO (JACS) -- I tried to get ellipses/circles working but they can + // just look terrible, at least on Windows. TODO: maybe have configurable bullets, + // possibly with the app supplying bitmaps. + int size = (int) ((m_Width / 2.0) + 0.5); + dc.DrawRectangle(x + m_PosX + (m_Width - size)/2, y + m_PosY + (m_Height - size)/ 2, size, size); } @@ -94,11 +99,15 @@ TAG_HANDLER_BEGIN(OLULLI, "OL,UL,LI") c = m_WParser->OpenContainer(); c->SetWidthFloat(2 * m_WParser->GetCharWidth(), wxHTML_UNITS_PIXELS); - c->SetAlignHor(wxHTML_ALIGN_RIGHT); if (m_Numbering == 0) + { + // Centering gives more space after the bullet + c->SetAlignHor(wxHTML_ALIGN_CENTER); c->InsertCell(new wxHtmlListmarkCell(m_WParser->GetDC(), m_WParser->GetActualColor())); + } else { + c->SetAlignHor(wxHTML_ALIGN_RIGHT); wxString mark; mark.Printf(wxT("%i."), m_Numbering); c->InsertCell(new wxHtmlWordCell(mark, *(m_WParser->GetDC()))); -- 2.45.2