Skip to content

Commit

Permalink
2023-04-29 Fred Gleason <[email protected]>
Browse files Browse the repository at this point in the history
	* Added a 'RDWidget::setBackgroundPixmap()' method.
	* Fixed a bug in the voice tracker in rdairplay(1) that caused the
	the track waveform areas to be painted solid black.

Signed-off-by: Fred Gleason <[email protected]>
  • Loading branch information
ElvishArtisan committed Apr 29, 2023
1 parent 8a679e2 commit b18da6a
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 19 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -24041,3 +24041,7 @@
* Updated the package version to 4.0.0rc3.
* Updated the version of the 'rivwebpyapi' PyPI package to
4.0.0rc3.
2023-04-29 Fred Gleason <[email protected]>
* Added a 'RDWidget::setBackgroundPixmap()' method.
* Fixed a bug in the voice tracker in rdairplay(1) that caused the
the track waveform areas to be painted solid black.
9 changes: 9 additions & 0 deletions icons/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
## Use automake to process this into a Makefile.in

install-exec-am:
mkdir -p $(DESTDIR)@prefix@/share/pixmaps/rivendell
cp rdairplay_skin.png $(DESTDIR)@prefix@/share/pixmaps/rivendell
cp rdpanel_skin.png $(DESTDIR)@prefix@/share/pixmaps/rivendell
mkdir -p $(DESTDIR)@libexecdir@
cp donut-spinner.gif $(DESTDIR)@libexecdir@
cp greencheckmark.png $(DESTDIR)@libexecdir@
Expand Down Expand Up @@ -192,6 +195,8 @@ install-exec-am:
./update_icons.sh

uninstall-local:
rm -f $(DESTDIR)@prefix@/share/pixmaps/rivendell/rdairplay_skin.png
rm -f $(DESTDIR)@prefix@/share/pixmaps/rivendell/rdpanel_skin.png
rm -f $(DESTDIR)@libexecdir@/donut-spinner.gif
rm -f $(DESTDIR)@libexecdir@/greencheckmark.png
rm -f $(DESTDIR)@libexecdir@/redx.png
Expand Down Expand Up @@ -324,6 +329,8 @@ EXTRA_DIST = admin.xpm\
progressbar.gif\
progressbar.xcf\
rdairplay_logo.png\
rdairplay_skin.png\
rdairplay_skin.xcf\
rdairplay_white_logo.png\
record.xpm\
record2.xpm\
Expand Down Expand Up @@ -455,6 +462,8 @@ EXTRA_DIST = admin.xpm\
rdlogmanager-512x512.xpm\
rdlogmanager-64x64.xpm\
rdlogmanager.ico\
rdpanel_skin.png\
rdpanel_skin.xcf\
rdpanel-128x128.png\
rdpanel-16x16.png\
rdpanel-22x22.png\
Expand Down
Binary file added icons/rdairplay_skin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/rdairplay_skin.xcf
Binary file not shown.
Binary file added icons/rdpanel_skin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/rdpanel_skin.xcf
Binary file not shown.
34 changes: 33 additions & 1 deletion lib/rdwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Base class for Rivendell modal widgets.
//
// (C) Copyright 2019 Fred Gleason <[email protected]>
// (C) Copyright 2019-2023 Fred Gleason <[email protected]>
//
// 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
Expand All @@ -18,6 +18,8 @@
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//

#include <QPainter>

#include "rdwidget.h"

RDWidget::RDWidget(QWidget *parent,Qt::WindowFlags f)
Expand All @@ -32,3 +34,33 @@ RDWidget::RDWidget(RDConfig *config,QWidget *parent,Qt::WindowFlags f)
{
setFont(defaultFont());
}


QPixmap RDWidget::backgroundPixmap() const
{
return d_background_pixmap;
}


void RDWidget::setBackgroundPixmap(const QPixmap &pix)
{
d_background_pixmap=pix;
update();
}


