Show the now playing widget "inside" the sidebar instead of under it.
This commit is contained in:
parent
c268f60339
commit
f4a1e86c45
23
3rdparty/fancytabwidget/fancytabwidget.cpp
vendored
23
3rdparty/fancytabwidget/fancytabwidget.cpp
vendored
@ -41,7 +41,6 @@
|
|||||||
#include <QtGui/QPainter>
|
#include <QtGui/QPainter>
|
||||||
#include <QtGui/QSplitter>
|
#include <QtGui/QSplitter>
|
||||||
#include <QtGui/QStackedLayout>
|
#include <QtGui/QStackedLayout>
|
||||||
#include <QtGui/QStatusBar>
|
|
||||||
#include <QtGui/QToolButton>
|
#include <QtGui/QToolButton>
|
||||||
#include <QtGui/QToolTip>
|
#include <QtGui/QToolTip>
|
||||||
#include <QtCore/QAnimationGroup>
|
#include <QtCore/QAnimationGroup>
|
||||||
@ -366,20 +365,17 @@ FancyTabWidget::FancyTabWidget(QWidget *parent)
|
|||||||
selectionLayout->addWidget(m_cornerWidgetContainer, 0);
|
selectionLayout->addWidget(m_cornerWidgetContainer, 0);
|
||||||
|
|
||||||
m_modesStack = new QStackedLayout;
|
m_modesStack = new QStackedLayout;
|
||||||
m_statusBar = new QStatusBar;
|
|
||||||
m_statusBar->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
|
|
||||||
|
|
||||||
QVBoxLayout *vlayout = new QVBoxLayout;
|
m_vlayout = new QVBoxLayout;
|
||||||
vlayout->setMargin(0);
|
m_vlayout->setMargin(0);
|
||||||
vlayout->setSpacing(0);
|
m_vlayout->setSpacing(0);
|
||||||
vlayout->addLayout(m_modesStack);
|
m_vlayout->addLayout(m_modesStack);
|
||||||
vlayout->addWidget(m_statusBar);
|
|
||||||
|
|
||||||
QHBoxLayout *mainLayout = new QHBoxLayout;
|
QHBoxLayout *mainLayout = new QHBoxLayout;
|
||||||
mainLayout->setMargin(0);
|
mainLayout->setMargin(0);
|
||||||
mainLayout->setSpacing(1);
|
mainLayout->setSpacing(1);
|
||||||
mainLayout->addWidget(m_selectionWidget);
|
mainLayout->addWidget(m_selectionWidget);
|
||||||
mainLayout->addLayout(vlayout);
|
mainLayout->addLayout(m_vlayout);
|
||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
|
|
||||||
connect(m_tabBar, SIGNAL(currentChanged(int)), this, SLOT(showWidget(int)));
|
connect(m_tabBar, SIGNAL(currentChanged(int)), this, SLOT(showWidget(int)));
|
||||||
@ -457,11 +453,6 @@ int FancyTabWidget::currentIndex() const
|
|||||||
return m_tabBar->currentIndex();
|
return m_tabBar->currentIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
QStatusBar *FancyTabWidget::statusBar() const
|
|
||||||
{
|
|
||||||
return m_statusBar;
|
|
||||||
}
|
|
||||||
|
|
||||||
void FancyTabWidget::setCurrentIndex(int index)
|
void FancyTabWidget::setCurrentIndex(int index)
|
||||||
{
|
{
|
||||||
m_tabBar->setCurrentIndex(index);
|
m_tabBar->setCurrentIndex(index);
|
||||||
@ -478,3 +469,7 @@ void FancyTabWidget::setTabToolTip(int index, const QString &toolTip)
|
|||||||
{
|
{
|
||||||
m_tabBar->setTabToolTip(index, toolTip);
|
m_tabBar->setTabToolTip(index, toolTip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FancyTabWidget::addBottomWidget(QWidget* widget) {
|
||||||
|
m_vlayout->addWidget(widget);
|
||||||
|
}
|
||||||
|
6
3rdparty/fancytabwidget/fancytabwidget.h
vendored
6
3rdparty/fancytabwidget/fancytabwidget.h
vendored
@ -40,6 +40,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
class QPainter;
|
class QPainter;
|
||||||
class QStackedLayout;
|
class QStackedLayout;
|
||||||
class QStatusBar;
|
class QStatusBar;
|
||||||
|
class QVBoxLayout;
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
@ -141,7 +142,8 @@ public:
|
|||||||
void paintEvent(QPaintEvent *event);
|
void paintEvent(QPaintEvent *event);
|
||||||
|
|
||||||
int currentIndex() const;
|
int currentIndex() const;
|
||||||
QStatusBar *statusBar() const;
|
|
||||||
|
void addBottomWidget(QWidget* widget);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void currentAboutToShow(int index);
|
void currentAboutToShow(int index);
|
||||||
@ -158,8 +160,8 @@ private:
|
|||||||
QWidget *m_cornerWidgetContainer;
|
QWidget *m_cornerWidgetContainer;
|
||||||
QStackedLayout *m_modesStack;
|
QStackedLayout *m_modesStack;
|
||||||
QWidget *m_selectionWidget;
|
QWidget *m_selectionWidget;
|
||||||
QStatusBar *m_statusBar;
|
|
||||||
QPixmap m_backgroundPixmap;
|
QPixmap m_backgroundPixmap;
|
||||||
|
QVBoxLayout* m_vlayout;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@ -190,7 +190,9 @@ MainWindow::MainWindow(NetworkAccessManager* network, Engine::Type engine, QWidg
|
|||||||
ui_->tabs->addTab(new QWidget, IconLoader::Load("view-media-lyrics"), tr("Song info"));
|
ui_->tabs->addTab(new QWidget, IconLoader::Load("view-media-lyrics"), tr("Song info"));
|
||||||
ui_->tabs->addTab(artist_info_view_, IconLoader::Load("view-media-lyrics"), tr("Artist info"));
|
ui_->tabs->addTab(artist_info_view_, IconLoader::Load("view-media-lyrics"), tr("Artist info"));
|
||||||
|
|
||||||
ui_->tabs->statusBar()->hide();
|
// Add the now playing widget to the fancy tab widget
|
||||||
|
ui_->tabs->addBottomWidget(ui_->now_playing);
|
||||||
|
|
||||||
ui_->tabs->setBackgroundPixmap(QPixmap(":/sidebar_background.png"));
|
ui_->tabs->setBackgroundPixmap(QPixmap(":/sidebar_background.png"));
|
||||||
StyleHelper::setBaseColor(palette().color(QPalette::Highlight).darker());
|
StyleHelper::setBaseColor(palette().color(QPalette::Highlight).darker());
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user