summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Knorr (astron) <heinzlesspam@gmail.com>2012-05-02 16:33:59 +0200
committerNorbert Thiebaud <nthiebaud@gmail.com>2012-05-27 04:27:32 -0500
commit072e4f9869f88019145cd75af7612b2e00a7046f (patch)
tree0c0ba90e22426a8b2c469a46d328415bf63aca48
parentd1dd475389b798e99d09f2dd9f1b52341bb610a0 (diff)
Use normal font in tab headers
-rw-r--r--vcl/aqua/source/app/salinst.cxx1
-rw-r--r--vcl/inc/svdata.hxx1
-rw-r--r--vcl/inc/vcl/tabctrl.hxx1
-rw-r--r--vcl/ios/source/app/salinst.cxx1
-rw-r--r--vcl/source/control/tabctrl.cxx31
5 files changed, 1 insertions, 34 deletions
diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index 794dd840078f..f8a883528804 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -448,7 +448,6 @@ SalInstance* CreateSalInstance()
SalData::ensureThreadAutoreleasePool();
// no focus rects on NWF aqua
ImplGetSVData()->maNWFData.mbNoFocusRects = true;
- ImplGetSVData()->maNWFData.mbNoBoldTabFocus = true;
ImplGetSVData()->maNWFData.mbNoActiveTabTextRaise = true;
ImplGetSVData()->maNWFData.mbCenteredTabs = true;
ImplGetSVData()->maNWFData.mbProgressNeedsErase = true;
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index 08c165de5bc4..a0f610dd3be5 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -314,7 +314,6 @@ struct ImplSVNWFData
bool mbTransparentMenubar:1; //< keep the background of the menubar transparent; needed for the Aero theme
bool mbOpenMenuOnF10:1; // on gnome the first menu opens on F10
bool mbNoFocusRects:1; // on Aqua focus rects are not used
- bool mbNoBoldTabFocus:1; // on Aqua and Gnome the focused tab has not bold text
bool mbCenteredTabs:1; // on Aqua, tabs are centered
bool mbNoActiveTabTextRaise:1; // on Aqua the text for the selected tab
// should not "jump up" a pixel
diff --git a/vcl/inc/vcl/tabctrl.hxx b/vcl/inc/vcl/tabctrl.hxx
index fd064dbe7948..c9d858310dca 100644
--- a/vcl/inc/vcl/tabctrl.hxx
+++ b/vcl/inc/vcl/tabctrl.hxx
@@ -68,7 +68,6 @@ private:
sal_Bool mbRestoreHelpId;
sal_Bool mbRestoreUnqId;
sal_Bool mbSmallInvalidate;
- sal_Bool mbExtraSpace;
Link maActivateHdl;
Link maDeactivateHdl;
diff --git a/vcl/ios/source/app/salinst.cxx b/vcl/ios/source/app/salinst.cxx
index e3747c23da22..5536538dabd9 100644
--- a/vcl/ios/source/app/salinst.cxx
+++ b/vcl/ios/source/app/salinst.cxx
@@ -314,7 +314,6 @@ SalInstance* CreateSalInstance()
SalData::ensureThreadAutoreleasePool();
// no focus rects on NWF ios
ImplGetSVData()->maNWFData.mbNoFocusRects = true;
- ImplGetSVData()->maNWFData.mbNoBoldTabFocus = true;
ImplGetSVData()->maNWFData.mbNoActiveTabTextRaise = true;
ImplGetSVData()->maNWFData.mbCenteredTabs = true;
ImplGetSVData()->maNWFData.mbProgressNeedsErase = true;
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index fb73946a68b7..0bf541d7f908 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -121,7 +121,6 @@ void TabControl::ImplInit( Window* pParent, WinBits nStyle )
mbRestoreHelpId = sal_False;
mbRestoreUnqId = sal_False;
mbSmallInvalidate = sal_False;
- mbExtraSpace = sal_False;
mpTabCtrlData = new ImplTabCtrlData;
mpTabCtrlData->mpListBox = NULL;
@@ -326,12 +325,9 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth )
return aContentRgn.GetSize();
}
- // For systems without synthetic bold support
- if ( mbExtraSpace )
- aSize.Width() += TAB_EXTRASPACE_X;
// For languages with short names (e.g. Chinese), because the space is
// normally only one pixel per char
- else if ( pItem->maFormatText.Len() < TAB_EXTRASPACE_X )
+ if ( pItem->maFormatText.Len() < TAB_EXTRASPACE_X )
aSize.Width() += TAB_EXTRASPACE_X-pItem->maFormatText.Len();
// Evt. den Text kuerzen
@@ -407,22 +403,8 @@ Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, long nHe
if ( mbFormat || (mnLastWidth != nWidth) || (mnLastHeight != nHeight) )
{
Font aFont( GetFont() );
- Font aLightFont = aFont;
aFont.SetTransparent( sal_True );
- aFont.SetWeight( (!ImplGetSVData()->maNWFData.mbNoBoldTabFocus) ? WEIGHT_BOLD : WEIGHT_LIGHT );
- aLightFont.SetTransparent( sal_True );
- aLightFont.SetWeight( WEIGHT_LIGHT );
-
- // If Bold and none Bold strings have the same width, we
- // add in the calcultion extra space, so that the tabs
- // looks better. The could be the case on systems without
- // an bold UI font and without synthetic bold support
- XubString aTestStr( RTL_CONSTASCII_USTRINGPARAM( "Abc." ) );
- SetFont( aLightFont );
- long nTextWidth1 = GetTextWidth( aTestStr );
SetFont( aFont );
- long nTextWidth2 = GetTextWidth( aTestStr );
- mbExtraSpace = (nTextWidth1 == nTextWidth2);
Size aSize;
const long nOffsetX = 2 + GetItemsOffset().X();
@@ -720,14 +702,6 @@ void TabControl::ImplShowFocus()
if ( !GetPageCount() || mpTabCtrlData->mpListBox )
return;
- // make sure the focussed item rect is computed using a bold font
- // the font may have changed meanwhile due to mouse over
-
- Font aOldFont( GetFont() );
- Font aFont( aOldFont );
- aFont.SetWeight( (!ImplGetSVData()->maNWFData.mbNoBoldTabFocus) ? WEIGHT_BOLD : WEIGHT_LIGHT );
- SetFont( aFont );
-
sal_uInt16 nCurPos = GetPagePos( mnCurPageId );
Rectangle aRect = ImplGetTabRect( nCurPos );
const ImplTabItem& rItem = mpTabCtrlData->maItemList[ nCurPos ];
@@ -771,8 +745,6 @@ void TabControl::ImplShowFocus()
aRect.Bottom() = aRect.Top() + aImageSize.Height() + 4;
}
ShowFocus( aRect );
-
- SetFont( aOldFont );
}
// -----------------------------------------------------------------------
@@ -939,7 +911,6 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
// we set the font attributes always before drawing to be re-entrant (DrawNativeControl may trigger additional paints)
Font aFont( GetFont() );
aFont.SetTransparent( sal_True );
- aFont.SetWeight( ((bIsCurrentItem) && (!ImplGetSVData()->maNWFData.mbNoBoldTabFocus)) ? WEIGHT_BOLD : WEIGHT_LIGHT );
SetFont( aFont );
Size aTabSize = aRect.GetSize();