summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-05-17 22:56:46 +0900
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-05-18 11:22:49 +0900
commitb4bbb5e5d7b31caad2fbcc00382ad27df3c81001 (patch)
tree8ac345712ff92a9b33a7d54651ed27ad88f1ec67 /dbaccess
parent2ca7795a6a723c701f295323fcc3f6c52ad37976 (diff)
refactor how font, fg. and bg. are applied in widgets/controls
- Move vcl::RenderContext to outdev. - Change some methods on vcl::Window to accept RenderContext as parameter. - Add ApplySettings to vcl::Window - This method is called before painting. Refactor existing classes that use InitSettings to have ApplySettings or mark the classes to be refactored later. - Add RenderSettings for adding defered settings to rendering. This is similar to ApplySettings but for more ad-hoc calls. Change-Id: I4ea58461f3b6b08ccfa3e0ddd1a4a3e04f8c4f45
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.cxx11
-rw-r--r--dbaccess/source/ui/app/AppDetailView.cxx6
-rw-r--r--dbaccess/source/ui/app/AppSwapWindow.cxx3
-rw-r--r--dbaccess/source/ui/app/AppTitleWindow.cxx3
-rw-r--r--dbaccess/source/ui/app/AppView.cxx6
-rw-r--r--dbaccess/source/ui/control/VertSplitView.cxx3
-rw-r--r--dbaccess/source/ui/querydesign/JoinTableView.cxx3
-rw-r--r--dbaccess/source/ui/querydesign/TableWindow.cxx4
-rw-r--r--dbaccess/source/ui/querydesign/TableWindowTitle.cxx2
-rw-r--r--dbaccess/source/ui/tabledesign/TableDesignView.cxx4
10 files changed, 30 insertions, 15 deletions
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index 44284fbb8f0b..c3dc8ef4a089 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -164,13 +164,14 @@ namespace
}
void OTablePreviewWindow::ImplInitSettings( bool bFont, bool bForeground, bool bBackground )
{
+ //FIXME RenderContext
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if( bFont )
{
vcl::Font aFont;
aFont = rStyleSettings.GetFieldFont();
aFont.SetColor( rStyleSettings.GetWindowTextColor() );
- SetPointFont( aFont );
+ SetPointFont(*this, aFont);
}
if( bForeground || bFont )
@@ -1234,12 +1235,13 @@ void OAppDetailPageHelper::DataChanged( const DataChangedEvent& rDCEvt )
void OAppDetailPageHelper::ImplInitSettings()
{
+ // FIXME RenderContext
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
vcl::Font aFont;
aFont = rStyleSettings.GetFieldFont();
aFont.SetColor( rStyleSettings.GetWindowTextColor() );
- SetPointFont( aFont );
- m_aTBPreview->SetPointFont( aFont );
+ SetPointFont(*this, aFont);
+ m_aTBPreview->SetPointFont(*m_aTBPreview, aFont);
SetTextColor( rStyleSettings.GetFieldTextColor() );
SetTextFillColor();
@@ -1324,13 +1326,14 @@ void OPreviewWindow::DataChanged( const DataChangedEvent& rDCEvt )
void OPreviewWindow::ImplInitSettings( bool bFont, bool bForeground, bool bBackground )
{
+ // FIXME RenderContext
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if( bFont )
{
vcl::Font aFont;
aFont = rStyleSettings.GetFieldFont();
aFont.SetColor( rStyleSettings.GetWindowTextColor() );
- SetPointFont( aFont );
+ SetPointFont(*this, aFont);
}
if( bForeground || bFont )
diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx
index c547945aee5b..bd4ba2f048c0 100644
--- a/dbaccess/source/ui/app/AppDetailView.cxx
+++ b/dbaccess/source/ui/app/AppDetailView.cxx
@@ -391,13 +391,14 @@ void OTasksWindow::DataChanged( const DataChangedEvent& rDCEvt )
void OTasksWindow::ImplInitSettings( bool bFont, bool bForeground, bool bBackground )
{
+ // FIXME RenderContext
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if( bFont )
{
vcl::Font aFont;
aFont = rStyleSettings.GetFieldFont();
aFont.SetColor( rStyleSettings.GetWindowTextColor() );
- SetPointFont( aFont );
+ SetPointFont(*this, aFont);
}
if( bForeground || bFont )
@@ -581,13 +582,14 @@ void OApplicationDetailView::dispose()
void OApplicationDetailView::ImplInitSettings( bool bFont, bool bForeground, bool bBackground )
{
+ // FIXME RenderContext
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if( bFont )
{
vcl::Font aFont;
aFont = rStyleSettings.GetFieldFont();
aFont.SetColor( rStyleSettings.GetWindowTextColor() );
- SetPointFont( aFont );
+ SetPointFont(*this, aFont);
}
if( bForeground || bFont )
diff --git a/dbaccess/source/ui/app/AppSwapWindow.cxx b/dbaccess/source/ui/app/AppSwapWindow.cxx
index 37df4725692a..05f9a06fc459 100644
--- a/dbaccess/source/ui/app/AppSwapWindow.cxx
+++ b/dbaccess/source/ui/app/AppSwapWindow.cxx
@@ -77,13 +77,14 @@ void OApplicationSwapWindow::Resize()
void OApplicationSwapWindow::ImplInitSettings( bool bFont, bool bForeground, bool bBackground )
{
+ // FIXME RenderContext
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if( bFont )
{
vcl::Font aFont;
aFont = rStyleSettings.GetFieldFont();
aFont.SetColor( rStyleSettings.GetWindowTextColor() );
- SetPointFont( aFont );
+ SetPointFont(*this, aFont);
}
if( bForeground || bFont )
diff --git a/dbaccess/source/ui/app/AppTitleWindow.cxx b/dbaccess/source/ui/app/AppTitleWindow.cxx
index 71317b01a82b..1a28fb789703 100644
--- a/dbaccess/source/ui/app/AppTitleWindow.cxx
+++ b/dbaccess/source/ui/app/AppTitleWindow.cxx
@@ -134,6 +134,7 @@ void OTitleWindow::DataChanged( const DataChangedEvent& rDCEvt )
void OTitleWindow::ImplInitSettings( bool bFont, bool bForeground, bool bBackground )
{
+ // FIXME RenderContext
AllSettings aAllSettings = GetSettings();
StyleSettings aStyle = aAllSettings.GetStyleSettings();
aStyle.SetMonoColor(aStyle.GetActiveBorderColor());//GetMenuBorderColor());
@@ -146,7 +147,7 @@ void OTitleWindow::ImplInitSettings( bool bFont, bool bForeground, bool bBackgro
vcl::Font aFont;
aFont = rStyleSettings.GetFieldFont();
aFont.SetColor( rStyleSettings.GetWindowTextColor() );
- SetPointFont( aFont );
+ SetPointFont(*this, aFont);
}
if( bForeground || bFont )
diff --git a/dbaccess/source/ui/app/AppView.cxx b/dbaccess/source/ui/app/AppView.cxx
index 8947c9e21c40..4c56fa87ba3f 100644
--- a/dbaccess/source/ui/app/AppView.cxx
+++ b/dbaccess/source/ui/app/AppView.cxx
@@ -150,13 +150,14 @@ void OAppBorderWindow::DataChanged( const DataChangedEvent& rDCEvt )
void OAppBorderWindow::ImplInitSettings()
{
+ // FIXME RenderContext
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if( true )
{
vcl::Font aFont;
aFont = rStyleSettings.GetFieldFont();
aFont.SetColor( rStyleSettings.GetWindowTextColor() );
- SetPointFont( aFont );
+ SetPointFont(*this, aFont);
}
if( true )
@@ -548,13 +549,14 @@ void OApplicationView::_disposing( const ::com::sun::star::lang::EventObject& /*
void OApplicationView::ImplInitSettings()
{
+ // FIXME RenderContext
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if( true )
{
vcl::Font aFont;
aFont = rStyleSettings.GetFieldFont();
aFont.SetColor( rStyleSettings.GetWindowTextColor() );
- SetPointFont( aFont );
+ SetPointFont(*this, aFont);
}
if( true )
diff --git a/dbaccess/source/ui/control/VertSplitView.cxx b/dbaccess/source/ui/control/VertSplitView.cxx
index 5644fbbaf4bf..469536b9af6f 100644
--- a/dbaccess/source/ui/control/VertSplitView.cxx
+++ b/dbaccess/source/ui/control/VertSplitView.cxx
@@ -67,6 +67,7 @@ IMPL_LINK( OSplitterView, SplitHdl, Splitter*, /*pSplit*/ )
void OSplitterView::ImplInitSettings( bool bFont, bool bForeground, bool bBackground )
{
+ // FIXME RenderContext
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
if ( bFont )
@@ -74,7 +75,7 @@ void OSplitterView::ImplInitSettings( bool bFont, bool bForeground, bool bBackgr
vcl::Font aFont = rStyleSettings.GetAppFont();
if ( IsControlFont() )
aFont.Merge( GetControlFont() );
- SetPointFont( aFont );
+ SetPointFont(*this, aFont);
// Set/*Zoomed*/PointFont( aFont );
}
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index 16879ed1b1d9..e444861d5b77 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -1464,6 +1464,7 @@ void OJoinTableView::StateChanged( StateChangedType nType )
{
Window::StateChanged( nType );
+ // FIXME RenderContext
if ( nType == StateChangedType::Zoom )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -1471,7 +1472,7 @@ void OJoinTableView::StateChanged( StateChangedType nType )
vcl::Font aFont = rStyleSettings.GetGroupFont();
if ( IsControlFont() )
aFont.Merge( GetControlFont() );
- SetZoomedPointFont( aFont );
+ SetZoomedPointFont(*this, aFont);
OTableWindowMap::iterator aIter = m_aTableMap.begin();
OTableWindowMap::iterator aEnd = m_aTableMap.end();
diff --git a/dbaccess/source/ui/querydesign/TableWindow.cxx b/dbaccess/source/ui/querydesign/TableWindow.cxx
index fefb91da63ee..971ff21bf21f 100644
--- a/dbaccess/source/ui/querydesign/TableWindow.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindow.cxx
@@ -560,6 +560,8 @@ void OTableWindow::StateChanged( StateChangedType nType )
{
Window::StateChanged( nType );
+ // FIXME RenderContext
+
if ( nType == StateChangedType::Zoom )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -567,7 +569,7 @@ void OTableWindow::StateChanged( StateChangedType nType )
vcl::Font aFont = rStyleSettings.GetGroupFont();
if ( IsControlFont() )
aFont.Merge( GetControlFont() );
- SetZoomedPointFont( aFont );
+ SetZoomedPointFont(*this, aFont);
m_aTitle->SetZoom(GetZoom());
m_pListBox->SetZoom(GetZoom());
diff --git a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx
index 2cb3efea4629..8adf24f934d2 100644
--- a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx
@@ -182,7 +182,7 @@ void OTableWindowTitle::StateChanged( StateChangedType nType )
vcl::Font aFont = rStyleSettings.GetGroupFont();
if ( IsControlFont() )
aFont.Merge( GetControlFont() );
- SetZoomedPointFont( aFont );
+ SetZoomedPointFont(*this, aFont);
Resize();
}
diff --git a/dbaccess/source/ui/tabledesign/TableDesignView.cxx b/dbaccess/source/ui/tabledesign/TableDesignView.cxx
index 9b5598f11a9b..90e012ff5d93 100644
--- a/dbaccess/source/ui/tabledesign/TableDesignView.cxx
+++ b/dbaccess/source/ui/tabledesign/TableDesignView.cxx
@@ -119,12 +119,14 @@ void OTableBorderWindow::ImplInitSettings( bool bFont, bool bForeground, bool bB
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ // FIXME RenderContext
+
if ( bFont )
{
vcl::Font aFont = rStyleSettings.GetAppFont();
if ( IsControlFont() )
aFont.Merge( GetControlFont() );
- SetPointFont( aFont );
+ SetPointFont(*this, aFont);
}
if ( bFont || bForeground )