summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2016-10-09 17:54:22 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2016-12-20 14:19:17 +0100
commitb82f4373f55ac814e40fe3040d44dfe261f11ac5 (patch)
treea0c95e4d00bd61a93c38c5f79684b18695461210 /vcl/unx
parent294958c73990eb69cb7ffbf8d84bd95eaef8a88d (diff)
KDE4 rely on style()->pixelMetric for frame width
Change-Id: I7a1e89c0c058bab0b6665e2b96b22251dcb51f4f
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/kde4/KDESalGraphics.cxx8
-rw-r--r--vcl/unx/kde4/KDESalInstance.cxx5
-rw-r--r--vcl/unx/kde4/KDESalInstance.hxx1
-rw-r--r--vcl/unx/kde4/KDEXLib.cxx22
-rw-r--r--vcl/unx/kde4/KDEXLib.hxx3
5 files changed, 3 insertions, 36 deletions
diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index ce26a7e0c4c3..0659e14b92c4 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -543,9 +543,8 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
{
lcl_drawFrame( QStyle::PE_Frame, m_image.get(),
vclStateValue2StateFlag(nControlState, value) );
-
// draw just the border, see http://qa.openoffice.org/issues/show_bug.cgi?id=107945
- int fw = static_cast< KDESalInstance* >(GetSalData()->m_pInstance)->getFrameWidth();
+ int fw = QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
localClipRegion = new QRegion(QRegion(widgetRect).subtracted(widgetRect.adjusted(fw, fw, -fw, -fw)));
}
else if (type == ControlType::WindowBackground)
@@ -858,14 +857,11 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
{
if( part == ControlPart::Border )
{
- int nFrameWidth = static_cast< KDESalInstance* >(GetSalData()->m_pInstance)->getFrameWidth();
auto nStyle = static_cast<DrawFrameFlags>(
val.getNumericVal() & 0xFFF0);
if( nStyle & DrawFrameFlags::NoDraw )
{
- // in this case the question is: how thick would a frame be
- // see brdwin.cxx, decoview.cxx
- // most probably the behavior in decoview.cxx is wrong.
+ int nFrameWidth = QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
contentRect.adjust(nFrameWidth, nFrameWidth, -nFrameWidth, -nFrameWidth);
}
retVal = true;
diff --git a/vcl/unx/kde4/KDESalInstance.cxx b/vcl/unx/kde4/KDESalInstance.cxx
index f8bf400fbfa2..dfe02cd36e2e 100644
--- a/vcl/unx/kde4/KDESalInstance.cxx
+++ b/vcl/unx/kde4/KDESalInstance.cxx
@@ -53,11 +53,6 @@ uno::Reference< ui::dialogs::XFilePicker2 > KDESalInstance::createFilePicker(
return X11SalInstance::createFilePicker( xMSF );
}
-int KDESalInstance::getFrameWidth()
-{
- return static_cast<KDEXLib*>( mpXLib )->getFrameWidth();
-}
-
SalX11Display* KDESalInstance::CreateDisplay() const
{
return new SalKDEDisplay( QX11Info::display() );
diff --git a/vcl/unx/kde4/KDESalInstance.hxx b/vcl/unx/kde4/KDESalInstance.hxx
index 2220816a334c..9807b178aa07 100644
--- a/vcl/unx/kde4/KDESalInstance.hxx
+++ b/vcl/unx/kde4/KDESalInstance.hxx
@@ -39,7 +39,6 @@ class KDESalInstance : public X11SalInstance
virtual css::uno::Reference< css::ui::dialogs::XFilePicker2 >
createFilePicker( const css::uno::Reference<
css::uno::XComponentContext >& ) override;
- int getFrameWidth();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index cdf148995cec..06340bebf45c 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -50,7 +50,7 @@
KDEXLib::KDEXLib() :
SalXLib(), m_bStartupDone(false),
m_pFreeCmdLineArgs(nullptr), m_pAppCmdLineArgs(nullptr), m_nFakeCmdLineArgs( 0 ),
- m_frameWidth( -1 ), m_isGlibEventLoopType(false),
+ m_isGlibEventLoopType(false),
m_allowKdeDialogs(false), m_blockIdleTimeout(false)
{
// the timers created here means they belong to the main thread.
@@ -76,9 +76,6 @@ KDEXLib::KDEXLib() :
connect( this, SIGNAL( createFilePickerSignal( const css::uno::Reference< css::uno::XComponentContext >&) ),
this, SLOT( createFilePicker( const css::uno::Reference< css::uno::XComponentContext >&) ),
Qt::BlockingQueuedConnection );
-
- connect( this, SIGNAL( getFrameWidthSignal() ),
- this, SLOT( getFrameWidth() ), Qt::BlockingQueuedConnection );
}
KDEXLib::~KDEXLib()
@@ -423,23 +420,6 @@ uno::Reference< ui::dialogs::XFilePicker2 > KDEXLib::createFilePicker(
#endif
}
-int KDEXLib::getFrameWidth()
-{
- if( m_frameWidth >= 0 )
- return m_frameWidth;
- if( qApp->thread() != QThread::currentThread()) {
- SalYieldMutexReleaser aReleaser;
- return Q_EMIT getFrameWidthSignal();
- }
-
- // fill in a default
- QFrame aFrame( nullptr );
- aFrame.setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
- aFrame.ensurePolished();
- m_frameWidth = aFrame.frameWidth();
- return m_frameWidth;
-}
-
#include "KDEXLib.moc"
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde4/KDEXLib.hxx b/vcl/unx/kde4/KDEXLib.hxx
index 3383ce8d34c9..4b482cc8c0d9 100644
--- a/vcl/unx/kde4/KDEXLib.hxx
+++ b/vcl/unx/kde4/KDEXLib.hxx
@@ -53,7 +53,6 @@ class KDEXLib : public QObject, public SalXLib
QHash< int, SocketData > socketData; // key is fd
QTimer timeoutTimer;
QTimer userEventTimer;
- int m_frameWidth;
bool m_isGlibEventLoopType;
bool m_allowKdeDialogs;
bool m_blockIdleTimeout;
@@ -74,7 +73,6 @@ class KDEXLib : public QObject, public SalXLib
void processYieldSignal( bool bWait, bool bHandleAllCurrentEvents );
css::uno::Reference< css::ui::dialogs::XFilePicker2 >
createFilePickerSignal( const css::uno::Reference< css::uno::XComponentContext >& );
- int getFrameWidthSignal();
public:
KDEXLib();
@@ -95,7 +93,6 @@ class KDEXLib : public QObject, public SalXLib
public Q_SLOTS:
css::uno::Reference< css::ui::dialogs::XFilePicker2 >
createFilePicker( const css::uno::Reference< css::uno::XComponentContext >& );
- int getFrameWidth();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */