2018-08-13 Fred Gleason <fredg@paravelsystems.com>

* Added code to force the 'Plastique' GUI style.
This commit is contained in:
Fred Gleason 2018-08-13 19:22:24 -04:00
parent ce323b471d
commit c588b4950a
23 changed files with 72 additions and 39 deletions

View File

@ -17386,3 +17386,5 @@
the incorrect shadow color. the incorrect shadow color.
2018-08-13 Fred Gleason <fredg@paravelsystems.com> 2018-08-13 Fred Gleason <fredg@paravelsystems.com>
* Updated table documentation. * Updated table documentation.
2018-08-13 Fred Gleason <fredg@paravelsystems.com>
* Added code to force the 'Plastique' GUI style.

View File

@ -585,5 +585,11 @@
#define RD_RDVAIRPLAY_LOG_BASE 100 #define RD_RDVAIRPLAY_LOG_BASE 100
#define RD_RDVAIRPLAY_LOG_QUAN 20 #define RD_RDVAIRPLAY_LOG_QUAN 20
/*
* GUI Style
* (must be one of the values returned by QStyleFactory::keys())
*/
#define RD_GUI_STYLE "Plastique"
#endif // RD_H #endif // RD_H

View File

@ -2,7 +2,7 @@
// //
// Edit Rivendell Audio // Edit Rivendell Audio
// //
// (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 // 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 // it under the terms of the GNU General Public License version 2 as
@ -214,7 +214,7 @@ RDEditAudio::RDEditAudio(RDCart *cart,QString cut_name,int card,
// //
// Amplitude Buttons // Amplitude Buttons
// //
QLabel *amp_label=new QLabel(this,"amp_label"); QLabel *amp_label=new QLabel(this);
amp_label->setGeometry(742,5,80,16); amp_label->setGeometry(742,5,80,16);
amp_label->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter); amp_label->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
amp_label->setFont(button_font); amp_label->setFont(button_font);

View File

@ -125,20 +125,20 @@ void RDPushButton::setPalette(const QPalette &pal)
void RDPushButton::mousePressEvent(QMouseEvent *e) void RDPushButton::mousePressEvent(QMouseEvent *e)
{ {
switch(e->button()) { switch(e->button()) {
case Qt::LeftButton: case Qt::LeftButton:
QPushButton::mousePressEvent(e); QPushButton::mousePressEvent(e);
break; break;
case Qt::MidButton: case Qt::MidButton:
emit centerPressed(); emit centerPressed();
break; break;
case Qt::RightButton: case Qt::RightButton:
emit rightPressed(); emit rightPressed();
break; break;
default: default:
break; break;
} }
} }
@ -146,32 +146,32 @@ void RDPushButton::mousePressEvent(QMouseEvent *e)
void RDPushButton::mouseReleaseEvent(QMouseEvent *e) void RDPushButton::mouseReleaseEvent(QMouseEvent *e)
{ {
switch(e->button()) { switch(e->button()) {
case Qt::LeftButton: case Qt::LeftButton:
QPushButton::mouseReleaseEvent(e); QPushButton::mouseReleaseEvent(e);
break; break;
case Qt::MidButton: case Qt::MidButton:
e->accept(); e->accept();
emit centerReleased(); emit centerReleased();
if((e->x()>=0)&&(e->x()<geometry().width())&& if((e->x()>=0)&&(e->x()<geometry().width())&&
(e->y()>=0)&&(e->y()<geometry().height())) { (e->y()>=0)&&(e->y()<geometry().height())) {
emit centerClicked(); emit centerClicked();
emit centerClicked(button_id,QPoint(e->x(),e->y())); emit centerClicked(button_id,QPoint(e->x(),e->y()));
} }
break; break;
case Qt::RightButton: case Qt::RightButton:
e->accept(); e->accept();
emit rightReleased(); emit rightReleased();
if((e->x()>=0)&&(e->x()<geometry().width())&& if((e->x()>=0)&&(e->x()<geometry().width())&&
(e->y()>=0)&&(e->y()<geometry().height())) { (e->y()>=0)&&(e->y()<geometry().height())) {
emit rightClicked(); emit rightClicked();
emit rightClicked(button_id,QPoint(e->x(),e->y())); emit rightClicked(button_id,QPoint(e->x(),e->y()));
} }
break; break;
default: default:
break; break;
} }
} }

View File

@ -392,6 +392,7 @@ void MainWidget::ClearTables()
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
QApplication::setStyle(RD_GUI_STYLE);
QApplication a(argc,argv); QApplication a(argc,argv);
// //

View File

@ -2479,6 +2479,7 @@ void MainWidget::SetActionMode(StartButton::Mode mode)
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
QApplication::setStyle(RD_GUI_STYLE);
QApplication a(argc,argv); QApplication a(argc,argv);
// //

View File

@ -237,6 +237,7 @@ void MainWidget::SetCaption()
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
QApplication::setStyle(RD_GUI_STYLE);
QApplication a(argc,argv); QApplication a(argc,argv);
// //

View File

