vcl/source/control/imivctl1.cxx | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-)
New commits: commit 9288e66770adc0cb5eda2dc3e242da1472172def Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Mon Jul 22 09:13:00 2024 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Wed Jul 24 05:43:02 2024 +0200 tdf#161501 icon choice ctrl: Simplify and drop extra local variable No need to have a `bSolidTextRect` variable here, just do the relevant call right away. That also means that there's no need to save and restore the previous fill color for the `bSelected = true` case (it never gets changed), so move that into the if block as well. Change-Id: I57637e570b01e2a09708fc7776c867817a131d31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170844 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index a7abd0af7743..5a79779e4dd2 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -962,25 +962,17 @@ void SvxIconChoiceCtrl_Impl::LoseFocus() void SvxIconChoiceCtrl_Impl::PaintEmphasis(const tools::Rectangle& rTextRect, bool bSelected, vcl::RenderContext& rRenderContext) { - Color aOldFillColor(rRenderContext.GetFillColor()); - - bool bSolidTextRect = false; - if (!bSelected) { + Color aOldFillColor(rRenderContext.GetFillColor()); const Color& rFillColor = rRenderContext.GetFont().GetFillColor(); rRenderContext.SetFillColor(rFillColor); + // draw text rectangle if (rFillColor != COL_TRANSPARENT) - bSolidTextRect = true; - } + rRenderContext.DrawRect(rTextRect); - // draw text rectangle - if (bSolidTextRect) - { - rRenderContext.DrawRect(rTextRect); + rRenderContext.SetFillColor(aOldFillColor); } - - rRenderContext.SetFillColor(aOldFillColor); } commit 3720078422b2c44faf8c4cbb53f4aa09875ad0bc Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Mon Jul 22 08:59:14 2024 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Wed Jul 24 05:42:53 2024 +0200 tdf#161501 icon choice ctrl: Drop extra drawing of entry bg Drop extra drawing of a rectangle with the background color just for selected entries. It's unclear why that is done, and why it's done only for selected entries, since the background color used here is unrelated to actual selection (e.g. is just white when using the gen VCL plugin or kf5 with the light Breeze theme). Drawing of the actual selection background happens further down. Therefore, drop drawing that extra rectangle to simplify code and having one place less to care about when switching to using native drawing for the whole entry in an upcoming commit. I see no visual difference with or without this commit in place with either gen or kf5 with either the "Insert -> "Hyperlink" or the "Format" -> "Page Style" vertical tab pages dialogs in Writer. Change-Id: Ia1a7275238a919d245420b5ab4abaf7b3e85bcf0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170843 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 7dec9e192ec7..a7abd0af7743 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -1040,10 +1040,6 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po aNewFont.SetColor(rSettings.GetTabHighlightTextColor()); rRenderContext.SetFont(aNewFont); - - rRenderContext.SetFillColor(rRenderContext.GetBackground().GetColor()); - rRenderContext.DrawRect(CalcFocusRect(pEntry)); - rRenderContext.SetFillColor(); } bool bResetClipRegion = false;