[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [oxygen] /: removed all background pixmap related code: it was not ported to kdecoration, and thus o
From:       Hugo Pereira Da Costa <hugo.pereira () free ! fr>
Date:       2016-02-04 16:10:48
Message-ID: E1aRMUa-0006HE-0B () scm ! kde ! org
[Download RAW message or body]

Git commit d44560b7c574297fa907e1953edc360c3d0409f3 by Hugo Pereira Da Costa.
Committed on 04/02/2016 at 13:12.
Pushed by hpereiradacosta into branch 'master'.

removed all background pixmap related code: it was not ported to kdecoration, and \
thus out of sync between style and decoration

M  +0    -6    kstyle/oxygen.kcfg
M  +2    -9    kstyle/oxygenstyle.cpp
M  +0    -3    kstyle/oxygenstylehelper.cpp
M  +0    -80   liboxygen/oxygenhelper.cpp
M  +0    -30   liboxygen/oxygenhelper.h

http://commits.kde.org/oxygen/d44560b7c574297fa907e1953edc360c3d0409f3

diff --git a/kstyle/oxygen.kcfg b/kstyle/oxygen.kcfg
index b3551cc..1bcb371 100644
--- a/kstyle/oxygen.kcfg
+++ b/kstyle/oxygen.kcfg
@@ -10,12 +10,6 @@
     <entry name="UseBackgroundGradient" type = "Bool" >
        <default>true</default>
     </entry>
-
-    <!-- background pixmap -->
-    <entry name="BackgroundPixmap" type = "String" >
-       <default></default>
-    </entry>
-
   </group>
 
   <!-- widget style -->
diff --git a/kstyle/oxygenstyle.cpp b/kstyle/oxygenstyle.cpp
index 7813567..1951f60 100644
--- a/kstyle/oxygenstyle.cpp
+++ b/kstyle/oxygenstyle.cpp
@@ -15,7 +15,7 @@
 // Copyright ( C ) 2001-2002, Chris Lee <clee@kde.org>
 // Carsten Pfeiffer <pfeiffer@kde.org>
 // Karol Szwed <gallium@kde.org>
-// Drawing routines completely reimplemented from KDE3 HighColor, which was
+// Drawing routines completely reimplemented from KDE3 +HighColor, which was
 // originally based on some stuff from the KDE2 HighColor.
 //
 // based on drawing routines of the style "Keramik":
@@ -225,10 +225,7 @@ namespace Oxygen
             // cast to QWidget
             QWidget *widget = static_cast<QWidget*>( object );
             if( event->type() == QEvent::Show && _helper.hasDecoration( widget ) )
-            {
-                _helper.setHasBackgroundGradient( widget->winId(), true );
-                _helper.setHasBackgroundPixmap( widget->winId(), \
                _helper.hasBackgroundPixmap() );
-            }
+            { _helper.setHasBackgroundGradient( widget->winId(), true ); }
 
             return false;
         }
@@ -1790,9 +1787,6 @@ namespace Oxygen
         // background gradient
         _helper->setUseBackgroundGradient( StyleConfigData::useBackgroundGradient() \
);  
-        // background pixmap
-        _helper->setBackgroundPixmap( StyleConfigData::backgroundPixmap() );
-
         // update top level window hints
         foreach( QWidget* widget, qApp->topLevelWidgets() )
         {
@@ -1804,7 +1798,6 @@ namespace Oxygen
 
             // update flags
             _helper->setHasBackgroundGradient( widget->winId(), true );
-            _helper->setHasBackgroundPixmap( widget->winId(), \
_helper->hasBackgroundPixmap() );  }
 
         // update caches size
diff --git a/kstyle/oxygenstylehelper.cpp b/kstyle/oxygenstylehelper.cpp
index a3d8f3d..01eb1f8 100644
--- a/kstyle/oxygenstylehelper.cpp
+++ b/kstyle/oxygenstylehelper.cpp
@@ -119,9 +119,6 @@ namespace Oxygen
             painter->fillRect( widget->rect(), color );
         }
 
-        // background pixmap
-        Helper::renderBackgroundPixmap( painter, clipRect, widget, widget->window(), \
                y_shift, gradientHeight );
-
     }
 
     //____________________________________________________________________
diff --git a/liboxygen/oxygenhelper.cpp b/liboxygen/oxygenhelper.cpp
index 7ba8242..4ff7d9c 100644
--- a/liboxygen/oxygenhelper.cpp
+++ b/liboxygen/oxygenhelper.cpp
@@ -216,59 +216,6 @@ namespace Oxygen
         { p->restore(); }
     }
 
-
-    //____________________________________________________________________
-    void Helper::renderBackgroundPixmap( QPainter* p, const QRect& clipRect, const \
                QWidget* widget, const QWidget* window, int yShift, int \
                gradientHeight )