@ -328,6 +328,7 @@ void MainWidget::RefreshList()
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
QApplication::setStyle(RD_GUI_STYLE);
QApplication a(argc,argv); QApplication a(argc,argv);
// //

View File

@ -2193,6 +2193,7 @@ void MainWidget::SaveGeometry()
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
QApplication::setStyle(RD_GUI_STYLE);
QApplication a(argc,argv); QApplication a(argc,argv);
// //

View File

@ -41,6 +41,8 @@
#include <QPixmap> #include <QPixmap>
#include <QResizeEvent> #include <QResizeEvent>
#include <QCloseEvent> #include <QCloseEvent>
#include <qstylefactory.h>
#include <curl/curl.h> #include <curl/curl.h>
#include <dbversion.h> #include <dbversion.h>
@ -88,6 +90,10 @@ void SigHandler(int signo);
MainWidget::MainWidget(QWidget *parent) MainWidget::MainWidget(QWidget *parent)
:QWidget(parent) :QWidget(parent)
{ {
QStringList styles=QStyleFactory::keys();
for(int i=0;i<styles.size();i++) {
printf("style: %s\n",(const char *)styles.at(i).toUtf8());
}
QString err_msg; QString err_msg;
lib_resize=false; lib_resize=false;
@ -1529,6 +1535,7 @@ void MainWidget::SendNotification(RDNotification::Action action,
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
QApplication::setStyle(RD_GUI_STYLE);
QApplication a(argc,argv); QApplication a(argc,argv);
// //

View File

@ -919,6 +919,7 @@ void MainWidget::UnlockList()
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
QApplication::setStyle(RD_GUI_STYLE);
QApplication a(argc,argv); QApplication a(argc,argv);
// //

View File

@ -302,6 +302,7 @@ void MainWidget::resizeEvent(QResizeEvent *e)
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
QApplication::setStyle(RD_GUI_STYLE);
QApplication a(argc,argv); QApplication a(argc,argv);
// //

View File

@ -304,6 +304,7 @@ void MainWidget::quitMainWidget()
int gui_main(int argc,char *argv[]) int gui_main(int argc,char *argv[])
{ {
QApplication::setStyle(RD_GUI_STYLE);
QApplication a(argc,argv); QApplication a(argc,argv);
// //

View File

@ -378,6 +378,7 @@ void MainWidget::SetPosition()
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
QApplication::setStyle(RD_GUI_STYLE);
QApplication a(argc,argv); QApplication a(argc,argv);
// //

View File

@ -410,6 +410,7 @@ void MainWidget::SetCaption()
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
QApplication::setStyle(RD_GUI_STYLE);
QApplication a(argc,argv); QApplication a(argc,argv);
// //

View File

@ -351,6 +351,7 @@ void MainWidget::SetCurrentItem(int id)
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
QApplication::setStyle(RD_GUI_STYLE);
QApplication a(argc,argv); QApplication a(argc,argv);
// //

View File

@ -380,6 +380,7 @@ int main(int argc,char *argv[])
// //
// Start GUI // Start GUI
// //
QApplication::setStyle(RD_GUI_STYLE);
QApplication a(argc,argv); QApplication a(argc,argv);
MainWidget *w=new MainWidget(); MainWidget *w=new MainWidget();
a.setMainWidget(w); a.setMainWidget(w);

View File

@ -628,6 +628,7 @@ void MainWidget::LogMessage(const QString &str)
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
QApplication::setStyle(RD_GUI_STYLE);
QApplication a(argc,argv); QApplication a(argc,argv);
// //

View File

@ -709,6 +709,7 @@ void MainWidget::SaveConfig()
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
QApplication::setStyle(RD_GUI_STYLE);
QApplication a(argc,argv); QApplication a(argc,argv);
// //

View File

@ -751,6 +751,7 @@ void MainWidget::AddEventsItem(int line,bool state)
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
QApplication::setStyle(RD_GUI_STYLE);
QApplication a(argc,argv); QApplication a(argc,argv);
// //

View File

@ -27,6 +27,7 @@
#include <qmessagebox.h> #include <qmessagebox.h>
#include <qdatetime.h> #include <qdatetime.h>
#include <rd.h>
#include <rdcmd_switch.h> #include <rdcmd_switch.h>
#include <rdpopup.h> #include <rdpopup.h>
@ -54,6 +55,7 @@ QString WordWrap(const QString &str)
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
QApplication::setStyle(RD_GUI_STYLE);
QApplication a(argc,argv); QApplication a(argc,argv);
RDCmdSwitch *cmd= RDCmdSwitch *cmd=

View File

@ -281,8 +281,8 @@ QString MainWidget::WrapText(QWidget *w,const QString &text)
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
QApplication::setStyle(RD_GUI_STYLE);
QApplication a(argc,argv); QApplication a(argc,argv);
QApplication::setStyle(new QWindowsStyle);
// //
// Load Translations // Load Translations

View File

@ -507,7 +507,8 @@ int main(int argc,char *argv[])
#endif // WIN32 #endif // WIN32
} }
else { else {
QApplication a(argc,argv,true); QApplication::setStyle(new QWindowsStyle);
QApplication a(argc,argv);
// //
// Load Translations // Load Translations