[-]
[+]
|
Changed |
breeze-5.3.0.tar.xz/CMakeLists.txt
|
@@ -1,5 +1,5 @@
project(breeze)
-set(PROJECT_VERSION "5.3.0")
+set(PROJECT_VERSION "5.3.90")
set(PROJECT_VERSION_MAJOR 5)
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
|
[-]
[+]
|
Changed |
breeze-5.3.0.tar.xz/cursors/Breeze_Snow/Breeze_Snow/index.theme
^
|
@@ -1,5 +1,6 @@
[Icon Theme]
Name=Breeze Snow
+Name[ar]=نسيم ثلجيّ
Name[ca]=Brisa neu
Name[cs]=Breeze sníh
Name[de]=Breeze-Schnee
|
[-]
[+]
|
Changed |
breeze-5.3.0.tar.xz/cursors/Breeze_Snow/src/index.theme
^
|
@@ -1,5 +1,6 @@
[Icon Theme]
Name=Breeze Snow
+Name[ar]=نسيم ثلجيّ
Name[ca]=Brisa neu
Name[cs]=Breeze sníh
Name[de]=Breeze-Schnee
|
[-]
[+]
|
Changed |
breeze-5.3.0.tar.xz/kdecoration/breezebutton.cpp
^
|
@@ -111,9 +111,6 @@
}
//__________________________________________________________________
- Button::~Button() = default;
-
- //__________________________________________________________________
void Button::paint(QPainter *painter, const QRect &repaintRegion)
{
Q_UNUSED(repaintRegion)
|
[-]
[+]
|
Changed |
breeze-5.3.0.tar.xz/kdecoration/breezebutton.h
^
|
@@ -44,14 +44,14 @@
explicit Button(QObject *parent, const QVariantList &args);
//* destructor
- virtual ~Button();
+ virtual ~Button() = default;
- //* render
- void paint(QPainter *painter, const QRect &repaintRegion) override;
-
- //* create
+ //* button creation
static Button *create(KDecoration2::DecorationButtonType type, KDecoration2::Decoration *decoration, QObject *parent);
+ //* render
+ virtual void paint(QPainter *painter, const QRect &repaintRegion) Q_DECL_OVERRIDE;
+
//* flag
enum Flag
{
|
[-]
[+]
|
Changed |
breeze-5.3.0.tar.xz/kdecoration/breezedecoration.cpp
^
|
@@ -140,7 +140,6 @@
m_colorSettings.update(client().data()->palette(), *client().data());
m_useSeparator = (m_colorSettings.palette().color( QPalette::Window ) != m_colorSettings.activeTitleBar() );
-
// active state change animation
m_animation->setStartValue( 0 );
m_animation->setEndValue( 1.0 );
@@ -472,7 +471,7 @@
// draw caption
painter->setFont(s->font());
- painter->setPen(m_colorSettings.font(c->isActive()));
+ painter->setPen( fontColor() );
const auto cR = captionRect();
const QString caption = painter->fontMetrics().elidedText(c->caption(), Qt::ElideMiddle, cR.first.width());
painter->drawText(cR.first, cR.second | Qt::TextSingleLine, caption);
@@ -488,11 +487,11 @@
const int baseSize = settings()->gridUnit();
switch( m_internalSettings->buttonSize() )
{
- case Breeze::InternalSettings::ButtonSmall: return baseSize*1.5;
+ case InternalSettings::ButtonSmall: return baseSize*1.5;
default:
- case Breeze::InternalSettings::ButtonDefault: return baseSize*2;
- case Breeze::InternalSettings::ButtonLarge: return baseSize*2.5;
- case Breeze::InternalSettings::ButtonVeryLarge: return baseSize*3.5;
+ case InternalSettings::ButtonDefault: return baseSize*2;
+ case InternalSettings::ButtonLarge: return baseSize*2.5;
+ case InternalSettings::ButtonVeryLarge: return baseSize*3.5;
}
}
@@ -514,17 +513,17 @@
switch( m_internalSettings->titleAlignment() )
{
- case Breeze::InternalSettings::AlignLeft:
+ case InternalSettings::AlignLeft:
return qMakePair( maxRect, Qt::AlignVCenter|Qt::AlignLeft );
- case Breeze::InternalSettings::AlignRight:
+ case InternalSettings::AlignRight:
return qMakePair( maxRect, Qt::AlignVCenter|Qt::AlignRight );
- case Breeze::InternalSettings::AlignCenter:
+ case InternalSettings::AlignCenter:
return qMakePair( maxRect, Qt::AlignCenter );
default:
- case Breeze::InternalSettings::AlignCenterFullWidth:
+ case InternalSettings::AlignCenterFullWidth:
{
// full caption rect
@@ -553,74 +552,73 @@
{
// assign global shadow if exists and parameters match
- if( g_sShadow && g_shadowSize == m_internalSettings->shadowSize() && g_shadowStrength == m_internalSettings->shadowStrength() )
+ if( !( g_sShadow && g_shadowSize == m_internalSettings->shadowSize() && g_shadowStrength == m_internalSettings->shadowStrength() ) )
{
- setShadow(g_sShadow);
- return;
- }
+ // assign parameters
+ g_shadowSize = m_internalSettings->shadowSize();
+ g_shadowStrength = m_internalSettings->shadowStrength();
+ const int shadowOffset = qMax( 6*g_shadowSize/16, Metrics::Shadow_Overlap*2 );
+
+ // create image
+ QImage image(2*g_shadowSize, 2*g_shadowSize, QImage::Format_ARGB32_Premultiplied);
+ image.fill(Qt::transparent);
+
+ // create gradient
+ // gaussian delta function
+ auto alpha = [](qreal x) { return std::exp( -x*x/0.15 ); };
- // assign parameters
- g_shadowSize = m_internalSettings->shadowSize();
- g_shadowStrength = m_internalSettings->shadowStrength();
-
- // setup shadow
- const int shadowOffset = qMax( 6*g_shadowSize/16, Metrics::Shadow_Overlap*2 );
- auto decorationShadow = QSharedPointer<KDecoration2::DecorationShadow>::create();
- decorationShadow->setPadding( QMargins(
- g_shadowSize-shadowOffset,
- g_shadowSize-shadowOffset,
- g_shadowSize,
- g_shadowSize ) );
-
- decorationShadow->setInnerShadowRect(QRect(
- g_shadowSize-shadowOffset+Metrics::Shadow_Overlap,
- g_shadowSize-shadowOffset+Metrics::Shadow_Overlap,
- shadowOffset - 2*Metrics::Shadow_Overlap,
- shadowOffset - 2*Metrics::Shadow_Overlap ) );
-
- // create image
- QImage image(2*g_shadowSize, 2*g_shadowSize, QImage::Format_ARGB32_Premultiplied);
- image.fill(Qt::transparent);
-
- // create gradient
- // gaussian delta function
- auto alpha = [](qreal x) { return std::exp( -x*x/0.15 ); };
+ // color calculation delta function
+ auto gradientStopColor = [](QColor color, int alpha)
+ {
+ color.setAlpha(alpha);
+ return color;
+ };
- // color calculation delta function
- auto gradientStopColor = [](QColor color, int alpha)
- {
- color.setAlpha(alpha);
- return color;
- };
+ const QColor shadowColor( m_colorSettings.palette().color( QPalette::Shadow ) );
- const QColor shadowColor( m_colorSettings.palette().color( QPalette::Shadow ) );
+ QRadialGradient radialGradient( g_shadowSize, g_shadowSize, g_shadowSize);
+ for( int i = 0; i < 10; ++i )
+ {
+ const qreal x( qreal( i )/9 );
+ radialGradient.setColorAt(x, gradientStopColor(shadowColor, alpha(x)*g_shadowStrength));
+ }
+
+ radialGradient.setColorAt(1, gradientStopColor( shadowColor, 0 ) );
+
+ // fill
+ QPainter painter(&image);
+ painter.setCompositionMode(QPainter::CompositionMode_Source);
+ painter.fillRect( image.rect(), radialGradient);
+
+ // contrast pixel
+ painter.setBrush( Qt::NoBrush );
+ painter.setPen( gradientStopColor(shadowColor, g_shadowStrength) );
+ painter.setRenderHints(QPainter::Antialiasing );
+ painter.drawRoundedRect( QRect( g_shadowSize-shadowOffset, g_shadowSize-shadowOffset, shadowOffset, shadowOffset ), 3, 3 );
+ painter.end();
- QRadialGradient radialGradient( g_shadowSize, g_shadowSize, g_shadowSize);
- for( int i = 0; i < 10; ++i )
- {
- const qreal x( qreal( i )/9 );
- radialGradient.setColorAt(x, gradientStopColor(shadowColor, alpha(x)*g_shadowStrength));
- }
- radialGradient.setColorAt(1, gradientStopColor( shadowColor, 0 ) );
+ g_sShadow = QSharedPointer<KDecoration2::DecorationShadow>::create();
+ g_sShadow->setPadding( QMargins(
+ g_shadowSize-shadowOffset,
+ g_shadowSize-shadowOffset,
+ g_shadowSize,
+ g_shadowSize ) );
- // fill
- QPainter painter(&image);
- painter.setCompositionMode(QPainter::CompositionMode_Source);
- painter.fillRect( image.rect(), radialGradient);
+ g_sShadow->setInnerShadowRect(QRect(
+ g_shadowSize-shadowOffset+Metrics::Shadow_Overlap,
+ g_shadowSize-shadowOffset+Metrics::Shadow_Overlap,
+ shadowOffset - 2*Metrics::Shadow_Overlap,
+ shadowOffset - 2*Metrics::Shadow_Overlap ) );
- // contrast pixel
- painter.setBrush( Qt::NoBrush );
- painter.setPen( gradientStopColor(shadowColor, g_shadowStrength) );
- painter.setRenderHints(QPainter::Antialiasing );
- painter.drawRoundedRect( QRect( g_shadowSize-shadowOffset, g_shadowSize-shadowOffset, shadowOffset, shadowOffset ), 3, 3 );
- painter.end();
- // assign to shadow
- decorationShadow->setShadow(image);
+ // assign image
+ g_sShadow->setShadow(image);
+
+ }
+
+ setShadow(g_sShadow);
- g_sShadow = decorationShadow;
- setShadow(decorationShadow);
}
//_________________________________________________________________
@@ -640,9 +638,9 @@
if( c->windowId() != 0 )
{
m_sizeGrip = new SizeGrip( this );
- connect( client().data(), &KDecoration2::DecoratedClient::maximizedChanged, this, &Breeze::Decoration::updateSizeGripVisibility );
- connect( client().data(), &KDecoration2::DecoratedClient::shadedChanged, this, &Breeze::Decoration::updateSizeGripVisibility );
- connect( client().data(), &KDecoration2::DecoratedClient::resizeableChanged, this, &Breeze::Decoration::updateSizeGripVisibility );
+ connect( client().data(), &KDecoration2::DecoratedClient::maximizedChanged, this, &Decoration::updateSizeGripVisibility );
+ connect( client().data(), &KDecoration2::DecoratedClient::shadedChanged, this, &Decoration::updateSizeGripVisibility );
+ connect( client().data(), &KDecoration2::DecoratedClient::resizeableChanged, this, &Decoration::updateSizeGripVisibility );
}
#endif
|
[-]
[+]
|
Changed |
breeze-5.3.0.tar.xz/kdecoration/config/breezedecorationconfig.desktop
^
|
@@ -10,6 +10,7 @@
X-KDE-Weight=60
Name=Window Decoration
+Name[ar]=زخرفة النّوافذ
Name[ca]=Decoració de les finestres
Name[cs]=Dekorace oken
Name[de]=Fensterdekoration
@@ -43,6 +44,7 @@
Name[zh_CN]=窗口装饰
Name[zh_TW]=視窗裝飾
Comment=Modify the appearance of window decorations
+Comment[ar]=عدّل مظهر زخرفات النّوافذ
Comment[ca]=Modifica l'aparença de les decoracions de les finestres
Comment[cs]=Změnit vzhled dekorace oken
Comment[de]=Das Erscheinungsbild der Fensterdekorationen ändern
@@ -76,6 +78,7 @@
Comment[zh_CN]=修改窗口装饰外观
Comment[zh_TW]=變更視窗裝飾外觀
X-KDE-Keywords=breeze,decoration
+X-KDE-Keywords[ar]=نسيم,زخرفة
X-KDE-Keywords[ca]=breeze,brisa,decoració
X-KDE-Keywords[cs]=breeze,dekorace
X-KDE-Keywords[de]=Breeze-Dekoration
|
[-]
[+]
|
Changed |
breeze-5.3.0.tar.xz/kdecoration/config/ui/breezeconfigurationui.ui
^
|
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>425</width>
- <height>583</height>
+ <width>428</width>
+ <height>418</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
@@ -15,268 +15,309 @@
<number>0</number>
</property>
<item>
- <widget class="QGroupBox" name="groupBox">
- <property name="title">
- <string>General</string>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="currentIndex">
+ <number>0</number>
</property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>Tit&le alignment:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- <property name="buddy">
- <cstring>titleAlignment</cstring>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QComboBox" name="titleAlignment">
- <item>
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>General</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_4">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_3">
<property name="text">
- <string>Left</string>
+ <string>Tit&le alignment:</string>
</property>
- </item>
- <item>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy">
+ <cstring>titleAlignment</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_4">
<property name="text">
- <string>Center</string>
+ <string>B&utton size:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy">
+ <cstring>buttonSize</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QComboBox" name="buttonSize">
+ <item>
+ <property name="text">
+ <string comment="@item:inlistbox Button size:">Small</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string comment="@item:inlistbox Button size:">Normal</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string comment="@item:inlistbox Button size:">Large</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string comment="@item:inlistbox Button size:">Very Large</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QComboBox" name="titleAlignment">
+ <item>
+ <property name="text">
+ <string>Left</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Center</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Center (Full Width)</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Right</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
</property>
- </item>
- <item>
+ </spacer>
+ </item>
+ <item row="5" column="0" colspan="3">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="4" column="0" colspan="3">
+ <widget class="QCheckBox" name="drawSizeGrip">
<property name="text">
- <string>Center (Full Width)</string>
+ <string>Add handle to resize windows with no border</string>
</property>
- </item>
- <item>
+ </widget>
+ </item>
+ <item row="3" column="0" colspan="3">
+ <widget class="QCheckBox" name="drawBorderOnMaximizedWindows">
<property name="text">
- <string>Right</string>
+ <string>Display window borders for maximized windows</string>
</property>
- </item>
- </widget>
- </item>
- <item row="0" column="2">
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>199</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_4">
- <property name="text">
- <string>B&utton size:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- <property name="buddy">
- <cstring>buttonSize</cstring>
- </property>
- </widget>
- </item>
- <item row="3" column="0" colspan="3">
- <widget class="QCheckBox" name="drawBorderOnMaximizedWindows">
- <property name="text">
- <string>Display window borders for maximized windows</string>
- </property>
|
[-]
[+]
|
Changed |
breeze-5.3.0.tar.xz/kstyle/CMakeLists.txt
^
|
@@ -103,9 +103,13 @@
animations/breezescrollbarengine.cpp
animations/breezespinboxengine.cpp
animations/breezespinboxdata.cpp
+ animations/breezestackedwidgetdata.cpp
+ animations/breezestackedwidgetengine.cpp
animations/breezetabbarengine.cpp
animations/breezetabbardata.cpp
animations/breezetoolboxengine.cpp
+ animations/breezetransitiondata.cpp
+ animations/breezetransitionwidget.cpp
animations/breezewidgetstateengine.cpp
animations/breezewidgetstatedata.cpp
debug/breezewidgetexplorer.cpp
|
[-]
[+]
|
Changed |
breeze-5.3.0.tar.xz/kstyle/animations/breezeanimations.cpp
^
|
@@ -54,6 +54,7 @@
registerEngine( _widgetStateEngine = new WidgetStateEngine( this ) );
registerEngine( _inputWidgetEngine = new WidgetStateEngine( this ) );
registerEngine( _scrollBarEngine = new ScrollBarEngine( this ) );
+ registerEngine( _stackedWidgetEngine = new StackedWidgetEngine( this ) );
registerEngine( _tabBarEngine = new TabBarEngine( this ) );
registerEngine( _dialEngine = new DialEngine( this ) );
@@ -79,6 +80,7 @@
_comboBoxEngine->setDuration( animationsDuration );
_toolButtonEngine->setDuration( animationsDuration );
_spinBoxEngine->setDuration( animationsDuration );
+ _stackedWidgetEngine->setDuration( animationsDuration );
_toolBoxEngine->setDuration( animationsDuration );
// registered engines
@@ -88,6 +90,9 @@
engine.data()->setDuration( animationsDuration );
}
+ // stacked widget transition has an extra flag for animations
+ _stackedWidgetEngine->setEnabled( animationsEnabled && StyleConfigData::stackedWidgetTransitionsEnabled() );
+
// busy indicator
_busyIndicatorEngine->setEnabled( StyleConfigData::progressBarAnimated() );
_busyIndicatorEngine->setDuration( StyleConfigData::progressBarBusyStepDuration() );
@@ -182,6 +187,10 @@
}
+ // stacked widgets
+ if( QStackedWidget* stack = qobject_cast<QStackedWidget*>( widget ) )
+ { _stackedWidgetEngine->registerWidget( stack ); }
+
return;
}
|
[-]
[+]
|
Changed |
breeze-5.3.0.tar.xz/kstyle/animations/breezeanimations.h
^
|
@@ -25,6 +25,7 @@
#include "breezeheaderviewengine.h"
#include "breezescrollbarengine.h"
#include "breezespinboxengine.h"
+#include "breezestackedwidgetengine.h"
#include "breezetabbarengine.h"
#include "breezetoolboxengine.h"
#include "breezewidgetstateengine.h"
@@ -146,6 +147,9 @@
//* spinbox engine
SpinBoxEngine* _spinBoxEngine;
+ //* stacked widget engine
+ StackedWidgetEngine* _stackedWidgetEngine;
+
//* tabbar engine
TabBarEngine* _tabBarEngine;
|
[-]
[+]
|
Added |
breeze-5.3.0.tar.xz/kstyle/animations/breezestackedwidgetdata.cpp
^
|
@@ -0,0 +1,139 @@
+//////////////////////////////////////////////////////////////////////////////
+// breezestackedwidgetdata.cpp
+// data container for QStackedWidget transition
+// -------------------
+//
+// Copyright (c) 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
+//
+// 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 "breezestackedwidgetdata.h"
+
+namespace Breeze
+{
+
+ //______________________________________________________
+ StackedWidgetData::StackedWidgetData( QObject* parent, QStackedWidget* target, int duration ):
+ TransitionData( parent, target, duration ),
+ _target( target ),
+ _index( target->currentIndex() )
+ {
+
+ // configure transition
+ connect( _target.data(), SIGNAL(destroyed()), SLOT(targetDestroyed()) );
+ connect( _target.data(), SIGNAL(currentChanged(int)), SLOT(animate()) );
+
+ // disable focus
+ transition().data()->setAttribute(Qt::WA_NoMousePropagation, true);
+ transition().data()->setFlag(TransitionWidget::PaintOnWidget, true);
+
+ setMaxRenderTime( 50 );
+
+ }
+
+ //___________________________________________________________________
+ bool StackedWidgetData::initializeAnimation( void )
+ {
+
+ // check enability
+ if( !( _target && _target.data()->isVisible() ) )
+ { return false; }
+
+ // check index
+ if( _target.data()->currentIndex() == _index )
+ { return false; }
+
+ // do not animate if either index or currentIndex is not valid
+ // but update _index none the less
+ if( _target.data()->currentIndex() < 0 || _index < 0 )
+ {
+ _index = _target.data()->currentIndex();
+ return false;
+ }
+
+ // get old widget (matching _index) and initialize transition
+ if( QWidget *widget = _target.data()->widget( _index ) )
+ {
+
+ transition().data()->setOpacity( 0 );
+ startClock();
+ transition().data()->setGeometry( widget->geometry() );
+ transition().data()->setStartPixmap( transition().data()->grab( widget ) );
+
+ _index = _target.data()->currentIndex();
+ return !slow();
+
+ } else {
+
+ _index = _target.data()->currentIndex();
+ return false;
+
+ }
+
+ }
+
+ //___________________________________________________________________
+ bool StackedWidgetData::animate( void )
+ {
+
+ // check enability
+ if( !enabled() ) return false;
+
+ // initialize animation
+ if( !initializeAnimation() ) return false;
+
+ // show transition widget
+ transition().data()->show();
+ transition().data()->raise();
+ transition().data()->animate();
+ return true;
+
+ }
+
+ //___________________________________________________________________
+ void StackedWidgetData::finishAnimation( void )
+ {
+ // disable updates on currentWidget
+ if( _target && _target.data()->currentWidget() )
+ { _target.data()->currentWidget()->setUpdatesEnabled( false ); }
+
+ // hide transition
+ transition().data()->hide();
+
+ // reenable updates and repaint
+ if( _target && _target.data()->currentWidget() )
+ {
+ _target.data()->currentWidget()->setUpdatesEnabled( true );
+ _target.data()->currentWidget()->repaint();
+ }
+
+ // invalidate start widget
+ transition().data()->resetStartPixmap();
+
+ }
+
+ //___________________________________________________________________
+ void StackedWidgetData::targetDestroyed( void )
+ {
+ setEnabled( false );
+ _target.clear();
+ }
+
+}
|
[-]
[+]
|
Added |
breeze-5.3.0.tar.xz/kstyle/animations/breezestackedwidgetdata.h
^
|
@@ -0,0 +1,78 @@
+#ifndef breezestackedwidget_datah
+#define breezestackedwidget_datah
+
+//////////////////////////////////////////////////////////////////////////////
+// breezestackedwidgetdata.h
+// data container for QStackedWidget transition
+// -------------------
+//
+// Copyright (c) 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
+//
+// 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 "breezetransitiondata.h"
+
+#include <QStackedWidget>
+
+namespace Breeze
+{
+
+ //! generic data
+ class StackedWidgetData: public TransitionData
+ {
+
+ Q_OBJECT
+
+ public:
+
+ //! constructor
+ StackedWidgetData( QObject*, QStackedWidget*, int );
+
+ //! destructor
+ virtual ~StackedWidgetData( void )
+ {}
+
+ protected Q_SLOTS:
+
+ //! initialize animation
+ virtual bool initializeAnimation( void );
+
+ //! animate
+ virtual bool animate( void );
+
+ //! finish animation
+ virtual void finishAnimation( void );
+
+ //! called when target is destroyed
+ virtual void targetDestroyed( void );
+
+ private:
+
+ //! target
+ WeakPointer<QStackedWidget> _target;
+
+ //! current index
+ int _index;
+
+ };
+
+}
+
+#endif
|
[-]
[+]
|
Added |
breeze-5.3.0.tar.xz/kstyle/animations/breezestackedwidgetengine.cpp
^
|
@@ -0,0 +1,47 @@
+//////////////////////////////////////////////////////////////////////////////
+// breezestackedwidgetengine.cpp
+// stores event filters and maps widgets to animations
+// -------------------
+//
+// Copyright (c) 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
+//
+// 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 "breezestackedwidgetengine.h"
+
+namespace Breeze
+{
+
+ //____________________________________________________________
+ bool StackedWidgetEngine::registerWidget( QStackedWidget* widget )
+ {
+
+ if( !widget ) return false;
+ if( !_data.contains( widget ) ) { _data.insert( widget, new StackedWidgetData( this, widget, duration() ), enabled() ); }
+
+ // connect destruction signal
+ disconnect( widget, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterWidget(QObject*)) );
+ connect( widget, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterWidget(QObject*)) );
+
+ return true;
+
+ }
+
+}
|
[-]
[+]
|
Added |
breeze-5.3.0.tar.xz/kstyle/animations/breezestackedwidgetengine.h
^
|
@@ -0,0 +1,86 @@
+#ifndef breezestackedwidgetengine_h
+#define breezestackedwidgetengine_h
+
+//////////////////////////////////////////////////////////////////////////////
+// breezestackedwidgetengine.h
+// stores event filters and maps widgets to animations
+// -------------------
+//
+// Copyright (c) 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
+//
+// 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 "breezebaseengine.h"
+#include "breezedatamap.h"
+#include "breezestackedwidgetdata.h"
+
+namespace Breeze
+{
+
+ //! used for simple widgets
+ class StackedWidgetEngine: public BaseEngine
+ {
+
+ Q_OBJECT
+
+ public:
+
+ //! constructor
+ explicit StackedWidgetEngine( QObject* parent ):
+ BaseEngine( parent )
+ {}
+
+ //! destructor
+ virtual ~StackedWidgetEngine( void )
+ {}
+
+ //! register widget
+ virtual bool registerWidget( QStackedWidget* );
+
+ //! duration
+ virtual void setEnabled( bool value )
+ {
+ BaseEngine::setEnabled( value );
+ _data.setEnabled( value );
+ }
+
+ //! duration
+ virtual void setDuration( int value )
+ {
+ BaseEngine::setDuration( value );
+ _data.setDuration( value );
+ }
+
+ public Q_SLOTS:
+
+ //! remove widget from map
+ virtual bool unregisterWidget( QObject* object )
+ { return _data.unregisterWidget( object ); }
+
+ private:
+
+ //! maps
+ DataMap<StackedWidgetData> _data;
+
+ };
+
+}
+
+#endif
|
[-]
[+]
|
Added |
breeze-5.3.0.tar.xz/kstyle/animations/breezetransitiondata.cpp
^
|
@@ -0,0 +1,42 @@
+//////////////////////////////////////////////////////////////////////////////
+// breezetransitiondata.cpp
+// data container for generic transitions
+// -------------------
+//
+// Copyright (c) 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
+//
+// 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 "breezetransitiondata.h"
+
+namespace Breeze
+{
+
+ //_________________________________________________________________
+ TransitionData::TransitionData( QObject* parent, QWidget* target, int duration ):
+ QObject( parent ),
+ _transition( new TransitionWidget( target, duration ) )
+ { _transition.data()->hide(); }
+
+ //_________________________________________________________________
+ TransitionData::~TransitionData( void )
+ { if( _transition ) _transition.data()->deleteLater(); }
+
+}
|
[-]
[+]
|
Added |
breeze-5.3.0.tar.xz/kstyle/animations/breezetransitiondata.h
^
|
@@ -0,0 +1,144 @@
+#ifndef breezetransitiondata_h
+#define breezetransitiondata_h
+
+//////////////////////////////////////////////////////////////////////////////
+// breezetransitiondata.h
+// data container for generic transitions
+// -------------------
+//
+// Copyright (c) 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
+//
+// 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 "breezetransitionwidget.h"
+
+#include <QObject>
+#include <QTime>
+#include <QWidget>
+
+namespace Breeze
+{
+
+ //* generic data
+ class TransitionData: public QObject
+ {
+
+ Q_OBJECT
+
+ public:
+
+ //* constructor
+ TransitionData( QObject* parent, QWidget* target, int );
+
+ //* destructor
+ virtual ~TransitionData( void );
+
+ //* enability
+ virtual void setEnabled( bool value )
+ { _enabled = value; }
+
+ //* enability
+ virtual bool enabled( void ) const
+ { return _enabled; }
+
+ //* duration
+ virtual void setDuration( int duration )
+ {
+ if( _transition )
+ { _transition.data()->setDuration( duration ); }
+ }
+
+ //* max render time
+ void setMaxRenderTime( int value )
+ { _maxRenderTime = value; }
+
+ //* max renderTime
+ const int& maxRenderTime( void ) const
+ { return _maxRenderTime; }
+
+ //* start clock
+ void startClock( void )
+ {
+ if( _clock.isNull() ) _clock.start();
+ else _clock.restart();
+ }
+
+ //* check if rendering is two slow
+ bool slow( void ) const
+ { return !( _clock.isNull() || _clock.elapsed() <= maxRenderTime() ); }
+
+ protected Q_SLOTS:
+
+ //* initialize animation
+ virtual bool initializeAnimation( void ) = 0;
+
+ //* animate
+ virtual bool animate( void ) = 0;
+
+ protected:
+
+ //* returns true if one parent matches given class name
+ inline bool hasParent( const QWidget*, const char* ) const;
+
+ //* transition widget
+ virtual const TransitionWidget::Pointer& transition( void ) const
+ { return _transition; }
+
+ //* used to avoid recursion when grabbing widgets
+ void setRecursiveCheck( bool value )
+ { _recursiveCheck = value; }
+
+ //* used to avoid recursion when grabbing widgets
+ bool recursiveCheck( void ) const
+ { return _recursiveCheck; }
+
+ private:
+
+ //* enability
+ bool _enabled = true;
+
+ //* used to avoid recursion when grabbing widgets
+ bool _recursiveCheck = false;
+
+ //* timer used to detect slow rendering
+ QTime _clock;
+
+ //* max render time
+ /*! used to detect slow rendering */
+ int _maxRenderTime = 200;
+
+ //* animation handling
+ TransitionWidget::Pointer _transition;
+
+ };
+
+ //_____________________________________________________________________________________
+ bool TransitionData::hasParent( const QWidget* widget, const char* className ) const
+ {
+ if( !widget ) return false;
+ for( QWidget* parent = widget->parentWidget(); parent; parent = parent->parentWidget() )
+ { if( parent->inherits( className ) ) return true; }
+
+ return false;
+ }
+
+}
+
+#endif
|
[-]
[+]
|
Added |
breeze-5.3.0.tar.xz/kstyle/animations/breezetransitionwidget.cpp
^
|
@@ -0,0 +1,309 @@
+//////////////////////////////////////////////////////////////////////////////
+// breezetransitionwidget.cpp
+// stores event filters and maps widgets to transitions for transitions
+// -------------------
+//
+// Copyright (c) 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
+//
+// 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 "breezetransitionwidget.h"
+
+#include <QPainter>
+#include <QPaintEvent>
+#include <QStyleOption>
+#include <QTextStream>
+
+namespace Breeze
+{
+
+ //________________________________________________
+ bool TransitionWidget::_paintEnabled = true;
+ bool TransitionWidget::paintEnabled( void )
+ { return _paintEnabled; }
+
+ int TransitionWidget::_steps = 0;
+
+ //________________________________________________
+ TransitionWidget::TransitionWidget( QWidget* parent, int duration ):
+ QWidget( parent ),
+ _animation( new Animation( duration, this ) )
+ {
+
+ // background flags
+ setAttribute( Qt::WA_NoSystemBackground );
+ setAutoFillBackground( false );
+
+ // setup animation
+ _animation.data()->setStartValue( 0 );
+ _animation.data()->setEndValue( 1.0 );
+ _animation.data()->setTargetObject( this );
+ _animation.data()->setPropertyName( "opacity" );
+
+ // hide when animation is finished
+ connect( _animation.data(), SIGNAL(finished()), SLOT(hide()) );
+
+ }
+
+ //________________________________________________
+ QPixmap TransitionWidget::grab( QWidget* widget, QRect rect )
+ {
+
+ // change rect
+ if( !rect.isValid() ) rect = widget->rect();
+ if( !rect.isValid() ) return QPixmap();
+
+ // initialize pixmap
+ QPixmap out( rect.size() );
+ out.fill( Qt::transparent );
+ _paintEnabled = false;
+
+ if( testFlag( GrabFromWindow ) )
+ {
+
+ rect = rect.translated( widget->mapTo( widget->window(), widget->rect().topLeft() ) );
+ widget = widget->window();
+ #if QT_VERSION < 0x050000
+ out = QPixmap::grabWidget( widget, rect );
+ #else
+ out = widget->grab( rect );
+ #endif
+
+ } else {
+
+ if( !testFlag( Transparent ) ) { grabBackground( out, widget, rect ); }
+ grabWidget( out, widget, rect );
+
+ }
+
+ _paintEnabled = true;
+
+ return out;
+
+ }
+
+ //________________________________________________
+ bool TransitionWidget::event( QEvent* event )
+ {
+ switch( event->type() )
+ {
+ case QEvent::MouseButtonPress:
+ case QEvent::MouseButtonRelease:
+ case QEvent::KeyPress:
+ case QEvent::KeyRelease:
+ endAnimation();
+ hide();
+ event->ignore();
+ return false;
+
+ default: return QWidget::event( event );
+ }
+
+ }
+
+ //________________________________________________
+ void TransitionWidget::paintEvent( QPaintEvent* event )
+ {
+
+ // fully transparent case
+ if( opacity() >= 1.0 && endPixmap().isNull() ) return;
+ if( !_paintEnabled ) return;
+
+ // get rect
+ QRect rect = event->rect();
+ if( !rect.isValid() ) rect = this->rect();
+
+ // local pixmap
+ const bool paintOnWidget( testFlag( PaintOnWidget ) && !testFlag( Transparent ) );
+ if( !paintOnWidget )
+ {
+
+ if( _currentPixmap.isNull() || _currentPixmap.size() != size() )
+ { _currentPixmap = QPixmap( size() ); }
+
+ }
+
+ // fill
+ _currentPixmap.fill( Qt::transparent );
+
+ // copy local pixmap to current
+ {
+
+ QPainter p;
+
+ // draw end pixmap first, provided that opacity is small enough
+ if( opacity() >= 0.004 && !_endPixmap.isNull() )
+ {
+
+ // faded endPixmap if parent target is transparent and opacity is
+ if( opacity() <= 0.996 && testFlag( Transparent ) )
+ {
+
+ fade( _endPixmap, _currentPixmap, opacity(), rect );
+ p.begin( &_currentPixmap );
+ p.setClipRect( event->rect() );
+
+ } else {
+
+ if( paintOnWidget ) p.begin( this );
+ else p.begin( &_currentPixmap );
+ p.setClipRect( event->rect() );
+ p.drawPixmap( QPoint(), _endPixmap );
+
+ }
+
+ } else {
+
+ if( paintOnWidget ) p.begin( this );
+ else p.begin( &_currentPixmap );
+ p.setClipRect( event->rect() );
+
+ }
+
+ // draw fading start pixmap
+ if( opacity() <= 0.996 && !_startPixmap.isNull() )
+ {
+ if( opacity() >= 0.004 )
+ {
+
+ fade( _startPixmap, _localStartPixmap, 1.0-opacity(), rect );
+ p.drawPixmap( QPoint(), _localStartPixmap );
+
+ } else p.drawPixmap( QPoint(), _startPixmap );
+
+ }
+
+ p.end();
+ }
+
+ // copy current pixmap on widget
+ if( !paintOnWidget )
+ {
+ QPainter p( this );
|
[-]
[+]
|
Added |
breeze-5.3.0.tar.xz/kstyle/animations/breezetransitionwidget.h
^
|
@@ -0,0 +1,235 @@
+#ifndef breezetransitionwidget_h
+#define breezetransitionwidget_h
+//////////////////////////////////////////////////////////////////////////////
+// breezetransitionwidget.h
+// stores event filters and maps widgets to transitions for transitions
+// -------------------
+//
+// Copyright (c) 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
+//
+// 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 "breezeanimation.h"
+#include "breeze.h"
+
+#include <QWidget>
+
+#include <cmath>
+
+namespace Breeze
+{
+
+ //* temporary widget used to perform smooth transition between one widget state and another
+ class TransitionWidget: public QWidget
+ {
+
+ Q_OBJECT
+
+ //* declare opacity property
+ Q_PROPERTY( qreal opacity READ opacity WRITE setOpacity )
+
+ public:
+
+ //* shortcut to painter
+ typedef WeakPointer<TransitionWidget> Pointer;
+
+ //* constructor
+ TransitionWidget( QWidget* parent, int duration );
+
+ //* destructor
+ virtual ~TransitionWidget( void ) = default;
+
+ //*@name flags
+ //@{
+ enum Flag
+ {
+ None = 0,
+ GrabFromWindow = 1<<0,
+ Transparent = 1<<1,
+ PaintOnWidget = 1<<2
+ };
+
+ Q_DECLARE_FLAGS(Flags, Flag)
+
+ void setFlags( Flags value )
+ { _flags = value; }
+
+ void setFlag( Flag flag, bool value = true )
+ {
+ if( value ) _flags |= flag;
+ else _flags &= (~flag);
+ }
+
+ bool testFlag( Flag flag ) const
+ { return _flags.testFlag( flag ); }
+
+ //@}
+
+ //* duration
+ void setDuration( int duration )
+ {
+ if( _animation )
+ { _animation.data()->setDuration( duration ); }
+ }
+
+ //* duration
+ int duration( void ) const
+ { return ( _animation ) ? _animation.data()->duration() : 0; }
+
+ //* steps
+ static void setSteps( int value )
+ { _steps = value; }
+
+ //*@name opacity
+ //@{
+
+ virtual qreal opacity( void ) const
+ { return _opacity; }
+
+ virtual void setOpacity( qreal value )
+ {
+ value = digitize( value );
+ if( _opacity == value ) return;
+ _opacity = value;
+ update();
+ }
+
+ //@}
+
+ //@name pixmaps handling
+ //@{
+
+ //* start
+ void resetStartPixmap( void )
+ { setStartPixmap( QPixmap() ); }
+
+ //* start
+ void setStartPixmap( QPixmap pixmap )
+ { _startPixmap = pixmap; }
+
+ //* start
+ const QPixmap& startPixmap( void ) const
+ { return _startPixmap; }
+
+ //* end
+ void resetEndPixmap( void )
+ { setEndPixmap( QPixmap() ); }
+
+ //* end
+ void setEndPixmap( QPixmap pixmap )
+ {
+ _endPixmap = pixmap;
+ _currentPixmap = pixmap;
+ }
+
+ //* start
+ const QPixmap& endPixmap( void ) const
+ { return _endPixmap; }
+
+ //* current
+ const QPixmap& currentPixmap( void ) const
+ { return _currentPixmap; }
+
+ //@}
+
+ //* grap pixmap
+ QPixmap grab( QWidget* = 0, QRect = QRect() );
+
+ //* true if animated
+ virtual bool isAnimated( void ) const
+ { return _animation.data()->isRunning(); }
+
+ //* end animation
+ virtual void endAnimation( void )
+ { if( _animation.data()->isRunning() ) _animation.data()->stop(); }
+
+ //* animate transition
+ virtual void animate( void )
+ {
+ if( _animation.data()->isRunning() ) _animation.data()->stop();
+ _animation.data()->start();
+ }
+
+ //* true if paint is enabled
+ static bool paintEnabled( void );
+
+ protected:
+
+ //* generic event filter
+ virtual bool event( QEvent* );
+
+ //* paint event
+ virtual void paintEvent( QPaintEvent* );
+
+ //* grab widget background
+ /*!
+ Background is not rendered properly using QWidget::render.
+ Use home-made grabber instead. This is directly inspired from bespin.
+ Copyright (C) 2007 Thomas Luebking <thomas.luebking@web.de>
+ */
+ virtual void grabBackground( QPixmap&, QWidget*, QRect& ) const;
+
+ //* grab widget
+ virtual void grabWidget( QPixmap&, QWidget*, QRect& ) const;
+
+ //* fade pixmap
+ virtual void fade( const QPixmap& source, QPixmap& target, qreal opacity, const QRect& ) const;
+
+ //* apply step
+ virtual qreal digitize( const qreal& value ) const
+ {
+ if( _steps > 0 ) return std::floor( value*_steps )/_steps;
+ else return value;
|
[-]
[+]
|
Changed |
breeze-5.3.0.tar.xz/kstyle/breeze.kcfg
^
|
@@ -44,6 +44,11 @@
<default>100</default>
</entry>
+ <!-- transition flags -->
+ <entry name="StackedWidgetTransitionsEnabled" type="Bool">
+ <default>false</default>
+ </entry>
+
<!-- busy progress bars -->
<entry name="ProgressBarAnimated" type="Bool">
<default>true</default>
|
[-]
[+]
|
Changed |
breeze-5.3.0.tar.xz/kstyle/breezepropertynames.cpp
^
|
@@ -29,5 +29,6 @@
const char PropertyNames::netWMSkipShadow[] = "_KDE_NET_WM_SKIP_SHADOW";
const char PropertyNames::sidePanelView[] = "_kde_side_panel_view";
const char PropertyNames::toolButtonAlignment[] = "_kde_toolButton_alignment";
+ const char PropertyNames::menuTitle[] = "_breeze_toolButton_menutitle";
}
|
[-]
[+]
|
Changed |
breeze-5.3.0.tar.xz/kstyle/breezepropertynames.h
^
|
@@ -33,6 +33,7 @@
static const char netWMSkipShadow[];
static const char sidePanelView[];
static const char toolButtonAlignment[];
+ static const char menuTitle[];
};
}
|
[-]
[+]
|
Changed |
breeze-5.3.0.tar.xz/kstyle/breezestyle.cpp
^
|
@@ -57,6 +57,7 @@
#include <QTextEdit>
#include <QToolBox>
#include <QToolButton>
+#include <QWidgetAction>
namespace BreezePrivate
{
@@ -2730,7 +2731,12 @@
QSize Style::itemViewItemSizeFromContents( const QStyleOption* option, const QSize& contentsSize, const QWidget* widget ) const
{
// call base class
- QSize size( ParentStyleClass::sizeFromContents( CT_ItemViewItem, option, contentsSize, widget ) );
+ const QSize size( ParentStyleClass::sizeFromContents( CT_ItemViewItem, option, contentsSize, widget ) );
+
+ #if QT_VERSION >= 0x050000
+ const bool isQtQuickControl = !widget && option && option->styleObject && option->styleObject->inherits( "QQuickStyleItem" );
+ if( isQtQuickControl ) return size;
+ #endif;
// add margins
return expandSize( size, Metrics::ItemView_ItemMarginWidth );
@@ -4259,11 +4265,11 @@
/*
* separator can have a title and an icon
- * in that case they are rendered as sunken flat toolbuttons
+ * in that case they are rendered as menu title buttons
*/
- QStyleOptionToolButton toolButtonOption( separatorMenuItemOption( menuItemOption, widget ) );
- toolButtonOption.state = State_On|State_Sunken|State_HasFocus|State_Enabled;
- drawComplexControl( CC_ToolButton, &toolButtonOption, painter, widget );
+ QStyleOptionToolButton copy( separatorMenuItemOption( menuItemOption, widget ) );
+ renderMenuTitle( ©, painter, widget );
+
return true;
}
@@ -5451,6 +5457,19 @@
// detect buttons in tabbar, for which special rendering is needed
const bool inTabBar( widget && qobject_cast<const QTabBar*>( widget->parentWidget() ) );
+ const bool isMenuTitle( this->isMenuTitle( widget ) );
+ if( isMenuTitle )
+ {
+ // copy option to adust state, and set font as not-bold
+ QStyleOptionToolButton copy( *toolButtonOption );
+ copy.font.setBold( false );
+ copy.state = State_Enabled;
+
+ // render
+ renderMenuTitle( ©, painter, widget );
+ return true;
+ }
+
// copy option and alter palette
QStyleOptionToolButton copy( *toolButtonOption );
@@ -5704,8 +5723,8 @@
}
- if( option->subControls & SC_SpinBoxUp ) renderSpinBoxArrow( painter, spinBoxOption, widget, SC_SpinBoxUp );
- if( option->subControls & SC_SpinBoxDown ) renderSpinBoxArrow( painter, spinBoxOption, widget, SC_SpinBoxDown );
+ if( option->subControls & SC_SpinBoxUp ) renderSpinBoxArrow( SC_SpinBoxUp, spinBoxOption, painter, widget );
+ if( option->subControls & SC_SpinBoxDown ) renderSpinBoxArrow( SC_SpinBoxDown, spinBoxOption, painter, widget );
return true;
@@ -6097,7 +6116,7 @@
}
//____________________________________________________________________________________________________
- void Style::renderSpinBoxArrow( QPainter* painter, const QStyleOptionSpinBox* option, const QWidget* widget, const SubControl& subControl ) const
+ void Style::renderSpinBoxArrow( const SubControl& subControl, const QStyleOptionSpinBox* option, QPainter* painter, const QWidget* widget ) const
{
const QPalette& palette( option->palette );
@@ -6159,6 +6178,24 @@
}
//______________________________________________________________________________
+ void Style::renderMenuTitle( const QStyleOptionToolButton* option, QPainter* painter, const QWidget* ) const
+ {
+
+ const QPalette& palette( option->palette );
+
+ // render a separator at the bottom
+ const QRect contentsRect = insideMargin( option->rect, Metrics::MenuItem_MarginWidth );
+ const QColor color( _helper->separatorColor( palette ) );
+ _helper->renderSeparator( painter, QRect( contentsRect.bottomLeft(), QSize( contentsRect.width(), 1 ) ), color );
+
+ // render text in the center of the rect
+ // icon is discarded on purpose
+ painter->setFont( option->font );
+ drawItemText( painter, contentsRect, Qt::AlignCenter, palette, true, option->text, QPalette::WindowText );
+
+ }
+
+ //______________________________________________________________________________
qreal Style::dialAngle( const QStyleOptionSlider* sliderOption, int value ) const
{
@@ -6287,7 +6324,7 @@
toolButtonOption.initFrom( widget );
toolButtonOption.rect = menuItemOption->rect;
toolButtonOption.features = QStyleOptionToolButton::None;
- toolButtonOption.state = State_On|State_Sunken|State_Enabled;
+ toolButtonOption.state = State_Enabled;
toolButtonOption.subControls = SC_ToolButton;
toolButtonOption.icon = menuItemOption->icon;
@@ -6296,7 +6333,6 @@
toolButtonOption.text = menuItemOption->text;
toolButtonOption.toolButtonStyle = Qt::ToolButtonTextBesideIcon;
-
return toolButtonOption;
}
@@ -6514,4 +6550,27 @@
}
+ //____________________________________________________________________
+ bool Style::isMenuTitle( const QWidget* widget ) const
+ {
+ if( !widget ) return false;
+ if( widget->property( PropertyNames::menuTitle ).toBool() ) return true;
+
+ // detect menu toolbuttons
+ QWidget* parent = widget->parentWidget();
+ if( qobject_cast<QMenu*>( parent ) )
+ {
+ foreach( auto child, parent->findChildren<QWidgetAction*>() )
+ {
+ if( child->defaultWidget() != widget ) continue;
+ const_cast<QWidget*>(widget)->setProperty( PropertyNames::menuTitle, true );
+ return true;
+ }
+
+ }
+
+ return false;
+
+ }
+
}
|
[-]
[+]
|
Changed |
breeze-5.3.0.tar.xz/kstyle/breezestyle.h
^
|
@@ -318,7 +318,10 @@
//@{
//* spinbox arrows
- void renderSpinBoxArrow( QPainter*, const QStyleOptionSpinBox*, const QWidget*, const SubControl& ) const;
+ void renderSpinBoxArrow( const SubControl&, const QStyleOptionSpinBox*, QPainter*, const QWidget*) const;
+
+ //* menu title
+ void renderMenuTitle( const QStyleOptionToolButton*, QPainter*, const QWidget* ) const;
//* return dial angle based on option and value
qreal dialAngle( const QStyleOptionSlider*, int ) const;
@@ -439,6 +442,9 @@
//* return true if one of the widget's parent inherits requested type
template<typename T> bool hasParent( const QWidget* ) const;
+ //* return true if passed widget is a menu title (KMenu::addTitle)
+ bool isMenuTitle( const QWidget* ) const;
+
private:
//*@name scrollbar button types (for addLine and subLine )
|
[-]
[+]
|
Changed |
breeze-5.3.0.tar.xz/kstyle/config/CMakeLists.txt
^
|
@@ -51,7 +51,6 @@
install(TARGETS breeze-settings5 ${INSTALL_TARGETS_DEFAULT_ARGS})
# icon
- message( "ICON_INSTALL_DIR: ${ICON_INSTALL_DIR}" )
ecm_install_icons(ICONS sc-apps-breeze-settings.svgz
DESTINATION ${ICON_INSTALL_DIR}
THEME hicolor )
|
[-]
[+]
|
Changed |
breeze-5.3.0.tar.xz/kstyle/config/breezestyleconfig.desktop
^
|
@@ -10,6 +10,7 @@
X-KDE-Weight=50
Name=Widget Style
+Name[ar]=نمط الودجات
Name[ca]=Estil dels estris
Name[cs]=Styl widgetu
Name[de]=Stil der Bedienelemente
@@ -43,6 +44,7 @@
Name[zh_CN]=部件样式
Name[zh_TW]=元件樣式
Comment=Modify the appearance of widgets
+Comment[ar]=عدّل مظهر الودجات
Comment[ca]=Modifica l'aparença dels estris
Comment[cs]=Změnit vzhled widgetů
Comment[de]=Das Erscheinungsbild der Bedienelemente ändern
@@ -77,6 +79,7 @@
Comment[zh_TW]=變更元件外觀
X-KDE-Keywords=breeze,widget,style
+X-KDE-Keywords[ar]=نسيم,ودجة,نمط
X-KDE-Keywords[ca]=breeze,brisa,estri,estil
X-KDE-Keywords[cs]=breeze,widget,styl
X-KDE-Keywords[de]=Breeze,Bedienelement,Stil
|
[-]
[+]
|
Changed |
breeze-5.3.0.tar.xz/kstyle/config/ui/breezestyleconfig.ui
^
|
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>471</width>
- <height>560</height>
+ <width>455</width>
+ <height>232</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
@@ -15,335 +15,375 @@
<number>0</number>
</property>
<item>
- <widget class="QGroupBox" name="groupBox_2">
- <property name="title">
- <string>Animations</string>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="currentIndex">
+ <number>0</number>
</property>
- <layout class="QGridLayout" name="gridLayout_2">
- <item row="3" column="0">
- <widget class="QLabel" name="_animationsDurationLabel">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Animations d&uration:</string>
- </property>
- <property name="buddy">
- <cstring>_animationsDuration</cstring>
- </property>
- </widget>
- </item>
- <item row="3" column="1">
- <widget class="QSpinBox" name="_animationsDuration">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="suffix">
- <string>ms</string>
- </property>
- <property name="maximum">
- <number>500</number>
- </property>
- </widget>
- </item>
- <item row="3" column="2">
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>461</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="2" column="0" colspan="2">
- <widget class="QCheckBox" name="_animationsEnabled">
- <property name="text">
- <string>Enable animations</string>
- </property>
- </widget>
- </item>
- </layout>
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>General</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_4">
+ <item row="0" column="0" colspan="3">
+ <widget class="QCheckBox" name="_tabBarDrawCenteredTabs">
+ <property name="text">
+ <string>Center tabbar tabs</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" colspan="3">
+ <widget class="QCheckBox" name="_toolBarDrawItemSeparator">
+ <property name="text">
+ <string>Draw toolbar item separators</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" colspan="3">
+ <widget class="QCheckBox" name="_sliderDrawTickMarks">
+ <property name="text">
+ <string>Draw slider tick marks</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" colspan="3">
+ <widget class="QCheckBox" name="_splitterProxyEnabled">
+ <property name="text">
+ <string>Enable extended resize handles</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QLabel" name="_mnemonicsLabel">
+ <property name="text">
+ <string>&Keyboard accelerators visibility:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy">
+ <cstring>_mnemonicsMode</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QComboBox" name="_mnemonicsMode">
+ <item>
+ <property name="text">
+ <string>Always Hide Keyboard Accelerators</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Show Keyboard Accelerators When Needed</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Always Show Keyboard Accelerators</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="_windowDragLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>W&indows' drag mode:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ </property>
+ <property name="buddy">
+ <cstring>_windowDragMode</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <widget class="QComboBox" name="_windowDragMode">
+ <item>
+ <property name="text">
+ <string>Drag windows from titlebar only</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Drag windows from titlebar, menubar and toolbars</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Drag windows from all empty areas</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="4" column="2">
+ <spacer name="horizontalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>65</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="6" column="0" colspan="2">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>49</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
|
|
Deleted |
breeze-5.3.0.tar.xz/wallpapers/Next/contents/images/1024x768.png
^
|
|
Changed |
breeze-5.3.0.tar.xz/wallpapers/Next/contents/images/1280x1024.png
^
|
|
Changed |
breeze-5.3.0.tar.xz/wallpapers/Next/contents/images/1280x800.png
^
|
|
Changed |
breeze-5.3.0.tar.xz/wallpapers/Next/contents/images/1440x900.png
^
|
|
Changed |
breeze-5.3.0.tar.xz/wallpapers/Next/contents/images/1600x1200.png
^
|
|
Changed |
breeze-5.3.0.tar.xz/wallpapers/Next/contents/images/1638x1024.png
^
|
|
Changed |
breeze-5.3.0.tar.xz/wallpapers/Next/contents/images/1680x1050.png
^
|
|
Changed |
breeze-5.3.0.tar.xz/wallpapers/Next/contents/images/1920x1080.png
^
|
|
Changed |
breeze-5.3.0.tar.xz/wallpapers/Next/contents/images/1920x1200.png
^
|
|
Changed |
breeze-5.3.0.tar.xz/wallpapers/Next/contents/images/2560x1440.png
^
|
|
Changed |
breeze-5.3.0.tar.xz/wallpapers/Next/contents/images/2560x1600.png
^
|
|
Changed |
breeze-5.3.0.tar.xz/wallpapers/Next/contents/images/3200x1800.png
^
|
|
Deleted |
breeze-5.3.0.tar.xz/wallpapers/Next/contents/images/3200x2000.png
^
|
|
Changed |
breeze-5.3.0.tar.xz/wallpapers/Next/contents/screenshot.png
^
|
[-]
[+]
|
Changed |
breeze-5.3.0.tar.xz/wallpapers/Next/metadata.desktop
^
|
@@ -1,5 +1,6 @@
[Desktop Entry]
Name=Next
+Name[ar]=التّالي
Name[bs]=Sljedeći
Name[ca]=Next
Name[cs]=Následující
|