void RDWidget::paintEvent(QPaintEvent *e)
{
int w=size().width();
int h=size().height();

if(!d_background_pixmap.isNull()) {
QPainter *p=new QPainter(this);
for(int i=0;i<h;i+=d_background_pixmap.height()) {
for(int j=0;j<w;j+=d_background_pixmap.width()) {
p->drawPixmap(j,i,d_background_pixmap);
}
}
delete p;
}
}
12 changes: 10 additions & 2 deletions lib/rdwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// Base class for Rivendell widgets.
//
// (C) Copyright 2019 Fred Gleason <[email protected]>
// (C) Copyright 2019-2023 Fred Gleason <[email protected]>
//
// 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
Expand All @@ -21,7 +21,7 @@
#ifndef RDWIDGET_H
#define RDWIDGET_H

#include <qwidget.h>
#include <QWidget>

#include <rdfontengine.h>

Expand All @@ -31,6 +31,14 @@ class RDWidget : public QWidget, public RDFontEngine
public:
RDWidget(QWidget *parent=0,Qt::WindowFlags f=0);
RDWidget(RDConfig *config,QWidget *parent=0,Qt::WindowFlags f=0);
QPixmap backgroundPixmap() const;
void setBackgroundPixmap(const QPixmap &pix);

protected:
void paintEvent(QPaintEvent *e);

private:
QPixmap d_background_pixmap;
};


Expand Down
10 changes: 2 additions & 8 deletions rdairplay/rdairplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,7 @@ MainWidget::MainWidget(RDConfig *config,QWidget *parent)
for(int i=0;i<RDAIRPLAY_LOG_QUANTITY;i++) {
air_op_mode[i]=RDAirPlayConf::Previous;
}
bgmap=QPixmap(rda->airplayConf()->skinPath());
if(!bgmap.isNull()&&(bgmap.width()>=1024)&&(bgmap.height()>=738)) {
QPalette palette;
palette.setBrush(backgroundRole(),bgmap);
setPalette(palette);
}
setBackgroundPixmap(QPixmap(rda->airplayConf()->skinPath()));

//
// Top Strip
Expand Down Expand Up @@ -1800,7 +1795,7 @@ void MainWidget::resizeEvent(QResizeEvent *e)
{
int w=width();
int h=height();

//
// Top Row
//
Expand Down Expand Up @@ -1832,7 +1827,6 @@ void MainWidget::resizeEvent(QResizeEvent *e)
air_log_list[i]->setGeometry(550,140,w-560,h-215);
}


//
// Bottom Button Row
//
Expand Down
10 changes: 2 additions & 8 deletions rdpanel/rdpanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ RDCartDialog *panel_cart_dialog;
MainWidget::MainWidget(RDConfig *c,QWidget *parent)
: RDMainWindow("rdpanel",c)
{
QPixmap panel_skin_pixmap;
// QPixmap panel_skin_pixmap;
QString err_msg;

//
Expand Down Expand Up @@ -82,13 +82,7 @@ MainWidget::MainWidget(RDConfig *c,QWidget *parent)
//
// Allocate Global Resources
//
panel_skin_pixmap=QPixmap(rda->panelConf()->skinPath());
if(!panel_skin_pixmap.isNull()&&(panel_skin_pixmap.width()>=1024)&&
(panel_skin_pixmap.height()>=738)) {
QPalette p=palette();
p.setBrush(backgroundRole(),panel_skin_pixmap);
setPalette(p);
}
setBackgroundPixmap(rda->panelConf()->skinPath());

//
// CAE Connection
Expand Down
2 changes: 2 additions & 0 deletions rivendell.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,8 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/icons/hicolor/512x512/apps/rdpanel.png
%{_datadir}/pixmaps/rivendell/rdairplay_logo.png
%{_datadir}/pixmaps/rivendell/rdairplay_white_logo.png
%{_datadir}/pixmaps/rivendell/rdairplay_skin.png
%{_datadir}/pixmaps/rivendell/rdpanel_skin.png
%{_datadir}/X11/fvwm2/pixmaps/mini.rivendell.xpm
%{_datadir}/X11/fvwm2/pixmaps/rivendell.xpm
%{_datadir}/applications/rivendell-rdadmin.desktop
Expand Down

0 comments on commit b18da6a

Please sign in to comment.