1
0
Fork 0

[Backend] Add toggle stats.

This commit is contained in:
Kitteh 2018-11-08 18:17:43 +00:00
parent c492c57f82
commit d1606274cc
3 changed files with 8 additions and 3 deletions

View file

@ -163,7 +163,6 @@ MpvPlayerBackend::on_update(void* ctx)
emit self->onUpdate();
}
// connected to onUpdate(); signal makes sure it runs on the GUI thread
void
MpvPlayerBackend::doUpdate()
{
@ -322,6 +321,12 @@ MpvPlayerBackend::toggleOnTop()
AlwaysOnTop(window()->winId(), onTop);
}
void
MpvPlayerBackend::toggleStats()
{
command(QVariantList() << "script-binding" << "stats/display-stats-toggle");
}
void
MpvPlayerBackend::addSpeed(const QVariant& speed)
{

View file

@ -37,6 +37,7 @@ public slots:
void prevPlaylistItem();
void nextPlaylistItem();
void toggleOnTop();
void toggleStats();
void updateDurationStringText();
QVariant getTracks() const;
void updatePrev(const QVariant& val);

View file

@ -665,8 +665,7 @@ ApplicationWindow {
Action {
text: translate.getTranslation("STATS", i18n.language)
onTriggered: {
player.command(
["script-binding", "stats/display-stats-toggle"])
player.toggleStats()
}
shortcut: keybinds.statsForNerds
}