Commit d2dda98e authored by Tranter Madi's avatar Tranter Madi 🌧 Committed by Nate Graham
Browse files

Add F11 hotkey for toggling Party Mode

parent 6ff6557e
Pipeline #63842 passed with stage
in 7 minutes and 53 seconds
......@@ -208,6 +208,13 @@ void ElisaApplication::setupActions(const QString &actionName)
d->mCollection.addAction(findAction->objectName(), findAction);
}
if (actionName == QLatin1String("togglePartyMode") && KAuthorized::authorizeAction(actionName)) {
auto togglePartyModeAction = d->mCollection.addAction(actionName, this, &ElisaApplication::togglePartyMode);
togglePartyModeAction->setText(i18n("Toggle Party Mode"));
d->mCollection.setDefaultShortcut(togglePartyModeAction, QKeySequence(Qt::Key_F11));
d->mCollection.addAction(togglePartyModeAction->objectName(), togglePartyModeAction);
}
d->mCollection.readSettings();
#endif
}
......@@ -329,6 +336,8 @@ void ElisaApplication::previousTrack() {}
void ElisaApplication::playPause() {}
void ElisaApplication::togglePartyMode() {}
void ElisaApplication::configChanged()
{
auto currentConfiguration = Elisa::ElisaConfiguration::self();
......
......@@ -209,6 +209,8 @@ private Q_SLOTS:
void find();
void togglePartyMode();
void togglePlaylist();
void seek();
......
......@@ -67,6 +67,7 @@ Kirigami.ApplicationWindow {
property var previousTrackAction: ElisaApplication.action("PreviousTrack")
property var playPauseAction: ElisaApplication.action("Play-Pause")
property var findAction: ElisaApplication.action("edit_find")
property var togglePartyModeAction: ElisaApplication.action("togglePartyMode")
property var mediaPlayerControl: Kirigami.Settings.isMobile ? mobileFooterBarLoader.item : headerBarLoader.item
......@@ -105,6 +106,11 @@ Kirigami.ApplicationWindow {
onTriggered: persistentSettings.expandedFilterView = !persistentSettings.expandedFilterView
}
Action {
shortcut: togglePartyModeAction.shortcut
onTriggered: mediaPlayerControl.isMaximized = !mediaPlayerControl.isMaximized
}
SystemPalette {
id: myPalette
colorGroup: SystemPalette.Active
......
......@@ -47,7 +47,7 @@ BasePlayerControl {
FlatButtonWithToolTip {
id: minimizeMaximizeButton
text: i18nc("toggle between maximized and minimized ivre", "Toggle Maximize")
text: i18nc("toggle the party mode", "Toggle Party Mode")
icon.name: musicWidget.isMaximized ? "draw-arrow-up" : "draw-arrow-down"
onClicked: musicWidget.isMaximized = !musicWidget.isMaximized
}
......
......@@ -49,9 +49,9 @@ MenuBar {
title: i18nc("menu category", "View")
MenuItem {
text: mediaPlayerControl.item && mediaPlayerControl.item.isMaximized ? i18nc("menu entry", "Collapse Player") : i18nc("menu entry", "Expand Player")
iconName: mediaPlayerControl.item && mediaPlayerControl.item.isMaximized ? "arrow-up" : "expand"
onTriggered: mediaPlayerControl.item.isMaximized = !mediaPlayerControl.item.isMaximized
text: i18nc("menu entry", "Toggle Party Mode")
iconName: mediaPlayerControl && mediaPlayerControl.isMaximized ? "arrow-up" : "expand"
onTriggered: mediaPlayerControl.isMaximized = !mediaPlayerControl.isMaximized
}
MenuItem {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment