include/vcl/toolkit/ivctrl.hxx  |    2 --
 vcl/source/control/imivctl1.cxx |   35 ++++++++++++++---------------------
 vcl/source/control/ivctrl.cxx   |    2 +-
 3 files changed, 15 insertions(+), 24 deletions(-)

New commits:
commit f3d7d24b99fec4a26afb7b53dded069649fa8fab
Author:     Michael Weghorn <[email protected]>
AuthorDate: Wed Jul 24 08:10:40 2024 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Wed Jul 24 14:45:01 2024 +0200

    tdf#161501 icon choice ctrl: Actually set text colors for non-selection
    
        commit 24103bdf3fa3d6962efcc6fb6ee5c95b62e29cc4
        Author: Michael Weghorn <[email protected]>
        Date:   Thu Jul 18 08:58:10 2024 +0200
    
            tdf#161501 icon choice ctrl: Use tab text colors
    
            Instead of using the generic window or highlight
            text color, use the specific text colors for tabs
            when painting entries of the vertical tab control,
            similar to how it's done for the non-vertical
            tab control (see `TabControl::ImplDrawItem`).
    
            (...)
    
    had added code to set the font color for the different
    states of a vertical tab control item, but as this
    was in the `if (bSelected)` block, only the one
    for selection was actually used, so the other cases
    were consequently removed in
    
        commit a4befb29f325d4800b3408abb6e6df608a97ecf9
        Author: Caolán McNamara <[email protected]>
        Date:   Sat Jul 20 19:20:13 2024 +0100
    
            cid#1610738 Logically dead code
    
    again.
    
    Thanks to Chris Sherlock for pointing this out!
    
    Reintroduce setting colors, but drop the `bSelected`
    condition altogether. Drop explicitly setting a fill
    color, which the implementation for the non-vertical
    tab control in `TabControl::ImplDrawItem` also doesn't
    do and which would e.g. result in an odd grey background
    for non-selected entries when used unconditionally with
    the gen VCL plugin.
    
    I see no visual difference with or without this commit
    in place on Windows or for the gen VCL plugin or the kf5 VCL
    plugin with the Breeze style on Linux, but other theming/styles
    could depend on according colors being set.
    
    Change-Id: Iccf7170f2de04cead23607977ac8cf7acbc471f3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170926
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index 8a6ace9c6adb..0d24e0b25c45 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -997,22 +997,16 @@ void 
SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po
 
     const bool bMouseHovered = pEntry == pCurHighlightFrame;
     const bool bSelected = pEntry->IsSelected();
-    if (bSelected)
-    {
-        const StyleSettings& rSettings = 
rRenderContext.GetSettings().GetStyleSettings();
-        vcl::Font aNewFont(rRenderContext.GetFont());
-
-        // font fill colors that are attributed "hard" need corresponding 
"hard"
-        // attributed highlight colors
-        if (pView->HasFocus())
-            aNewFont.SetFillColor(rSettings.GetHighlightColor());
-        else
-            aNewFont.SetFillColor(rSettings.GetDeactiveColor());
 
+    const StyleSettings& rSettings = 
rRenderContext.GetSettings().GetStyleSettings();
+    vcl::Font aNewFont(rRenderContext.GetFont());
+    if (bSelected)
         aNewFont.SetColor(rSettings.GetTabHighlightTextColor());
-
-        rRenderContext.SetFont(aNewFont);
-    }
+    else if (bMouseHovered)
+        aNewFont.SetColor(rSettings.GetTabRolloverTextColor());
+    else
+        aNewFont.SetColor(rSettings.GetTabTextColor());
+    rRenderContext.SetFont(aNewFont);
 
     bool bResetClipRegion = false;
     if (!rRenderContext.IsClipRegion() && (aVerSBar->IsVisible() || 
aHorSBar->IsVisible()))
commit 87671a72505603a4cf9b3118c867654e788086da
Author:     Michael Weghorn <[email protected]>
AuthorDate: Wed Jul 24 06:51:35 2024 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Wed Jul 24 14:44:54 2024 +0200

    tdf#161501 icon choice ctrl: Stop hover-highlight when mouse leaves
    
    When the mouse leaves the vertical tab bar,
    unset the entry to highlight as mouse-hovered,
    as the previously one no longer is when the
    mouse is outside the area of the tab bar.
    
    This fixes the issue of the previously
    mouse-hovered entry still being painted
    with mouse-hover feedback when slowly moving the
    mouse to the right away from an entry in the
    "Insert" -> "Page Style" dialog with gen or kf5
    at least, as shown in attachment 195467
    of tdf#161501.
    
    Change-Id: I646cab54f5031ed6a8aa88d4a162bb3a2456eec4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170923
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index ed4c2faa8abe..8a6ace9c6adb 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -494,8 +494,12 @@ bool SvxIconChoiceCtrl_Impl::MouseMove( const MouseEvent& 
rMEvt )
     if( pView->IsTracking() )
         return false;
 
