mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-18 04:19:55 +01:00
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/QSplitter>
|
||||
#include <QtGui/QStackedLayout>
|
||||
#include <QtGui/QStatusBar>
|
||||
#include <QtGui/QToolButton>
|
||||
#include <QtGui/QToolTip>
|
||||
#include <QtCore/QAnimationGroup>
|
||||
@ -366,20 +365,17 @@ FancyTabWidget::FancyTabWidget(QWidget *parent)
|
||||
selectionLayout->addWidget(m_cornerWidgetContainer, 0);
|
||||
|
||||
m_modesStack = new QStackedLayout;
|
||||
m_statusBar = new QStatusBar;
|
||||
m_statusBar->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
|
||||
|
||||
QVBoxLayout *vlayout = new QVBoxLayout;
|
||||
vlayout->setMargin(0);
|
||||
vlayout->setSpacing(0);
|
||||
vlayout->addLayout(m_modesStack);
|
||||
vlayout->addWidget(m_statusBar);
|
||||
m_vlayout = new QVBoxLayout;
|
||||
m_vlayout->setMargin(0);
|
||||
m_vlayout->setSpacing(0);
|
||||
m_vlayout->addLayout(m_modesStack);
|
||||
|
||||
QHBoxLayout *mainLayout = new QHBoxLayout;
|
||||
mainLayout->setMargin(0);
|
||||
mainLayout->setSpacing(1);
|
||||
mainLayout->addWidget(m_selectionWidget);
|
||||
mainLayout->addLayout(vlayout);
|
||||
mainLayout->addLayout(m_vlayout);
|
||||
setLayout(mainLayout);
|
||||
|
||||
connect(m_tabBar, SIGNAL(currentChanged(int)), this, SLOT(showWidget(int)));
|
||||
@ -457,11 +453,6 @@ int FancyTabWidget::currentIndex() const
|
||||
return m_tabBar->currentIndex();
|
||||
}
|
||||
|
||||
QStatusBar *FancyTabWidget::statusBar() const
|
||||
{
|
||||
return m_statusBar;
|
||||
}
|
||||
|
||||
void FancyTabWidget::setCurrentIndex(int index)
|
||||
{
|
||||
m_tabBar->setCurrentIndex(index);
|
||||
@ -478,3 +469,7 @@ void FancyTabWidget::setTabToolTip(int index, const QString &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 QStackedLayout;
|
||||
class QStatusBar;
|
||||
class QVBoxLayout;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core {
|
||||
@ -141,7 +142,8 @@ public:
|
||||
void paintEvent(QPaintEvent *event);
|
||||
|
||||
int currentIndex() const;
|
||||
QStatusBar *statusBar() const;
|
||||
|
||||
void addBottomWidget(QWidget* widget);
|
||||
|
||||
signals:
|
||||
void currentAboutToShow(int index);
|
||||
@ -158,8 +160,8 @@ private:
|
||||
QWidget *m_cornerWidgetContainer;
|
||||
QStackedLayout *m_modesStack;
|
||||
QWidget *m_selectionWidget;
|
||||
QStatusBar *m_statusBar;
|
||||
QPixmap m_backgroundPixmap;
|
||||
QVBoxLayout* m_vlayout;
|
||||
};
|
||||
|
||||
} // 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(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"));
|
||||
StyleHelper::setBaseColor(palette().color(QPalette::Highlight).darker());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user