Commit 2df91ac9 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii Committed by Vlad Zahorodnii

[kstyle] Drop Qt 4 style plugin

Summary:
KWindowSystem cannot be used in the Qt 4 style plugin. On the other hand,
we need to use KWindowSystem to make QWidget-based internal clients in
KWin cast drop-shadows.

Another problem with the Qt 4 style plugin is that some distributions
have already dropped Qt 4, so one has to build it first in order to
verify that his or her change works with Qt 4.

Given maintenance burden and the fact that Qt 6 is around the corner,
this change drops the Qt 4 style plugin.

Reviewers: #kwin, #plasma, davidedmundson

Reviewed By: #kwin, #plasma, davidedmundson

Subscribers: davidedmundson, mart, plasma-devel

Tags: #plasma

Maniphest Tasks: T12496

Differential Revision: https://phabricator.kde.org/D26476
parent 5a447b59
...@@ -4,81 +4,67 @@ set(PROJECT_VERSION_MAJOR 5) ...@@ -4,81 +4,67 @@ set(PROJECT_VERSION_MAJOR 5)
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
option(USE_KDE4 "Build a widget style for KDE4 (and nothing else)")
include(GenerateExportHeader) include(GenerateExportHeader)
include(WriteBasicConfigVersionFile) include(WriteBasicConfigVersionFile)
include(FeatureSummary) include(FeatureSummary)
if(USE_KDE4) find_package(ECM 0.0.9 REQUIRED NO_MODULE)
find_package(KDE4 REQUIRED) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_SOURCE_DIR}/cmake)
include(KDE4Defaults)
include(MacroLibrary)
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
include_directories(${KDE4_INCLUDES})
add_subdirectory(libbreezecommon)
add_subdirectory(kstyle)
else()
find_package(ECM 0.0.9 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_SOURCE_DIR}/cmake)
include(ECMInstallIcons) include(ECMInstallIcons)
include(KDEInstallDirs) include(KDEInstallDirs)
include(KDECMakeSettings) include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE) include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDEClangFormat) include(KDEClangFormat)
include(GtkUpdateIconCache) include(GtkUpdateIconCache)
option(WITH_DECORATIONS "Build Breeze window decorations for KWin" ON) option(WITH_DECORATIONS "Build Breeze window decorations for KWin" ON)
if(WITH_DECORATIONS) if(WITH_DECORATIONS)
find_package(KDecoration2 REQUIRED) find_package(KDecoration2 REQUIRED)
add_subdirectory(kdecoration) add_subdirectory(kdecoration)
endif() endif()
add_subdirectory(colors) add_subdirectory(colors)
add_subdirectory(cursors) add_subdirectory(cursors)
add_subdirectory(libbreezecommon) add_subdirectory(libbreezecommon)
add_subdirectory(kstyle) add_subdirectory(kstyle)
add_subdirectory(misc) add_subdirectory(misc)
option(WITH_WALLPAPERS "Install Breeze default wallpapers" ON) option(WITH_WALLPAPERS "Install Breeze default wallpapers" ON)
if (WITH_WALLPAPERS) if (WITH_WALLPAPERS)
add_subdirectory(wallpapers) add_subdirectory(wallpapers)
endif() endif()
find_package(KF5Package CONFIG REQUIRED) find_package(KF5Package CONFIG REQUIRED)
kpackage_install_package(lookandfeel.dark org.kde.breezedark.desktop look-and-feel plasma) kpackage_install_package(lookandfeel.dark org.kde.breezedark.desktop look-and-feel plasma)
if(EXISTS ${CMAKE_SOURCE_DIR}/po AND IS_DIRECTORY ${CMAKE_SOURCE_DIR}/po) if(EXISTS ${CMAKE_SOURCE_DIR}/po AND IS_DIRECTORY ${CMAKE_SOURCE_DIR}/po)
find_package(KF5I18n CONFIG REQUIRED) find_package(KF5I18n CONFIG REQUIRED)
ki18n_install(po) ki18n_install(po)
endif()
include(ECMSetupVersion)
ecm_setup_version(${PROJECT_VERSION} VARIABLE_PREFIX BREEZE
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/BreezeConfigVersion.cmake"
)
# create a Config.cmake and a ConfigVersion.cmake file and install them
set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/Breeze")
ecm_configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/BreezeConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/BreezeConfig.cmake"
PATH_VARS KDE_INSTALL_FULL_DATADIR
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
# add clang-format target for all our real source files
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/BreezeConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/BreezeConfigVersion.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel
)
endif() endif()
include(ECMSetupVersion)
ecm_setup_version(${PROJECT_VERSION} VARIABLE_PREFIX BREEZE
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/BreezeConfigVersion.cmake"
)
# create a Config.cmake and a ConfigVersion.cmake file and install them
set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/Breeze")
ecm_configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/BreezeConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/BreezeConfig.cmake"
PATH_VARS KDE_INSTALL_FULL_DATADIR
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
# add clang-format target for all our real source files
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/BreezeConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/BreezeConfigVersion.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel
)
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
set(BREEZE_USE_KDE4 ${USE_KDE4})
if(BREEZE_USE_KDE4)
############ Language and toolchain features
############ copied from ECM
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel" AND NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif()
endif()
################# Qt/KDE ################# ################# Qt/KDE #################
if(BREEZE_USE_KDE4) find_package(Qt5 REQUIRED CONFIG COMPONENTS Widgets DBus)
find_package(KF5 REQUIRED COMPONENTS
### XCB I18n
if(UNIX AND NOT APPLE) Config
find_package(PkgConfig REQUIRED) GuiAddons
pkg_check_modules(XCB xcb x11-xcb) ConfigWidgets
add_feature_info("x11-xcb" XCB_FOUND "Required to pass style properties to native Windows on X11 Platform") WindowSystem)
set_feature_info("x11-xcb" "Required to pass style properties to native Windows on X11 Platform" "https://xcb.freedesktop.org")
set(BREEZE_HAVE_X11 ${XCB_FOUND}) find_package(Qt5 COMPONENTS Quick)
else() set(BREEZE_HAVE_QTQUICK ${Qt5Quick_FOUND})
set(BREEZE_HAVE_X11 FALSE)
endif() find_package( KF5FrameworkIntegration CONFIG )
set_package_properties(KF5FrameworkIntegration PROPERTIES
set(BREEZE_HAVE_QTQUICK FALSE) DESCRIPTION "KF5 Framework Integration"
set(BREEZE_HAVE_KWAYLAND FALSE) URL "https://projects.kde.org/projects/frameworks/frameworkintegration"
TYPE OPTIONAL
### KStyle PURPOSE "Required to use KStyle convenience functionalities in style")
set(BREEZE_HAVE_KSTYLE FALSE)
set(BREEZE_HAVE_KSTYLE ${KF5FrameworkIntegration_FOUND})
else()
find_package(XCB COMPONENTS XCB)
find_package(Qt5 REQUIRED CONFIG COMPONENTS Widgets DBus) set_package_properties(XCB PROPERTIES
find_package(KF5 REQUIRED COMPONENTS DESCRIPTION "X protocol C-language Binding"
I18n URL "https://xcb.freedesktop.org"
Config TYPE OPTIONAL
GuiAddons PURPOSE "Required to pass style properties to native Windows on X11 Platform"
ConfigWidgets )
WindowSystem)
find_package(Qt5 COMPONENTS Quick)
set(BREEZE_HAVE_QTQUICK ${Qt5Quick_FOUND})
find_package( KF5FrameworkIntegration CONFIG )
set_package_properties(KF5FrameworkIntegration PROPERTIES
DESCRIPTION "KF5 Framework Integration"
URL "https://projects.kde.org/projects/frameworks/frameworkintegration"
TYPE OPTIONAL
PURPOSE "Required to use KStyle convenience functionalities in style")
set(BREEZE_HAVE_KSTYLE ${KF5FrameworkIntegration_FOUND})
find_package(XCB COMPONENTS XCB)
set_package_properties(XCB PROPERTIES
DESCRIPTION "X protocol C-language Binding"
URL "https://xcb.freedesktop.org"
TYPE OPTIONAL
PURPOSE "Required to pass style properties to native Windows on X11 Platform"
)
find_package(KF5Wayland CONFIG)
set(BREEZE_HAVE_KWAYLAND ${KF5Wayland_FOUND})
if(UNIX AND NOT APPLE) find_package(KF5Wayland CONFIG)
set(BREEZE_HAVE_KWAYLAND ${KF5Wayland_FOUND})
if(UNIX AND NOT APPLE)
set(BREEZE_HAVE_X11 ${XCB_XCB_FOUND}) set(BREEZE_HAVE_X11 ${XCB_XCB_FOUND})
if (XCB_XCB_FOUND) if (XCB_XCB_FOUND)
find_package(Qt5 REQUIRED CONFIG COMPONENTS X11Extras) find_package(Qt5 REQUIRED CONFIG COMPONENTS X11Extras)
endif() endif()
else()
else()
set(BREEZE_HAVE_X11 FALSE) set(BREEZE_HAVE_X11 FALSE)
endif()
endif() endif()
################# includes ################# ################# includes #################
include_directories( include_directories(
animations animations
...@@ -121,6 +81,7 @@ set(breeze_PART_SRCS ...@@ -121,6 +81,7 @@ set(breeze_PART_SRCS
animations/breezewidgetstatedata.cpp animations/breezewidgetstatedata.cpp
debug/breezewidgetexplorer.cpp debug/breezewidgetexplorer.cpp
breezeaddeventfilter.cpp breezeaddeventfilter.cpp
breezeblurhelper.cpp
breezeframeshadow.cpp breezeframeshadow.cpp
breezehelper.cpp breezehelper.cpp
breezemdiwindowshadow.cpp breezemdiwindowshadow.cpp
...@@ -134,62 +95,37 @@ set(breeze_PART_SRCS ...@@ -134,62 +95,37 @@ set(breeze_PART_SRCS
breezewindowmanager.cpp breezewindowmanager.cpp
) )
if(NOT BREEZE_USE_KDE4) kconfig_add_kcfg_files(breeze_PART_SRCS breezestyleconfigdata.kcfgc)
set(breeze_PART_SRCS add_library(breeze MODULE ${breeze_PART_SRCS})
${breeze_PART_SRCS} target_link_libraries(breeze Qt5::Core Qt5::Gui Qt5::Widgets Qt5::DBus)
breezeblurhelper.cpp if( BREEZE_HAVE_QTQUICK )
)
endif()
if(BREEZE_USE_KDE4)
kde4_add_kcfg_files(breeze_PART_SRCS breezestyleconfigdata.kcfgc)
kde4_add_plugin(breeze ${breeze_PART_SRCS} kstylekde4compat.cpp)
target_link_libraries(breeze ${KDE4_KDEUI_LIBS})
target_link_libraries(breeze breezecommon4)
if(BREEZE_HAVE_X11)
target_link_libraries(breeze ${X11_XCB_LIBRARIES})
target_link_libraries(breeze ${XCB_LIBRARIES})
endif()
install(TARGETS breeze DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/styles/)
else()
kconfig_add_kcfg_files(breeze_PART_SRCS breezestyleconfigdata.kcfgc)
add_library(breeze MODULE ${breeze_PART_SRCS})
target_link_libraries(breeze Qt5::Core Qt5::Gui Qt5::Widgets Qt5::DBus)
if( BREEZE_HAVE_QTQUICK )
target_link_libraries(breeze Qt5::Quick) target_link_libraries(breeze Qt5::Quick)
endif() endif()
target_link_libraries(breeze KF5::ConfigCore KF5::ConfigWidgets KF5::GuiAddons KF5::WindowSystem) target_link_libraries(breeze KF5::ConfigCore KF5::ConfigWidgets KF5::GuiAddons KF5::WindowSystem)
target_link_libraries(breeze breezecommon5) target_link_libraries(breeze breezecommon5)
if( KF5FrameworkIntegration_FOUND ) if(KF5FrameworkIntegration_FOUND)
target_link_libraries(breeze KF5::Style) target_link_libraries(breeze KF5::Style)
endif() endif()
if (WIN32) if (WIN32)
# As stated in https://docs.microsoft.com/en-us/cpp/c-runtime-library/math-constants M_PI only gets defined # As stated in https://docs.microsoft.com/en-us/cpp/c-runtime-library/math-constants M_PI only gets defined
# when if _USE_MATH_DEFINES is defined # when if _USE_MATH_DEFINES is defined
target_compile_definitions(breeze PRIVATE _USE_MATH_DEFINES _BSD_SOURCE) target_compile_definitions(breeze PRIVATE _USE_MATH_DEFINES _BSD_SOURCE)
endif() endif()
if(BREEZE_HAVE_X11) if(BREEZE_HAVE_X11)
target_link_libraries(breeze ${XCB_LIBRARIES}) target_link_libraries(breeze ${XCB_LIBRARIES})
target_link_libraries(breeze Qt5::X11Extras) target_link_libraries(breeze Qt5::X11Extras)
endif() endif()
if(BREEZE_HAVE_KWAYLAND) if(BREEZE_HAVE_KWAYLAND)
target_link_libraries(breeze KF5::WaylandClient) target_link_libraries(breeze KF5::WaylandClient)
endif()
install(TARGETS breeze DESTINATION ${QT_PLUGIN_INSTALL_DIR}/styles/)
endif() endif()
########### install files ############### ########### install files ###############
install(TARGETS breeze DESTINATION ${QT_PLUGIN_INSTALL_DIR}/styles/)
install(FILES breeze.themerc DESTINATION ${DATA_INSTALL_DIR}/kstyle/themes) install(FILES breeze.themerc DESTINATION ${DATA_INSTALL_DIR}/kstyle/themes)
########### subdirectories ############### ########### subdirectories ###############
......
...@@ -80,11 +80,7 @@ namespace Breeze ...@@ -80,11 +80,7 @@ namespace Breeze
rect = rect.translated( widget->mapTo( widget->window(), widget->rect().topLeft() ) ); rect = rect.translated( widget->mapTo( widget->window(), widget->rect().topLeft() ) );
widget = widget->window(); widget = widget->window();
#if QT_VERSION < 0x050000
out = QPixmap::grabWidget( widget, rect );
#else
out = widget->grab( rect ); out = widget->grab( rect );
#endif
} else { } else {
......
...@@ -31,22 +31,12 @@ namespace Breeze ...@@ -31,22 +31,12 @@ namespace Breeze
//*@name convenience typedef //*@name convenience typedef
//@{ //@{
#if QT_VERSION >= 0x050000
//* scoped pointer convenience typedef //* scoped pointer convenience typedef
template <typename T> using WeakPointer = QPointer<T>; template <typename T> using WeakPointer = QPointer<T>;
#else
//* scoped pointer convenience typedef
template <typename T> using WeakPointer = QWeakPointer<T>;
#endif
//* scoped pointer convenience typedef //* scoped pointer convenience typedef
template <typename T> using ScopedPointer = QScopedPointer<T, QScopedPointerPodDeleter>; template <typename T> using ScopedPointer = QScopedPointer<T, QScopedPointerPodDeleter>;
//* disable QStringLiteral for older Qt version
#if QT_VERSION < 0x050000
using QStringLiteral = QString;
#endif
//@} //@}
//* metrics //* metrics
......
...@@ -28,10 +28,6 @@ ...@@ -28,10 +28,6 @@
#include <QApplication> #include <QApplication>
#include <QPainter> #include <QPainter>
#if BREEZE_HAVE_X11 && QT_VERSION < 0x050000
#include <X11/Xlib-xcb.h>
#endif
#include <algorithm> #include <algorithm>
namespace Breeze namespace Breeze
...@@ -45,14 +41,6 @@ namespace Breeze ...@@ -45,14 +41,6 @@ namespace Breeze
_config( std::move( config ) ) _config( std::move( config ) )
{ init(); } { init(); }
//____________________________________________________________________
#if BREEZE_USE_KDE4
Helper::Helper( const QByteArray& name ):
_componentData( name, nullptr, KComponentData::SkipMainComponentRegistration ),
_config( _componentData.config() )
{ init(); }
#endif
//____________________________________________________________________ //____________________________________________________________________
KSharedConfig::Ptr Helper::config() const KSharedConfig::Ptr Helper::config() const
{ return _config; } { return _config; }
...@@ -1480,12 +1468,8 @@ namespace Breeze ...@@ -1480,12 +1468,8 @@ namespace Breeze
bool Helper::isX11() bool Helper::isX11()
{ {
#if BREEZE_HAVE_X11 #if BREEZE_HAVE_X11
#if QT_VERSION >= 0x050000
static const bool s_isX11 = KWindowSystem::isPlatformX11(); static const bool s_isX11 = KWindowSystem::isPlatformX11();
return s_isX11; return s_isX11;
#else
return true;
#endif
#endif #endif
return false; return false;
...@@ -1495,12 +1479,8 @@ namespace Breeze ...@@ -1495,12 +1479,8 @@ namespace Breeze
//______________________________________________________________________________ //______________________________________________________________________________
bool Helper::isWayland() bool Helper::isWayland()
{ {
#if QT_VERSION >= 0x050000
static const bool s_isWayland = KWindowSystem::isPlatformWayland(); static const bool s_isWayland = KWindowSystem::isPlatformWayland();
return s_isWayland; return s_isWayland;
#else
return false;
#endif
} }
//______________________________________________________________________________ //______________________________________________________________________________
...@@ -1614,25 +1594,16 @@ namespace Breeze ...@@ -1614,25 +1594,16 @@ namespace Breeze
//______________________________________________________________________________________ //______________________________________________________________________________________
QPixmap Helper::highDpiPixmap( int width, int height ) const QPixmap Helper::highDpiPixmap( int width, int height ) const
{ {
#if QT_VERSION >= 0x050300
const qreal dpiRatio( qApp->devicePixelRatio() ); const qreal dpiRatio( qApp->devicePixelRatio() );
QPixmap pixmap( width*dpiRatio, height*dpiRatio ); QPixmap pixmap( width*dpiRatio, height*dpiRatio );
pixmap.setDevicePixelRatio( dpiRatio ); pixmap.setDevicePixelRatio( dpiRatio );
return pixmap; return pixmap;
#else
return QPixmap( width, height );
#endif
} }
//______________________________________________________________________________________ //______________________________________________________________________________________
qreal Helper::devicePixelRatio( const QPixmap& pixmap ) const qreal Helper::devicePixelRatio( const QPixmap& pixmap ) const
{ {
#if QT_VERSION >= 0x050300
return pixmap.devicePixelRatio(); return pixmap.devicePixelRatio();
#else
Q_UNUSED(pixmap);
return 1;
#endif
} }
#if BREEZE_HAVE_X11 #if BREEZE_HAVE_X11
...@@ -1641,17 +1612,7 @@ namespace Breeze ...@@ -1641,17 +1612,7 @@ namespace Breeze
xcb_connection_t* Helper::connection() xcb_connection_t* Helper::connection()
{ {
#if QT_VERSION >= 0x050000
return QX11Info::connection(); return QX11Info::connection();
#else
static xcb_connection_t* connection = nullptr;
if( !connection )
{
Display* display = QX11Info::display();
if( display ) connection = XGetXCBConnection( display );
}
return connection;
#endif
} }
//____________________________________________________________________ //____________________________________________________________________
......
...@@ -28,10 +28,6 @@ ...@@ -28,10 +28,6 @@
#include <KColorScheme> #include <KColorScheme>
#include <KSharedConfig> #include <KSharedConfig>
#if BREEZE_USE_KDE4
#include <KComponentData>
#endif
#include <QPainterPath> #include <QPainterPath>
#include <QWidget> #include <QWidget>
...@@ -52,11 +48,6 @@ namespace Breeze ...@@ -52,11 +48,6 @@ namespace Breeze
//* constructor //* constructor
explicit Helper( KSharedConfig::Ptr ); explicit Helper( KSharedConfig::Ptr );
#if BREEZE_USE_KDE4
//* constructor
explicit Helper( const QByteArray& );
#endif
//* destructor //* destructor
virtual ~Helper() virtual ~Helper()
{} {}
...@@ -337,11 +328,6 @@ namespace Breeze ...@@ -337,11 +328,6 @@ namespace Breeze
private: private:
#if BREEZE_USE_KDE4
//* component data
KComponentData _componentData;
#endif
//* configuration //* configuration
KSharedConfig::Ptr _config; KSharedConfig::Ptr _config;
......
...@@ -70,11 +70,9 @@ namespace Breeze ...@@ -70,11 +70,9 @@ namespace Breeze
{ setEnabled( false ); } { setEnabled( false ); }
break; break;
#if QT_VERSION >= 0x050000
case QEvent::ApplicationStateChange: case QEvent::ApplicationStateChange:
{ setEnabled( false ); } { setEnabled( false ); }
break; break;
#endif
default: break; default: break;
......
...@@ -284,12 +284,7 @@ namespace Breeze ...@@ -284,12 +284,7 @@ namespace Breeze
const QSize boxSize = BoxShadowRenderer::calculateMinimumBoxSize(params.shadow1.radius) const QSize boxSize = BoxShadowRenderer::calculateMinimumBoxSize(params.shadow1.radius)
.expandedTo(BoxShadowRenderer::calculateMinimumBoxSize(params.shadow2.radius)); .expandedTo(BoxShadowRenderer::calculateMinimumBoxSize(params.shadow2.radius));
#if QT_VERSION >= 0x050300
const qreal dpr = qApp->devicePixelRatio(); const qreal dpr = qApp->devicePixelRatio();
#else
const qreal dpr = 1.0;
#endif
const qreal frameRadius = _helper.frameRadius(); const qreal frameRadius = _helper.frameRadius();
BoxShadowRenderer shadowRenderer; BoxShadowRenderer shadowRenderer;
...@@ -323,11 +318,7 @@ namespace Breeze ...@@ -323,11 +318,7 @@ namespace Breeze
painter.setBrush(Qt::black); painter.setBrush(Qt::black);
painter.setCompositionMode(QPainter::CompositionMode_DestinationOut); painter.setCompositionMode(QPainter::CompositionMode_DestinationOut);
painter.drawRoundedRect( painter.drawRoundedRect(
#if BREEZE_USE_KDE4
outerRect.adjusted(margins.left(), margins.top(), -margins.right(), -margins.bottom()),
#else
outerRect - margins, outerRect - margins,
#endif
frameRadius, frameRadius,
frameRadius); frameRadius);
...@@ -595,14 +586,7 @@ namespace Breeze ...@@ -595,14 +586,7 @@ namespace Breeze
int bottom = widget->contentsMargins().bottom(); int bottom = widget->contentsMargins().bottom();
// Need to decrement default size further due to extra hard coded round corner. // Need to decrement default size further due to extra hard coded round corner.
#if BREEZE_USE_KDE4
margins.setLeft(margins.left() - 1);
margins.setTop(margins.top() - 1);
margins.setRight(margins.right() - 1);
margins.setBottom(margins.bottom() - 1);
#else
margins -= 1; margins -= 1;
#endif
// Arrow can be either to the top or the bottom. Adjust margins accordingly. // Arrow can be either to the top or the bottom. Adjust margins accordingly.
const int diff = qAbs(top - bottom); const int diff = qAbs(top - bottom);
...@@ -613,15 +597,7 @@ namespace Breeze ...@@ -613,15 +597,7 @@ namespace Breeze
} }
} }
#if BREEZE_USE_KDE4
const qreal dpr = _helper.devicePixelRatio(_shadowTiles.pixmap(0));
margins.setLeft(margins.left() * dpr);
margins.setTop(margins.top() * dpr);
margins.setRight(margins.right() * dpr);
margins.setBottom(margins.bottom() * dpr);
#else
margins *= _helper.devicePixelRatio(_shadowTiles.pixmap(0)); margins *= _helper.devicePixelRatio(_shadowTiles.pixmap(0));
#endif
return margins; return margins;
} }
......