Kaydet (Commit) 7cc23494 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

remove ImplInitMenuWindow as ApplySettings set it up instead

Change-Id: I9086d36e254d3705bfc60ad9f01c09943f915c09
üst 24945eaa
...@@ -187,7 +187,6 @@ void MenuBarWindow::SetMenu( MenuBar* pMen ) ...@@ -187,7 +187,6 @@ void MenuBarWindow::SetMenu( MenuBar* pMen )
pMenu = pMen; pMenu = pMen;
KillActivePopup(); KillActivePopup();
nHighlightedItem = ITEMPOS_INVALID; nHighlightedItem = ITEMPOS_INVALID;
ImplInitMenuWindow(this, true, true);
if (pMen) if (pMen)
{ {
aCloseBtn->ShowItem(IID_DOCUMENTCLOSE, pMen->HasCloseButton()); aCloseBtn->ShowItem(IID_DOCUMENTCLOSE, pMen->HasCloseButton());
...@@ -991,7 +990,6 @@ void MenuBarWindow::StateChanged( StateChangedType nType ) ...@@ -991,7 +990,6 @@ void MenuBarWindow::StateChanged( StateChangedType nType )
if (nType == StateChangedType::ControlForeground || if (nType == StateChangedType::ControlForeground ||
nType == StateChangedType::ControlBackground) nType == StateChangedType::ControlBackground)
{ {
ImplInitMenuWindow(this, false, true);
Invalidate(); Invalidate();
} }
else if(pMenu) else if(pMenu)
...@@ -1005,8 +1003,6 @@ void MenuBarWindow::LayoutChanged() ...@@ -1005,8 +1003,6 @@ void MenuBarWindow::LayoutChanged()
if (!pMenu) if (!pMenu)
return; return;
ImplInitMenuWindow(this, true, true);
// if the font was changed. // if the font was changed.
long nHeight = pMenu->ImplCalcSize(this).Height(); long nHeight = pMenu->ImplCalcSize(this).Height();
......
...@@ -46,7 +46,6 @@ MenuFloatingWindow::MenuFloatingWindow( Menu* pMen, vcl::Window* pParent, WinBit ...@@ -46,7 +46,6 @@ MenuFloatingWindow::MenuFloatingWindow( Menu* pMen, vcl::Window* pParent, WinBit
bKeyInput = false; bKeyInput = false;
EnableSaveBackground(); EnableSaveBackground();
ImplInitMenuWindow( this, true, false );
SetPopupModeEndHdl( LINK( this, MenuFloatingWindow, PopupEnd ) ); SetPopupModeEndHdl( LINK( this, MenuFloatingWindow, PopupEnd ) );
...@@ -1176,7 +1175,6 @@ void MenuFloatingWindow::StateChanged( StateChangedType nType ) ...@@ -1176,7 +1175,6 @@ void MenuFloatingWindow::StateChanged( StateChangedType nType )
if ( ( nType == StateChangedType::ControlForeground ) || ( nType == StateChangedType::ControlBackground ) ) if ( ( nType == StateChangedType::ControlForeground ) || ( nType == StateChangedType::ControlBackground ) )
{ {
ImplInitMenuWindow( this, false, false );
Invalidate(); Invalidate();
} }
} }
...@@ -1190,7 +1188,6 @@ void MenuFloatingWindow::DataChanged( const DataChangedEvent& rDCEvt ) ...@@ -1190,7 +1188,6 @@ void MenuFloatingWindow::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DataChangedEventType::SETTINGS) && ((rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
(rDCEvt.GetFlags() & AllSettingsFlags::STYLE)) ) (rDCEvt.GetFlags() & AllSettingsFlags::STYLE)) )
{ {
ImplInitMenuWindow( this, false, false );
Invalidate(); Invalidate();
} }
} }
...@@ -1202,18 +1199,17 @@ void MenuFloatingWindow::Command( const CommandEvent& rCEvt ) ...@@ -1202,18 +1199,17 @@ void MenuFloatingWindow::Command( const CommandEvent& rCEvt )
const CommandWheelData* pData = rCEvt.GetWheelData(); const CommandWheelData* pData = rCEvt.GetWheelData();
if( !pData->GetModifier() && ( pData->GetMode() == CommandWheelMode::SCROLL ) ) if( !pData->GetModifier() && ( pData->GetMode() == CommandWheelMode::SCROLL ) )
{ {
// ImplCursorUpDown( pData->GetDelta() > 0L );
ImplScroll( pData->GetDelta() > 0L ); ImplScroll( pData->GetDelta() > 0L );
MouseMove( MouseEvent( GetPointerPosPixel(), 0 ) ); MouseMove( MouseEvent( GetPointerPosPixel(), 0 ) );
} }
} }
} }
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > MenuFloatingWindow::CreateAccessible() css::uno::Reference<css::accessibility::XAccessible> MenuFloatingWindow::CreateAccessible()
{ {
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc; css::uno::Reference<css::accessibility::XAccessible> xAcc;
if ( pMenu && !pMenu->pStartedFrom ) if (pMenu && !pMenu->pStartedFrom)
xAcc = pMenu->GetAccessible(); xAcc = pMenu->GetAccessible();
return xAcc; return xAcc;
......
...@@ -26,57 +26,6 @@ ...@@ -26,57 +26,6 @@
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <vcl/window.hxx> #include <vcl/window.hxx>
void MenuWindow::ImplInitMenuWindow(vcl::Window* pWin, bool bFont, bool bMenuBar)
{
const StyleSettings& rStyleSettings = pWin->GetSettings().GetStyleSettings();
// FIXME RenderContext
if (bFont)
pWin->SetPointFont(*pWin, rStyleSettings.GetMenuFont());
if( bMenuBar )
{
const BitmapEx& rPersonaBitmap = Application::GetSettings().GetStyleSettings().GetPersonaHeader();
if ( !rPersonaBitmap.IsEmpty() )
{
Wallpaper aWallpaper( rPersonaBitmap );
aWallpaper.SetStyle( WALLPAPER_TOPRIGHT );
aWallpaper.SetColor( Application::GetSettings().GetStyleSettings().GetWorkspaceColor() );
pWin->SetBackground( aWallpaper );
pWin->SetPaintTransparent( false );
pWin->SetParentClipMode( 0 );
}
else if ( pWin->IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL ) )
{
pWin->SetBackground(); // background will be drawn by NWF
}
else
{
Wallpaper aWallpaper;
aWallpaper.SetStyle( WALLPAPER_APPLICATIONGRADIENT );
pWin->SetBackground( aWallpaper );
pWin->SetPaintTransparent( false );
pWin->SetParentClipMode( 0 );
}
}
else
{
if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL ) )
{
pWin->SetBackground(); // background will be drawn by NWF
}
else
pWin->SetBackground( Wallpaper( rStyleSettings.GetMenuColor() ) );
}
if ( bMenuBar )
pWin->SetTextColor( rStyleSettings.GetMenuBarTextColor() );
else
pWin->SetTextColor( rStyleSettings.GetMenuTextColor() );
pWin->SetTextFillColor();
pWin->SetLineColor();
}
static sal_uLong ImplChangeTipTimeout( sal_uLong nTimeout, vcl::Window *pWindow ) static sal_uLong ImplChangeTipTimeout( sal_uLong nTimeout, vcl::Window *pWindow )
{ {
AllSettings aAllSettings( pWindow->GetSettings() ); AllSettings aAllSettings( pWindow->GetSettings() );
......
...@@ -53,9 +53,6 @@ class MenuWindow ...@@ -53,9 +53,6 @@ class MenuWindow
public: public:
virtual ~MenuWindow() {} virtual ~MenuWindow() {}
/// Sets up some visual properties of the underlying window.
static void ImplInitMenuWindow(vcl::Window* pWin, bool bFont, bool bMenuBar);
/// Show the appropriate help tooltip. /// Show the appropriate help tooltip.
static bool ImplHandleHelpEvent(vcl::Window* pMenuWindow, Menu* pMenu, sal_uInt16 nHighlightedItem, static bool ImplHandleHelpEvent(vcl::Window* pMenuWindow, Menu* pMenu, sal_uInt16 nHighlightedItem,
const HelpEvent& rHEvt, const Rectangle &rHighlightRect); const HelpEvent& rHEvt, const Rectangle &rHighlightRect);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment