1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2025-01-29 16:49:27 +01:00

Add hide()

This commit is contained in:
Jonas Kvinge 2018-10-02 00:58:46 +02:00
parent 1fbfabdf66
commit 044cf4624a
2 changed files with 7 additions and 6 deletions

View File

@ -52,8 +52,8 @@ const qreal TrackSliderPopup::kBlurRadius = 20.0;
TrackSliderPopup::TrackSliderPopup(QWidget* parent)
: QWidget(parent),
font_metrics_(fontMetrics()),
small_font_metrics_(fontMetrics())
{
small_font_metrics_(fontMetrics()) {
setAttribute(Qt::WA_TransparentForMouseEvents);
setMouseTracking(true);
@ -62,6 +62,7 @@ TrackSliderPopup::TrackSliderPopup(QWidget* parent)
small_font_.setPointSizeF(7.5);
font_metrics_ = QFontMetrics(font_);
small_font_metrics_ = QFontMetrics(small_font_);
}
void TrackSliderPopup::SetText(const QString& text) {
@ -180,6 +181,5 @@ void TrackSliderPopup::UpdatePixmap() {
}
void TrackSliderPopup::UpdatePosition() {
move(pos_.x() - pixmap_.width() / 2,
pos_.y() - pixmap_.height() + kBlurRadius);
move(pos_.x() - pixmap_.width() / 2, pos_.y() - pixmap_.height() + kBlurRadius);
}

View File

@ -38,9 +38,10 @@
TrackSliderSlider::TrackSliderSlider(QWidget* parent)
: QSlider(parent),
popup_(new TrackSliderPopup(window())),
mouse_hover_seconds_(0)
{
mouse_hover_seconds_(0) {
setMouseTracking(true);
popup_->hide();
connect(this, SIGNAL(valueChanged(int)), SLOT(UpdateDeltaTime()));
}