Remove unnecessary header includes

Fix rendering and tooltips

Signed-off-by: Emanoil Kotsev <deloptes@gmail.com>
(cherry picked from commit a497253048)
r14.0.x
Emanoil Kotsev 4 years ago committed by Michele Calgaro
parent e8f9e29e10
commit 2daa5d626d
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -19,30 +19,12 @@
*
*/
#include <stdlib.h>
#include <assert.h>
#include <unistd.h>
#include <tqbitmap.h>
#include <tqtooltip.h>
#include <tqpainter.h>
#include <tqpopupmenu.h>
#include <tqlayout.h>
#include <dcopclient.h>
#include <kdebug.h>
#include <tdeapplication.h>
#include <twin.h>
#include <tdestartupinfo.h>
#include <tdemessagebox.h>
#include <tdeaboutdata.h>
#include <tdelocale.h>
#include <kstandarddirs.h>
#include <tdecmdlineargs.h>
#include <kiconloader.h>
#include <kiconeffect.h>
#include <tdeconfig.h>
#include <kdialogbase.h>
#include "version.h"
#include "kmoondlg.h"
@ -145,7 +127,6 @@ void MoonPAWidget::timerEvent( TQTimerEvent * )
time(&clock);
struct tm *t = localtime(&clock);
moon->calcStatus(mktime(t));
moon->repaint();
}
void MoonPAWidget::mousePressEvent( TQMouseEvent *e)

@ -21,14 +21,9 @@
#ifndef KMOONAPPLET
#define KMOONAPPLET
#include <tqwidget.h>
#include <tqimage.h>
#include <sys/types.h>
#include <time.h>
#include <ksystemtray.h>
#include <kpanelapplet.h>
// #include "kmoonwidget.h"
#include "kmoonwidget.h"
class TQPopupMenu;

@ -19,27 +19,14 @@
*
*/
#include <stdlib.h>
#include <assert.h>
#include <unistd.h>
#include <tqbitmap.h>
#include <tqtooltip.h>
#include <tqpainter.h>
#include <tqpopupmenu.h>
#include <tqcolor.h>
#include <dcopclient.h>
#include <kdebug.h>
#include <tdeapplication.h>
#include <twin.h>
#include <tdestartupinfo.h>
#include <tdemessagebox.h>
#include <tdeaboutdata.h>
#include <tdelocale.h>
#include <kstandarddirs.h>
#include <tdecmdlineargs.h>
#include <kiconloader.h>
#include <kiconeffect.h>
#include <tdeconfig.h>
@ -125,6 +112,8 @@ void MoonWidget::calcStatus( time_t time )
if ( fm.daysTo( now ) == 0 ) {
counter = 14;
tooltip = i18n( "Full Moon" );
renderGraphic();
repaint();
return;
} else if ( counter <= 15 && counter >= 13 ) {
counter = 14 + fm.daysTo( now );
@ -168,6 +157,8 @@ void MoonWidget::calcStatus( time_t time )
switch (counter) {
case 0:
tooltip = i18n("New Moon");
renderGraphic();
repaint();
return;
case 1:
case 2:
@ -215,7 +206,7 @@ void MoonWidget::calcStatus( time_t time )
default:
kdFatal() << "coolo can't count\n";
}
renderGraphic();
repaint();
}
@ -359,10 +350,13 @@ void MoonWidget::renderGraphic()
if (!pixmap.convertFromImage(dest, 0)) {
return;
}
TQToolTip::remove(this);
TQToolTip::add(this, tooltip);
TQString oldText = TQToolTip::textFor(this);
if (oldText != tooltip)
{
TQToolTip::remove(this);
TQToolTip::add(this, tooltip);
}
}

@ -21,11 +21,10 @@
#ifndef KMOON
#define KMOON
#include <tqwidget.h>
#include <tqimage.h>
#include <sys/types.h>
#include <time.h>
#include <ksystemtray.h>
class TQPopupMenu;
class MoonWidget : public TQWidget

Loading…
Cancel
Save