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 )
pMenu = pMen;
KillActivePopup();
nHighlightedItem = ITEMPOS_INVALID;
ImplInitMenuWindow(this, true, true);
if (pMen)
{
aCloseBtn->ShowItem(IID_DOCUMENTCLOSE, pMen->HasCloseButton());
......@@ -991,7 +990,6 @@ void MenuBarWindow::StateChanged( StateChangedType nType )
if (nType == StateChangedType::ControlForeground ||
nType == StateChangedType::ControlBackground)
{
ImplInitMenuWindow(this, false, true);
Invalidate();
}
else if(pMenu)
......@@ -1005,8 +1003,6 @@ void MenuBarWindow::LayoutChanged()
if (!pMenu)
return;
ImplInitMenuWindow(this, true, true);
// if the font was changed.
long nHeight = pMenu->ImplCalcSize(this).Height();
......
......@@ -46,7 +46,6 @@ MenuFloatingWindow::MenuFloatingWindow( Menu* pMen, vcl::Window* pParent, WinBit
bKeyInput = false;
EnableSaveBackground();
ImplInitMenuWindow( this, true, false );
SetPopupModeEndHdl( LINK( this, MenuFloatingWindow, PopupEnd ) );
......@@ -1176,7 +1175,6 @@ void MenuFloatingWindow::StateChanged( StateChangedType nType )
if ( ( nType == StateChangedType::ControlForeground ) || ( nType == StateChangedType::ControlBackground ) )
{
ImplInitMenuWindow( this, false, false );
Invalidate();
}
}
......@@ -1190,7 +1188,6 @@ void MenuFloatingWindow::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
(rDCEvt.GetFlags() & AllSettingsFlags::STYLE)) )
{
ImplInitMenuWindow( this, false, false );
Invalidate();
}
}
......@@ -1202,18 +1199,17 @@ void MenuFloatingWindow::Command( const CommandEvent& rCEvt )
const CommandWheelData* pData = rCEvt.GetWheelData();
if( !pData->GetModifier() && ( pData->GetMode() == CommandWheelMode::SCROLL ) )
{
// ImplCursorUpDown( pData->GetDelta() > 0L );
ImplScroll( pData->GetDelta() > 0L );
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();
return xAcc;
......
......@@ -26,57 +26,6 @@
#include <vcl/svapp.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 )
{
AllSettings aAllSettings( pWindow->GetSettings() );
......
......@@ -53,9 +53,6 @@ class MenuWindow
public:
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.
static bool ImplHandleHelpEvent(vcl::Window* pMenuWindow, Menu* pMenu, sal_uInt16 nHighlightedItem,
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