Merge branch 'KDE/4.9'
Conflicts: khotkeys/data/kde32b1.khotkeys kinfocenter/Modules/opengl/opengl.desktop kwin/tabbox/tests/CMakeLists.txt plasma/generic/applets/system-monitor/plasma-applet-sm_hdd_activity.desktop
This commit is contained in:
commit
90365e27d0
42 changed files with 772 additions and 4 deletions
|
@ -85,6 +85,9 @@ bool AuroraeFactory::reset(unsigned long changed)
|
|||
if (changed & SettingButtons) {
|
||||
emit buttonsChanged();
|
||||
}
|
||||
if (changed & SettingFont){
|
||||
emit titleFontChanged();
|
||||
}
|
||||
const KConfig conf("auroraerc");
|
||||
const KConfigGroup group(&conf, "Engine");
|
||||
const QString themeName = group.readEntry("ThemeName", "example-deco");
|
||||
|
@ -161,6 +164,16 @@ bool AuroraeFactory::customButtonPositions()
|
|||
return options()->customButtonPositions();
|
||||
}
|
||||
|
||||
QFont AuroraeFactory::activeTitleFont()
|
||||
{
|
||||
return options()->font();
|
||||
}
|
||||
|
||||
QFont AuroraeFactory::inactiveTitleFont()
|
||||
{
|
||||
return options()->font(false);
|
||||
}
|
||||
|
||||
AuroraeFactory *AuroraeFactory::s_instance = NULL;
|
||||
|
||||
/*******************************************************
|
||||
|
|
|
@ -41,6 +41,8 @@ class AuroraeFactory : public QObject, public KDecorationFactoryUnstable
|
|||
Q_PROPERTY(QString leftButtons READ leftButtons NOTIFY buttonsChanged)
|
||||
Q_PROPERTY(QString rightButtons READ rightButtons NOTIFY buttonsChanged)
|
||||
Q_PROPERTY(bool customButtonPositions READ customButtonPositions NOTIFY buttonsChanged)
|
||||
Q_PROPERTY(QFont activeTitleFont READ activeTitleFont NOTIFY titleFontChanged)
|
||||
Q_PROPERTY(QFont inactiveTitleFont READ inactiveTitleFont NOTIFY titleFontChanged)
|
||||
public:
|
||||
~AuroraeFactory();
|
||||
|
||||
|
@ -58,12 +60,16 @@ public:
|
|||
QString rightButtons();
|
||||
bool customButtonPositions();
|
||||
|
||||
QFont activeTitleFont();
|
||||
QFont inactiveTitleFont();
|
||||
|
||||
private:
|
||||
AuroraeFactory();
|
||||
void init();
|
||||
|
||||
Q_SIGNALS:
|
||||
void buttonsChanged();
|
||||
void titleFontChanged();
|
||||
|
||||
private:
|
||||
static AuroraeFactory *s_instance;
|
||||
|
|
|
@ -143,6 +143,7 @@ Decoration {
|
|||
elide: Text.ElideRight
|
||||
height: auroraeTheme.titleHeight
|
||||
color: decoration.active ? auroraeTheme.activeTextColor : auroraeTheme.inactiveTextColor
|
||||
font: decoration.active ? options.activeTitleFont : options.inactiveTitleFont
|
||||
anchors {
|
||||
left: leftButtonGroup.right
|
||||
right: rightButtonGroup.left
|
||||
|
|
26
effects.cpp
26
effects.cpp
|
@ -1359,9 +1359,9 @@ void EffectsHandlerImpl::reconfigureEffect(const QString& name)
|
|||
}
|
||||
}
|
||||
|
||||
bool EffectsHandlerImpl::isEffectLoaded(const QString& name)
|
||||
bool EffectsHandlerImpl::isEffectLoaded(const QString& name) const
|
||||
{
|
||||
for (QVector< EffectPair >::iterator it = loaded_effects.begin(); it != loaded_effects.end(); ++it)
|
||||
for (QVector< EffectPair >::const_iterator it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it)
|
||||
if ((*it).first == name)
|
||||
return true;
|
||||
|
||||
|
@ -1430,6 +1430,28 @@ void EffectsHandlerImpl::slotHideOutline()
|
|||
emit hideOutline();
|
||||
}
|
||||
|
||||
QString EffectsHandlerImpl::supportInformation(const QString &name) const
|
||||
{
|
||||
if (!isEffectLoaded(name)) {
|
||||
return QString();
|
||||
}
|
||||
for (QVector< EffectPair >::const_iterator it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it) {
|
||||
if ((*it).first == name) {
|
||||
QString support((*it).first + ":\n");
|
||||
const QMetaObject *metaOptions = (*it).second->metaObject();
|
||||
for (int i=0; i<metaOptions->propertyCount(); ++i) {
|
||||
const QMetaProperty property = metaOptions->property(i);
|
||||
if (QLatin1String(property.name()) == "objectName") {
|
||||
continue;
|
||||
}
|
||||
support.append(QLatin1String(property.name()) % ": " % (*it).second->property(property.name()).toString() % '\n');
|
||||
}
|
||||
return support;
|
||||
}
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
//****************************************
|
||||
// EffectWindowImpl
|
||||
//****************************************
|
||||
|
|
|
@ -167,7 +167,8 @@ public:
|
|||
void toggleEffect(const QString& name);
|
||||
void unloadEffect(const QString& name);
|
||||
void reconfigureEffect(const QString& name);
|
||||
bool isEffectLoaded(const QString& name);
|
||||
bool isEffectLoaded(const QString& name) const;
|
||||
QString supportInformation(const QString& name) const;
|
||||
QStringList loadedEffects() const;
|
||||
QStringList listOfEffects() const;
|
||||
|
||||
|
|
|
@ -672,5 +672,10 @@ void BlurEffect::doCachedBlur(EffectWindow *w, const QRegion& region, const floa
|
|||
shader->unbind();
|
||||
}
|
||||
|
||||
int BlurEffect::blurRadius() const
|
||||
{
|
||||
return shader->radius();
|
||||
}
|
||||
|
||||
} // namespace KWin
|
||||
|
||||
|
|
|
@ -35,6 +35,8 @@ class BlurShader;
|
|||
class BlurEffect : public KWin::Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int blurRadius READ blurRadius)
|
||||
Q_PROPERTY(bool cacheTexture READ isCacheTexture)
|
||||
public:
|
||||
BlurEffect();
|
||||
~BlurEffect();
|
||||
|
@ -48,6 +50,12 @@ public:
|
|||
void drawWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data);
|
||||
void paintEffectFrame(EffectFrame *frame, QRegion region, double opacity, double frameOpacity);
|
||||
|
||||
// for dynamic setting extraction
|
||||
int blurRadius() const;
|
||||
bool isCacheTexture() const {
|
||||
return m_shouldCache;
|
||||
}
|
||||
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(KWin::EffectWindow *w);
|
||||
void slotWindowDeleted(KWin::EffectWindow *w);
|
||||
|
|
|
@ -38,6 +38,18 @@ class CoverSwitchEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int animationDuration READ configuredAnimationDuration)
|
||||
Q_PROPERTY(bool animateSwitch READ isAnimateSwitch)
|
||||
Q_PROPERTY(bool animateStart READ isAnimateStart)
|
||||
Q_PROPERTY(bool animateStop READ isAnimateStop)
|
||||
Q_PROPERTY(bool reflection READ isReflection)
|
||||
Q_PROPERTY(bool windowTitle READ isWindowTitle)
|
||||
Q_PROPERTY(qreal zPosition READ windowZPosition)
|
||||
Q_PROPERTY(bool dynamicThumbnails READ isDynamicThumbnails)
|
||||
Q_PROPERTY(int thumbnailWindows READ configurredThumbnailWindows)
|
||||
Q_PROPERTY(bool primaryTabBox READ isPrimaryTabBox)
|
||||
Q_PROPERTY(bool secondaryTabBox READ isSecondaryTabBox)
|
||||
// TODO: mirror colors
|
||||
public:
|
||||
CoverSwitchEffect();
|
||||
~CoverSwitchEffect();
|
||||
|
@ -52,6 +64,41 @@ public:
|
|||
|
||||
static bool supported();
|
||||
|
||||
// for properties
|
||||
int configuredAnimationDuration() const {
|
||||
return animationDuration;
|
||||
}
|
||||
bool isAnimateSwitch() const {
|
||||
return animateSwitch;
|
||||
}
|
||||
bool isAnimateStart() const {
|
||||
return animateStart;
|
||||
}
|
||||
bool isAnimateStop() const {
|
||||
return animateStop;
|
||||
}
|
||||
bool isReflection() const {
|
||||
return reflection;
|
||||
}
|
||||
bool isWindowTitle() const {
|
||||
return windowTitle;
|
||||
}
|
||||
qreal windowZPosition() const {
|
||||
return zPosition;
|
||||
}
|
||||
bool isDynamicThumbnails() const {
|
||||
return dynamicThumbnails;
|
||||
}
|
||||
int configurredThumbnailWindows() const {
|
||||
return thumbnailWindows;
|
||||
}
|
||||
bool isPrimaryTabBox() const {
|
||||
return primaryTabBox;
|
||||
}
|
||||
bool isSecondaryTabBox() const {
|
||||
return secondaryTabBox;
|
||||
}
|
||||
|
||||
public Q_SLOTS:
|
||||
void slotWindowClosed(KWin::EffectWindow *c);
|
||||
void slotTabBoxAdded(int mode);
|
||||
|
|
|
@ -38,6 +38,23 @@ class CubeEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(qreal cubeOpacity READ configuredCubeOpacity)
|
||||
Q_PROPERTY(bool opacityDesktopOnly READ isOpacityDesktopOnly)
|
||||
Q_PROPERTY(bool displayDesktopName READ isDisplayDesktopName)
|
||||
Q_PROPERTY(bool reflection READ isReflection)
|
||||
Q_PROPERTY(int rotationDuration READ configuredRotationDuration)
|
||||
Q_PROPERTY(QColor backgroundColor READ configuredBackgroundColor)
|
||||
Q_PROPERTY(QColor capColor READ configuredCapColor)
|
||||
Q_PROPERTY(bool paintCaps READ isPaintCaps)
|
||||
Q_PROPERTY(bool closeOnMouseRelease READ isCloseOnMouseRelease)
|
||||
Q_PROPERTY(qreal zPosition READ configuredZPosition)
|
||||
Q_PROPERTY(bool useForTabBox READ isUseForTabBox)
|
||||
Q_PROPERTY(bool invertKeys READ isInvertKeys)
|
||||
Q_PROPERTY(bool invertMouse READ isInvertMouse)
|
||||
Q_PROPERTY(qreal capDeformationFactor READ configuredCapDeformationFactor)
|
||||
Q_PROPERTY(bool useZOrdering READ isUseZOrdering)
|
||||
Q_PROPERTY(bool texturedCaps READ isTexturedCaps)
|
||||
// TODO: electric borders: not a registered type
|
||||
public:
|
||||
CubeEffect();
|
||||
~CubeEffect();
|
||||
|
@ -58,6 +75,56 @@ public:
|
|||
void unregisterCubeInsideEffect(CubeInsideEffect* effect);
|
||||
|
||||
static bool supported();
|
||||
|
||||
// for properties
|
||||
qreal configuredCubeOpacity() const {
|
||||
return cubeOpacity;
|
||||
}
|
||||
bool isOpacityDesktopOnly() const {
|
||||
return opacityDesktopOnly;
|
||||
}
|
||||
bool isDisplayDesktopName() const {
|
||||
return displayDesktopName;
|
||||
}
|
||||
bool isReflection() const {
|
||||
return reflection;
|
||||
}
|
||||
int configuredRotationDuration() const {
|
||||
return rotationDuration;
|
||||
}
|
||||
QColor configuredBackgroundColor() const {
|
||||
return backgroundColor;
|
||||
}
|
||||
QColor configuredCapColor() const {
|
||||
return capColor;
|
||||
}
|
||||
bool isPaintCaps() const {
|
||||
return paintCaps;
|
||||
}
|
||||
bool isCloseOnMouseRelease() const {
|
||||
return closeOnMouseRelease;
|
||||
}
|
||||
qreal configuredZPosition() const {
|
||||
return zPosition;
|
||||
}
|
||||
bool isUseForTabBox() const {
|
||||
return useForTabBox;
|
||||
}
|
||||
bool isInvertKeys() const {
|
||||
return invertKeys;
|
||||
}
|
||||
bool isInvertMouse() const {
|
||||
return invertMouse;
|
||||
}
|
||||
qreal configuredCapDeformationFactor() const {
|
||||
return capDeformationFactor;
|
||||
}
|
||||
bool isUseZOrdering() const {
|
||||
return useZOrdering;
|
||||
}
|
||||
bool isTexturedCaps() const {
|
||||
return texturedCaps;
|
||||
}
|
||||
private slots:
|
||||
void toggleCube();
|
||||
void toggleCylinder();
|
||||
|
|
|
@ -33,6 +33,11 @@ class CubeSlideEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int rotationDuration READ configuredRotationDuration)
|
||||
Q_PROPERTY(bool dontSlidePanels READ isDontSlidePanels)
|
||||
Q_PROPERTY(bool dontSlideStickyWindows READ isDontSlideStickyWindows)
|
||||
Q_PROPERTY(bool usePagerLayout READ isUsePagerLayout)
|
||||
Q_PROPERTY(bool useWindowMoving READ isUseWindowMoving)
|
||||
public:
|
||||
CubeSlideEffect();
|
||||
~CubeSlideEffect();
|
||||
|
@ -46,6 +51,22 @@ public:
|
|||
|
||||
static bool supported();
|
||||
|
||||
// for properties
|
||||
int configuredRotationDuration() const {
|
||||
return rotationDuration;
|
||||
}
|
||||
bool isDontSlidePanels() const {
|
||||
return dontSlidePanels;
|
||||
}
|
||||
bool isDontSlideStickyWindows() const {
|
||||
return dontSlideStickyWindows;
|
||||
}
|
||||
bool isUsePagerLayout() const {
|
||||
return usePagerLayout;
|
||||
}
|
||||
bool isUseWindowMoving() const {
|
||||
return useWindowMoving;
|
||||
}
|
||||
private Q_SLOTS:
|
||||
void slotDesktopChanged(int old, int current);
|
||||
void slotWindowStepUserMovedResized(KWin::EffectWindow *w);
|
||||
|
|
|
@ -34,6 +34,9 @@ namespace KWin
|
|||
class DashboardEffect : public KWin::Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(qreal brightness READ configuredBrightness)
|
||||
Q_PROPERTY(qreal saturation READ configuredSaturation)
|
||||
Q_PROPERTY(bool blur READ isBlur)
|
||||
public:
|
||||
DashboardEffect();
|
||||
~DashboardEffect();
|
||||
|
@ -45,6 +48,16 @@ public:
|
|||
virtual void unpropagate();
|
||||
virtual bool isActive() const;
|
||||
|
||||
// for properties
|
||||
qreal configuredBrightness() const {
|
||||
return brightness;
|
||||
}
|
||||
qreal configuredSaturation() const {
|
||||
return saturation;
|
||||
}
|
||||
bool isBlur() const {
|
||||
return blur;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(KWin::EffectWindow* c);
|
||||
void slotWindowClosed(KWin::EffectWindow *c);
|
||||
|
|
|
@ -63,6 +63,13 @@ class DesktopGridEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int zoomDuration READ configuredZoomDuration)
|
||||
Q_PROPERTY(int border READ configuredBorder)
|
||||
Q_PROPERTY(Qt::Alignment desktopNameAlignment READ configuredDesktopNameAlignment)
|
||||
Q_PROPERTY(int layoutMode READ configuredLayoutMode)
|
||||
Q_PROPERTY(int customLayoutRows READ configuredCustomLayoutRows)
|
||||
Q_PROPERTY(bool usePresentWindows READ isUsePresentWindows)
|
||||
// TODO: electric borders
|
||||
public:
|
||||
DesktopGridEffect();
|
||||
~DesktopGridEffect();
|
||||
|
@ -79,6 +86,25 @@ public:
|
|||
|
||||
enum { LayoutPager, LayoutAutomatic, LayoutCustom }; // Layout modes
|
||||
|
||||
// for properties
|
||||
int configuredZoomDuration() const {
|
||||
return zoomDuration;
|
||||
}
|
||||
int configuredBorder() const {
|
||||
return border;
|
||||
}
|
||||
Qt::Alignment configuredDesktopNameAlignment() const {
|
||||
return desktopNameAlignment;
|
||||
}
|
||||
int configuredLayoutMode() const {
|
||||
return layoutMode;
|
||||
}
|
||||
int configuredCustomLayoutRows() const {
|
||||
return customLayoutRows;
|
||||
}
|
||||
bool isUsePresentWindows() const {
|
||||
return m_usePresentWindows;
|
||||
}
|
||||
private slots:
|
||||
void toggle();
|
||||
// slots for global shortcut changed
|
||||
|
|
|
@ -38,6 +38,7 @@ class DialogParentEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int changeTime READ configuredChangeTime)
|
||||
public:
|
||||
DialogParentEffect();
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
|
@ -48,6 +49,10 @@ public:
|
|||
|
||||
virtual bool isActive() const;
|
||||
|
||||
// for properties
|
||||
int configuredChangeTime() const {
|
||||
return changeTime;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowClosed(KWin::EffectWindow *c);
|
||||
void slotWindowActivated(KWin::EffectWindow *c);
|
||||
|
|
|
@ -34,12 +34,33 @@ class DimInactiveEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool dimPanels READ isDimPanels)
|
||||
Q_PROPERTY(bool dimDesktop READ isDimDesktop)
|
||||
Q_PROPERTY(bool dimKeepAbove READ isDimKeepAbove)
|
||||
Q_PROPERTY(bool dimByGroup READ isDimByGroup)
|
||||
Q_PROPERTY(int dimStrength READ configuredDimStrength)
|
||||
public:
|
||||
DimInactiveEffect();
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
virtual void prePaintScreen(ScreenPrePaintData& data, int time);
|
||||
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
|
||||
|
||||
// for properties
|
||||
bool isDimPanels() const {
|
||||
return dim_panels;
|
||||
}
|
||||
bool isDimDesktop() const {
|
||||
return dim_desktop;
|
||||
}
|
||||
bool isDimKeepAbove() const {
|
||||
return dim_keepabove;
|
||||
}
|
||||
bool isDimByGroup() const {
|
||||
return dim_by_group;
|
||||
}
|
||||
int configuredDimStrength() const {
|
||||
return dim_strength;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowActivated(KWin::EffectWindow* c);
|
||||
void slotWindowDeleted(KWin::EffectWindow *w);
|
||||
|
|
|
@ -30,6 +30,7 @@ class FallApartEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int blockSize READ configuredBlockSize)
|
||||
public:
|
||||
FallApartEffect();
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
|
@ -39,6 +40,10 @@ public:
|
|||
virtual void postPaintScreen();
|
||||
virtual bool isActive() const;
|
||||
|
||||
// for properties
|
||||
int configuredBlockSize() const {
|
||||
return blockSize;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowClosed(KWin::EffectWindow *c);
|
||||
void slotWindowDeleted(KWin::EffectWindow *w);
|
||||
|
|
|
@ -35,6 +35,14 @@ class FlipSwitchEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool tabBox READ isTabBox)
|
||||
Q_PROPERTY(bool tabBoxAlternative READ isTabBoxAlternative)
|
||||
Q_PROPERTY(int duration READ duration)
|
||||
Q_PROPERTY(int angle READ angle)
|
||||
Q_PROPERTY(qreal xPosition READ xPosition)
|
||||
Q_PROPERTY(qreal yPosition READ yPosition)
|
||||
Q_PROPERTY(bool windowTitle READ isWindowTitle)
|
||||
// TODO: electric borders
|
||||
public:
|
||||
FlipSwitchEffect();
|
||||
~FlipSwitchEffect();
|
||||
|
@ -51,6 +59,29 @@ public:
|
|||
virtual bool isActive() const;
|
||||
|
||||
static bool supported();
|
||||
|
||||
// for properties
|
||||
bool isTabBox() const {
|
||||
return m_tabbox;
|
||||
}
|
||||
bool isTabBoxAlternative() const {
|
||||
return m_tabboxAlternative;
|
||||
}
|
||||
int duration() const {
|
||||
return m_timeLine.duration();
|
||||
}
|
||||
int angle() const {
|
||||
return m_angle;
|
||||
}
|
||||
qreal xPosition() const {
|
||||
return m_xPosition;
|
||||
}
|
||||
qreal yPosition() const {
|
||||
return m_yPosition;
|
||||
}
|
||||
bool isWindowTitle() const {
|
||||
return m_windowTitle;
|
||||
}
|
||||
private Q_SLOTS:
|
||||
void toggleActiveCurrent();
|
||||
void toggleActiveAllDesktops();
|
||||
|
|
|
@ -34,6 +34,9 @@ class GlideEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int duration READ configuredDuration)
|
||||
Q_PROPERTY(int effect READ configuredEffect)
|
||||
Q_PROPERTY(int angle READ configuredAngle)
|
||||
public:
|
||||
GlideEffect();
|
||||
~GlideEffect();
|
||||
|
@ -45,6 +48,17 @@ public:
|
|||
virtual bool isActive() const;
|
||||
|
||||
static bool supported();
|
||||
|
||||
// for properties
|
||||
int configuredDuration() const {
|
||||
return duration;
|
||||
}
|
||||
int configuredEffect() const {
|
||||
return effect;
|
||||
}
|
||||
int configuredAngle() const {
|
||||
return angle;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(KWin::EffectWindow* c);
|
||||
void slotWindowClosed(KWin::EffectWindow *c);
|
||||
|
|
|
@ -31,6 +31,7 @@ class LoginEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool fadeToBlack READ isFadeToBlack)
|
||||
public:
|
||||
LoginEffect();
|
||||
virtual void prePaintScreen(ScreenPrePaintData& data, int time);
|
||||
|
@ -40,6 +41,10 @@ public:
|
|||
virtual void reconfigure(ReconfigureFlags);
|
||||
virtual bool isActive() const;
|
||||
|
||||
// for properties
|
||||
bool isFadeToBlack() const {
|
||||
return m_fadeToBlack;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowClosed(KWin::EffectWindow *w);
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ class LogoutEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool useBlur READ isUseBlur)
|
||||
public:
|
||||
LogoutEffect();
|
||||
~LogoutEffect();
|
||||
|
@ -45,6 +46,11 @@ public:
|
|||
virtual void postPaintScreen();
|
||||
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
|
||||
virtual bool isActive() const;
|
||||
|
||||
// for properties
|
||||
bool isUseBlur() const {
|
||||
return useBlur;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(KWin::EffectWindow* w);
|
||||
void slotWindowClosed(KWin::EffectWindow *w);
|
||||
|
|
|
@ -40,6 +40,7 @@ class GLVertexBuffer;
|
|||
class LookingGlassEffect : public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int initialRadius READ initialRadius)
|
||||
public:
|
||||
LookingGlassEffect();
|
||||
virtual ~LookingGlassEffect();
|
||||
|
@ -52,6 +53,10 @@ public:
|
|||
|
||||
static bool supported();
|
||||
|
||||
// for properties
|
||||
int initialRadius() const {
|
||||
return initialradius;
|
||||
}
|
||||
public slots:
|
||||
void toggle();
|
||||
void zoomIn();
|
||||
|
|
|
@ -32,6 +32,7 @@ class MagicLampEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int animationDuration READ animationDuration)
|
||||
public:
|
||||
MagicLampEffect();
|
||||
|
||||
|
@ -44,6 +45,10 @@ public:
|
|||
|
||||
static bool supported();
|
||||
|
||||
// for properties
|
||||
int animationDuration() const {
|
||||
return mAnimationDuration;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowDeleted(KWin::EffectWindow *w);
|
||||
void slotWindowMinimized(KWin::EffectWindow *w);
|
||||
|
|
|
@ -34,6 +34,8 @@ class MagnifierEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QSize magnifierSize READ magnifierSize)
|
||||
Q_PROPERTY(qreal targetZoom READ targetZoom)
|
||||
public:
|
||||
MagnifierEffect();
|
||||
virtual ~MagnifierEffect();
|
||||
|
@ -43,6 +45,14 @@ public:
|
|||
virtual void postPaintScreen();
|
||||
virtual bool isActive() const;
|
||||
static bool supported();
|
||||
|
||||
// for properties
|
||||
QSize magnifierSize() const {
|
||||
return magnifier_size;
|
||||
}
|
||||
qreal targetZoom() const {
|
||||
return target_zoom;
|
||||
}
|
||||
private slots:
|
||||
void zoomIn();
|
||||
void zoomOut();
|
||||
|
|
|
@ -32,12 +32,22 @@ class MouseMarkEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int width READ configuredWidth)
|
||||
Q_PROPERTY(QColor color READ configuredColor)
|
||||
public:
|
||||
MouseMarkEffect();
|
||||
~MouseMarkEffect();
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
|
||||
virtual bool isActive() const;
|
||||
|
||||
// for properties
|
||||
int configuredWidth() const {
|
||||
return width;
|
||||
}
|
||||
QColor configuredColor() const {
|
||||
return color;
|
||||
}
|
||||
private slots:
|
||||
void clear();
|
||||
void clearLast();
|
||||
|
|
|
@ -67,6 +67,23 @@ class PresentWindowsEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int layoutMode READ layoutMode)
|
||||
Q_PROPERTY(bool showCaptions READ isShowCaptions)
|
||||
Q_PROPERTY(bool showIcons READ isShowIcons)
|
||||
Q_PROPERTY(bool doNotCloseWindows READ isDoNotCloseWindows)
|
||||
Q_PROPERTY(bool ignoreMinimized READ isIgnoreMinimized)
|
||||
Q_PROPERTY(int accuracy READ accuracy)
|
||||
Q_PROPERTY(bool fillGaps READ isFillGaps)
|
||||
Q_PROPERTY(int fadeDuration READ fadeDuration)
|
||||
Q_PROPERTY(bool showPanel READ isShowPanel)
|
||||
Q_PROPERTY(int leftButtonWindow READ leftButtonWindow)
|
||||
Q_PROPERTY(int rightButtonWindow READ rightButtonWindow)
|
||||
Q_PROPERTY(int middleButtonWindow READ middleButtonWindow)
|
||||
Q_PROPERTY(int leftButtonDesktop READ leftButtonDesktop)
|
||||
Q_PROPERTY(int middleButtonDesktop READ middleButtonDesktop)
|
||||
Q_PROPERTY(int rightButtonDesktop READ rightButtonDesktop)
|
||||
Q_PROPERTY(bool dragToClose READ isDragToClose)
|
||||
// TODO: electric borders
|
||||
private:
|
||||
// Structures
|
||||
struct WindowData {
|
||||
|
@ -130,6 +147,55 @@ public:
|
|||
DesktopShowDesktopAction = 3 // Minimizes all windows
|
||||
};
|
||||
|
||||
// for properties
|
||||
int layoutMode() const {
|
||||
return m_layoutMode;
|
||||
}
|
||||
bool isShowCaptions() const {
|
||||
return m_showCaptions;
|
||||
}
|
||||
bool isShowIcons() const {
|
||||
return m_showIcons;
|
||||
}
|
||||
bool isDoNotCloseWindows() const {
|
||||
return m_doNotCloseWindows;
|
||||
}
|
||||
bool isIgnoreMinimized() const {
|
||||
return m_ignoreMinimized;
|
||||
}
|
||||
int accuracy() const {
|
||||
return m_accuracy;
|
||||
}
|
||||
bool isFillGaps() const {
|
||||
return m_fillGaps;
|
||||
}
|
||||
int fadeDuration() const {
|
||||
return m_fadeDuration;
|
||||
}
|
||||
bool isShowPanel() const {
|
||||
return m_showPanel;
|
||||
}
|
||||
int leftButtonWindow() const {
|
||||
return m_leftButtonWindow;
|
||||
}
|
||||
int rightButtonWindow() const {
|
||||
return m_rightButtonWindow;
|
||||
}
|
||||
int middleButtonWindow() const {
|
||||
return m_middleButtonWindow;
|
||||
}
|
||||
int leftButtonDesktop() const {
|
||||
return m_leftButtonDesktop;
|
||||
}
|
||||
int middleButtonDesktop() const {
|
||||
return m_middleButtonDesktop;
|
||||
}
|
||||
int rightButtonDesktop() const {
|
||||
return m_rightButtonDesktop;
|
||||
}
|
||||
bool isDragToClose() const {
|
||||
return m_dragToClose;
|
||||
}
|
||||
public slots:
|
||||
void setActive(bool active);
|
||||
void toggleActive() {
|
||||
|
|
|
@ -30,6 +30,8 @@ class ResizeEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool textureScale READ isTextureScale)
|
||||
Q_PROPERTY(bool outline READ isOutline)
|
||||
public:
|
||||
ResizeEffect();
|
||||
~ResizeEffect();
|
||||
|
@ -42,6 +44,13 @@ public:
|
|||
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
|
||||
bool isTextureScale() const {
|
||||
return m_features & TextureScale;
|
||||
}
|
||||
bool isOutline() const {
|
||||
return m_features & Outline;
|
||||
}
|
||||
|
||||
public Q_SLOTS:
|
||||
void slotWindowStartUserMovedResized(KWin::EffectWindow *w);
|
||||
void slotWindowStepUserMovedResized(KWin::EffectWindow *w, const QRect &geometry);
|
||||
|
|
|
@ -33,6 +33,7 @@ class SheetEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int duration READ configuredDuration)
|
||||
public:
|
||||
SheetEffect();
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
|
@ -44,6 +45,10 @@ public:
|
|||
|
||||
static bool supported();
|
||||
|
||||
// for properties
|
||||
int configuredDuration() const {
|
||||
return duration;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(KWin::EffectWindow* c);
|
||||
void slotWindowClosed(KWin::EffectWindow *c);
|
||||
|
|
|
@ -33,6 +33,14 @@ class GLTexture;
|
|||
class ShowFpsEffect
|
||||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(qreal alpha READ configuredAlpha)
|
||||
Q_PROPERTY(int x READ configuredX)
|
||||
Q_PROPERTY(int y READ configuredY)
|
||||
Q_PROPERTY(QRect fpsTextRect READ configuredFpsTextRect)
|
||||
Q_PROPERTY(int textAlign READ configuredTextAlign)
|
||||
Q_PROPERTY(QFont textFont READ configuredTextFont)
|
||||
Q_PROPERTY(QColor textColor READ configuredTextColor)
|
||||
public:
|
||||
ShowFpsEffect();
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
|
@ -41,6 +49,29 @@ public:
|
|||
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
|
||||
virtual void postPaintScreen();
|
||||
enum { INSIDE_GRAPH, NOWHERE, TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT }; // fps text position
|
||||
|
||||
// for properties
|
||||
qreal configuredAlpha() const {
|
||||
return alpha;
|
||||
}
|
||||
int configuredX() const {
|
||||
return x;
|
||||
}
|
||||
int configuredY() const {
|
||||
return y;
|
||||
}
|
||||
QRect configuredFpsTextRect() const {
|
||||
return fpsTextRect;
|
||||
}
|
||||
int configuredTextAlign() const {
|
||||
return textAlign;
|
||||
}
|
||||
QFont configuredTextFont() const {
|
||||
return textFont;
|
||||
}
|
||||
QColor configuredTextColor() const {
|
||||
return textColor;
|
||||
}
|
||||
private:
|
||||
void paintGL(int fps);
|
||||
#ifdef KWIN_HAVE_XRENDER_COMPOSITING
|
||||
|
|
|
@ -33,6 +33,8 @@ class SlidingPopupsEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int fadeInTime READ fadeInTime)
|
||||
Q_PROPERTY(int fadeOutTime READ fadeOutTime)
|
||||
public:
|
||||
SlidingPopupsEffect();
|
||||
~SlidingPopupsEffect();
|
||||
|
@ -44,6 +46,13 @@ public:
|
|||
virtual bool isActive() const;
|
||||
// TODO react also on virtual desktop changes
|
||||
|
||||
// for properties
|
||||
int fadeInTime() const {
|
||||
return mFadeInTime;
|
||||
}
|
||||
int fadeOutTime() const {
|
||||
return mFadeOutTime;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(KWin::EffectWindow *c);
|
||||
void slotWindowClosed(KWin::EffectWindow *c);
|
||||
|
|
|
@ -39,10 +39,28 @@ class ThumbnailAsideEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int maxWidth READ configuredMaxWidth)
|
||||
Q_PROPERTY(int spacing READ configuredSpacing)
|
||||
Q_PROPERTY(qreal opacity READ configuredOpacity)
|
||||
Q_PROPERTY(int screen READ configuredScreen)
|
||||
public:
|
||||
ThumbnailAsideEffect();
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
|
||||
|
||||
// for properties
|
||||
int configuredMaxWidth() const {
|
||||
return maxwidth;
|
||||
}
|
||||
int configuredSpacing() const {
|
||||
return spacing;
|
||||
}
|
||||
qreal configuredOpacity() const {
|
||||
return opacity;
|
||||
}
|
||||
int configuredScreen() const {
|
||||
return screen;
|
||||
}
|
||||
private slots:
|
||||
void toggleCurrentThumbnail();
|
||||
void slotWindowClosed(KWin::EffectWindow *w);
|
||||
|
|
|
@ -34,6 +34,8 @@ class TrackMouseEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(Qt::KeyboardModifiers modifiers READ modifiers)
|
||||
Q_PROPERTY(bool mousePolling READ isMousePolling)
|
||||
public:
|
||||
TrackMouseEffect();
|
||||
virtual ~TrackMouseEffect();
|
||||
|
@ -42,6 +44,14 @@ public:
|
|||
virtual void postPaintScreen();
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
virtual bool isActive() const;
|
||||
|
||||
// for properties
|
||||
Qt::KeyboardModifiers modifiers() const {
|
||||
return m_modifiers;
|
||||
}
|
||||
bool isMousePolling() const {
|
||||
return m_mousePolling;
|
||||
}
|
||||
private slots:
|
||||
void toggle();
|
||||
void slotMouseChanged(const QPoint& pos, const QPoint& old,
|
||||
|
|
|
@ -31,12 +31,61 @@ class TranslucencyEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(qreal decoration READ configuredDecoration)
|
||||
Q_PROPERTY(qreal moveResize READ configuredMoveResize)
|
||||
Q_PROPERTY(qreal dialogs READ configuredDialogs)
|
||||
Q_PROPERTY(qreal inactive READ configuredInactive)
|
||||
Q_PROPERTY(qreal comboboxPopups READ configuredComboboxPopups)
|
||||
Q_PROPERTY(qreal menus READ configuredMenus)
|
||||
Q_PROPERTY(bool individualMenuConfig READ isIndividualMenuConfig)
|
||||
Q_PROPERTY(qreal dropDownMenus READ configuredDropDownMenus)
|
||||
Q_PROPERTY(qreal popupMenus READ configuredPopupMenus)
|
||||
Q_PROPERTY(qreal tornOffMenus READ configuredTornOffMenus)
|
||||
Q_PROPERTY(int moveResizeDuration READ configuredMoveResizeDuration)
|
||||
Q_PROPERTY(int activeInactiveDuration READ configuredActiveInactiveDuration)
|
||||
public:
|
||||
TranslucencyEffect();
|
||||
virtual void reconfigure(ReconfigureFlags);
|
||||
virtual void prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time);
|
||||
virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
|
||||
|
||||
// for properties
|
||||
qreal configuredDecoration() const {
|
||||
return decoration;
|
||||
}
|
||||
qreal configuredMoveResize() const {
|
||||
return moveresize;
|
||||
}
|
||||
qreal configuredDialogs() const {
|
||||
return dialogs;
|
||||
}
|
||||
qreal configuredInactive() const {
|
||||
return inactive;
|
||||
}
|
||||
qreal configuredComboboxPopups() const {
|
||||
return comboboxpopups;
|
||||
}
|
||||
qreal configuredMenus() const {
|
||||
return menus;
|
||||
}
|
||||
bool isIndividualMenuConfig() const {
|
||||
return individualmenuconfig;
|
||||
}
|
||||
qreal configuredDropDownMenus() const {
|
||||
return dropdownmenus;
|
||||
}
|
||||
qreal configuredPopupMenus() const {
|
||||
return popupmenus;
|
||||
}
|
||||
qreal configuredTornOffMenus() const {
|
||||
return tornoffmenus;
|
||||
}
|
||||
int configuredMoveResizeDuration() const {
|
||||
return moveresize_timeline.duration();
|
||||
}
|
||||
int configuredActiveInactiveDuration() const {
|
||||
return activeinactive_timeline.duration();
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowActivated(KWin::EffectWindow* w);
|
||||
void slotWindowStartStopUserMovedResized(KWin::EffectWindow *w);
|
||||
|
|
|
@ -29,6 +29,8 @@ namespace KWin
|
|||
class WindowGeometry : public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool handlesMoves READ isHandlesMoves)
|
||||
Q_PROPERTY(bool handlesResizes READ isHandlesResizes)
|
||||
public:
|
||||
WindowGeometry();
|
||||
~WindowGeometry();
|
||||
|
@ -40,6 +42,13 @@ public:
|
|||
void paintScreen(int mask, QRegion region, ScreenPaintData &data);
|
||||
virtual bool isActive() const;
|
||||
|
||||
// for properties
|
||||
bool isHandlesMoves() const {
|
||||
return iHandleMoves;
|
||||
}
|
||||
bool isHandlesResizes() const {
|
||||
return iHandleResizes;
|
||||
}
|
||||
private slots:
|
||||
void toggle();
|
||||
void slotWindowStartUserMovedResized(KWin::EffectWindow *w);
|
||||
|
|
|
@ -25,6 +25,22 @@ struct ParameterSet;
|
|||
class WobblyWindowsEffect : public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(qreal stiffness READ stiffness)
|
||||
Q_PROPERTY(qreal drag READ drag)
|
||||
Q_PROPERTY(qreal moveFactor READ moveFactor)
|
||||
Q_PROPERTY(qreal xTesselation READ xTesselation)
|
||||
Q_PROPERTY(qreal yTesselation READ yTesselation)
|
||||
Q_PROPERTY(qreal minVelocity READ minVelocity)
|
||||
Q_PROPERTY(qreal maxVelocity READ maxVelocity)
|
||||
Q_PROPERTY(qreal stopVelocity READ stopVelocity)
|
||||
Q_PROPERTY(qreal minAcceleration READ minAcceleration)
|
||||
Q_PROPERTY(qreal maxAcceleration READ maxAcceleration)
|
||||
Q_PROPERTY(qreal stopAcceleration READ stopAcceleration)
|
||||
Q_PROPERTY(bool moveEffectEnabled READ isMoveEffectEnabled)
|
||||
Q_PROPERTY(bool openEffectEnabled READ isOpenEffectEnabled)
|
||||
Q_PROPERTY(bool closeEffectEnabled READ isCloseEffectEnabled)
|
||||
Q_PROPERTY(bool moveWobble READ isMoveWobble)
|
||||
Q_PROPERTY(bool resizeWobble READ isResizeWobble)
|
||||
public:
|
||||
|
||||
WobblyWindowsEffect();
|
||||
|
@ -57,6 +73,55 @@ public:
|
|||
|
||||
static bool supported();
|
||||
|
||||
// for properties
|
||||
qreal stiffness() const {
|
||||
return m_stiffness;
|
||||
}
|
||||
qreal drag() const {
|
||||
return m_drag;
|
||||
}
|
||||
qreal moveFactor() const {
|
||||
return m_move_factor;
|
||||
}
|
||||
qreal xTesselation() const {
|
||||
return m_xTesselation;
|
||||
}
|
||||
qreal yTesselation() const {
|
||||
return m_yTesselation;
|
||||
}
|
||||
qreal minVelocity() const {
|
||||
return m_minVelocity;
|
||||
}
|
||||
qreal maxVelocity() const {
|
||||
return m_maxVelocity;
|
||||
}
|
||||
qreal stopVelocity() const {
|
||||
return m_stopVelocity;
|
||||
}
|
||||
qreal minAcceleration() const {
|
||||
return m_minAcceleration;
|
||||
}
|
||||
qreal maxAcceleration() const {
|
||||
return m_maxAcceleration;
|
||||
}
|
||||
qreal stopAcceleration() const {
|
||||
return m_stopAcceleration;
|
||||
}
|
||||
bool isMoveEffectEnabled() const {
|
||||
return m_moveEffectEnabled;
|
||||
}
|
||||
bool isOpenEffectEnabled() const {
|
||||
return m_openEffectEnabled;
|
||||
}
|
||||
bool isCloseEffectEnabled() const {
|
||||
return m_closeEffectEnabled;
|
||||
}
|
||||
bool isMoveWobble() const {
|
||||
return m_moveWobble;
|
||||
}
|
||||
bool isResizeWobble() const {
|
||||
return m_resizeWobble;
|
||||
}
|
||||
public Q_SLOTS:
|
||||
void slotWindowAdded(KWin::EffectWindow *w);
|
||||
void slotWindowClosed(KWin::EffectWindow *w);
|
||||
|
|
|
@ -36,6 +36,14 @@ class ZoomEffect
|
|||
: public Effect
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(qreal zoomFactor READ configuredZoomFactor)
|
||||
Q_PROPERTY(int mousePointer READ configuredMousePointer)
|
||||
Q_PROPERTY(int mouseTracking READ configuredMouseTracking)
|
||||
Q_PROPERTY(bool enableFocusTracking READ isEnableFocusTracking)
|
||||
Q_PROPERTY(bool followFocus READ isFollowFocus)
|
||||
Q_PROPERTY(int focusDelay READ configuredFocusDelay)
|
||||
Q_PROPERTY(qreal moveFactor READ configuredMoveFactor)
|
||||
Q_PROPERTY(qreal targetZoom READ targetZoom)
|
||||
public:
|
||||
ZoomEffect();
|
||||
virtual ~ZoomEffect();
|
||||
|
@ -44,6 +52,31 @@ public:
|
|||
virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
|
||||
virtual void postPaintScreen();
|
||||
virtual bool isActive() const;
|
||||
// for properties
|
||||
qreal configuredZoomFactor() const {
|
||||
return zoomFactor;
|
||||
}
|
||||
int configuredMousePointer() const {
|
||||
return mousePointer;
|
||||
}
|
||||
int configuredMouseTracking() const {
|
||||
return mouseTracking;
|
||||
}
|
||||
bool isEnableFocusTracking() const {
|
||||
return enableFocusTracking;
|
||||
}
|
||||
bool isFollowFocus() const {
|
||||
return followFocus;
|
||||
}
|
||||
int configuredFocusDelay() const {
|
||||
return focusDelay;
|
||||
}
|
||||
qreal configuredMoveFactor() const {
|
||||
return moveFactor;
|
||||
}
|
||||
qreal targetZoom() const {
|
||||
return target_zoom;
|
||||
}
|
||||
private slots:
|
||||
inline void zoomIn() { zoomIn(-1.0); };
|
||||
void zoomIn(double to);
|
||||
|
|
|
@ -58,6 +58,10 @@
|
|||
<method name="listOfEffects">
|
||||
<arg type="as" direction="out"/>
|
||||
</method>
|
||||
<method name="supportInformationForEffect">
|
||||
<arg name="name" type="s" direction="in"/>
|
||||
<arg type="s" direction="out"/>
|
||||
</method>
|
||||
<method name="compositingActive">
|
||||
<arg type="b" direction="out"/>
|
||||
</method>
|
||||
|
|
|
@ -63,6 +63,7 @@ Item {
|
|||
}
|
||||
}
|
||||
Item {
|
||||
id: captionFrame
|
||||
anchors {
|
||||
top: icons.bottom
|
||||
left: parent.left
|
||||
|
@ -73,11 +74,23 @@ Item {
|
|||
bottomMargin: background.margins.bottom
|
||||
}
|
||||
Text {
|
||||
function constrainWidth() {
|
||||
if (textItem.width > textItem.maxWidth && textItem.width > 0 && textItem.maxWidth > 0) {
|
||||
textItem.width = textItem.maxWidth;
|
||||
} else {
|
||||
textItem.width = undefined;
|
||||
}
|
||||
}
|
||||
function calculateMaxWidth() {
|
||||
textItem.maxWidth = bigIconsTabBox.width - captionFrame.anchors.leftMargin - captionFrame.anchors.rightMargin - captionFrame.anchors.rightMargin;
|
||||
}
|
||||
id: textItem
|
||||
property int maxWidth: 0
|
||||
text: icons.currentItem ? icons.currentItem.data.caption : ""
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: theme.textColor
|
||||
elide: Text.ElideMiddle
|
||||
font {
|
||||
bold: true
|
||||
}
|
||||
|
@ -85,6 +98,15 @@ Item {
|
|||
verticalCenter: parent.verticalCenter
|
||||
horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
onTextChanged: textItem.constrainWidth()
|
||||
Component.onCompleted: textItem.calculateMaxWidth()
|
||||
Connections {
|
||||
target: bigIconsTabBox
|
||||
onWidthChanged: {
|
||||
textItem.calculateMaxWidth();
|
||||
textItem.constrainWidth();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -124,7 +124,11 @@ void TabBoxHandlerPrivate::updateOutline()
|
|||
q->hideOutline();
|
||||
return;
|
||||
}
|
||||
TabBoxClient* c = static_cast< TabBoxClient* >(m_clientModel->data(index, ClientModel::ClientRole).value<void *>());
|
||||
const QVariant client = m_clientModel->data(index, ClientModel::ClientRole);
|
||||
if (!client.isValid()) {
|
||||
return;
|
||||
}
|
||||
TabBoxClient* c = static_cast< TabBoxClient* >(client.value<void *>());
|
||||
q->showOutline(QRect(c->x(), c->y(), c->width(), c->height()));
|
||||
}
|
||||
|
||||
|
|
|
@ -15,3 +15,21 @@ set( testTabBoxClientModel_SRCS
|
|||
kde4_add_unit_test( testTabBoxClientModel TESTNAME testTabBoxClientModel ${testTabBoxClientModel_SRCS} )
|
||||
|
||||
target_link_libraries( testTabBoxClientModel ${KDE4_KDEUI_LIBS} ${QT_QTDECLARATIVE_LIBRARY} ${X11_LIBRARIES} ${QT_QTTEST_LIBRARY} )
|
||||
|
||||
########################################################
|
||||
# Test TabBox::TabBoxHandler
|
||||
########################################################
|
||||
set( testTabBoxHandler_SRCS
|
||||
../clientmodel.cpp
|
||||
../desktopmodel.cpp
|
||||
../tabboxconfig.cpp
|
||||
../tabboxhandler.cpp
|
||||
test_tabbox_handler.cpp
|
||||
mock_declarative.cpp
|
||||
mock_tabboxhandler.cpp
|
||||
mock_tabboxclient.cpp
|
||||
)
|
||||
|
||||
kde4_add_unit_test( testTabBoxHandler TESTNAME testTabBoxHandler ${testTabBoxHandler_SRCS} )
|
||||
|
||||
target_link_libraries( testTabBoxHandler ${KDE4_KDEUI_LIBS} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY} ${QT_QTTEST_LIBRARY} ${X11_LIBRARIES} )
|
||||
|
|
55
tabbox/tests/test_tabbox_handler.cpp
Normal file
55
tabbox/tests/test_tabbox_handler.cpp
Normal file
|
@ -0,0 +1,55 @@
|
|||
/********************************************************************
|
||||
KWin - the KDE window manager
|
||||
This file is part of the KDE project.
|
||||
|
||||
Copyright (C) 2012 Martin Gräßlin <mgraesslin@kde.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*********************************************************************/
|
||||
#include "mock_tabboxhandler.h"
|
||||
#include "clientmodel.h"
|
||||
#include <QtTest/QtTest>
|
||||
|
||||
using namespace KWin;
|
||||
|
||||
class TestTabBoxHandler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
private slots:
|
||||
/**
|
||||
* Test to verify that update outline does not crash
|
||||
* if the ModelIndex for which the outline should be
|
||||
* shown is not valid. That is accessing the Pointer
|
||||
* to the Client returns an invalid QVariant.
|
||||
* BUG: 304620
|
||||
**/
|
||||
void testDontCrashUpdateOutlineNullClient();
|
||||
};
|
||||
|
||||
void TestTabBoxHandler::testDontCrashUpdateOutlineNullClient()
|
||||
{
|
||||
MockTabBoxHandler tabboxhandler;
|
||||
TabBox::TabBoxConfig config;
|
||||
config.setTabBoxMode(TabBox::TabBoxConfig::ClientTabBox);
|
||||
config.setShowOutline(true);
|
||||
config.setShowTabBox(false);
|
||||
config.setHighlightWindows(false);
|
||||
tabboxhandler.setConfig(config);
|
||||
// now show the tabbox which will attempt to show the outline
|
||||
tabboxhandler.show();
|
||||
}
|
||||
|
||||
QTEST_MAIN(TestTabBoxHandler)
|
||||
|
||||
#include "test_tabbox_handler.moc"
|
|
@ -997,6 +997,13 @@ QStringList Workspace::listOfEffects() const
|
|||
return listModules;
|
||||
}
|
||||
|
||||
QString Workspace::supportInformationForEffect(const QString& name) const
|
||||
{
|
||||
if (effects)
|
||||
return static_cast<EffectsHandlerImpl*>(effects)->supportInformation(name);
|
||||
return QString();
|
||||
}
|
||||
|
||||
void Workspace::slotActivateAttentionWindow()
|
||||
{
|
||||
if (attention_chain.count() > 0)
|
||||
|
|
|
@ -2342,6 +2342,12 @@ QString Workspace::supportInformation() const
|
|||
foreach (const QString &effect, activeEffects()) {
|
||||
support.append(effect % '\n');
|
||||
}
|
||||
support.append("\nEffect Settings:\n");
|
||||
support.append( "----------------\n");
|
||||
foreach (const QString &effect, loadedEffects()) {
|
||||
support.append(supportInformationForEffect(effect));
|
||||
support.append('\n');
|
||||
}
|
||||
} else {
|
||||
support.append("Compositing is not active\n");
|
||||
}
|
||||
|
|
|
@ -380,6 +380,7 @@ public:
|
|||
void toggleEffect(const QString& name);
|
||||
void reconfigureEffect(const QString& name);
|
||||
void unloadEffect(const QString& name);
|
||||
QString supportInformationForEffect(const QString& name) const;
|
||||
void updateCompositeBlocking(Client* c = NULL);
|
||||
|
||||
QStringList loadedEffects() const;
|
||||
|
|
Loading…
Reference in a new issue