ditch the font/screen-scaling thing

its of limited utility wrt the vcl layout work and optimal size widgets,
and its confuses people looking for hidpi settings

Change-Id: I37d21b480446f9fe2845b3a2d9fd59cdeddf1a93
This commit is contained in:
Caolán McNamara
2016-07-10 16:13:16 +01:00
parent cc8ffd0f49
commit ec950f8ebb
13 changed files with 42 additions and 219 deletions

View File

@@ -619,7 +619,6 @@ OfaViewTabPage::OfaViewTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
, mpDrawinglayerOpt(new SvtOptionsDrawinglayer) , mpDrawinglayerOpt(new SvtOptionsDrawinglayer)
, mpOpenGLConfig(new svt::OpenGLCfg) , mpOpenGLConfig(new svt::OpenGLCfg)
{ {
get(m_pWindowSizeMF, "windowsize");
get(m_pIconSizeLB, "iconsize"); get(m_pIconSizeLB, "iconsize");
get(m_pSidebarIconSizeLB, "sidebariconsize"); get(m_pSidebarIconSizeLB, "sidebariconsize");
get(m_pIconStyleLB, "iconstyle"); get(m_pIconStyleLB, "iconstyle");
@@ -701,7 +700,6 @@ void OfaViewTabPage::dispose()
pCanvasSettings = nullptr; pCanvasSettings = nullptr;
delete pAppearanceCfg; delete pAppearanceCfg;
pAppearanceCfg = nullptr; pAppearanceCfg = nullptr;
m_pWindowSizeMF.clear();
m_pIconSizeLB.clear(); m_pIconSizeLB.clear();
m_pSidebarIconSizeLB.clear(); m_pSidebarIconSizeLB.clear();
m_pIconStyleLB.clear(); m_pIconStyleLB.clear();
@@ -795,17 +793,6 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
bool bAppearanceChanged = false; bool bAppearanceChanged = false;
// Screen Scaling
sal_uInt16 nOldScale = pAppearanceCfg->GetScaleFactor();
sal_uInt16 nNewScale = (sal_uInt16)m_pWindowSizeMF->GetValue();
if ( nNewScale != nOldScale )
{
pAppearanceCfg->SetScaleFactor(nNewScale);
bAppearanceChanged = true;
}
// Mouse Snap Mode // Mouse Snap Mode
SnapType eOldSnap = pAppearanceCfg->GetSnapMode(); SnapType eOldSnap = pAppearanceCfg->GetSnapMode();
SnapType eNewSnap = (SnapType)m_pMousePosLB->GetSelectEntryPos(); SnapType eNewSnap = (SnapType)m_pMousePosLB->GetSelectEntryPos();
@@ -941,8 +928,6 @@ void OfaViewTabPage::Reset( const SfxItemSet* )
m_pIconStyleLB->SelectEntryPos( nStyleLB_InitialSelection ); m_pIconStyleLB->SelectEntryPos( nStyleLB_InitialSelection );
m_pIconStyleLB->SaveValue(); m_pIconStyleLB->SaveValue();
// Screen Scaling
m_pWindowSizeMF->SetValue ( pAppearanceCfg->GetScaleFactor() );
// Mouse Snap // Mouse Snap
m_pMousePosLB->SelectEntryPos((sal_Int32)pAppearanceCfg->GetSnapMode()); m_pMousePosLB->SelectEntryPos((sal_Int32)pAppearanceCfg->GetSnapMode());
m_pMousePosLB->SaveValue(); m_pMousePosLB->SaveValue();

View File

@@ -79,7 +79,6 @@ class SvtTabAppearanceCfg;
class OfaViewTabPage : public SfxTabPage class OfaViewTabPage : public SfxTabPage
{ {
private: private:
VclPtr<MetricField> m_pWindowSizeMF;
VclPtr<ListBox> m_pIconSizeLB; VclPtr<ListBox> m_pIconSizeLB;
VclPtr<ListBox> m_pSidebarIconSizeLB; VclPtr<ListBox> m_pSidebarIconSizeLB;
VclPtr<ListBox> m_pIconStyleLB; VclPtr<ListBox> m_pIconStyleLB;

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.19.0 --> <!-- Generated with glade 3.20.0 -->
<interface> <interface>
<requires lib="gtk+" version="3.0"/> <requires lib="gtk+" version="3.0"/>
<object class="GtkAdjustment" id="adjustment1"> <object class="GtkAdjustment" id="adjustment1">
@@ -305,33 +305,6 @@
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="row_spacing">6</property> <property name="row_spacing">6</property>
<property name="column_spacing">12</property> <property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">Sc_aling:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">windowsize:0%</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="windowsize:0%">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="invisible_char">•</property>
<property name="adjustment">adjustment1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child> <child>
<object class="GtkLabel" id="label8"> <object class="GtkLabel" id="label8">
<property name="visible">True</property> <property name="visible">True</property>
@@ -343,7 +316,7 @@
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">1</property> <property name="top_attach">0</property>
</packing> </packing>
</child> </child>
<child> <child>
@@ -367,7 +340,7 @@
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="top_attach">3</property> <property name="top_attach">2</property>
</packing> </packing>
</child> </child>
<child> <child>
@@ -382,7 +355,7 @@
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="top_attach">1</property> <property name="top_attach">0</property>
</packing> </packing>
</child> </child>
<child> <child>
@@ -396,7 +369,7 @@
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">3</property> <property name="top_attach">2</property>
</packing> </packing>
</child> </child>
<child> <child>
@@ -411,7 +384,7 @@
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">4</property> <property name="top_attach">3</property>
<property name="width">2</property> <property name="width">2</property>
</packing> </packing>
</child> </child>
@@ -426,7 +399,7 @@
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">5</property> <property name="top_attach">4</property>
</packing> </packing>
</child> </child>
<child> <child>
@@ -439,7 +412,7 @@
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="top_attach">5</property> <property name="top_attach">4</property>
</packing> </packing>
</child> </child>
<child> <child>
@@ -453,7 +426,7 @@
</object> </object>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="top_attach">2</property> <property name="top_attach">1</property>
</packing> </packing>
</child> </child>
<child> <child>
@@ -468,7 +441,7 @@
</object> </object>
<packing> <packing>
<property name="left_attach">1</property> <property name="left_attach">1</property>
<property name="top_attach">2</property> <property name="top_attach">1</property>
</packing> </packing>
</child> </child>
</object> </object>

View File

@@ -41,7 +41,6 @@ enum class DragMode {
class SVT_DLLPUBLIC SvtTabAppearanceCfg : public utl::ConfigItem class SVT_DLLPUBLIC SvtTabAppearanceCfg : public utl::ConfigItem
{ {
DragMode nDragMode ; DragMode nDragMode ;
short nScaleFactor ;
SnapType nSnapMode ; SnapType nSnapMode ;
MouseMiddleButtonAction nMiddleMouse; MouseMiddleButtonAction nMiddleMouse;
#if defined( UNX ) #if defined( UNX )
@@ -66,9 +65,6 @@ public:
DragMode GetDragMode () const { return nDragMode; } DragMode GetDragMode () const { return nDragMode; }
sal_uInt16 GetScaleFactor () const { return nScaleFactor; }
void SetScaleFactor ( sal_uInt16 nSet );
SnapType GetSnapMode () const { return nSnapMode; } SnapType GetSnapMode () const { return nSnapMode; }
void SetSnapMode ( SnapType nSet ); void SetSnapMode ( SnapType nSet );

View File

@@ -501,12 +501,6 @@ public:
void SetCursorBlinkTime( sal_uInt64 nBlinkTime ); void SetCursorBlinkTime( sal_uInt64 nBlinkTime );
sal_uInt64 GetCursorBlinkTime() const; sal_uInt64 GetCursorBlinkTime() const;
void SetScreenZoom( sal_uInt16 nPercent );
sal_uInt16 GetScreenZoom() const;
void SetScreenFontZoom( sal_uInt16 nPercent );
sal_uInt16 GetScreenFontZoom() const;
void SetDragFullOptions( DragFullOptions nOptions ); void SetDragFullOptions( DragFullOptions nOptions );
DragFullOptions GetDragFullOptions() const; DragFullOptions GetDragFullOptions() const;

View File

@@ -2621,29 +2621,6 @@
<info> <info>
<desc>Contains window and dialog settings.</desc> <desc>Contains window and dialog settings.</desc>
</info> </info>
<prop oor:name="FontScaling" oor:type="xs:short" oor:nillable="false">
<!--OldPath: General/View -->
<!--OldLocation: soffice.cfg-->
<!--UIHints: Tools Options - General View [Section] Display-->
<info>
<desc>Specifies the scaling only of the screen representation
[UNIT=%].</desc>
<label>Scaling</label>
</info>
<constraints>
<minInclusive oor:value="50">
<info>
<desc>Specifies the minimum range of the scaling.</desc>
</info>
</minInclusive>
<maxInclusive oor:value="200">
<info>
<desc>Specifies the maximum range of the scaling.</desc>
</info>
</maxInclusive>
</constraints>
<value>100</value>
</prop>
<group oor:name="NewDocumentHandling"> <group oor:name="NewDocumentHandling">
<info> <info>
<desc>Contains settings to change new document window behavior.</desc> <desc>Contains settings to change new document window behavior.</desc>

View File

@@ -500,6 +500,8 @@ class ScGlobal
static ScFieldEditEngine* pFieldEditEngine; static ScFieldEditEngine* pFieldEditEngine;
static void InitPPT();
public: public:
static SvtSysLocale* pSysLocale; static SvtSysLocale* pSysLocale;
// for faster access a pointer to the single instance provided by SvtSysLocale // for faster access a pointer to the single instance provided by SvtSysLocale
@@ -556,8 +558,6 @@ public:
static void InitAddIns(); static void InitAddIns();
static void Clear(); // at the end of the program static void Clear(); // at the end of the program
static void UpdatePPT(OutputDevice* pDev);
static void InitTextHeight(SfxItemPool* pPool); static void InitTextHeight(SfxItemPool* pPool);
static SvxBrushItem* GetEmptyBrushItem() { return pEmptyBrushItem; } static SvxBrushItem* GetEmptyBrushItem() { return pEmptyBrushItem; }
static SvxBrushItem* GetButtonBrushItem(); static SvxBrushItem* GetButtonBrushItem();

View File

@@ -130,8 +130,6 @@ sal_uInt16 ScGlobal::nStdRowHeight = 256;
long ScGlobal::nLastRowHeightExtra = 0; long ScGlobal::nLastRowHeightExtra = 0;
long ScGlobal::nLastColWidthExtra = STD_EXTRA_WIDTH; long ScGlobal::nLastColWidthExtra = STD_EXTRA_WIDTH;
static sal_uInt16 nPPTZoom = 0; // ScreenZoom used to determine nScreenPPTX/Y
SfxViewShell* pScActiveViewShell = nullptr; //FIXME: Make this a member SfxViewShell* pScActiveViewShell = nullptr; //FIXME: Make this a member
sal_uInt16 nScClickMouseModifier = 0; //FIXME: This too sal_uInt16 nScClickMouseModifier = 0; //FIXME: This too
sal_uInt16 nScFillModeMouseModifier = 0; //FIXME: And this sal_uInt16 nScFillModeMouseModifier = 0; //FIXME: And this
@@ -521,7 +519,7 @@ void ScGlobal::Init()
pEmbeddedBrushItem = new SvxBrushItem( Color( COL_LIGHTCYAN ), ATTR_BACKGROUND ); pEmbeddedBrushItem = new SvxBrushItem( Color( COL_LIGHTCYAN ), ATTR_BACKGROUND );
pProtectedBrushItem = new SvxBrushItem( Color( COL_LIGHTGRAY ), ATTR_BACKGROUND ); pProtectedBrushItem = new SvxBrushItem( Color( COL_LIGHTGRAY ), ATTR_BACKGROUND );
UpdatePPT(nullptr); InitPPT();
//ScCompiler::InitSymbolsNative(); //ScCompiler::InitSymbolsNative();
// ScParameterClassification _after_ Compiler, needs function resources if // ScParameterClassification _after_ Compiler, needs function resources if
// arguments are to be merged in, which in turn need strings of function // arguments are to be merged in, which in turn need strings of function
@@ -536,23 +534,12 @@ void ScGlobal::Init()
// ScDocumentPool::InitVersionMaps() has been called earlier already // ScDocumentPool::InitVersionMaps() has been called earlier already
} }
void ScGlobal::UpdatePPT( OutputDevice* pDev ) void ScGlobal::InitPPT()
{ {
sal_uInt16 nCurrentZoom = Application::GetSettings().GetStyleSettings().GetScreenZoom(); OutputDevice* pDev = Application::GetDefaultDevice();
if ( nCurrentZoom != nPPTZoom ) Point aPix1000 = pDev->LogicToPixel( Point(100000,100000), MAP_TWIP );
{ nScreenPPTX = aPix1000.X() / 100000.0;
// Screen PPT values must be updated when ScreenZoom has changed. nScreenPPTY = aPix1000.Y() / 100000.0;
// If called from Window::DataChanged, the window is passed as pDev,
// to make sure LogicToPixel uses a device which already uses the new zoom.
// For the initial settings, NULL is passed and GetDefaultDevice used.
if ( !pDev )
pDev = Application::GetDefaultDevice();
Point aPix1000 = pDev->LogicToPixel( Point(100000,100000), MAP_TWIP );
nScreenPPTX = aPix1000.X() / 100000.0;
nScreenPPTY = aPix1000.Y() / 100000.0;
nPPTZoom = nCurrentZoom;
}
} }
const OUString& ScGlobal::GetClipDocName() const OUString& ScGlobal::GetClipDocName()

View File

@@ -1905,8 +1905,6 @@ void ScGridWindow::DataChanged( const DataChangedEvent& rDCEvt )
{ {
ScTabView* pView = pViewData->GetView(); ScTabView* pView = pViewData->GetView();
// update scale in case the UI ScreenZoom has changed
ScGlobal::UpdatePPT(this);
pView->RecalcPPT(); pView->RecalcPPT();
// RepeatResize in case scroll bar sizes have changed // RepeatResize in case scroll bar sizes have changed

View File

@@ -749,20 +749,6 @@ void Window::DataChanged( const DataChangedEvent& rDCEvt )
if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
(rDCEvt.GetFlags() & AllSettingsFlags::STYLE) ) (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) )
{ {
// When the screen zoom factor has changed then reset the zoom
// factor of the frame to always display the whole page.
const AllSettings* pOldSettings = rDCEvt.GetOldSettings ();
const AllSettings& rNewSettings = GetSettings ();
if (pOldSettings && mpViewShell)
{
if (pOldSettings->GetStyleSettings().GetScreenZoom()
!= rNewSettings.GetStyleSettings().GetScreenZoom())
{
mpViewShell->GetViewFrame()->GetDispatcher()->
Execute(SID_SIZE_PAGE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD);
}
}
/* Rearrange or initiate Resize for scroll bars since the size of /* Rearrange or initiate Resize for scroll bars since the size of
the scroll bars my have changed. Within this, inside the resize- the scroll bars my have changed. Within this, inside the resize-
handler, the size of the scroll bars will be asked from the handler, the size of the scroll bars will be asked from the

View File

@@ -28,7 +28,6 @@
#define DEFAULT_DRAGMODE DragMode::SystemDep #define DEFAULT_DRAGMODE DragMode::SystemDep
#define DEFAULT_SNAPMODE SnapType::ToButton #define DEFAULT_SNAPMODE SnapType::ToButton
#define DEFAULT_SCALEFACTOR 100
#if defined UNX #if defined UNX
#define DEFAULT_AAMINHEIGHT 8 #define DEFAULT_AAMINHEIGHT 8
#endif #endif
@@ -40,7 +39,6 @@ bool SvtTabAppearanceCfg::bInitialized = false;
SvtTabAppearanceCfg::SvtTabAppearanceCfg() SvtTabAppearanceCfg::SvtTabAppearanceCfg()
:ConfigItem(OUString("Office.Common/View")) :ConfigItem(OUString("Office.Common/View"))
,nDragMode ( DEFAULT_DRAGMODE ) ,nDragMode ( DEFAULT_DRAGMODE )
,nScaleFactor ( DEFAULT_SCALEFACTOR )
,nSnapMode ( DEFAULT_SNAPMODE ) ,nSnapMode ( DEFAULT_SNAPMODE )
,nMiddleMouse ( MouseMiddleButtonAction::AutoScroll ) ,nMiddleMouse ( MouseMiddleButtonAction::AutoScroll )
#if defined( UNX ) #if defined( UNX )
@@ -64,26 +62,25 @@ SvtTabAppearanceCfg::SvtTabAppearanceCfg()
{ {
switch(nProp) switch(nProp)
{ {
case 0: *pValues >>= nScaleFactor; break; //"FontScaling", case 0: //"Window/Drag"
case 1: //"Window/Drag"
{ {
short nTmp; short nTmp;
if (*pValues >>= nTmp) if (*pValues >>= nTmp)
nDragMode = (DragMode)nTmp; nDragMode = (DragMode)nTmp;
break; break;
} }
case 2: bMenuMouseFollow = *o3tl::doAccess<bool>(*pValues); break; //"Menu/FollowMouse", case 1: bMenuMouseFollow = *o3tl::doAccess<bool>(*pValues); break; //"Menu/FollowMouse",
case 3: case 2:
{ {
short nTmp; short nTmp;
if (*pValues >>= nTmp) if (*pValues >>= nTmp)
nSnapMode = (SnapType)nTmp; //"Dialog/MousePositioning", nSnapMode = (SnapType)nTmp; //"Dialog/MousePositioning",
break; break;
} }
case 4: { short nTmp = 0; *pValues >>= nTmp; nMiddleMouse = static_cast<MouseMiddleButtonAction>(nTmp); break; } //"Dialog/MiddleMouseButton", case 3: { short nTmp = 0; *pValues >>= nTmp; nMiddleMouse = static_cast<MouseMiddleButtonAction>(nTmp); break; } //"Dialog/MiddleMouseButton",
#if defined( UNX ) #if defined( UNX )
case 5: bFontAntialiasing = *o3tl::doAccess<bool>(*pValues); break; // "FontAntialising/Enabled", case 4: bFontAntialiasing = *o3tl::doAccess<bool>(*pValues); break; // "FontAntialising/Enabled",
case 6: *pValues >>= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight", case 5: *pValues >>= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight",
#endif #endif
} }
} }
@@ -102,14 +99,13 @@ const Sequence<OUString>& SvtTabAppearanceCfg::GetPropertyNames()
{ {
static const sal_Char* aPropNames[] = static const sal_Char* aPropNames[] =
{ {
"FontScaling" // 0 "Window/Drag" // 0
,"Window/Drag" // 1 ,"Menu/FollowMouse" // 1
,"Menu/FollowMouse" // 2 ,"Dialog/MousePositioning" // 2
,"Dialog/MousePositioning" // 3 ,"Dialog/MiddleMouseButton" // 3
,"Dialog/MiddleMouseButton" // 4
#if defined( UNX ) #if defined( UNX )
,"FontAntiAliasing/Enabled" // 5 ,"FontAntiAliasing/Enabled" // 4
,"FontAntiAliasing/MinPixelHeight" // 6 ,"FontAntiAliasing/MinPixelHeight" // 5
#endif #endif
}; };
const int nCount = SAL_N_ELEMENTS( aPropNames ); const int nCount = SAL_N_ELEMENTS( aPropNames );
@@ -133,14 +129,13 @@ void SvtTabAppearanceCfg::ImplCommit()
{ {
switch(nProp) switch(nProp)
{ {
case 0: pValues[nProp] <<= nScaleFactor; break; // "FontScaling", case 0: pValues[nProp] <<= (short)nDragMode; break; // "Window/Drag",
case 1: pValues[nProp] <<= (short)nDragMode; break; //"Window/Drag", case 1: pValues[nProp] <<= bMenuMouseFollow; break; // "Menu/FollowMouse",
case 2: pValues[nProp] <<= bMenuMouseFollow; break; //"Menu/FollowMouse", case 2: pValues[nProp] <<= (short)nSnapMode; break; // "Dialog/MousePositioning",
case 3: pValues[nProp] <<= (short)nSnapMode; break; //"Dialog/MousePositioning", case 3: pValues[nProp] <<= static_cast<short>(nMiddleMouse); break; // "Dialog/MiddleMouseButton",
case 4: pValues[nProp] <<= static_cast<short>(nMiddleMouse); break; //"Dialog/MiddleMouseButton",
#if defined( UNX ) #if defined( UNX )
case 5: pValues[nProp] <<= bFontAntialiasing; break; // "FontAntialising/Enabled", case 4: pValues[nProp] <<= bFontAntialiasing; break; // "FontAntialising/Enabled",
case 6: pValues[nProp] <<= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight", case 5: pValues[nProp] <<= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight",
#endif #endif
} }
} }
@@ -151,12 +146,6 @@ void SvtTabAppearanceCfg::Notify( const css::uno::Sequence< OUString >& )
{ {
} }
void SvtTabAppearanceCfg::SetScaleFactor ( sal_uInt16 nSet )
{
nScaleFactor = nSet;
SetModified();
}
void SvtTabAppearanceCfg::SetSnapMode ( SnapType nSet ) void SvtTabAppearanceCfg::SetSnapMode ( SnapType nSet )
{ {
nSnapMode = nSet; nSnapMode = nSet;
@@ -183,11 +172,6 @@ void SvtTabAppearanceCfg::SetApplicationDefaults ( Application* pApp )
// and set it here // and set it here
hAppStyle.SetUseSystemUIFonts( bUseSystemUIFonts ); hAppStyle.SetUseSystemUIFonts( bUseSystemUIFonts );
// Screen and ScreenFont Scaling
hAppStyle.SetScreenZoom( nScaleFactor );
hAppStyle.SetScreenFontZoom( nScaleFactor );
#if defined( UNX ) #if defined( UNX )
// font anti aliasing // font anti aliasing
hAppStyle.SetAntialiasingMinPixelHeight( nAAMinPixelHeight ); hAppStyle.SetAntialiasingMinPixelHeight( nAAMinPixelHeight );

View File

@@ -171,8 +171,6 @@ struct ImplStyleData
ToolbarIconSize mnToolbarIconSize; ToolbarIconSize mnToolbarIconSize;
bool mnUseFlatMenus; bool mnUseFlatMenus;
StyleSettingsOptions mnOptions; StyleSettingsOptions mnOptions;
sal_uInt16 mnScreenZoom;
sal_uInt16 mnScreenFontZoom;
bool mbHighContrast; bool mbHighContrast;
bool mbUseSystemUIFonts; bool mbUseSystemUIFonts;
bool mbAutoMnemonic; bool mbAutoMnemonic;
@@ -539,8 +537,6 @@ ImplStyleData::ImplStyleData() :
mnAntialiasedMin = 0; mnAntialiasedMin = 0;
mnCursorSize = 2; mnCursorSize = 2;
mnCursorBlinkTime = STYLE_CURSOR_NOBLINKTIME; mnCursorBlinkTime = STYLE_CURSOR_NOBLINKTIME;
mnScreenZoom = 100;
mnScreenFontZoom = 100;
mnDragFullOptions = DragFullOptions::All; mnDragFullOptions = DragFullOptions::All;
mnSelectionOptions = SelectionOptions::NONE; mnSelectionOptions = SelectionOptions::NONE;
mnDisplayOptions = DisplayOptions::NONE; mnDisplayOptions = DisplayOptions::NONE;
@@ -648,8 +644,6 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) :
mnAntialiasedMin = rData.mnAntialiasedMin; mnAntialiasedMin = rData.mnAntialiasedMin;
mnCursorSize = rData.mnCursorSize; mnCursorSize = rData.mnCursorSize;
mnCursorBlinkTime = rData.mnCursorBlinkTime; mnCursorBlinkTime = rData.mnCursorBlinkTime;
mnScreenZoom = rData.mnScreenZoom;
mnScreenFontZoom = rData.mnScreenFontZoom;
mnDragFullOptions = rData.mnDragFullOptions; mnDragFullOptions = rData.mnDragFullOptions;
mnSelectionOptions = rData.mnSelectionOptions; mnSelectionOptions = rData.mnSelectionOptions;
mnDisplayOptions = rData.mnDisplayOptions; mnDisplayOptions = rData.mnDisplayOptions;
@@ -1833,32 +1827,6 @@ StyleSettings::GetCursorBlinkTime() const
return (long) mxData->mnCursorBlinkTime; return (long) mxData->mnCursorBlinkTime;
} }
void
StyleSettings::SetScreenZoom( sal_uInt16 nPercent )
{
CopyData();
mxData->mnScreenZoom = nPercent;
}
sal_uInt16
StyleSettings::GetScreenZoom() const
{
return mxData->mnScreenZoom;
}
void
StyleSettings::SetScreenFontZoom( sal_uInt16 nPercent )
{
CopyData();
mxData->mnScreenFontZoom = nPercent;
}
sal_uInt16
StyleSettings::GetScreenFontZoom() const
{
return mxData->mnScreenFontZoom;
}
void void
StyleSettings::SetDragFullOptions( DragFullOptions nOptions ) StyleSettings::SetDragFullOptions( DragFullOptions nOptions )
{ {
@@ -2312,8 +2280,6 @@ bool StyleSettings::operator ==( const StyleSettings& rSet ) const
(mxData->mnSplitSize == rSet.mxData->mnSplitSize) && (mxData->mnSplitSize == rSet.mxData->mnSplitSize) &&
(mxData->mnSpinSize == rSet.mxData->mnSpinSize) && (mxData->mnSpinSize == rSet.mxData->mnSpinSize) &&
(mxData->mnAntialiasedMin == rSet.mxData->mnAntialiasedMin) && (mxData->mnAntialiasedMin == rSet.mxData->mnAntialiasedMin) &&
(mxData->mnScreenZoom == rSet.mxData->mnScreenZoom) &&
(mxData->mnScreenFontZoom == rSet.mxData->mnScreenFontZoom) &&
(mxData->mbHighContrast == rSet.mxData->mbHighContrast) && (mxData->mbHighContrast == rSet.mxData->mbHighContrast) &&
(mxData->mbUseSystemUIFonts == rSet.mxData->mbUseSystemUIFonts) && (mxData->mbUseSystemUIFonts == rSet.mxData->mbUseSystemUIFonts) &&
(mxData->mnUseFlatBorders == rSet.mxData->mnUseFlatBorders) && (mxData->mnUseFlatBorders == rSet.mxData->mnUseFlatBorders) &&

View File

@@ -1138,14 +1138,13 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p
// setup the scale factor for Hi-DPI displays // setup the scale factor for Hi-DPI displays
mnDPIScaleFactor = CountDPIScaleFactor(mpWindowImpl->mpFrameData->mnDPIY); mnDPIScaleFactor = CountDPIScaleFactor(mpWindowImpl->mpFrameData->mnDPIY);
mnDPIX = mpWindowImpl->mpFrameData->mnDPIX;
mnDPIY = mpWindowImpl->mpFrameData->mnDPIY;
if (!utl::ConfigManager::IsAvoidConfig()) if (!utl::ConfigManager::IsAvoidConfig())
{ {
const StyleSettings& rStyleSettings = mxSettings->GetStyleSettings(); const StyleSettings& rStyleSettings = mxSettings->GetStyleSettings();
sal_uInt16 nScreenZoom = rStyleSettings.GetScreenZoom(); maFont = rStyleSettings.GetAppFont();
mnDPIX = (mpWindowImpl->mpFrameData->mnDPIX*nScreenZoom)/100;
mnDPIY = (mpWindowImpl->mpFrameData->mnDPIY*nScreenZoom)/100;
maFont = rStyleSettings.GetAppFont();
if ( nStyle & WB_3DLOOK ) if ( nStyle & WB_3DLOOK )
{ {
@@ -1160,8 +1159,6 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p
} }
else else
{ {
mnDPIX = 96;
mnDPIY = 96;
maFont = GetDefaultFont( DefaultFontType::FIXED, LANGUAGE_ENGLISH_US, GetDefaultFontFlags::NONE ); maFont = GetDefaultFont( DefaultFontType::FIXED, LANGUAGE_ENGLISH_US, GetDefaultFontFlags::NONE );
} }
@@ -1326,13 +1323,12 @@ void Window::ImplInitResolutionSettings()
// recalculate AppFont-resolution and DPI-resolution // recalculate AppFont-resolution and DPI-resolution
if (mpWindowImpl->mbFrame) if (mpWindowImpl->mbFrame)
{ {
const StyleSettings& rStyleSettings = mxSettings->GetStyleSettings(); mnDPIX = mpWindowImpl->mpFrameData->mnDPIX;
sal_uInt16 nScreenZoom = rStyleSettings.GetScreenZoom(); mnDPIY = mpWindowImpl->mpFrameData->mnDPIY;
mnDPIX = (mpWindowImpl->mpFrameData->mnDPIX*nScreenZoom)/100;
mnDPIY = (mpWindowImpl->mpFrameData->mnDPIY*nScreenZoom)/100;
// setup the scale factor for Hi-DPI displays // setup the scale factor for Hi-DPI displays
mnDPIScaleFactor = CountDPIScaleFactor(mpWindowImpl->mpFrameData->mnDPIY); mnDPIScaleFactor = CountDPIScaleFactor(mpWindowImpl->mpFrameData->mnDPIY);
const StyleSettings& rStyleSettings = mxSettings->GetStyleSettings();
SetPointFont(*this, rStyleSettings.GetAppFont()); SetPointFont(*this, rStyleSettings.GetAppFont());
} }
else if ( mpWindowImpl->mpParent ) else if ( mpWindowImpl->mpParent )
@@ -1355,25 +1351,16 @@ void Window::ImplInitResolutionSettings()
void Window::ImplPointToLogic(vcl::RenderContext& rRenderContext, vcl::Font& rFont) const void Window::ImplPointToLogic(vcl::RenderContext& rRenderContext, vcl::Font& rFont) const
{ {
Size aSize = rFont.GetFontSize(); Size aSize = rFont.GetFontSize();
sal_uInt16 nScreenFontZoom;
if (!utl::ConfigManager::IsAvoidConfig())
nScreenFontZoom = rRenderContext.GetSettings().GetStyleSettings().GetScreenFontZoom();
else
nScreenFontZoom = 100;
if (aSize.Width()) if (aSize.Width())
{ {
aSize.Width() *= mpWindowImpl->mpFrameData->mnDPIX; aSize.Width() *= mpWindowImpl->mpFrameData->mnDPIX;
aSize.Width() += 72 / 2; aSize.Width() += 72 / 2;
aSize.Width() /= 72; aSize.Width() /= 72;
aSize.Width() *= nScreenFontZoom;
aSize.Width() /= 100;
} }
aSize.Height() *= mpWindowImpl->mpFrameData->mnDPIY; aSize.Height() *= mpWindowImpl->mpFrameData->mnDPIY;
aSize.Height() += 72/2; aSize.Height() += 72/2;
aSize.Height() /= 72; aSize.Height() /= 72;
aSize.Height() *= nScreenFontZoom;
aSize.Height() /= 100;
if (rRenderContext.IsMapModeEnabled()) if (rRenderContext.IsMapModeEnabled())
aSize = rRenderContext.PixelToLogic(aSize); aSize = rRenderContext.PixelToLogic(aSize);
@@ -1384,25 +1371,16 @@ void Window::ImplPointToLogic(vcl::RenderContext& rRenderContext, vcl::Font& rFo
void Window::ImplLogicToPoint(vcl::RenderContext& rRenderContext, vcl::Font& rFont) const void Window::ImplLogicToPoint(vcl::RenderContext& rRenderContext, vcl::Font& rFont) const
{ {
Size aSize = rFont.GetFontSize(); Size aSize = rFont.GetFontSize();
sal_uInt16 nScreenFontZoom;
if (!utl::ConfigManager::IsAvoidConfig())
nScreenFontZoom = rRenderContext.GetSettings().GetStyleSettings().GetScreenFontZoom();
else
nScreenFontZoom = 100;
if (rRenderContext.IsMapModeEnabled()) if (rRenderContext.IsMapModeEnabled())
aSize = rRenderContext.LogicToPixel(aSize); aSize = rRenderContext.LogicToPixel(aSize);
if (aSize.Width()) if (aSize.Width())
{ {
aSize.Width() *= 100;
aSize.Width() /= nScreenFontZoom;
aSize.Width() *= 72; aSize.Width() *= 72;
aSize.Width() += mpWindowImpl->mpFrameData->mnDPIX / 2; aSize.Width() += mpWindowImpl->mpFrameData->mnDPIX / 2;
aSize.Width() /= mpWindowImpl->mpFrameData->mnDPIX; aSize.Width() /= mpWindowImpl->mpFrameData->mnDPIX;
} }
aSize.Height() *= 100;
aSize.Height() /= nScreenFontZoom;
aSize.Height() *= 72; aSize.Height() *= 72;
aSize.Height() += mpWindowImpl->mpFrameData->mnDPIY / 2; aSize.Height() += mpWindowImpl->mpFrameData->mnDPIY / 2;
aSize.Height() /= mpWindowImpl->mpFrameData->mnDPIY; aSize.Height() /= mpWindowImpl->mpFrameData->mnDPIY;