mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2026-01-12 07:35:55 +01:00
2018-08-15 Fred Gleason <fredg@paravelsystems.com>
* Fixed style inconsistencies in dialogs within rdairplay(1).
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// A wall-clock widget with date.
|
||||
//
|
||||
// (C) Copyright 2002-2003,2016-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@@ -18,6 +18,9 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <qpainter.h>
|
||||
#include <qpalette.h>
|
||||
#include <qpixmap.h>
|
||||
@@ -25,10 +28,6 @@
|
||||
#include <qfontmetrics.h>
|
||||
#include <qsize.h>
|
||||
#include <qevent.h>
|
||||
//Added by qt3to4:
|
||||
#include <QKeyEvent>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <rdapplication.h>
|
||||
#include <rdconf.h>
|
||||
@@ -111,7 +110,7 @@ void WallClock::tickClock()
|
||||
static QString date;
|
||||
QString accum;
|
||||
QColor system_button_text_color = palette().active().buttonText();
|
||||
static QPixmap *pix=new QPixmap(sizeHint().width(),sizeHint().height());
|
||||
static QPixmap *pix=new QPixmap(sizeHint().width()-2,sizeHint().height()-2);
|
||||
static bool synced=true;
|
||||
|
||||
if(check_sync) {
|
||||
@@ -152,17 +151,17 @@ void WallClock::tickClock()
|
||||
}
|
||||
QPainter p(pix);
|
||||
if(flash_state) {
|
||||
p.fillRect(0,0,width(),height(),BUTTON_TIME_SYNC_LOST_COLOR);
|
||||
p.fillRect(0,0,width()-2,height()-2,BUTTON_TIME_SYNC_LOST_COLOR);
|
||||
p.setPen(Qt::color1);
|
||||
}
|
||||
else {
|
||||
p.fillRect(0,0,width(),height(),backgroundColor());
|
||||
p.fillRect(0,0,width()-2,height()-2,backgroundColor());
|
||||
p.setPen(QColor(system_button_text_color));
|
||||
}
|
||||
p.setFont(label_font);
|
||||
p.drawText((sizeHint().width()-p.fontMetrics().width(date))/2,22,date);
|
||||
p.drawText((size().width()-2-p.fontMetrics().width(date))/2,22,date);
|
||||
p.setFont(time_font);
|
||||
p.drawText((sizeHint().width()-p.fontMetrics().width(accum))/2,48,accum);
|
||||
p.drawText((size().width()-2-p.fontMetrics().width(accum))/2,48,accum);
|
||||
p.end();
|
||||
setPixmap(*pix);
|
||||
}
|
||||
@@ -170,7 +169,6 @@ void WallClock::tickClock()
|
||||
|
||||
void WallClock::flashButton(bool state)
|
||||
{
|
||||
printf("flashButton()\n");
|
||||
flash_state=state;
|
||||
tickClock();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user