Kaydet (Commit) b82f4373 authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

KDE4 rely on style()->pixelMetric for frame width

Change-Id: I7a1e89c0c058bab0b6665e2b96b22251dcb51f4f
üst 294958c7
......@@ -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;
......
......@@ -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() );
......
......@@ -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: */
......@@ -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: */
......@@ -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: */
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