1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-01-31 11:35:24 +01:00

Add a small top border to the large cover

This commit is contained in:
David Sansome 2010-06-18 00:24:09 +00:00
parent 398bd54203
commit 4c938c0da1
4 changed files with 9 additions and 6 deletions

View File

@ -463,7 +463,6 @@ MainWindow::MainWindow(NetworkAccessManager* network, Engine::Type engine, QWidg
// Now playing widget
ui_->now_playing->set_network(network);
ui_->now_playing->set_ideal_height(ui_->status_bar->sizeHint().height() +
ui_->status_bar_line->sizeHint().height() +
ui_->player_controls->sizeHint().height() +
1); // Don't question the 1
connect(playlists_, SIGNAL(CurrentSongChanged(Song)), ui_->now_playing, SLOT(NowPlaying(Song)));

View File

@ -41,7 +41,7 @@
<enum>QTabWidget::North</enum>
</property>
<property name="currentIndex">
<number>0</number>
<number>2</number>
</property>
<property name="usesScrollButtons">
<bool>false</bool>

View File

@ -30,7 +30,7 @@
const char* NowPlayingWidget::kSettingsGroup = "NowPlayingWidget";
// Space between the cover and the details in small mode
const int NowPlayingWidget::kPadding = 4;
const int NowPlayingWidget::kPadding = 2;
// Width of the transparent to black gradient above and below the text in large
// mode
@ -42,6 +42,9 @@ const int NowPlayingWidget::kGradientTail = 20;
const int NowPlayingWidget::kMaxCoverSize = 260;
const int NowPlayingWidget::kBottomOffset = 0;
// Border for large mode
const int NowPlayingWidget::kTopBorder = 4;
NowPlayingWidget::NowPlayingWidget(QWidget *parent)
: QWidget(parent),
@ -126,7 +129,7 @@ void NowPlayingWidget::UpdateHeight() {
case LargeSongDetails:
cover_height_ = qMin(kMaxCoverSize, width());
total_height_ = cover_height_ + kBottomOffset;
total_height_ = kTopBorder + cover_height_ + kBottomOffset;
break;
}
@ -256,10 +259,10 @@ void NowPlayingWidget::DrawContents(QPainter *p) {
const int x_offset = (width() - cover_height_) / 2;
// Draw the black background
p->fillRect(rect(), Qt::black);
p->fillRect(QRect(0, kTopBorder, width(), height() - kTopBorder), Qt::black);
// Draw the cover
p->drawPixmap(x_offset, 0, total_size, total_size, cover_);
p->drawPixmap(x_offset, kTopBorder, total_size, total_size, cover_);
// Work out how high the text is going to be
const int text_height = details_->size().height();

View File

@ -43,6 +43,7 @@ public:
static const int kGradientTail;
static const int kMaxCoverSize;
static const int kBottomOffset;
static const int kTopBorder;
// Values are saved in QSettings
enum Mode {