-    {
-
-        // background pixmap
-        if( _backgroundPixmap.isNull() ) return;
-
-        // get coordinates relative to the client area
-        // this is stupid. One could use mapTo if this was taking const QWidget* and \
                not
-        // QWidget* as argument.
-        const QWidget* w( widget );
-        int x( 0 );
-        int y( -yShift );
-
-        while ( w != window && !w->isWindow() && w != w->parentWidget() )
-        {
-            x += w->geometry().x();
-            y += w->geometry().y();
-            w = w->parentWidget();
-        }
-
-        if ( clipRect.isValid() )
-        {
-            p->save();
-            p->setClipRegion( clipRect,Qt::IntersectClip );
-        }
-
-        // calculate upper part height
-        // special tricks are needed
-        // to handle both window contents and window decoration
-        int height( window->frameGeometry().height() );
-        int width( window->frameGeometry().width() );
-
-        // account for vertical shift
-        if( yShift > 0 ) height -= 2*yShift;
-
-        // calculate source rect
-        QPoint offset( 40, 48 - 20 );
-        QRect source( 0, 0, width + offset.x(), height + offset.y() );
-
-        offset -= _backgroundPixmapOffset;
-        source.translate( offset.x(), offset.y() );
-        source.translate( 0, 20 - gradientHeight );
-
-        // draw
-        p->drawPixmap( QPoint( -x, -y ), _backgroundPixmap, source );
-
-        if ( clipRect.isValid() )
-        { p->restore(); }
-
-    }
-
     //_____________________________________________________________
     void Helper::renderDot( QPainter* p, const QPoint& point, const QColor& \
baseColor )  {
@@ -1046,31 +993,6 @@ namespace Oxygen
         #endif
     }
 
-    //____________________________________________________________________
-    void Helper::setHasBackgroundPixmap( WId id, bool value ) const
-    {
-
-        #if OXYGEN_HAVE_X11
-        setHasHint( id, _backgroundPixmapAtom, value );
-        #else
-        Q_UNUSED( id );
-        Q_UNUSED( value );
-        #endif
-        return;
-    }
-
-    //____________________________________________________________________
-    bool Helper::hasBackgroundPixmap( WId id ) const
-    {
-
-        #if OXYGEN_HAVE_X11
-        return hasHint( id, _backgroundPixmapAtom );
-        #else
-        Q_UNUSED( id );
-        return false;
-        #endif
-    }
-
     //______________________________________________________________________________________
  QPixmap Helper::highDpiPixmap( int width, int height ) const
     {
@@ -1307,12 +1229,10 @@ namespace Oxygen
         {
 
             _backgroundGradientAtom = createAtom( QStringLiteral( \
                "_KDE_OXYGEN_BACKGROUND_GRADIENT" ) );
-            _backgroundPixmapAtom = createAtom( QStringLiteral( \
"_KDE_OXYGEN_BACKGROUND_PIXMAP" ) );  
         } else {
 
             _backgroundGradientAtom = 0;
-            _backgroundPixmapAtom = 0;
 
         }
 
diff --git a/liboxygen/oxygenhelper.h b/liboxygen/oxygenhelper.h
index 0e1fd51..883120e 100644
--- a/liboxygen/oxygenhelper.h
+++ b/liboxygen/oxygenhelper.h
@@ -212,21 +212,6 @@ namespace Oxygen
 
         void renderWindowBackground( QPainter* p, const QRect& clipRect, const \
QRect& windowRect, const QColor& color, int y_shift, int gradientHeight = 20 );  
-        //* background pixmap
-        bool hasBackgroundPixmap( void ) const
-        { return !_backgroundPixmap.isNull(); }
-
-        //* background pixmap
-        void setBackgroundPixmap( const QPixmap& pixmap )
-        { _backgroundPixmap = pixmap; }
-
-        //* offset
-        void setBackgroundPixmapOffset( const QPoint& offset )
-        { _backgroundPixmapOffset = offset; }
-
-        //* render window background using a given color as a reference
-        virtual void renderBackgroundPixmap( QPainter* p, const QRect& clipRect, \
                const QWidget *, const QWidget *, int y_shift=-23, int gradientHeight \
                = 20 );
-
         //@}
 
         //* dots
@@ -361,12 +346,6 @@ namespace Oxygen
         //* true if background gradient hint is set
         virtual bool hasBackgroundGradient( WId ) const;
 
-        //* set background pixmap hint to widget
-        virtual void setHasBackgroundPixmap( WId, bool ) const;
-
-        //* true if background pixmap hint is set
-        virtual bool hasBackgroundPixmap( WId ) const;
-
         //@}
 
         //@name high dpi utility functions
@@ -496,12 +475,6 @@ namespace Oxygen
         ColorMap _highThreshold;
         ColorMap _lowThreshold;
 
-        //* background pixmap
-        QPixmap _backgroundPixmap;
-
-        //* background pixmap offsets
-        QPoint _backgroundPixmapOffset;
-
         #if OXYGEN_HAVE_X11
 
         //* set value for given hint
@@ -513,9 +486,6 @@ namespace Oxygen
         //* background gradient hint atom
         xcb_atom_t _backgroundGradientAtom;
 
-        //* background gradient hint atom
-        xcb_atom_t _backgroundPixmapAtom;
-
         #endif
 
         bool _isX11;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic