From 0b6057404f65218182ab27a9483a21065ef61fca Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 7 Nov 2011 21:50:33 -0600 Subject: Rename kwin to twin (Part 2 of 2) --- kwin/popupinfo.cpp | 147 ----------------------------------------------------- 1 file changed, 147 deletions(-) delete mode 100644 kwin/popupinfo.cpp (limited to 'kwin/popupinfo.cpp') diff --git a/kwin/popupinfo.cpp b/kwin/popupinfo.cpp deleted file mode 100644 index f2367b933..000000000 --- a/kwin/popupinfo.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/***************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - -Copyright (C) 1999, 2000 Matthias Ettrich -Copyright (C) 2002 Alexander Kellett -Copyright (C) 2003 Lubos Lunak - -You can Freely distribute this program under the GNU General Public -License. See the file "COPYING" for the exact licensing terms. -******************************************************************/ - -//#define QT_CLEAN_NAMESPACE -#include "popupinfo.h" -#include "workspace.h" -#include "client.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// specify externals before namespace - -namespace KWinInternal -{ - -PopupInfo::PopupInfo( Workspace* ws, const char *name ) - : TQWidget( 0, name ), workspace( ws ) - { - m_infoString = ""; - m_shown = false; - reset(); - reconfigure(); - connect(&m_delayedHideTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(hide())); - - TQFont f = font(); - f.setBold( TRUE ); - f.setPointSize( 14 ); - setFont( f ); - - } - -PopupInfo::~PopupInfo() - { - } - - -/*! - Resets the popup info - */ -void PopupInfo::reset() - { - TQRect r = workspace->screenGeometry( workspace->activeScreen()); - - int w = fontMetrics().width( m_infoString ) + 30; - - setGeometry( - (r.width()-w)/2 + r.x(), r.height()/2-fontMetrics().height()-10 + r.y(), - w, fontMetrics().height() + 20 ); - } - - -/*! - Paints the popup info - */ -void PopupInfo::paintEvent( TQPaintEvent* ) - { - TQPainter p( this ); - tqstyle().tqdrawPrimitive( TQStyle::PE_Panel, &p, TQRect( 0, 0, width(), height() ), - tqcolorGroup(), TQStyle::Style_Default ); - paintContents(); - } - - -/*! - Paints the contents of the tab popup info box. - Used in paintEvent() and whenever the contents changes. - */ -void PopupInfo::paintContents() - { - TQPainter p( this ); - TQRect r( 6, 6, width()-12, height()-12 ); - - p.fillRect( r, tqcolorGroup().brush( TQColorGroup::Background ) ); - - /* - p.setPen(Qt::white); - p.drawText( r, AlignCenter, m_infoString ); - p.setPen(Qt::black); - r.moveBy( -1, -1 ); - p.drawText( r, AlignCenter, m_infoString ); - r.moveBy( -1, 0 ); - */ - p.drawText( r, AlignCenter, m_infoString ); - } - -void PopupInfo::hide() - { - m_delayedHideTimer.stop(); - TQWidget::hide(); - TQApplication::syncX(); - XEvent otherEvent; - while (XCheckTypedEvent (qt_xdisplay(), EnterNotify, &otherEvent ) ) - ; - m_shown = false; - } - -void PopupInfo::reconfigure() - { - KConfig * c(KGlobal::config()); - c->setGroup("PopupInfo"); - m_show = c->readBoolEntry("ShowPopup", false ); - m_delayTime = c->readNumEntry("PopupHideDelay", 350 ); - } - -void PopupInfo::showInfo(TQString infoString) - { - if (m_show) - { - m_infoString = infoString; - reset(); - if (m_shown) - { - paintContents(); - } - else - { - show(); - raise(); - m_shown = true; - } - m_delayedHideTimer.start(m_delayTime, true); - } - } - -} // namespace - -#include "popupinfo.moc" -- cgit v1.2.1