diff --git a/kwinbutton.cpp b/kwinbutton.cpp index 96a3246f3..674e8ddae 100644 --- a/kwinbutton.cpp +++ b/kwinbutton.cpp @@ -1,304 +1,304 @@ /* * $Id$ * * KWin client button tooltip support module * * Copyright (c) 2001 * Karol Szwed * * Uses portions of QToolTip code * Copyright (c) TrollTech AS * * Since Qt installs its own internal event filter when using * a QToolTip, kwin doesn't obtain the necessary events and hence * focus problems and loss of window frames occur if they are used * for kwin styles. Thus, this small class implements a bare subset * of QToolTip designed especially for kwin client buttons without * installing any event filters that confuse kwin. * * For all normal clients, simply use the KWinButton class instead * of QButton, which will use a KWinToolTip internally. Other clients * which rely on QToolButton or QWidget for client buttons may use the * KWinToolButton and KWinWidgetButton classes to automatically take * care of tooltips. * */ #include #include "kwinbutton.h" #include "options.h" #include "workspace.h" // This is a hack to ensure that we use Qt fade and scroll effects #warning: Using extracts from qeffects_p.h for kwinbutton tooltip fade and scroll effects // This code is copied directly from qeffects_p.h struct QEffects { enum Direction { LeftScroll = 0x0001, RightScroll = 0x0002, UpScroll = 0x0004, DownScroll = 0x0008 }; typedef uint DirFlags; }; extern void Q_EXPORT qScrollEffect( QWidget*, QEffects::DirFlags dir = QEffects::DownScroll, int time = -1 ); extern void Q_EXPORT qFadeEffect( QWidget*, int time = -1 ); // end qeffects_p.h code using namespace KWinInternal; KWinToolTip::KWinToolTip( QWidget* parent, const QString& tip ) : QLabel( NULL, "KWinToolTip", WStyle_StaysOnTop + WStyle_Customize + WStyle_NoBorder + WStyle_Tool ) { setMargin(1); setIndent(0); setFrameStyle( QFrame::Plain | QFrame::Box ); setLineWidth(1); setAlignment( AlignLeft | AlignTop ); setText(tip); adjustSize(); // Use stock Qt tooltip colors as defined in qapplication.cpp QColorGroup clrGroup( Qt::black, QColor(255,255,220), QColor(96,96,96), Qt::black, Qt::black, Qt::black, QColor(255,255,220) ); setPalette( QPalette( clrGroup, clrGroup, clrGroup ) ); btn = parent; connect(&hideTimer, SIGNAL(timeout()), SLOT(hideTip())); connect(&showTimer, SIGNAL(timeout()), SLOT(showTip())); } KWinToolTip::~KWinToolTip() { } void KWinToolTip::setTipText( const QString& tip ) { bool visible = isVisible(); if (visible) hide(); setText(tip); adjustSize(); positionTip(); if (visible) showTip(); } void KWinToolTip::enterTip() { // Show after 1 second showTimer.start( 1000, TRUE ); } void KWinToolTip::leaveTip() { if (hideTimer.isActive()) hideTimer.stop(); if (showTimer.isActive()) showTimer.stop(); if (isVisible()) hide(); } /* Internal */ void KWinToolTip::showTip() { if (isVisible()) return; // Ignore empty tooltips if (text().isEmpty()) return; positionTip(); - // Display the tooltip the Qt way - if (QApplication::isEffectEnabled(UI_AnimateTooltip) == FALSE) - show(); - else if (QApplication::isEffectEnabled(UI_FadeTooltip)) - qFadeEffect(this); - else + // Show tooltips the Qt way + if (options->fadeTooltips()) + qFadeEffect(this); + else if (options->animateTooltips()) qScrollEffect(this); + else + show(); raise(); // Hide after 10 seconds hideTimer.start( 10000, TRUE ); } /* Internal */ void KWinToolTip::hideTip() { if (isVisible()) hide(); } /* Internal */ void KWinToolTip::positionTip() { QPoint p = btn->mapToGlobal(btn->rect().bottomLeft()) + QPoint(0, 16); // Ensure the tooltip is displayed within the current desktop if ( p.x() + width() > Workspace::self()->desktopWidget()->width() ) p.setX( Workspace::self()->desktopWidget()->width() - width()); if ( p.y() + height() > Workspace::self()->desktopWidget()->height() ) p.setY( Workspace::self()->desktopWidget()->height() - height() ); if (p.x() < 0) p.setX(0); if (p.y() < 0) p.setY(0); move(p); // Ensure we don't get enter/leave event race conditions when a // tooltip is over a button. QRect btnGlobalRect( btn->mapToGlobal(btn->rect().topLeft()), btn->mapToGlobal(btn->rect().bottomRight()) ); QRect tipGlobalRect( mapToGlobal(rect().topLeft()), mapToGlobal(rect().bottomRight()) ); if (btnGlobalRect.intersects( tipGlobalRect )) { // Only intersects when button is at lower part of screen p.setY( btn->mapToGlobal(btn->rect().topLeft()).y() - height() - 5 ); move(p); } } // KWinButton class KWinButton::KWinButton(QWidget *parent, const char *name, const QString& tip) : QButton(parent, name, WStyle_Customize | WRepaintNoErase | WResizeNoErase | WStyle_NoBorder ) { - buttonTip = options->showToolTips() ? new KWinToolTip(this, tip) : NULL; + buttonTip = options->showTooltips() ? new KWinToolTip(this, tip) : NULL; } KWinButton::~KWinButton() { if (buttonTip) delete buttonTip; } void KWinButton::setTipText(const QString& newTip) { if (buttonTip) buttonTip->setTipText( newTip ); } void KWinButton::enterEvent(QEvent *e) { if (buttonTip) buttonTip->enterTip(); QButton::enterEvent( e ); } void KWinButton::leaveEvent(QEvent *e) { if (buttonTip) buttonTip->leaveTip(); QButton::leaveEvent( e ); } void KWinButton::mousePressEvent(QMouseEvent* e) { // Hide tooltips if a button is pressed if (buttonTip) buttonTip->leaveTip(); QButton::mousePressEvent( e ); } // KWinToolButton class KWinToolButton::KWinToolButton(QWidget *parent, const char *name, const QString& tip) : QToolButton(parent, name) { - buttonTip = options->showToolTips() ? new KWinToolTip(this, tip) : NULL; + buttonTip = options->showTooltips() ? new KWinToolTip(this, tip) : NULL; } KWinToolButton::~KWinToolButton() { if (buttonTip) delete buttonTip; } void KWinToolButton::setTipText(const QString& newTip) { if (buttonTip) buttonTip->setTipText( newTip ); } void KWinToolButton::enterEvent(QEvent *e) { if (buttonTip) buttonTip->enterTip(); QToolButton::enterEvent( e ); } void KWinToolButton::leaveEvent(QEvent *e) { if (buttonTip) buttonTip->leaveTip(); QToolButton::leaveEvent( e ); } void KWinToolButton::mousePressEvent(QMouseEvent* e) { // Hide tooltips if a button is pressed if (buttonTip) buttonTip->leaveTip(); QToolButton::mousePressEvent( e ); } // KWinWidgetButton class KWinWidgetButton::KWinWidgetButton(QWidget *parent, const char *name, WFlags f, const QString& tip) : QWidget(parent, name, f) { - buttonTip = options->showToolTips() ? new KWinToolTip(this, tip) : NULL; + buttonTip = options->showTooltips() ? new KWinToolTip(this, tip) : NULL; } KWinWidgetButton::~KWinWidgetButton() { if (buttonTip) delete buttonTip; } void KWinWidgetButton::setTipText(const QString& newTip) { if (buttonTip) buttonTip->setTipText( newTip ); } void KWinWidgetButton::enterEvent(QEvent *e) { if (buttonTip) buttonTip->enterTip(); QWidget::enterEvent( e ); } void KWinWidgetButton::leaveEvent(QEvent *e) { if (buttonTip) buttonTip->leaveTip(); QWidget::leaveEvent( e ); } void KWinWidgetButton::mousePressEvent(QMouseEvent* e) { // Hide tooltips if a button is pressed if (buttonTip) buttonTip->leaveTip(); QWidget::mousePressEvent( e ); } #include "kwinbutton.moc" // vim: ts=4 diff --git a/options.cpp b/options.cpp index 642453c94..6189624b8 100644 --- a/options.cpp +++ b/options.cpp @@ -1,334 +1,355 @@ /***************************************************************** kwin - the KDE window manager Copyright (C) 1999, 2000 Matthias Ettrich ******************************************************************/ #include "options.h" #include #include #include #include #include #include #include // for KAccel::keyboardHasMetaKey() using namespace KWinInternal; namespace KWinInternal { class OptionsPrivate { public: OptionsPrivate() : title_buttons_left( "MS" ), title_buttons_right( "HIAX" ), custom_button_positions( false ) {}; QColor colors[KWINCOLORS*2]; QColorGroup *cg[KWINCOLORS*2]; QString title_buttons_left; QString title_buttons_right; bool custom_button_positions; bool show_tooltips; + bool fade_tooltips; + bool animate_tooltips; }; }; #define colors (d->colors) #define cg (d->cg) Options::Options() : QObject( 0, 0) { d = new OptionsPrivate; int i; for(i=0; i < KWINCOLORS*2; ++i) cg[i] = NULL; reload(); connect( kapp, SIGNAL( appearanceChanged() ), this, SLOT(reload() ) ); } Options::~Options(){ int i; for(i=0; i < KWINCOLORS*2; ++i){ if(cg[i]){ delete cg[i]; cg[i] = NULL; } } delete d; } const QColor& Options::color(ColorType type, bool active) { return(colors[type + (active ? 0 : KWINCOLORS)]); } const QFont& Options::font(bool active, bool small) { if ( small ) return(active ? activeFontSmall : inactiveFontSmall); else return(active ? activeFont : inactiveFont); } const QColorGroup& Options::colorGroup(ColorType type, bool active) { int idx = type + (active ? 0 : KWINCOLORS); if(cg[idx]) return(*cg[idx]); cg[idx] = new QColorGroup(Qt::black, colors[idx], colors[idx].light(150), colors[idx].dark(), colors[idx].dark(120), Qt::black, QApplication::palette().normal(). base()); return(*cg[idx]); } void Options::reload() { QPalette pal = QApplication::palette(); KConfig *config = KGlobal::config(); config->setGroup("WM"); // normal colors colors[Frame] = pal.normal().background(); colors[Frame] = config->readColorEntry("frame", &colors[Frame]); colors[Handle] = colors[Frame]; colors[Handle] = config->readColorEntry("handle", &colors[Handle]); // full button configuration (background, blend, and foreground if(QPixmap::defaultDepth() > 8) colors[ButtonBg] = colors[Frame].light(130); else colors[ButtonBg] = colors[Frame]; colors[ButtonBg] = config->readColorEntry("activeTitleBtnBg", &colors[Frame]); colors[TitleBar] = pal.normal().highlight(); colors[TitleBar] = config->readColorEntry("activeBackground", &colors[TitleBar]); if(QPixmap::defaultDepth() > 8) colors[TitleBlend] = colors[ TitleBar ].dark(110); else colors[TitleBlend] = colors[ TitleBar ]; colors[TitleBlend] = config->readColorEntry("activeBlend", &colors[TitleBlend]); colors[Font] = pal.normal().highlightedText(); colors[Font] = config->readColorEntry("activeForeground", &colors[Font]); // inactive colors[Frame+KWINCOLORS] = config->readColorEntry("inactiveFrame", &colors[Frame]); colors[TitleBar+KWINCOLORS] = colors[Frame]; colors[TitleBar+KWINCOLORS] = config-> readColorEntry("inactiveBackground", &colors[TitleBar+KWINCOLORS]); if(QPixmap::defaultDepth() > 8) colors[TitleBlend+KWINCOLORS] = colors[ TitleBar+KWINCOLORS ].dark(110); else colors[TitleBlend+KWINCOLORS] = colors[ TitleBar+KWINCOLORS ]; colors[TitleBlend+KWINCOLORS] = config->readColorEntry("inactiveBlend", &colors[TitleBlend+KWINCOLORS]); // full button configuration if(QPixmap::defaultDepth() > 8) colors[ButtonBg+KWINCOLORS] = colors[Frame+KWINCOLORS].light(130); else colors[ButtonBg+KWINCOLORS] = colors[Frame+KWINCOLORS]; colors[ButtonBg+KWINCOLORS] = config->readColorEntry("inactiveTitleBtnBg", &colors[ButtonBg]); colors[Handle+KWINCOLORS] = colors[Frame]; config->readColorEntry("inactiveHandle", &colors[Handle]); colors[Font+KWINCOLORS] = colors[Frame].dark(); colors[Font+KWINCOLORS] = config->readColorEntry("inactiveForeground", &colors[Font+KWINCOLORS]); // Keep in sync with kglobalsettings. QFont activeFontGuess("helvetica", 12, QFont::Bold); activeFontGuess.setPixelSize(12); activeFont = config->readFontEntry("activeFont", &activeFontGuess); inactiveFont = config->readFontEntry("inactiveFont", &activeFont); activeFontSmall = activeFont; activeFontSmall.setPointSize(activeFont.pointSize() - 2); activeFontSmall = config->readFontEntry("activeFontSmall", &activeFontSmall); inactiveFontSmall = config->readFontEntry("inactiveFontSmall", &activeFontSmall); int i; for(i=0; i < KWINCOLORS*2; ++i){ if(cg[i]){ delete cg[i]; cg[i] = NULL; } } config->setGroup( "Windows" ); moveMode = config->readEntry("MoveMode", "Opaque" ) == "Opaque"?Opaque:Transparent; resizeMode = config->readEntry("ResizeMode", "Opaque" ) == "Opaque"?Opaque:Transparent; moveResizeMaximizedWindows = config->readBoolEntry("MoveResizeMaximizedWindows", true ); QString val; val = config->readEntry ("FocusPolicy", "ClickToFocus"); focusPolicy = ClickToFocus; // what a default :-) if ( val == "FocusFollowsMouse" ) focusPolicy = FocusFollowsMouse; else if ( val == "FocusUnderMouse" ) focusPolicy = FocusUnderMouse; else if ( val == "FocusStrictlyUnderMouse" ) focusPolicy = FocusStrictlyUnderMouse; val = config->readEntry ("AltTabStyle", "KDE"); altTabStyle = KDE; // what a default :-) if ( val == "CDE" ) altTabStyle = CDE; xineramaEnabled = config->readBoolEntry ("XineramaEnabled", FALSE ) && KApplication::desktop()->isVirtualDesktop(); if (xineramaEnabled) { xineramaPlacementEnabled = config->readBoolEntry ("XineramaPlacementEnabled", FALSE); xineramaMovementEnabled = config->readBoolEntry ("XineramaMovementEnabled", FALSE); xineramaMaximizeEnabled = config->readBoolEntry ("XineramaMaximizeEnabled", FALSE); } val = config->readEntry("Placement","Smart"); if (val == "Smart") placement = Smart; else if (val == "Random") placement = Random; else if (val == "Cascade") placement = Cascade; animateShade = config->readBoolEntry("AnimateShade", TRUE ); animateMinimize = config->readBoolEntry("AnimateMinimize", TRUE ); animateMinimizeSpeed = config->readNumEntry("AnimateMinimizeSpeed", 5 ); autoRaise = config->readBoolEntry("AutoRaise", FALSE ); autoRaiseInterval = config->readNumEntry("AutoRaiseInterval", 0 ); shadeHover = config->readBoolEntry("ShadeHover", FALSE ); shadeHoverInterval = config->readNumEntry("ShadeHoverInterval", 250 ); // important: autoRaise implies ClickRaise clickRaise = autoRaise || config->readBoolEntry("ClickRaise", FALSE ); borderSnapZone = config->readNumEntry("BorderSnapZone", 10); windowSnapZone = config->readNumEntry("WindowSnapZone", 10); snapOnlyWhenOverlapping=config->readBoolEntry("SnapOnlyWhenOverlapping",FALSE); OpTitlebarDblClick = windowOperation( config->readEntry("TitlebarDoubleClickCommand", "Shade") ); ignorePositionClasses = config->readListEntry("IgnorePositionClasses"); // desktop settings config->setGroup("Desktops"); desktopRows = config->readNumEntry( "DesktopRows", 2 ); if ( desktopRows < 1 ) desktopRows = 1; // Mouse bindings config->setGroup( "MouseBindings"); CmdActiveTitlebar1 = mouseCommand(config->readEntry("CommandActiveTitlebar1","Raise")); CmdActiveTitlebar2 = mouseCommand(config->readEntry("CommandActiveTitlebar2","Lower")); CmdActiveTitlebar3 = mouseCommand(config->readEntry("CommandActiveTitlebar3","Operations menu")); CmdInactiveTitlebar1 = mouseCommand(config->readEntry("CommandInactiveTitlebar1","Activate and raise")); CmdInactiveTitlebar2 = mouseCommand(config->readEntry("CommandInactiveTitlebar2","Activate and lower")); CmdInactiveTitlebar3 = mouseCommand(config->readEntry("CommandInactiveTitlebar3","Activate")); CmdWindow1 = mouseCommand(config->readEntry("CommandWindow1","Activate, raise and pass click")); CmdWindow2 = mouseCommand(config->readEntry("CommandWindow2","Activate and pass click")); CmdWindow3 = mouseCommand(config->readEntry("CommandWindow3","Activate and pass click")); CmdAllModKey = (config->readEntry("CommandAllKey", KAccel::keyboardHasMetaKey() ? "Meta" : "Alt") == "Meta") ? Qt::Key_Meta : Qt::Key_Alt; CmdAll1 = mouseCommand(config->readEntry("CommandAll1","Move")); CmdAll2 = mouseCommand(config->readEntry("CommandAll2","Toggle raise and lower")); CmdAll3 = mouseCommand(config->readEntry("CommandAll3","Resize")); // custom button positions config->setGroup("Style"); d->custom_button_positions = config->readBoolEntry("CustomButtonPositions", false); if (d->custom_button_positions) { d->title_buttons_left = config->readEntry("ButtonsOnLeft", "MS"); d->title_buttons_right = config->readEntry("ButtonsOnRight", "HIAX"); } else { d->title_buttons_left = "MS"; d->title_buttons_right = "HIAX"; } // button tooltips d->show_tooltips = config->readBoolEntry("ShowToolTips", true); + // Read button tooltip animation effect from kdeglobals + // Since we want to allow users to enable window decoration tooltips + // and not kstyle tooltips and vise-versa, we don't read the + // "EffectNoTooltip" setting from kdeglobals. + KConfig globalConfig("kdeglobals"); + globalConfig.setGroup("KDE"); + d->fade_tooltips = globalConfig.readBoolEntry("EffectFadeTooltip", false); + d->animate_tooltips = globalConfig.readBoolEntry("EffectAnimateTooltip", false); + emit resetPlugin(); emit resetClients(); } Options::WindowOperation Options::windowOperation(const QString &name){ if (name == "Move") return MoveOp; else if (name == "Resize") return ResizeOp; else if (name == "Maximize") return MaximizeOp; else if (name == "Iconify") return IconifyOp; else if (name == "Close") return CloseOp; else if (name == "Sticky") return StickyOp; else if (name == "Shade") return ShadeOp; else if (name == "Operations") return OperationsOp; else if (name == "Maximize (vertical only)") return VMaximizeOp; else if (name == "Maximize (horizontal only)") return HMaximizeOp; else if (name == "Lower") return LowerOp; return NoOp; } Options::MouseCommand Options::mouseCommand(const QString &name) { if (name == "Raise") return MouseRaise; if (name == "Lower") return MouseLower; if (name == "Operations menu") return MouseOperationsMenu; if (name == "Toggle raise and lower") return MouseToggleRaiseAndLower; if (name == "Activate and raise") return MouseActivateAndRaise; if (name == "Activate and lower") return MouseActivateAndLower; if (name == "Activate") return MouseActivate; if (name == "Activate, raise and pass click") return MouseActivateRaiseAndPassClick; if (name == "Activate and pass click") return MouseActivateAndPassClick; if (name == "Move") return MouseMove; if (name == "Resize") return MouseResize; if (name == "Shade") return MouseShade; if (name == "Nothing") return MouseNothing; return MouseNothing; } QString Options::titleButtonsLeft() { return d->title_buttons_left; } QString Options::titleButtonsRight() { return d->title_buttons_right; } bool Options::customButtonPositions() { return d->custom_button_positions; } -bool Options::showToolTips() +bool Options::showTooltips() { return d->show_tooltips; } +bool Options::fadeTooltips() +{ + return d->fade_tooltips; +} + +bool Options::animateTooltips() +{ + return d->animate_tooltips; +} + #include "options.moc" diff --git a/options.h b/options.h index 27e952867..556530fb8 100644 --- a/options.h +++ b/options.h @@ -1,334 +1,351 @@ /***************************************************************** kwin - the KDE window manager Copyright (C) 1999, 2000 Matthias Ettrich ******************************************************************/ #ifndef OPTIONS_H #define OPTIONS_H #include #include #include #include // increment this when you add a color type (mosfet) #define KWINCOLORS 6 namespace KWinInternal { class OptionsPrivate; // NOTE: this class has to keep binary compatibility, just like other // KWin classes accessible from the plugins class Options : public QObject { Q_OBJECT public: Options(); ~Options(); /*! Different focus policies:
  • ClickToFocus - Clicking into a window activates it. This is also the default.
  • FocusFollowsMouse - Moving the mouse pointer actively onto a normal window activates it. For convenience, the desktop and windows on the dock are excluded. They require clicking.
  • FocusUnderMouse - The window that happens to be under the mouse pointer becomes active. The invariant is: no window can have focus that is not under the mouse. This also means that Alt-Tab won't work properly and popup dialogs are usually unsable with the keyboard. Note that the desktop and windows on the dock are excluded for convenience. They get focus only when clicking on it.
  • FocusStrictlyUnderMouse - this is even worse than FocusUnderMouse. Only the window under the mouse pointer is active. If the mouse points nowhere, nothing has the focus. If the mouse points onto the desktop, the desktop has focus. The same holds for windows on the dock. Note that FocusUnderMouse and FocusStrictlyUnderMouse are not particulary useful. They are only provided for old-fashined die-hard UNIX people ;-)
