diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-05-19 16:46:19 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-05-19 16:46:19 +0200 |
commit | 9f8a56806bc6603bcc63944049b04efc0228f378 (patch) | |
tree | 4567ce2711090343f186386e8bfdb02ae79c59b6 /src/gui | |
parent | df58db54af73453b0f2d5b028a86a174147e9734 (diff) | |
download | fpGUI-9f8a56806bc6603bcc63944049b04efc0228f378.tar.xz |
Combobox paint optimization.
We painted the background rectangle twice. So I just removed the duplicate
paint code.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/fpg_combobox.pas | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/gui/fpg_combobox.pas b/src/gui/fpg_combobox.pas index ba23a0cf..eb119f01 100644 --- a/src/gui/fpg_combobox.pas +++ b/src/gui/fpg_combobox.pas @@ -713,19 +713,16 @@ begin Canvas.SetColor(clSelection); Canvas.SetTextColor(clSelectionText); InflateRect(r, -1, -1); + Canvas.FillRectangle(r); end else begin - if Enabled then - Canvas.SetColor(FBackgroundColor) - else - Canvas.SetColor(clWindowBackground); Canvas.SetTextColor(FTextColor); - r.Left := r.Left + Margin; - r.Width := r.Width - (Margin*2); end; - Canvas.FillRectangle(r); + { adjust rectangle size smaller for text } + r.Left := r.Left + Margin; + r.Width := r.Width - (Margin*2); DoDrawText(r); end; |