UI Nits: Reinstate drop shadow option

But NOT for win32 and ONLY on the sidebar and tabwidget (for
performance reasons). Since most users prefer the tabbed look
anyway this should be ok.

Performance of the graphicseffect has improved remarkably in
the 2 years since we tried it before. Worth experimenting with
since it adds a bit of polish to the look and feel.

Users turn it on and off in options, it is off by default.
This commit is contained in:
Mark Liversedge
2012-11-13 15:22:38 +00:00
parent fcbff57bac
commit 3c57f01674
6 changed files with 26 additions and 2 deletions

View File

@@ -24,7 +24,6 @@
#include <QPixmap>
#include <QEvent>
#include <QMouseEvent>
#include <QGraphicsDropShadowEffect>
QWidget *GcWindow::controls() const
{

View File

@@ -217,6 +217,15 @@ HomeWindow::HomeWindow(MainWindow *mainWindow, QString name, QString /* windowti
// watch drop operations
//setMouseTracking(true);
installEventFilter(this);
#ifndef WIN32
// add a drop shadow to the window
if (appsettings->value(this, GC_DROPSHADOWS, false).toBool() == true) {
QGraphicsDropShadowEffect *dropShadow = new QGraphicsDropShadowEffect(this);
dropShadow->setBlurRadius(10);
tabbed->setGraphicsEffect(dropShadow);
}
#endif
}
HomeWindow::~HomeWindow()

View File

@@ -100,6 +100,7 @@
#include <assert.h>
#include <QApplication>
#include <QtGui>
#include <QGraphicsDropShadowEffect>
#include <QRegExp>
#include <qwt_plot_curve.h>
#include <qwt_plot_picker.h>
@@ -534,6 +535,14 @@ MainWindow::MainWindow(const QDir &home) :
toolBox->setContentsMargins(0,0,0,0);
toolBox->layout()->setSpacing(0);
#ifndef WIN32
// add a drop shadow to the window
if (appsettings->value(this, GC_DROPSHADOWS, false).toBool() == true) {
QGraphicsDropShadowEffect *dropShadow = new QGraphicsDropShadowEffect(this);
dropShadow->setBlurRadius(10);
toolBox->setGraphicsEffect(dropShadow);
}
#endif
// CONTAINERS FOR TOOLBOX
masterControls = new QStackedWidget(this);
masterControls->setFrameStyle(QFrame::Plain | QFrame::NoFrame);

View File

@@ -1100,6 +1100,8 @@ ColorsPage::ColorsPage(QWidget *parent) : QWidget(parent)
shadeZones->setChecked(appsettings->value(this, GC_SHADEZONES, true).toBool());
antiAliased = new QCheckBox;
antiAliased->setChecked(appsettings->value(this, GC_ANTIALIAS, false).toBool());
dropShadows = new QCheckBox;
dropShadows->setChecked(appsettings->value(this, GC_DROPSHADOWS, false).toBool());
lineWidth = new QDoubleSpinBox;
lineWidth->setMaximum(5);
lineWidth->setMinimum(0.5);
@@ -1110,6 +1112,7 @@ ColorsPage::ColorsPage(QWidget *parent) : QWidget(parent)
QLabel *lineWidthLabel = new QLabel(tr("Line Width"));
QLabel *antialiasLabel = new QLabel(tr("Antialias" ));
QLabel *shadeZonesLabel = new QLabel(tr("Shade Zones" ));
QLabel *dropShadowsLabel = new QLabel(tr("Drop Shadows" ));
QLabel *defaultLabel = new QLabel(tr("Default"));
QLabel *titlesLabel = new QLabel(tr("Title" ));
@@ -1194,9 +1197,11 @@ ColorsPage::ColorsPage(QWidget *parent) : QWidget(parent)
grid->addWidget(lineWidthLabel, 0,3);
grid->addWidget(antialiasLabel, 1,3);
grid->addWidget(shadeZonesLabel, 2,3);
grid->addWidget(dropShadowsLabel, 3,3);
grid->addWidget(lineWidth, 0,4, Qt::AlignVCenter|Qt::AlignLeft);
grid->addWidget(antiAliased, 1,4, Qt::AlignVCenter|Qt::AlignLeft);
grid->addWidget(shadeZones, 2,4, Qt::AlignVCenter|Qt::AlignLeft);
grid->addWidget(dropShadows, 3,4, Qt::AlignVCenter|Qt::AlignLeft);
grid->addWidget(reset, 5,4, Qt::AlignVCenter|Qt::AlignRight);
grid->addWidget(defaultLabel, 0,0);
@@ -1264,6 +1269,7 @@ ColorsPage::saveClicked()
appsettings->setValue(GC_LINEWIDTH, lineWidth->value());
appsettings->setValue(GC_ANTIALIAS, antiAliased->isChecked());
appsettings->setValue(GC_SHADEZONES, shadeZones->isChecked());
appsettings->setValue(GC_DROPSHADOWS, dropShadows->isChecked());
// run down and get the current colors and save
for (int i=0; colorSet[i].name != ""; i++) {

View File

@@ -398,6 +398,7 @@ class ColorsPage : public QWidget
// General stuff
QCheckBox *antiAliased;
QCheckBox *shadeZones;
QCheckBox *dropShadows;
QDoubleSpinBox *lineWidth;
// Fonts

View File

@@ -77,7 +77,7 @@
#define GC_LTM_SPLITTER_SIZES "ltmwindow/splitterSizes"
#define GC_LINEWIDTH "linewidth"
#define GC_ANTIALIAS "antialias"
#define GC_DROPSHADOW "dropshadow"
#define GC_DROPSHADOWS "dropshadow"
#define GC_SHADEZONES "shadezones"
#define GC_PROXYTYPE "proxy/type"
#define GC_PROXYHOST "proxy/host"