Fix a bug where the OSD would move back to the top-left of the first display
This commit is contained in:
parent
8b678cba9a
commit
8027449b8e
@ -303,6 +303,9 @@ void OSDPretty::mouseMoveEvent(QMouseEvent* e) {
|
||||
new_pos.setY(qBound(geometry.top(), new_pos.y(), geometry.bottom() - height()));
|
||||
|
||||
move(new_pos);
|
||||
|
||||
popup_display_ = current_display();
|
||||
popup_pos_ = current_pos();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,9 +64,12 @@ class OSDPretty : public QWidget {
|
||||
QRgb foreground_color() const { return foreground_color_.rgb(); }
|
||||
QRgb background_color() const { return background_color_.rgb(); }
|
||||
qreal background_opacity() const { return background_opacity_; }
|
||||
int popup_display() const { return popup_display_; }
|
||||
QPoint popup_pos() const { return popup_pos_; }
|
||||
|
||||
// When the user has been moving the popup, use these to get its current
|
||||
// position and screen
|
||||
// position and screen. Note that these return invalid values if the popup
|
||||
// is hidden.
|
||||
int current_display() const;
|
||||
QPoint current_pos() const;
|
||||
|
||||
|
@ -140,8 +140,8 @@ void SettingsDialog::accept() {
|
||||
s.setValue("foreground_color", pretty_popup_->foreground_color());
|
||||
s.setValue("background_color", pretty_popup_->background_color());
|
||||
s.setValue("background_opacity", pretty_popup_->background_opacity());
|
||||
s.setValue("popup_display", pretty_popup_->current_display());
|
||||
s.setValue("popup_pos", pretty_popup_->current_pos());
|
||||
s.setValue("popup_display", pretty_popup_->popup_display());
|
||||
s.setValue("popup_pos", pretty_popup_->popup_pos());
|
||||
s.endGroup();
|
||||
|
||||
ui_.library_config->Save();
|
||||
|
Loading…
x
Reference in New Issue
Block a user