-    const Point aDocPos(pView->PixelToLogic(rMEvt.GetPosPixel()));
-    SvxIconChoiceCtrlEntry* pEntry = GetEntry(aDocPos);
+    SvxIconChoiceCtrlEntry* pEntry = nullptr;
+    if (!rMEvt.IsLeaveWindow())
+    {
+        const Point aDocPos(pView->PixelToLogic(rMEvt.GetPosPixel()));
+        pEntry = GetEntry(aDocPos);
+    }
     SetEntryHighlightFrame(pEntry);
     return true;
 }
commit b3626b0142fc8b72d2249279c34badbb971addce
Author:     Michael Weghorn <[email protected]>
AuthorDate: Wed Jul 24 06:40:59 2024 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Wed Jul 24 14:44:46 2024 +0200

    tdf#161501 icon choice ctrl: Drop WB_HIGHLIGHTFRAME
    
    It is always set, so no need to have an
    icon choice control specific window bit to
    specify whether or not to highlight the
    currently mouse-hovered entry. Just always
    do it.
    
    Change-Id: Ib259b6b1576e1968221c4f98661a3a93e600c93b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170922
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx
index 9d0822fa4d6c..0340eacf164e 100644
--- a/include/vcl/toolkit/ivctrl.hxx
+++ b/include/vcl/toolkit/ivctrl.hxx
@@ -102,7 +102,6 @@ public:
         WB_NODRAGSELECTION  // No selection with tracking rectangle
         WB_NOCOLUMNHEADER   // No Headerbar in Details view (Headerbar not 
implemented)
         WB_NOPOINTERFOCUS   // No GrabFocus at MouseButtonDown
-        WB_HIGHLIGHTFRAME   // The entry beneath the mouse will be highlighted
 */
 
 #define WB_ICON                 WB_RECTSTYLE
@@ -112,7 +111,6 @@ public:
 #define WB_NOVSCROLL            WB_DRAG
 #define WB_NODRAGSELECTION      WB_PATHELLIPSIS
 #define WB_NOCOLUMNHEADER       WB_CENTER
-#define WB_HIGHLIGHTFRAME       WB_IGNORETAB
 
 class MnemonicGenerator;
 
diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index 22e41a967470..ed4c2faa8abe 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -491,17 +491,12 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const 
MouseEvent& rMEvt)
 
 bool SvxIconChoiceCtrl_Impl::MouseMove( const MouseEvent& rMEvt )
 {
-    const Point aDocPos( pView->PixelToLogic(rMEvt.GetPosPixel()) );
-
     if( pView->IsTracking() )
         return false;
-    else if( nWinBits & WB_HIGHLIGHTFRAME )
-    {
-        SvxIconChoiceCtrlEntry* pEntry = GetEntry( aDocPos );
-        SetEntryHighlightFrame(pEntry);
-    }
-    else
-        return false;
+
+    const Point aDocPos(pView->PixelToLogic(rMEvt.GetPosPixel()));
+    SvxIconChoiceCtrlEntry* pEntry = GetEntry(aDocPos);
+    SetEntryHighlightFrame(pEntry);
     return true;
 }
 
diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx
index ba35056e7588..4566ad1310b9 100644
--- a/vcl/source/control/ivctrl.cxx
+++ b/vcl/source/control/ivctrl.cxx
@@ -369,7 +369,7 @@ struct VerticalTabPageData
 VerticalTabControl::VerticalTabControl(vcl::Window* pParent, bool bWithIcons)
     : VclHBox(pParent)
     , m_xChooser(VclPtr<SvtIconChoiceCtrl>::Create(this, WB_3DLOOK | 
(bWithIcons ?  WB_ICON : WB_DETAILS) | WB_BORDER |
-                                                         WB_NOCOLUMNHEADER | 
WB_HIGHLIGHTFRAME |
+                                                         WB_NOCOLUMNHEADER |
                                                          WB_NODRAGSELECTION | 
WB_TABSTOP | WB_CLIPCHILDREN |
                                                          WB_NOHSCROLL))
     , m_xBox(VclPtr<VclVBox>::Create(this))

Reply via email to