Skip to content

Commit

Permalink
chore(#47):
Browse files Browse the repository at this point in the history
  • Loading branch information
ffiirree committed Mar 15, 2024
1 parent 19f9428 commit 7521439
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 23 deletions.
5 changes: 1 addition & 4 deletions src/player/video-player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,8 @@ uint32_t VideoPlayer::audio_callback(uint8_t **ptr, const uint32_t request_frame

// update audio clock pts
if (frame.value()->pts >= 0)
audio_pts_ = av::clock::ns(frame.value()->pts, source_->afo.time_base);

if (audio_pts_.load() != av::clock::nopts)
audio_pts_ =
audio_pts_.load() + av::clock::ns(frame.value()->nb_samples, source_->afo.time_base);
av::clock::ns(frame.value()->pts + frame.value()->nb_samples, source_->afo.time_base);

sonic_stream_write(sonic_stream_, frame.value()->data[0], frame.value()->nb_samples);
}
Expand Down
4 changes: 1 addition & 3 deletions src/setting/settingdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ SettingWindow::SettingWindow(QWidget *parent)
menu->addItem(tr("GIF Recording"));
menu->addItem(tr("Devices"));
menu->addItem(tr("About"));
menu->setMinimumWidth(275);
menu->setMinimumWidth(280);
menu->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
layout->addWidget(menu);

Expand Down Expand Up @@ -141,8 +141,6 @@ QWidget *SettingWindow::setupGeneralWidget()

QWidget *SettingWindow::setupHotkeyWidget()
{
using namespace config;

const auto page = new ScrollWidget();
{
const auto form = page->addForm(tr("Hotkeys"));
Expand Down
23 changes: 9 additions & 14 deletions src/widgets/framelesswindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,26 +75,16 @@ void FramelessWindow::toggleTransparentInput()
TransparentInput(this, transparent_input_);
}

void FramelessWindow::mousePressEvent(QMouseEvent *event)
{
if (!isFullScreen() && event->button() == Qt::LeftButton) {
windowHandle()->startSystemMove();
return;
}

return QWidget::mousePressEvent(event);
}

void FramelessWindow::closeEvent(QCloseEvent *event)
{
emit closed();
return QWidget::closeEvent(event);
QWidget::closeEvent(event);
}

void FramelessWindow::hideEvent(QHideEvent *event)
{
emit hidden();
return QWidget::hideEvent(event);
QWidget::hideEvent(event);
}

void FramelessWindow::changeEvent(QEvent *event)
Expand All @@ -109,7 +99,7 @@ void FramelessWindow::changeEvent(QEvent *event)
}

#ifdef Q_OS_LINUX
void FramelessWindow::updateCursor(Qt::Edges edges)
void FramelessWindow::updateCursor(const Qt::Edges edges)
{
switch (edges) {
case Qt::LeftEdge:
Expand All @@ -130,7 +120,12 @@ bool FramelessWindow::event(QEvent *event)
switch (event->type()) {
case QEvent::MouseButtonPress:
if (edges_) {
window()->windowHandle()->startSystemResize(edges_);
windowHandle()->startSystemResize(edges_);
return true;
}

if(dynamic_cast<QMouseEvent *>(event)->button() == Qt::LeftButton) {
windowHandle()->startSystemMove();
return true;
}
break;
Expand Down
2 changes: 0 additions & 2 deletions src/widgets/framelesswindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ public slots:
void fullscreened();

protected:
void mousePressEvent(QMouseEvent *event) override;

void closeEvent(QCloseEvent *) override;
void hideEvent(QHideEvent *event) override;
void changeEvent(QEvent *) override;
Expand Down

0 comments on commit 7521439

Please sign in to comment.