*/ enum FocusPolicy { ClickToFocus, FocusFollowsMouse, FocusUnderMouse, FocusStrictlyUnderMouse }; FocusPolicy focusPolicy; /** Whether clicking on a window raises it in FocusFollowsMouse mode or not. */ bool clickRaise; /** whether autoraise is enabled FocusFollowsMouse mode or not. */ bool autoRaise; /** autoraise interval */ int autoRaiseInterval; /** Whether shade hover is enabled or not */ bool shadeHover; /** shade hover interval */ int shadeHoverInterval; /** Different Alt-Tab-Styles:
  • KDE - the recommended KDE style. Alt-Tab opens a nice icon box that makes it easy to select the window you want to tab to. The order automatically adjusts to the most recently used windows. Note that KDE style does not work with the FocusUnderMouse and FocusStrictlyUnderMouse focus policies. Choose ClickToFocus or FocusFollowsMouse instead.
  • CDE - the old-fashion CDE style. Alt-Tab cycles between the windows in static order. The current window gets raised, the previous window gets lowered.
*/ enum AltTabStyle { KDE, CDE }; AltTabStyle altTabStyle; /** * Xinerama options */ bool xineramaEnabled; bool xineramaPlacementEnabled; bool xineramaMovementEnabled; bool xineramaMaximizeEnabled; /** Number of desktop rowsd */ int desktopRows; /** MoveResizeMode, either Tranparent or Opaque. */ enum MoveResizeMode { Transparent, Opaque }; MoveResizeMode resizeMode; MoveResizeMode moveMode; /** * Can maximized windows be moved or resized */ bool moveResizeMaximizedWindows; /** * Placement policies. How workspace decides the way windows get positioned * on the screen. The better the policy, the heavier the resource use. * Normally you don't have to worry. What the WM adds to the startup time * is nil compared to the creation of the window itself in the memory */ enum PlacementPolicy { Random, Smart, Cascade }; PlacementPolicy placement; bool focusPolicyIsReasonable() { return focusPolicy == ClickToFocus || focusPolicy == FocusFollowsMouse; } /** * Basic color types that should be recognized by all decoration styles. * Not all styles have to implement all the colors, but for the ones that * are implemented you should retrieve them here. */ // increment KWINCOLORS if you add something (mosfet) enum ColorType{TitleBar=0, TitleBlend, Font, ButtonBg, Frame, Handle}; /** * Return the color for the given decoration. */ const QColor& color(ColorType type, bool active=true); /** * Return a colorgroup using the given decoration color as the background */ const QColorGroup& colorGroup(ColorType type, bool active=true); /** * Return the active or inactive decoration font. */ const QFont& font(bool active=true, bool small = false); /** * whether we animate the shading of windows to titlebar or not */ bool animateShade; /** * the size of the zone that triggers snapping on desktop borders */ int borderSnapZone; /** * the number of animation steps (would this be general?) */ int windowSnapZone; /** * snap only when windows will overlap */ bool snapOnlyWhenOverlapping; /** * whether we animate the minimization of windows or not */ bool animateMinimize; /** * Animation speed (0 .. 10 ) */ int animateMinimizeSpeed; /** * List of window classes to ignore PPosition size hint */ QStringList ignorePositionClasses; // mouse bindings enum WindowOperation{ MaximizeOp = 5000, RestoreOp, IconifyOp, MoveOp, ResizeOp, CloseOp, StickyOp, ShadeOp, StaysOnTopOp, OperationsOp, ToggleStoreSettingsOp, HMaximizeOp, VMaximizeOp, LowerOp, NoOp }; WindowOperation operationTitlebarDblClick() { return OpTitlebarDblClick; } enum MouseCommand { MouseRaise, MouseLower, MouseOperationsMenu, MouseToggleRaiseAndLower, MouseActivateAndRaise, MouseActivateAndLower, MouseActivate, MouseActivateRaiseAndPassClick, MouseActivateAndPassClick, MouseMove, MouseResize, MouseShade, MouseNothing }; MouseCommand commandActiveTitlebar1() { return CmdActiveTitlebar1; } MouseCommand commandActiveTitlebar2() { return CmdActiveTitlebar2; } MouseCommand commandActiveTitlebar3() { return CmdActiveTitlebar3; } MouseCommand commandInactiveTitlebar1() { return CmdInactiveTitlebar1; } MouseCommand commandInactiveTitlebar2() { return CmdInactiveTitlebar2; } MouseCommand commandInactiveTitlebar3() { return CmdInactiveTitlebar3; } MouseCommand commandWindow1() { return CmdWindow1; } MouseCommand commandWindow2() { return CmdWindow2; } MouseCommand commandWindow3() { return CmdWindow3; } MouseCommand commandAll1() { return CmdAll1; } MouseCommand commandAll2() { return CmdAll2; } MouseCommand commandAll3() { return CmdAll3; } uint keyCmdAllModKey() { return CmdAllModKey; } static WindowOperation windowOperation(const QString &name ); static MouseCommand mouseCommand(const QString &name); /** * @returns true if the style should use custom button positions * @see #titleButtonsLeft * @see #titleButtonsRight */ bool customButtonPositions(); /** * If @ref customButtonPositions returns true, titleButtonsLeft * returns which buttons should be on the left side of the titlebar from left * to right. Characters in the returned string have this meaning : * @li 'M' menu button * @li 'S' sticky button * @li 'H' quickhelp button * @li 'I' iconify ( minimize ) button * @li 'A' maximize button * @li 'X' close button * @li '_' spacer * * The default ( which is also returned if customButtonPositions returns false ) * is "MS". */ QString titleButtonsLeft(); /** * If @ref customButtonPositions returns true, titleButtonsRight * returns which buttons should be on the right side of the titlebar from left * to right. Characters in the return string have the same meaning like * in @ref titleButtonsLeft . * * The default ( which is also returned if customButtonPositions returns false ) * is "HIAX". */ QString titleButtonsRight(); /** * @returns true if the style should use tooltips for window buttons */ - bool showToolTips(); + bool showTooltips(); + + /** + * @returns true if window button tooltips should use a fade-in effect + * @see #animateTooltips + * @see #showTooltips + */ + bool fadeTooltips(); + + /** + * @returns true if window button tooltips should use an animated effect. + * When this is true, tooltips should use a animated scroll effect. If + * fadeToolTips is also true, tooltips should be faded-in instead. + * @see #fadeTooltips + * @see #showTooltips + */ + bool animateTooltips(); + public slots: void reload(); signals: void resetPlugin(); void resetClients(); protected: QFont activeFont, inactiveFont, activeFontSmall, inactiveFontSmall; private: WindowOperation OpTitlebarDblClick; // mouse bindings MouseCommand CmdActiveTitlebar1; MouseCommand CmdActiveTitlebar2; MouseCommand CmdActiveTitlebar3; MouseCommand CmdInactiveTitlebar1; MouseCommand CmdInactiveTitlebar2; MouseCommand CmdInactiveTitlebar3; MouseCommand CmdWindow1; MouseCommand CmdWindow2; MouseCommand CmdWindow3; MouseCommand CmdAll1; MouseCommand CmdAll2; MouseCommand CmdAll3; uint CmdAllModKey; OptionsPrivate* d; }; extern Options* options; }; // namespace #endif