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:
parent
398bd54203
commit
4c938c0da1
@ -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)));
|
||||
|
@ -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>
|
||||
|
@ -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();
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user