From e48424563007c0ff272c4a0626c08d24dec9b142 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Fri, 11 Aug 2023 13:59:07 +0300 Subject: [PATCH] kstyles: preperations for Katie changes Signed-off-by: Ivailo Monev --- kstyles/oxygen/CMakeLists.txt | 1 - kstyles/oxygen/demo/CMakeLists.txt | 2 - kstyles/oxygen/demo/oxygendemodialog.cpp | 11 - kstyles/oxygen/demo/oxygenmdidemowidget.cpp | 97 --------- kstyles/oxygen/demo/oxygenmdidemowidget.h | 64 ------ kstyles/oxygen/demo/oxygenmdidemowidget.ui | 164 -------------- kstyles/oxygen/demo/oxygensimulator.cpp | 21 -- kstyles/oxygen/oxygenmdiwindowshadow.cpp | 224 -------------------- kstyles/oxygen/oxygenmdiwindowshadow.h | 193 ----------------- kstyles/oxygen/oxygenstyle.cpp | 41 ---- kstyles/oxygen/oxygenstyle.h | 10 - kstyles/oxygen/oxygenwindowmanager.cpp | 4 - 12 files changed, 832 deletions(-) delete mode 100644 kstyles/oxygen/demo/oxygenmdidemowidget.cpp delete mode 100644 kstyles/oxygen/demo/oxygenmdidemowidget.h delete mode 100644 kstyles/oxygen/demo/oxygenmdidemowidget.ui delete mode 100644 kstyles/oxygen/oxygenmdiwindowshadow.cpp delete mode 100644 kstyles/oxygen/oxygenmdiwindowshadow.h diff --git a/kstyles/oxygen/CMakeLists.txt b/kstyles/oxygen/CMakeLists.txt index f1660194..1159672c 100644 --- a/kstyles/oxygen/CMakeLists.txt +++ b/kstyles/oxygen/CMakeLists.txt @@ -15,7 +15,6 @@ add_subdirectory( demo ) set(oxygen_PART_SRCS debug/oxygenwidgetexplorer.cpp oxygenframeshadow.cpp - oxygenmdiwindowshadow.cpp oxygenmnemonics.cpp oxygenpropertynames.cpp oxygenshadowhelper.cpp diff --git a/kstyles/oxygen/demo/CMakeLists.txt b/kstyles/oxygen/demo/CMakeLists.txt index 82698ee8..76dc9a61 100644 --- a/kstyles/oxygen/demo/CMakeLists.txt +++ b/kstyles/oxygen/demo/CMakeLists.txt @@ -7,7 +7,6 @@ set(oxygen_demo_SOURCES oxygenframedemowidget.cpp oxygeninputdemowidget.cpp oxygenlistdemowidget.cpp - oxygenmdidemowidget.cpp oxygensimulator.cpp oxygensliderdemowidget.cpp oxygentabdemowidget.cpp @@ -17,7 +16,6 @@ set(oxygen_demo_SOURCES oxygenframedemowidget.ui oxygeninputdemowidget.ui oxygenlistdemowidget.ui - oxygenmdidemowidget.ui oxygensliderdemowidget.ui oxygentabdemowidget.ui ) diff --git a/kstyles/oxygen/demo/oxygendemodialog.cpp b/kstyles/oxygen/demo/oxygendemodialog.cpp index 92740be8..8470eb5d 100644 --- a/kstyles/oxygen/demo/oxygendemodialog.cpp +++ b/kstyles/oxygen/demo/oxygendemodialog.cpp @@ -31,7 +31,6 @@ #include "oxygeninputdemowidget.h" #include "oxygenframedemowidget.h" #include "oxygenlistdemowidget.h" -#include "oxygenmdidemowidget.h" #include "oxygensliderdemowidget.h" #include "oxygentabdemowidget.h" @@ -137,16 +136,6 @@ namespace Oxygen _widgets.append( widget ); } - // mdi - { - page = new KPageWidgetItem( widget = new MdiDemoWidget() ); - page->setName( "MDI Windows" ); - page->setIcon( KIcon( "preferences-system-windows" ) ); - page->setHeader( "Shows the appearance of MDI windows" ); - _pageWidget->addPage( page ); - _widgets.append( widget ); - } - // sliders { page = new KPageWidgetItem( widget = new SliderDemoWidget() ); diff --git a/kstyles/oxygen/demo/oxygenmdidemowidget.cpp b/kstyles/oxygen/demo/oxygenmdidemowidget.cpp deleted file mode 100644 index 8094a3cd..00000000 --- a/kstyles/oxygen/demo/oxygenmdidemowidget.cpp +++ /dev/null @@ -1,97 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// oxygenmdidemowidget.cpp -// oxygen mdi windows demo widget -// ------------------- -// -// Copyright (c) 2010 Hugo Pereira Da Costa -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -////////////////////////////////////////////////////////////////////////////// - -#include "oxygenmdidemowidget.h" -#include "moc_oxygenmdidemowidget.cpp" - -#include -#include -#include -#include - -namespace Oxygen -{ - - //______________________________________________________________ - MdiDemoWidget::MdiDemoWidget( QWidget* parent ): - DemoWidget( parent ) - { - setLayout( new QVBoxLayout() ); - QMenuBar* menuBar = new QMenuBar( this ); - layout()->addWidget( menuBar ); - - QWidget* widget = new QWidget( this ); - layout()->addWidget( widget ); - ui.setupUi( widget ); - - QMenu* menu = menuBar->addMenu( "&Layout" ); - connect( menu->addAction( i18n( "Tile" ) ), SIGNAL(triggered()), ui.mdiArea, SLOT(tileSubWindows()) ); - //action->trigger(); - - connect( menu->addAction( i18n( "Cascade" ) ), SIGNAL(triggered()), ui.mdiArea, SLOT(cascadeSubWindows()) ); - - menu = menuBar->addMenu( "&Tools" ); - QAction* action; - connect( action = menu->addAction( KIcon( "arrow-right" ), i18n( "Select Next Window" ) ), SIGNAL(triggered()), ui.mdiArea, SLOT(activateNextSubWindow()) ); - action->setShortcut( Qt::CTRL + Qt::Key_Tab ); - addAction( action ); - - connect( action = menu->addAction( KIcon( "arrow-left" ), i18n( "Select Previous Window" ) ), SIGNAL(triggered()), ui.mdiArea, SLOT(activatePreviousSubWindow()) ); - action->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_Tab ); - addAction( action ); - - } - - //______________________________________________________________ - void MdiDemoWidget::benchmark( void ) - { - if( !isVisible() ) return; - - if( true ) - { - // slide windows - foreach( QMdiSubWindow* window, ui.mdiArea->findChildren() ) - { - simulator().click( window ); - simulator().slide( window, QPoint( 20, 20 ) ); - simulator().slide( window, QPoint( -20, -20 ) ); - } - - } - - if( true ) - { - foreach( QAbstractButton* button, ui.toolBox->findChildren() ) - { simulator().click( button ); } - - foreach( QAbstractButton* button, ui.toolBox->findChildren() ) - { simulator().click( button ); } - } - - simulator().run(); - - } -} diff --git a/kstyles/oxygen/demo/oxygenmdidemowidget.h b/kstyles/oxygen/demo/oxygenmdidemowidget.h deleted file mode 100644 index 9f4939d9..00000000 --- a/kstyles/oxygen/demo/oxygenmdidemowidget.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef OXYGENMDIDEMOWIDGET_H -#define OXYGENMDIDEMOWIDGET_H - -////////////////////////////////////////////////////////////////////////////// -// oxygenmdidemowidget.h -// oxygen mdi windows demo widget -// ------------------- -// -// Copyright (c) 2010 Hugo Pereira Da Costa -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -////////////////////////////////////////////////////////////////////////////// - -#include -#include - -#include "oxygendemowidget.h" -#include "ui_oxygenmdidemowidget.h" - -namespace Oxygen -{ - class MdiDemoWidget: public DemoWidget - { - - Q_OBJECT - - public: - - //! constructor - explicit MdiDemoWidget( QWidget* = 0 ); - - //! destructor - virtual ~MdiDemoWidget( void ) - {} - - public slots: - - void benchmark( void ); - - private: - - Ui_MdiDemoWidget ui; - - }; - -} - -#endif diff --git a/kstyles/oxygen/demo/oxygenmdidemowidget.ui b/kstyles/oxygen/demo/oxygenmdidemowidget.ui deleted file mode 100644 index 5aa82543..00000000 --- a/kstyles/oxygen/demo/oxygenmdidemowidget.ui +++ /dev/null @@ -1,164 +0,0 @@ - - - MdiDemoWidget - - - - 0 - 0 - 620 - 420 - - - - - 0 - - - - - Qt::ScrollBarAsNeeded - - - Qt::ScrollBarAsNeeded - - - - - 300 - 100 - - - - Editors - - - - - - Title: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - true - - - - - - - - - - - - 300 - 100 - - - - Toolbox - - - - - - 0 - - - - - 0 - 0 - 282 - 72 - - - - First Page - - - - - - - 0 - 0 - 83 - 40 - - - - Second Page - - - - - - First Label - - - - - - - Second Label - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - 0 - 0 - 100 - 30 - - - - Third Page - - - - - - - - - - - - - KLineEdit - QLineEdit -
klineedit.h
-
- - KTextEdit - QTextEdit -
ktextedit.h
-
-
- -
diff --git a/kstyles/oxygen/demo/oxygensimulator.cpp b/kstyles/oxygen/demo/oxygensimulator.cpp index 787fc9a6..4628c46d 100644 --- a/kstyles/oxygen/demo/oxygensimulator.cpp +++ b/kstyles/oxygen/demo/oxygensimulator.cpp @@ -36,8 +36,6 @@ #include #include #include -#include -#include #include #include #include @@ -46,7 +44,6 @@ #include #include #include -#include #include @@ -93,15 +90,6 @@ namespace Oxygen &option, radiobutton).center(); - } else if( const QMdiSubWindow* window = qobject_cast( receiver ) ) { - - QStyleOptionTitleBar option; - option.initFrom( window ); - int titleBarHeight( window->style()->pixelMetric( QStyle::PM_TitleBarHeight, &option, window ) ); - QRect titleBarRect( QPoint(0,0), QSize( window->width(), titleBarHeight ) ); - if( !titleBarRect.isValid() ) return; - position = titleBarRect.center(); - } else { position = receiver->rect().center(); @@ -365,15 +353,6 @@ namespace Oxygen if( !handleRect.isValid() ) break; begin = handleRect.center(); - } else if( const QMdiSubWindow* window = qobject_cast( receiver ) ) { - - QStyleOptionTitleBar option; - option.initFrom( window ); - int titleBarHeight( window->style()->pixelMetric( QStyle::PM_TitleBarHeight, &option, window ) ); - QRect titleBarRect( QPoint(0,0), QSize( window->width(), titleBarHeight ) ); - if( !titleBarRect.isValid() ) break; - begin = titleBarRect.center(); - } else { begin = receiver->rect().center(); diff --git a/kstyles/oxygen/oxygenmdiwindowshadow.cpp b/kstyles/oxygen/oxygenmdiwindowshadow.cpp deleted file mode 100644 index 7db074e1..00000000 --- a/kstyles/oxygen/oxygenmdiwindowshadow.cpp +++ /dev/null @@ -1,224 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// oxygenmdiwindowshadow.cpp -// handle MDI windows' shadows -// ------------------- -// -// Copyright (c) 2010 Hugo Pereira Da Costa -// -// Largely inspired from skulpture widget style -// Copyright (c) 2007-2009 Christoph Feck -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -////////////////////////////////////////////////////////////////////////////// - -#include "oxygenmdiwindowshadow.h" -#include "moc_oxygenmdiwindowshadow.cpp" -#include "oxygenshadowcache.h" - -#include -#include -#include -#include - -namespace Oxygen -{ - - //____________________________________________________________________ - void MdiWindowShadow::updateGeometry( void ) - { - if( !_widget ) return; - - // get tileSet rect - _tileSetRect = _widget->frameGeometry().adjusted( -ShadowSize, -ShadowSize, ShadowSize, ShadowSize ); - - // get parent MDI area's viewport - QWidget *parent( parentWidget() ); - if (parent && !qobject_cast(parent) && qobject_cast(parent->parentWidget())) - { parent = parent->parentWidget(); } - if( qobject_cast( parent ) ) - { parent = qobject_cast( parent )->viewport(); } - - // set geometry - QRect geometry( _tileSetRect ); - if( parent ) geometry &= parent->rect(); - setGeometry( geometry ); - - // translate rendering rect - _tileSetRect.translate( -geometry.topLeft() ); - - } - - //____________________________________________________________________ - void MdiWindowShadow::updateZOrder( void ) - { stackUnder( _widget ); } - - //____________________________________________________________________ - void MdiWindowShadow::paintEvent( QPaintEvent* event ) - { - - if( !_tileSet.isValid() ) return; - - QPainter p( this ); - p.setRenderHints( QPainter::Antialiasing ); - p.setClipRegion( event->region() ); - _tileSet.render( _tileSetRect, &p ); - - } - - //____________________________________________________________________ - MdiWindowShadowFactory::MdiWindowShadowFactory( QObject* parent, StyleHelper& helper ): - QObject( parent ) - { - - // create shadow cache - ShadowCache cache( helper ); - cache.setShadowSize( QPalette::Inactive, MdiWindowShadow::ShadowSize ); - cache.setShadowSize( QPalette::Active, MdiWindowShadow::ShadowSize ); - - // get tileset - _tileSet = *cache.tileSet( ShadowCache::Key() ); - } - - //____________________________________________________________________________________ - bool MdiWindowShadowFactory::registerWidget( QWidget* widget ) - { - - // check widget type - if( !( widget && qobject_cast( widget ) ) ) return false; - - // make sure widget is not already registered - if( isRegistered( widget ) ) return false; - - // store in set - _registeredWidgets.insert( widget ); - - widget->installEventFilter( this ); - - // catch object destruction - connect( widget, SIGNAL(destroyed(QObject*)), SLOT(widgetDestroyed(QObject*)) ); - - return true; - - } - - //____________________________________________________________________________________ - void MdiWindowShadowFactory::unregisterWidget( QWidget* widget ) - { - if( !isRegistered( widget ) ) return; - widget->removeEventFilter( this ); - _registeredWidgets.remove( widget ); - removeShadow( widget ); - } - - //____________________________________________________________________________________ - bool MdiWindowShadowFactory::eventFilter( QObject* object, QEvent* event ) - { - - switch( event->type() ) - { - // TODO: possibly implement ZOrderChange event, to make sure that - // the shadow is always painted on top - case QEvent::ZOrderChange: - updateShadowZOrder( object ); - break; - - case QEvent::Destroy: - if( isRegistered( object ) ) - { - _registeredWidgets.remove( object ); - removeShadow( object ); - } - break; - - case QEvent::Hide: - hideShadows( object ); - break; - - case QEvent::Show: - installShadow( object ); - updateShadowGeometry( object ); - updateShadowZOrder( object ); - break; - - case QEvent::Move: - case QEvent::Resize: - updateShadowGeometry( object ); - break; - - default: - break; - } - - return QObject::eventFilter( object, event ); - - } - - //____________________________________________________________________________________ - MdiWindowShadow* MdiWindowShadowFactory::findShadow( QObject* object ) const - { - - // check object, - if( !object->parent() ) return 0L; - - // find existing window shadows - const QList children = object->parent()->children(); - foreach( QObject *child, children ) - { - if( MdiWindowShadow* shadow = qobject_cast(child) ) - { if( shadow->widget() == object ) return shadow; } - } - - return 0L; - - } - - //____________________________________________________________________________________ - void MdiWindowShadowFactory::installShadow( QObject* object ) - { - - // cast - QWidget* widget( static_cast( object ) ); - if( !widget->parentWidget() ) return; - - // make sure shadow is not already installed - if( findShadow( object ) ) return; - - // create new shadow - MdiWindowShadow* windowShadow( new MdiWindowShadow( widget->parentWidget(), _tileSet ) ); - windowShadow->setWidget( widget ); - windowShadow->show(); - return; - - } - - //____________________________________________________________________________________ - void MdiWindowShadowFactory::removeShadow( QObject* object ) - { - if( MdiWindowShadow* windowShadow = findShadow( object ) ) - { - windowShadow->hide(); - windowShadow->deleteLater(); - } - } - - //____________________________________________________________________________________ - void MdiWindowShadowFactory::widgetDestroyed( QObject* object ) - { _registeredWidgets.remove( object ); } - -} diff --git a/kstyles/oxygen/oxygenmdiwindowshadow.h b/kstyles/oxygen/oxygenmdiwindowshadow.h deleted file mode 100644 index 66e68611..00000000 --- a/kstyles/oxygen/oxygenmdiwindowshadow.h +++ /dev/null @@ -1,193 +0,0 @@ -#ifndef OXYGENMDIWINDOWSHADOW_H -#define OXYGENMDIWINDOWSHADOW_H - -////////////////////////////////////////////////////////////////////////////// -// oxygenmdiwindowshadow.h -// handle MDI windows' shadows -// ------------------- -// -// Copyright (c) 2010 Hugo Pereira Da Costa -// -// Largely inspired from skulpture widget style -// Copyright (c) 2007-2009 Christoph Feck -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -// IN THE SOFTWARE. -////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include - -#include -#include -#include - -#include "oxygenstylehelper.h" -#include "oxygentileset.h" - -namespace Oxygen -{ - - //! frame shadow - /*! this allows the shadow to be painted over the widgets viewport */ - class MdiWindowShadow: public QWidget - { - - Q_OBJECT - - public: - - //! shadow size (hard coded) - enum { ShadowSize = 10 }; - - //! constructor - explicit MdiWindowShadow( QWidget* parent, TileSet tileSet ): - QWidget( parent ), - _widget( 0L ), - _tileSet( tileSet ) - { - setAttribute( Qt::WA_OpaquePaintEvent, false ); - setAttribute( Qt::WA_TransparentForMouseEvents, true ); - setFocusPolicy( Qt::NoFocus ); - } - - //! destructor - virtual ~MdiWindowShadow( void ) - {} - - //! update geometry - void updateGeometry( void ); - - //! update ZOrder - void updateZOrder( void ); - - //! set associated window - void setWidget( QWidget* value ) - { _widget = value; } - - //! associated window - QWidget* widget( void ) const - { return _widget; } - - protected: - - //! painting - virtual void paintEvent(QPaintEvent *); - - private: - - //! associated widget - QWidget* _widget; - - //! tileset rect, used for painting - QRect _tileSetRect; - - //! tileset used to draw shadow - TileSet _tileSet; - - }; - - //! shadow manager - class MdiWindowShadowFactory: public QObject - { - - Q_OBJECT - - public: - - //! constructor - MdiWindowShadowFactory( QObject*, StyleHelper& ); - - //! destructor - virtual ~MdiWindowShadowFactory( void ) - {} - - //! register widget - bool registerWidget( QWidget* ); - - //! unregister - void unregisterWidget( QWidget* ); - - //! true if widget is registered - bool isRegistered( const QObject* widget ) const - { return _registeredWidgets.contains( widget ); } - - //! event filter - virtual bool eventFilter( QObject*, QEvent*); - - protected: - - //! find shadow matching a given object - MdiWindowShadow* findShadow( QObject* ) const; - - //! install shadows on given widget - void installShadow( QObject* ); - - //! remove shadows from widget - void removeShadow( QObject* ); - - //! hide shadows - void hideShadows( QObject* object ) const - { - if( MdiWindowShadow* windowShadow = findShadow( object ) ) - { windowShadow->hide(); } - } - - //! update ZOrder - void updateShadowZOrder( QObject* object ) const - { - if( MdiWindowShadow* windowShadow = findShadow( object ) ) - { - if( !windowShadow->isVisible() ) windowShadow->show(); - windowShadow->updateZOrder(); - } - } - - //! update shadows geometry - void updateShadowGeometry( QObject* object ) const - { - if( MdiWindowShadow* windowShadow = findShadow( object ) ) - { windowShadow->updateGeometry(); } - } - - //! update shadows - void update( QObject* object ) const - { - if( MdiWindowShadow* windowShadow = findShadow( object ) ) - { windowShadow->update(); } - } - - protected slots: - - //! triggered by object destruction - void widgetDestroyed( QObject* ); - - private: - - //! set of registered widgets - QSet _registeredWidgets; - - //! tileset used to draw shadow - TileSet _tileSet; - - }; - -} - -#endif diff --git a/kstyles/oxygen/oxygenstyle.cpp b/kstyles/oxygen/oxygenstyle.cpp index 58274f30..c35b8b5f 100644 --- a/kstyles/oxygen/oxygenstyle.cpp +++ b/kstyles/oxygen/oxygenstyle.cpp @@ -50,7 +50,6 @@ #include "moc_oxygenstyle.cpp" #include "oxygenframeshadow.h" -#include "oxygenmdiwindowshadow.h" #include "oxygenmnemonics.h" #include "oxygenshadowhelper.h" #include "oxygenstyleconfigdata.h" @@ -75,7 +74,6 @@ #include #include #include -#include #include #include #include @@ -159,7 +157,6 @@ namespace Oxygen _windowManager( new WindowManager( this ) ), _topLevelManager( new TopLevelManager( this, *_helper ) ), _frameShadowFactory( new FrameShadowFactory( this ) ), - _mdiWindowShadowFactory( new MdiWindowShadowFactory( this, *_helper ) ), _mnemonics( new Mnemonics( this ) ), _widgetExplorer( new WidgetExplorer( this ) ), _tabBarData( new TabBarData( this ) ), @@ -195,7 +192,6 @@ namespace Oxygen // register widget to animations windowManager().registerWidget( widget ); frameShadowFactory().registerWidget( widget, helper() ); - mdiWindowShadowFactory().registerWidget( widget ); shadowHelper().registerWidget( widget ); // scroll areas @@ -368,11 +364,6 @@ namespace Oxygen widget->setContentsMargins( 3,3,3,3 ); addEventFilter( widget ); - } else if( qobject_cast( widget ) ) { - - widget->setAutoFillBackground( false ); - addEventFilter( widget ); - } else if( qobject_cast( widget ) ) { widget->setBackgroundRole( QPalette::NoRole ); @@ -418,7 +409,6 @@ namespace Oxygen // register widget to animations windowManager().unregisterWidget( widget ); frameShadowFactory().unregisterWidget( widget ); - mdiWindowShadowFactory().unregisterWidget( widget ); shadowHelper().unregisterWidget( widget ); if( isKTextEditFrame( widget ) ) @@ -1146,7 +1136,6 @@ namespace Oxygen if( QToolBar* toolBar = qobject_cast( object ) ) { return eventFilterToolBar( toolBar, event ); } if( QDockWidget* dockWidget = qobject_cast( object ) ) { return eventFilterDockWidget( dockWidget, event ); } if( QToolBox* toolBox = qobject_cast( object ) ) { return eventFilterToolBox( toolBox, event ); } - if( QMdiSubWindow* subWindow = qobject_cast( object ) ) { return eventFilterMdiSubWindow( subWindow, event ); } if( QScrollBar* scrollBar = qobject_cast( object ) ) { return eventFilterScrollBar( scrollBar, event ); } if( QProgressBar* progressBar = qobject_cast( object ) ) { return eventFilterProgressBar( progressBar, event ); } @@ -1263,36 +1252,6 @@ namespace Oxygen } - //____________________________________________________________________________ - bool Style::eventFilterMdiSubWindow( QMdiSubWindow* subWindow, QEvent* event ) - { - - if( event->type() == QEvent::Paint ) - { - - QPainter painter( subWindow ); - QRect clip( static_cast( event )->rect() ); - if( subWindow->isMaximized() ) helper().renderWindowBackground( &painter, clip, subWindow, subWindow->palette() ); - else { - - painter.setClipRect( clip ); - - const QRect r( subWindow->rect() ); - TileSet *tileSet( helper().roundCorner( subWindow->palette().color( subWindow->backgroundRole() ) ) ); - tileSet->render( r, &painter ); - - painter.setClipRegion( helper().roundedMask( r.adjusted( 1, 1, -1, -1 ) ), Qt::IntersectClip ); - helper().renderWindowBackground( &painter, clip, subWindow, subWindow, subWindow->palette(), 0, 58 ); - - } - - } - - // continue with normal painting - return false; - - } - //_________________________________________________________ bool Style::eventFilterScrollBar( QWidget* widget, QEvent* event ) { diff --git a/kstyles/oxygen/oxygenstyle.h b/kstyles/oxygen/oxygenstyle.h index c679ebfe..b4be69a1 100644 --- a/kstyles/oxygen/oxygenstyle.h +++ b/kstyles/oxygen/oxygenstyle.h @@ -54,7 +54,6 @@ #include #include #include -#include #include #include #include @@ -69,7 +68,6 @@ namespace Oxygen class Animations; class FrameShadowFactory; - class MdiWindowShadowFactory; class Mnemonics; class ShadowHelper; class StyleHelper; @@ -171,7 +169,6 @@ namespace Oxygen //@{ bool eventFilterComboBoxContainer( QWidget*, QEvent* ); bool eventFilterDockWidget( QDockWidget*, QEvent* ); - bool eventFilterMdiSubWindow( QMdiSubWindow*, QEvent* ); bool eventFilterScrollBar( QWidget*, QEvent* ); bool eventFilterTabBar( QWidget*, QEvent* ); bool eventFilterToolBar( QToolBar*, QEvent* ); @@ -342,10 +339,6 @@ namespace Oxygen FrameShadowFactory& frameShadowFactory( void ) const { return *_frameShadowFactory; } - //! mdi window shadows - MdiWindowShadowFactory& mdiWindowShadowFactory( void ) const - { return *_mdiWindowShadowFactory; } - //! mdi window shadows Mnemonics& mnemonics( void ) const { return *_mnemonics; } @@ -820,9 +813,6 @@ namespace Oxygen //! frame shadows FrameShadowFactory* _frameShadowFactory; - //! mdi window shadows - MdiWindowShadowFactory* _mdiWindowShadowFactory; - //! keyboard accelerators Mnemonics* _mnemonics; diff --git a/kstyles/oxygen/oxygenwindowmanager.cpp b/kstyles/oxygen/oxygenwindowmanager.cpp index ca12c5a7..5e4de20d 100644 --- a/kstyles/oxygen/oxygenwindowmanager.cpp +++ b/kstyles/oxygen/oxygenwindowmanager.cpp @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include @@ -466,9 +465,6 @@ namespace Oxygen if( QMenuBar* menuBar = qobject_cast( widget ) ) { - // do not drag from menubars embedded in Mdi windows - if( findParent( widget ) ) return false; - // check if there is an active action if( menuBar->activeAction() && menuBar->activeAction()->isEnabled() ) return false;