[Libreoffice-commits] core.git: 2 commits - svtools/source vcl/source

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Fri May 29 00:59:32 PDT 2015


 svtools/source/contnr/imivctl1.cxx       |   12 ++++--------
 vcl/source/window/menubarwindow.cxx      |    5 +++++
 vcl/source/window/menufloatingwindow.cxx |    5 +++++
 3 files changed, 14 insertions(+), 8 deletions(-)

New commits:
commit 9ce71b67f705ccbc6df327d1bb181ca20b3ed17f
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Fri May 29 16:56:15 2015 +0900

    menu: call ApplySettings on places that InitSettings was called
    
    Change-Id: I5519cf6a8e77a7da27fa883f2f7695ae4371af88

diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx
index 1f690fc..3a5d8fb 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -990,6 +990,7 @@ void MenuBarWindow::StateChanged( StateChangedType nType )
     if (nType == StateChangedType::ControlForeground ||
         nType == StateChangedType::ControlBackground)
     {
+        ApplySettings(*this);
         Invalidate();
     }
     else if(pMenu)
@@ -1003,6 +1004,8 @@ void MenuBarWindow::LayoutChanged()
     if (!pMenu)
         return;
 
+    ApplySettings(*this);
+
     // if the font was changed.
     long nHeight = pMenu->ImplCalcSize(this).Height();
 
@@ -1023,6 +1026,7 @@ void MenuBarWindow::LayoutChanged()
 
 void MenuBarWindow::ApplySettings(vcl::RenderContext& rRenderContext)
 {
+    Window::ApplySettings(rRenderContext);
     const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
 
     SetPointFont(rRenderContext, rStyleSettings.GetMenuFont());
@@ -1083,6 +1087,7 @@ void MenuBarWindow::DataChanged( const DataChangedEvent& rDCEvt )
          ((rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
           (rDCEvt.GetFlags() & AllSettingsFlags::STYLE)) )
     {
+        ApplySettings(*this);
         ImplInitStyleSettings();
         LayoutChanged();
     }
diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx
index a4b70b4..cd92d11 100644
--- a/vcl/source/window/menufloatingwindow.cxx
+++ b/vcl/source/window/menufloatingwindow.cxx
@@ -46,6 +46,7 @@ MenuFloatingWindow::MenuFloatingWindow( Menu* pMen, vcl::Window* pParent, WinBit
     bKeyInput           = false;
 
     EnableSaveBackground();
+    ApplySettings(*this);
 
     SetPopupModeEndHdl( LINK( this, MenuFloatingWindow, PopupEnd ) );
 
@@ -120,6 +121,8 @@ void MenuFloatingWindow::Resize()
 
 void MenuFloatingWindow::ApplySettings(vcl::RenderContext& rRenderContext)
 {
+    FloatingWindow::ApplySettings(rRenderContext);
+
     const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
 
     SetPointFont(rRenderContext, rStyleSettings.GetMenuFont());
@@ -1214,6 +1217,7 @@ void MenuFloatingWindow::StateChanged( StateChangedType nType )
 
     if ( ( nType == StateChangedType::ControlForeground ) || ( nType == StateChangedType::ControlBackground ) )
     {
+        ApplySettings(*this);
         Invalidate();
     }
 }
@@ -1227,6 +1231,7 @@ void MenuFloatingWindow::DataChanged( const DataChangedEvent& rDCEvt )
          ((rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
           (rDCEvt.GetFlags() & AllSettingsFlags::STYLE)) )
     {
+        ApplySettings(*this);
         Invalidate();
     }
 }
commit b0922150c2b3a63b810af5adda2770f270185a61
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Fri May 29 16:54:48 2015 +0900

    tdf#91677 fix invidsible menu in Base
    
    Change-Id: Ie1a8d6125d4a9d67f06f7dc37aa4d5115ad1af28

diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index c19c9cb..53fe772 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -655,10 +655,6 @@ void SvxIconChoiceCtrl_Impl::Paint(vcl::RenderContext& rRenderContext, const Rec
             pCursor = aEntries[ 0 ];
     }
 
-    // Show Focus at Init-Time
-    if (pView->HasFocus())
-        GetFocus();
-
     size_t nCount = pZOrderList->size();
     if (!nCount)
         return;
@@ -1642,20 +1638,20 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po
     bool bDropTarget = pEntry->IsDropTarget();
     bool bNoEmphasis = pEntry->IsBlockingEmphasis();
 
-    vcl::Font aTempFont(rRenderContext.GetFont());
+    rRenderContext.Push(PushFlags::FONT | PushFlags::TEXTCOLOR);
 
     OUString aEntryText(SvtIconChoiceCtrl::GetEntryText(pEntry, false));
     Rectangle aTextRect(CalcTextRect(pEntry, &rPos, false, &aEntryText));
     Rectangle aBmpRect(CalcBmpRect(pEntry, &rPos));
 
-    bool bShowSelection = (((bSelected && !bCursored) || bDropTarget) && !bNoEmphasis && (eSelectionMode != NO_SELECTION));
+    bool bShowSelection = ((bSelected && !bCursored) && !bNoEmphasis && (eSelectionMode != NO_SELECTION));
 
     bool bActiveSelection = (0 != (nWinBits & WB_NOHIDESELECTION)) || pView->HasFocus();
 
     if (bShowSelection)
     {
         const StyleSettings& rSettings = rRenderContext.GetSettings().GetStyleSettings();
-        vcl::Font aNewFont(aTempFont);
+        vcl::Font aNewFont(rRenderContext.GetFont());
 
         // font fill colors that are attributed "hard" need corresponding "hard"
         // attributed highlight colors
@@ -1710,7 +1706,7 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po
     if (pEntry == pCurHighlightFrame && !bNoEmphasis)
         DrawHighlightFrame(rRenderContext, CalcFocusRect(pEntry), false);
 
-    rRenderContext.SetFont(aTempFont);
+    rRenderContext.Pop();
     if (bResetClipRegion)
         rRenderContext.SetClipRegion();
 }


More information about the Libreoffice-commits mailing list