Custom playqueue background is not workig with Qt 5.12 onwards, so
disabled for now. Issue #1554
This commit is contained in:
committed by
Craig Drummond
parent
a56f5eaae0
commit
8b734082f4
@@ -54,6 +54,8 @@
|
||||
40. Categorized view is reported to crash (#1530), so disable by default. Pass
|
||||
-DENABLE_CATEGORIZED_VIEW=ON to cmake to re-enable.
|
||||
41. Add 'aac' and 'libfdk_aac' as supported encoders.
|
||||
42. Custom playqueue background is not workig with Qt 5.12 onwards, so
|
||||
disabled for now.
|
||||
|
||||
2.3.3
|
||||
-----
|
||||
|
||||
@@ -64,4 +64,6 @@
|
||||
|
||||
#define CANTATA_ICON_THEME "@CANTATA_ICON_THEME@"
|
||||
|
||||
#define ENABLE_VIEW_BACKGROUND (QT_VERSION < QT_VERSION_CHECK(5, 12, 0))
|
||||
|
||||
#endif
|
||||
|
||||
@@ -172,6 +172,7 @@ InterfaceSettings::InterfaceSettings(QWidget *p)
|
||||
sbPosition->addItem(tr("Bottom"), FancyTabWidget::Bot);
|
||||
connect(sbAutoHide, SIGNAL(toggled(bool)), SLOT(sbAutoHideChanged()));
|
||||
views->setItemDelegate(new BasicItemDelegate(views));
|
||||
#if ENABLE_VIEW_BACKGROUND
|
||||
playQueueBackground_none->setProperty(constValueProperty, PlayQueueView::BI_None);
|
||||
playQueueBackground_cover->setProperty(constValueProperty, PlayQueueView::BI_Cover);
|
||||
playQueueBackground_custom->setProperty(constValueProperty, PlayQueueView::BI_Custom);
|
||||
@@ -185,6 +186,7 @@ InterfaceSettings::InterfaceSettings(QWidget *p)
|
||||
connect(playQueueBackground_none, SIGNAL(toggled(bool)), SLOT(enablePlayQueueBackgroundOptions()));
|
||||
connect(playQueueBackground_cover, SIGNAL(toggled(bool)), SLOT(enablePlayQueueBackgroundOptions()));
|
||||
connect(playQueueBackground_custom, SIGNAL(toggled(bool)), SLOT(enablePlayQueueBackgroundOptions()));
|
||||
#endif
|
||||
connect(storeCoversInMpdDir, SIGNAL(toggled(bool)), this, SLOT(storeCoversInMpdDirToggled()));
|
||||
if (!enableNotifications) {
|
||||
REMOVE(systemTrayPopup)
|
||||
@@ -248,6 +250,7 @@ void InterfaceSettings::load()
|
||||
playQueueStartClosed->setChecked(Settings::self()->playQueueStartClosed());
|
||||
playQueueScroll->setChecked(Settings::self()->playQueueScroll());
|
||||
|
||||
#if ENABLE_VIEW_BACKGROUND
|
||||
int pqBgnd=Settings::self()->playQueueBackground();
|
||||
playQueueBackground_none->setChecked(pqBgnd==playQueueBackground_none->property(constValueProperty).toInt());
|
||||
playQueueBackground_cover->setChecked(pqBgnd==playQueueBackground_cover->property(constValueProperty).toInt());
|
||||
@@ -255,6 +258,7 @@ void InterfaceSettings::load()
|
||||
playQueueBackgroundOpacity->setValue(Settings::self()->playQueueBackgroundOpacity());
|
||||
playQueueBackgroundBlur->setValue(Settings::self()->playQueueBackgroundBlur());
|
||||
playQueueBackgroundFile->setText(Utils::convertPathForDisplay(Settings::self()->playQueueBackgroundFile(), false));
|
||||
#endif
|
||||
|
||||
playQueueConfirmClear->setChecked(Settings::self()->playQueueConfirmClear());
|
||||
playQueueSearch->setChecked(Settings::self()->playQueueSearch());
|
||||
@@ -301,12 +305,16 @@ void InterfaceSettings::load()
|
||||
sbAutoHideChanged();
|
||||
responsiveSidebar->setChecked(Settings::self()->responsiveSidebar());
|
||||
viewItemChanged(views->item(0));
|
||||
#if ENABLE_VIEW_BACKGROUND
|
||||
setPlayQueueBackgroundOpacityLabel();
|
||||
setPlayQueueBackgroundBlurLabel();
|
||||
enablePlayQueueBackgroundOptions();
|
||||
if (enableMpris) {
|
||||
enableMpris->setChecked(Settings::self()->mpris());
|
||||
}
|
||||
#else
|
||||
playQueueBackgroundOptions->setVisible(false);
|
||||
#endif
|
||||
}
|
||||
|
||||
static QSet<QString> toSet(const QString &str)
|
||||
@@ -334,6 +342,7 @@ void InterfaceSettings::save()
|
||||
Settings::self()->savePlayQueueStartClosed(playQueueStartClosed->isChecked());
|
||||
Settings::self()->savePlayQueueScroll(playQueueScroll->isChecked());
|
||||
|
||||
#if ENABLE_VIEW_BACKGROUND
|
||||
if (playQueueBackground_none->isChecked()) {
|
||||
Settings::self()->savePlayQueueBackground(playQueueBackground_none->property(constValueProperty).toInt());
|
||||
} else if (playQueueBackground_cover->isChecked()) {
|
||||
@@ -344,6 +353,7 @@ void InterfaceSettings::save()
|
||||
Settings::self()->savePlayQueueBackgroundOpacity(playQueueBackgroundOpacity->value());
|
||||
Settings::self()->savePlayQueueBackgroundBlur(playQueueBackgroundBlur->value());
|
||||
Settings::self()->savePlayQueueBackgroundFile(Utils::convertPathFromDisplay(playQueueBackgroundFile->text(), false));
|
||||
#endif
|
||||
|
||||
Settings::self()->savePlayQueueConfirmClear(playQueueConfirmClear->isChecked());
|
||||
Settings::self()->savePlayQueueSearch(playQueueSearch->isChecked());
|
||||
@@ -562,20 +572,26 @@ void InterfaceSettings::sbAutoHideChanged()
|
||||
|
||||
void InterfaceSettings::setPlayQueueBackgroundOpacityLabel()
|
||||
{
|
||||
#if ENABLE_VIEW_BACKGROUND
|
||||
playQueueBackgroundOpacityLabel->setText(tr("%1%", "value%").arg(playQueueBackgroundOpacity->value()));
|
||||
#endif
|
||||
}
|
||||
|
||||
void InterfaceSettings::setPlayQueueBackgroundBlurLabel()
|
||||
{
|
||||
#if ENABLE_VIEW_BACKGROUND
|
||||
playQueueBackgroundBlurLabel->setText(tr("%1 px", "pixels").arg(playQueueBackgroundBlur->value()));
|
||||
#endif
|
||||
}
|
||||
|
||||
void InterfaceSettings::enablePlayQueueBackgroundOptions()
|
||||
{
|
||||
#if ENABLE_VIEW_BACKGROUND
|
||||
playQueueBackgroundOpacity->setEnabled(!playQueueBackground_none->isChecked());
|
||||
playQueueBackgroundOpacityLabel->setEnabled(playQueueBackgroundOpacity->isEnabled());
|
||||
playQueueBackgroundBlur->setEnabled(playQueueBackgroundOpacity->isEnabled());
|
||||
playQueueBackgroundBlurLabel->setEnabled(playQueueBackgroundOpacity->isEnabled());
|
||||
#endif
|
||||
}
|
||||
|
||||
void InterfaceSettings::systemTrayCheckBoxToggled()
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<widget class="QGroupBox" name="playQueueBackgroundOptions">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
|
||||
@@ -113,7 +113,9 @@ PlayQueueView::PlayQueueView(QWidget *parent)
|
||||
setMode(ItemView::Mode_GroupedTree);
|
||||
animator.setPropertyName("fade");
|
||||
animator.setTargetObject(this);
|
||||
#if ENABLE_VIEW_BACKGROUND
|
||||
connect(CurrentCover::self(), SIGNAL(coverImage(QImage)), this, SLOT(setImage(QImage)));
|
||||
#endif
|
||||
}
|
||||
|
||||
PlayQueueView::~PlayQueueView()
|
||||
@@ -122,17 +124,18 @@ PlayQueueView::~PlayQueueView()
|
||||
|
||||
void PlayQueueView::readConfig()
|
||||
{
|
||||
setAutoExpand(Settings::self()->playQueueAutoExpand());
|
||||
setStartClosed(Settings::self()->playQueueStartClosed());
|
||||
setMode((ItemView::Mode)Settings::self()->playQueueView());
|
||||
#if ENABLE_VIEW_BACKGROUND
|
||||
int origOpacity=backgroundOpacity;
|
||||
int origBlur=backgroundBlur;
|
||||
QString origCustomBackgroundFile=customBackgroundFile;
|
||||
BackgroundImage origType=backgroundImageType;
|
||||
setAutoExpand(Settings::self()->playQueueAutoExpand());
|
||||
setStartClosed(Settings::self()->playQueueStartClosed());
|
||||
backgroundImageType=(BackgroundImage)Settings::self()->playQueueBackground();
|
||||
backgroundOpacity=Settings::self()->playQueueBackgroundOpacity();
|
||||
backgroundBlur=Settings::self()->playQueueBackgroundBlur();
|
||||
customBackgroundFile=Settings::self()->playQueueBackgroundFile();
|
||||
setMode((ItemView::Mode)Settings::self()->playQueueView());
|
||||
switch (backgroundImageType) {
|
||||
case BI_None:
|
||||
if (origType!=backgroundImageType) {
|
||||
@@ -161,6 +164,7 @@ void PlayQueueView::readConfig()
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void PlayQueueView::saveConfig()
|
||||
@@ -426,6 +430,7 @@ void PlayQueueView::updatePalette()
|
||||
|
||||
void PlayQueueView::setImage(const QImage &img)
|
||||
{
|
||||
#if ENABLE_VIEW_BACKGROUND
|
||||
if (BI_None==backgroundImageType || (sender() && BI_Custom==backgroundImageType)) {
|
||||
return;
|
||||
}
|
||||
@@ -460,6 +465,7 @@ void PlayQueueView::setImage(const QImage &img)
|
||||
animator.setEndValue(1.0);
|
||||
animator.start();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void PlayQueueView::streamFetchStatus(const QString &msg)
|
||||
@@ -480,6 +486,7 @@ void PlayQueueView::searchActive(bool a)
|
||||
|
||||
void PlayQueueView::drawBackdrop(QWidget *widget, const QSize &size)
|
||||
{
|
||||
#if ENABLE_VIEW_BACKGROUND
|
||||
if (BI_None==backgroundImageType) {
|
||||
return;
|
||||
}
|
||||
@@ -504,6 +511,7 @@ void PlayQueueView::drawBackdrop(QWidget *widget, const QSize &size)
|
||||
p.drawPixmap((size.width()-curentBackground.width())/2, (size.height()-curentBackground.height())/2, curentBackground);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#include "moc_playqueueview.cpp"
|
||||
|
||||
@@ -55,6 +55,7 @@ QImage TreeView::setOpacity(const QImage &orig, double opacity)
|
||||
|
||||
QPixmap TreeView::createBgndPixmap(const QIcon &icon)
|
||||
{
|
||||
#if ENABLE_VIEW_BACKGROUND
|
||||
if (icon.isNull()) {
|
||||
return QPixmap();
|
||||
}
|
||||
@@ -68,6 +69,9 @@ QPixmap TreeView::createBgndPixmap(const QIcon &icon)
|
||||
img=img.scaled(bgndSize, bgndSize, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
}
|
||||
return QPixmap::fromImage(setOpacity(img, 0.075));
|
||||
#else
|
||||
return QPixmap();
|
||||
#endif
|
||||
}
|
||||
|
||||
static bool forceSingleClick=true;
|
||||
@@ -314,6 +318,7 @@ void TreeView::setUseSimpleDelegate()
|
||||
|
||||
void TreeView::setBackgroundImage(const QIcon &icon)
|
||||
{
|
||||
#if ENABLE_VIEW_BACKGROUND
|
||||
QPalette pal=parentWidget()->palette();
|
||||
// if (!icon.isNull()) {
|
||||
// pal.setColor(QPalette::Base, Qt::transparent);
|
||||
@@ -323,16 +328,19 @@ void TreeView::setBackgroundImage(const QIcon &icon)
|
||||
#endif
|
||||
viewport()->setPalette(pal);
|
||||
bgnd=createBgndPixmap(icon);
|
||||
#endif
|
||||
}
|
||||
|
||||
void TreeView::paintEvent(QPaintEvent *e)
|
||||
{
|
||||
#if ENABLE_VIEW_BACKGROUND
|
||||
if (!bgnd.isNull()) {
|
||||
QPainter p(viewport());
|
||||
QSize sz=size();
|
||||
p.fillRect(0, 0, sz.width(), sz.height(), QApplication::palette().color(QPalette::Base));
|
||||
p.drawPixmap((sz.width()-bgnd.width())/2, (sz.height()-bgnd.height())/2, bgnd);
|
||||
}
|
||||
#endif
|
||||
if (!info.isEmpty() && model() && 0==model()->rowCount()) {
|
||||
QPainter p(viewport());
|
||||
QColor col(palette().text().color());
|
||||
|
||||
Reference in New Issue
Block a user