2009-09-15 07:12:54 +00:00
|
|
|
#ifndef oxygenclient_h
|
|
|
|
#define oxygenclient_h
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2009-08-24 16:14:11 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2009-09-15 07:12:54 +00:00
|
|
|
// oxygenclient.h
|
2009-08-24 16:14:11 +00:00
|
|
|
// -------------------
|
2009-09-09 00:55:55 +00:00
|
|
|
//
|
2009-08-24 16:14:11 +00:00
|
|
|
// Copyright (c) 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
|
2009-08-25 04:15:13 +00:00
|
|
|
// Copyright (c) 2003, 2004 David Johnson <david@usermode.org>
|
|
|
|
// Copyright (c) 2006, 2007 Riccardo Iaconelli <ruphy@fsfe.org>
|
2009-08-24 16:14:11 +00:00
|
|
|
//
|
|
|
|
// 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
|
2009-09-09 00:55:55 +00:00
|
|
|
// IN THE SOFTWARE.
|
2009-08-24 16:14:11 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2009-10-13 01:45:01 +00:00
|
|
|
#include "oxygen.h"
|
2009-11-15 03:24:04 +00:00
|
|
|
#include "oxygenclientgroupitemdata.h"
|
2009-09-15 07:12:54 +00:00
|
|
|
#include "oxygenconfiguration.h"
|
2009-11-17 21:56:04 +00:00
|
|
|
#include "lib/oxygenanimation.h"
|
2009-08-22 08:24:06 +00:00
|
|
|
#include "lib/helper.h"
|
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
#include <kcommondecoration.h>
|
2009-11-15 06:28:40 +00:00
|
|
|
#include <QBasicTimer>
|
|
|
|
#include <QTimerEvent>
|
2009-11-15 03:24:04 +00:00
|
|
|
|
2009-09-15 07:12:54 +00:00
|
|
|
namespace Oxygen
|
2009-08-22 08:24:06 +00:00
|
|
|
{
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-15 07:12:54 +00:00
|
|
|
class OxygenSizeGrip;
|
|
|
|
class OxygenClient : public KCommonDecorationUnstable
|
2009-08-22 08:24:06 +00:00
|
|
|
{
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
Q_OBJECT
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-11-17 21:56:04 +00:00
|
|
|
//! declare glow intensity property
|
2009-11-17 22:26:36 +00:00
|
|
|
//!Q_PROPERTY( qreal glowIntensity READ glowIntensity WRITE setGlowIntensity )
|
|
|
|
Q_PROPERTY( qreal glowIntensity READ glowIntensityUnbiased WRITE setGlowIntensity )
|
2009-11-17 21:56:04 +00:00
|
|
|
|
|
|
|
//! declare title opacity
|
|
|
|
Q_PROPERTY( qreal titleOpacity READ titleOpacity WRITE setTitleOpacity )
|
|
|
|
|
2009-09-04 18:58:40 +00:00
|
|
|
public:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-04 18:58:40 +00:00
|
|
|
//! constructor
|
2009-10-13 01:45:01 +00:00
|
|
|
OxygenClient(KDecorationBridge *b, OxygenFactory *f);
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! destructor
|
2009-09-15 07:12:54 +00:00
|
|
|
virtual ~OxygenClient();
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-10-14 14:37:58 +00:00
|
|
|
//! decoration name
|
2009-08-22 08:24:06 +00:00
|
|
|
virtual QString visibleName() const;
|
2009-10-14 14:37:58 +00:00
|
|
|
|
|
|
|
//! buttons
|
2009-08-22 08:24:06 +00:00
|
|
|
virtual KCommonDecorationButton *createButton(::ButtonType type);
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-18 06:54:42 +00:00
|
|
|
//!@name flags
|
|
|
|
//@{
|
|
|
|
|
2009-10-14 14:37:58 +00:00
|
|
|
//! true if decoration has iquired behavior
|
|
|
|
virtual bool decorationBehaviour(DecorationBehaviour behaviour) const;
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! true if window is maximized
|
2009-09-18 06:54:42 +00:00
|
|
|
virtual bool isMaximized( void ) const
|
|
|
|
{ return maximizeMode()==MaximizeFull && !options()->moveResizeMaximizedWindows(); }
|
|
|
|
|
2009-11-17 21:56:04 +00:00
|
|
|
//! true if glow is animated
|
|
|
|
bool glowIsAnimated( void ) const
|
|
|
|
{ return glowAnimation_.data()->isRunning(); }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
//! true when decoration is forced active
|
|
|
|
bool isForcedActive( void ) const
|
|
|
|
{ return forceActive_ && clientGroupItems().count() > 1; }
|
|
|
|
|
2009-09-07 17:26:56 +00:00
|
|
|
//! true when separator is to be drawn
|
2009-09-18 01:32:27 +00:00
|
|
|
bool drawSeparator( void ) const
|
|
|
|
{
|
2009-10-15 16:03:30 +00:00
|
|
|
return
|
2009-11-17 21:56:04 +00:00
|
|
|
( glowIsAnimated() || isActive() ) &&
|
2009-10-15 16:03:30 +00:00
|
|
|
configuration().drawSeparator() &&
|
2009-11-07 03:33:53 +00:00
|
|
|
!configuration().hideTitleBar() &&
|
2009-10-15 16:03:30 +00:00
|
|
|
!configuration().drawTitleOutline();
|
2009-09-18 01:32:27 +00:00
|
|
|
}
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-18 06:54:42 +00:00
|
|
|
//@}
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! window shape
|
|
|
|
virtual void updateWindowShape();
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! initialization
|
|
|
|
virtual void init();
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-10 05:13:25 +00:00
|
|
|
// reset
|
|
|
|
virtual void reset( unsigned long changed );
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! return associated configuration
|
2009-09-18 06:54:42 +00:00
|
|
|
const OxygenConfiguration& configuration( void ) const
|
|
|
|
{ return configuration_; }
|
|
|
|
|
2009-11-17 21:56:04 +00:00
|
|
|
//!@name glow animation
|
|
|
|
//@{
|
|
|
|
|
|
|
|
virtual const Animation::Pointer& glowAnimation( void ) const
|
|
|
|
{ return glowAnimation_; }
|
|
|
|
|
|
|
|
void setGlowIntensity( qreal value )
|
|
|
|
{ glowIntensity_ = value; }
|
|
|
|
|
2009-11-17 22:26:36 +00:00
|
|
|
//! unbiased glow intensity
|
|
|
|
qreal glowIntensityUnbiased( void ) const
|
2009-11-17 21:56:04 +00:00
|
|
|
{ return glowIntensity_; }
|
|
|
|
|
2009-11-17 22:26:36 +00:00
|
|
|
//! glow bias
|
|
|
|
static qreal glowBias( void )
|
|
|
|
{ return 0.2; }
|
|
|
|
|
|
|
|
//! true (biased) intensity
|
|
|
|
/*! this is needed to have glow go from either 0.2->1 or 0.8->0 depending on the animation direction */
|
|
|
|
qreal glowIntensity( void ) const
|
|
|
|
{ return glowAnimation().data()->direction() == Animation::Forward ? glowIntensity_ : glowIntensity_-glowBias(); }
|
|
|
|
|
2009-11-17 21:56:04 +00:00
|
|
|
//@}
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! helper class
|
2009-09-04 04:22:26 +00:00
|
|
|
OxygenHelper& helper( void ) const
|
2009-10-13 01:45:01 +00:00
|
|
|
{ return factory_->helper(); }
|
|
|
|
|
|
|
|
//! helper class
|
|
|
|
OxygenShadowCache& shadowCache( void ) const
|
|
|
|
{ return factory_->shadowCache(); }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-10-14 14:37:58 +00:00
|
|
|
//!@name metrics and color definitions
|
|
|
|
//@{
|
|
|
|
|
|
|
|
//! dimensions
|
|
|
|
virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const;
|
2009-11-15 07:27:49 +00:00
|
|
|
|
|
|
|
//! get title rect for untabbed window
|
|
|
|
virtual QRect defaultTitleRect( bool active = true ) const;
|
2009-10-14 14:37:58 +00:00
|
|
|
|
2009-10-15 16:03:30 +00:00
|
|
|
//! get title bounding rect
|
2009-11-15 03:24:04 +00:00
|
|
|
virtual QRect titleBoundingRect( const QFont& font, const QString& caption ) const
|
|
|
|
{ return titleBoundingRect( font, titleRect(), caption ); }
|
2009-10-14 14:37:58 +00:00
|
|
|
|
|
|
|
//! get title bounding rect
|
2009-11-15 03:24:04 +00:00
|
|
|
virtual QRect titleBoundingRect( const QFont&, QRect, const QString& ) const;
|
2009-10-14 14:37:58 +00:00
|
|
|
|
2009-09-09 17:00:13 +00:00
|
|
|
//! palette background
|
|
|
|
QPalette backgroundPalette( const QWidget*, QPalette ) const;
|
|
|
|
|
2009-09-26 04:57:27 +00:00
|
|
|
//! background
|
|
|
|
QColor backgroundColor( const QWidget* widget, QPalette palette ) const
|
2009-11-15 03:24:04 +00:00
|
|
|
{ return backgroundColor( widget, palette, isActive() || isForcedActive() ); }
|
2009-09-26 04:57:27 +00:00
|
|
|
|
|
|
|
//! background
|
|
|
|
QColor backgroundColor( const QWidget*, QPalette, bool ) const;
|
|
|
|
|
2009-10-14 14:37:58 +00:00
|
|
|
//@}
|
|
|
|
|
2009-11-10 23:11:08 +00:00
|
|
|
//! default buttons located on the left
|
|
|
|
virtual QString defaultButtonsLeft() const;
|
|
|
|
|
|
|
|
//! default buttons located on the right
|
|
|
|
virtual QString defaultButtonsRight() const;
|
|
|
|
|
2009-10-17 06:57:17 +00:00
|
|
|
//!@name status change methods (overloaded from KCommonDecorationUnstable)
|
|
|
|
//@{
|
|
|
|
|
|
|
|
//! triggered when window activity is changed
|
|
|
|
virtual void activeChange();
|
|
|
|
|
|
|
|
//! triggered when maximize state changed
|
|
|
|
virtual void maximizeChange();
|
|
|
|
|
|
|
|
//! triggered when window shade is changed
|
|
|
|
virtual void shadeChange();
|
|
|
|
|
|
|
|
//! triggered when window shade is changed
|
|
|
|
virtual void captionChange();
|
|
|
|
|
|
|
|
//@}
|
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
//! event filter
|
|
|
|
virtual bool eventFilter( QObject*, QEvent* );
|
2009-10-17 06:57:17 +00:00
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
//! resize event
|
|
|
|
virtual void resizeEvent(QResizeEvent *e);
|
2009-10-17 06:57:17 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
//! true when decoration is forced active
|
|
|
|
void setForceActive( bool value )
|
|
|
|
{ forceActive_ = value; }
|
|
|
|
|
|
|
|
//!@name event filters
|
|
|
|
//@{
|
|
|
|
|
2009-10-17 06:57:17 +00:00
|
|
|
//! paint
|
|
|
|
virtual void paintEvent( QPaintEvent* );
|
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
//! mouse press event
|
|
|
|
virtual bool mousePressEvent( QMouseEvent* );
|
|
|
|
|
|
|
|
//! mouse release event
|
|
|
|
virtual bool mouseReleaseEvent( QMouseEvent* );
|
|
|
|
|
|
|
|
//! mouse move event
|
|
|
|
virtual bool mouseMoveEvent( QMouseEvent* );
|
|
|
|
|
|
|
|
//! drag enter event
|
|
|
|
virtual bool dragEnterEvent( QDragEnterEvent* );
|
|
|
|
|
|
|
|
//! drag move event
|
|
|
|
virtual bool dragMoveEvent( QDragMoveEvent* );
|
|
|
|
|
|
|
|
//! drag leave event
|
|
|
|
virtual bool dragLeaveEvent( QDragLeaveEvent* );
|
|
|
|
|
|
|
|
//! drop event
|
|
|
|
virtual bool dropEvent( QDropEvent* );
|
|
|
|
|
2009-11-15 06:28:40 +00:00
|
|
|
//! timer event
|
|
|
|
virtual void timerEvent( QTimerEvent* );
|
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
//@}
|
|
|
|
|
2009-10-14 14:37:58 +00:00
|
|
|
//!@name rendering methods (called in paintEvent)
|
|
|
|
//@{
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! window background
|
|
|
|
virtual void renderWindowBackground( QPainter*, const QRect&, const QWidget*, const QPalette& ) const;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-04 18:58:40 +00:00
|
|
|
//! window border
|
|
|
|
// this draws a "blue" border around active window
|
2009-10-15 16:03:30 +00:00
|
|
|
virtual void renderWindowBorder( QPainter*, const QRect&, const QWidget*, const QPalette& ) const;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-18 01:32:27 +00:00
|
|
|
//! separator
|
|
|
|
virtual void renderSeparator( QPainter*, const QRect&, const QWidget*, const QColor& ) const;
|
|
|
|
|
2009-09-04 18:58:40 +00:00
|
|
|
//! title outline
|
|
|
|
virtual void renderTitleOutline( QPainter*, const QRect&, const QPalette& ) const;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-10-02 02:52:41 +00:00
|
|
|
//! title text
|
2009-11-14 04:19:09 +00:00
|
|
|
/*! second color, if valid, is for contrast pixel */
|
|
|
|
virtual void renderTitleText( QPainter*, const QRect&, const QColor&, const QColor& = QColor() ) const;
|
2009-10-15 16:03:30 +00:00
|
|
|
|
|
|
|
//! title text
|
2009-11-14 04:19:09 +00:00
|
|
|
/*! second color, if valid, is for contrast pixel */
|
|
|
|
virtual void renderTitleText( QPainter*, const QRect&, const QString&, const QColor&, const QColor& = QColor() ) const;
|
2009-10-02 02:52:41 +00:00
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
//! GroupItem
|
|
|
|
virtual void renderItem( QPainter*, int, const QPalette& );
|
|
|
|
|
|
|
|
//! tabbing target rect
|
|
|
|
virtual void renderTargetRect( QPainter*, const QPalette& );
|
|
|
|
|
2009-10-14 14:28:37 +00:00
|
|
|
//! render float frame
|
|
|
|
virtual void renderFloatFrame( QPainter*, const QRect&, const QPalette& ) const;
|
|
|
|
|
|
|
|
//! render dots
|
|
|
|
virtual void renderDots( QPainter*, const QRect&, const QColor& ) const;
|
|
|
|
|
2009-10-14 14:37:58 +00:00
|
|
|
//@}
|
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
//! close tab matching give button
|
|
|
|
virtual bool closeItem( const OxygenButton* );
|
|
|
|
|
|
|
|
//! index of item matching point
|
|
|
|
int itemClicked( const QPoint& position, bool between = false ) const
|
|
|
|
{ return itemData_.itemAt( position , between ); }
|
|
|
|
|
|
|
|
//! return pixmap corresponding to a given tab, for dragging
|
|
|
|
QPixmap itemDragPixmap( int, const QRect& );
|
|
|
|
|
2009-11-17 21:56:04 +00:00
|
|
|
//!@name title animation
|
|
|
|
//@{
|
|
|
|
|
|
|
|
const Animation::Pointer& titleAnimation( void ) const
|
|
|
|
{ return titleAnimation_; }
|
|
|
|
|
|
|
|
bool titleIsAnimated( void ) const
|
|
|
|
{ return titleAnimation().data()->isRunning(); }
|
2009-10-02 02:52:41 +00:00
|
|
|
|
|
|
|
qreal titleOpacity( void ) const
|
2009-11-17 21:56:04 +00:00
|
|
|
{ return titleOpacity_; }
|
|
|
|
|
|
|
|
void setTitleOpacity( qreal value )
|
|
|
|
{ titleOpacity_ = value; }
|
|
|
|
|
|
|
|
//@}
|
2009-10-02 02:52:41 +00:00
|
|
|
|
|
|
|
//! old caption if any
|
|
|
|
const QString& oldCaption( void ) const
|
|
|
|
{ return oldCaption_; }
|
|
|
|
|
|
|
|
//! old caption
|
|
|
|
void setOldCaption( const QString& value )
|
|
|
|
{ oldCaption_ = value; }
|
|
|
|
|
2009-09-18 01:32:27 +00:00
|
|
|
//! return true when activity change are animated
|
|
|
|
bool animateActiveChange( void ) const
|
2009-10-07 15:38:18 +00:00
|
|
|
{ return ( configuration().useAnimations() && !isPreview() ); }
|
2009-09-18 01:32:27 +00:00
|
|
|
|
2009-10-02 02:52:41 +00:00
|
|
|
//! return true when activity change are animated
|
|
|
|
bool animateTitleChange( void ) const
|
|
|
|
{
|
2009-10-15 16:03:30 +00:00
|
|
|
return
|
|
|
|
configuration().useAnimations() &&
|
|
|
|
!configuration().drawTitleOutline() &&
|
2009-11-07 03:33:53 +00:00
|
|
|
!configuration().hideTitleBar() &&
|
2009-10-15 16:03:30 +00:00
|
|
|
!isPreview();
|
2009-10-02 02:52:41 +00:00
|
|
|
}
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! calculate mask
|
|
|
|
QRegion calcMask( void ) const;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! text color
|
|
|
|
QColor titlebarTextColor(const QPalette&);
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-18 19:47:53 +00:00
|
|
|
//! text color
|
|
|
|
QColor titlebarTextColor(const QPalette&, bool active);
|
|
|
|
|
2009-11-14 04:19:09 +00:00
|
|
|
//! text color
|
2009-11-15 03:24:04 +00:00
|
|
|
QColor titlebarContrastColor(const QPalette& palette ) const
|
|
|
|
{ return titlebarContrastColor( palette.color( widget()->window()->backgroundRole() ) ); }
|
|
|
|
|
|
|
|
//! text color
|
|
|
|
QColor titlebarContrastColor(const QColor& color ) const
|
|
|
|
{ return helper().calcLightColor( color ); }
|
2009-11-14 04:19:09 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//!@name size grip
|
|
|
|
//@{
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! create size grip
|
|
|
|
void createSizeGrip( void );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! delete size grip
|
|
|
|
void deleteSizeGrip( void );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
// size grip
|
|
|
|
bool hasSizeGrip( void ) const
|
2009-09-14 23:10:19 +00:00
|
|
|
{ return (bool)sizeGrip_; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! size grip
|
2009-09-15 07:12:54 +00:00
|
|
|
OxygenSizeGrip& sizeGrip( void ) const
|
2009-09-14 23:10:19 +00:00
|
|
|
{ return *sizeGrip_; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//@}
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-10-15 16:03:30 +00:00
|
|
|
protected slots:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-10-15 16:03:30 +00:00
|
|
|
//! update old caption with current
|
|
|
|
void updateOldCaption( void )
|
|
|
|
{ setOldCaption( caption() ); }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
//! set target item to -1
|
|
|
|
void clearTargetItem( void );
|
|
|
|
|
|
|
|
//! clear force active flag
|
|
|
|
void clearForceActive( void )
|
|
|
|
{ if( isActive() ) setForceActive( false ); }
|
|
|
|
|
|
|
|
//! title bounding rects
|
|
|
|
/*! calculate and return title bounding rects in case of tabbed window */
|
|
|
|
void updateItemBoundingRects( bool alsoUpdate = true );
|
|
|
|
|
2009-10-15 16:03:30 +00:00
|
|
|
private:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-10-13 01:45:01 +00:00
|
|
|
//! factory
|
|
|
|
OxygenFactory* factory_;
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! size grip widget
|
2009-09-15 07:12:54 +00:00
|
|
|
OxygenSizeGrip* sizeGrip_;
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2009-10-15 16:03:30 +00:00
|
|
|
//! configuration
|
|
|
|
OxygenConfiguration configuration_;
|
|
|
|
|
2009-11-17 21:56:04 +00:00
|
|
|
//! glow animation
|
|
|
|
Animation::Pointer glowAnimation_;
|
|
|
|
|
|
|
|
//! title animation
|
|
|
|
Animation::Pointer titleAnimation_;
|
2009-09-18 01:32:27 +00:00
|
|
|
|
2009-11-17 21:56:04 +00:00
|
|
|
//! glow intensity
|
|
|
|
qreal glowIntensity_;
|
|
|
|
|
|
|
|
//! title opacity
|
|
|
|
qreal titleOpacity_;
|
2009-10-02 02:52:41 +00:00
|
|
|
|
|
|
|
//! old caption
|
|
|
|
QString oldCaption_;
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
//! true when initialized
|
|
|
|
bool initialized_;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
//! true when decoration is forced active
|
|
|
|
bool forceActive_;
|
|
|
|
|
|
|
|
//! mouse button
|
|
|
|
Qt::MouseButton mouseButton_;
|
|
|
|
|
|
|
|
//! tab bounding rects
|
|
|
|
ClientGroupItemDataList itemData_;
|
|
|
|
|
|
|
|
//! index of tab being dragged if any, -1 otherwise
|
|
|
|
int sourceItem_;
|
|
|
|
|
|
|
|
//! drag start point
|
|
|
|
QPoint dragPoint_;
|
|
|
|
|
2009-11-15 06:28:40 +00:00
|
|
|
//! drag start timer.
|
|
|
|
/*!
|
|
|
|
it is needed to activate animations when this was not done via either
|
|
|
|
dragMoveEvent or dragLeaveEvent
|
|
|
|
*/
|
|
|
|
QBasicTimer dragStartTimer_;
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
};
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-10-14 15:36:08 +00:00
|
|
|
//!@name utility functions
|
|
|
|
//@{
|
|
|
|
|
|
|
|
// dot
|
|
|
|
void renderDot(QPainter*, const QPointF&, qreal );
|
|
|
|
|
|
|
|
// contrast
|
|
|
|
QColor reduceContrast(const QColor&, const QColor&, double t);
|
|
|
|
|
|
|
|
//@}
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-09-15 07:12:54 +00:00
|
|
|
} // namespace Oxygen
|
2009-08-22 08:24:06 +00:00
|
|
|
|
|
|
|
#endif // EXAMPLECLIENT_H
|