Skip to content

Commit

Permalink
feat: Add option to change volume step size
Browse files Browse the repository at this point in the history
  • Loading branch information
luisbocanegra authored and ccatterina committed Jul 28, 2024
1 parent b2718d9 commit 7f850bc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/contents/config/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,8 @@
<entry name="textScrollingResetOnPause" type="Bool">
<default>false</default>
</entry>
<entry name="volumeStep" type="Int">
<default>5</default>
</entry>
</group>
</kcfg>
11 changes: 10 additions & 1 deletion src/contents/ui/ConfigGeneral.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ KCM.SimpleKCM {
property alias cfg_textScrollingBehaviour: scrollingBehaviourRadio.value
property alias cfg_textScrollingEnabled: textScrollingEnabledCheckbox.checked
property alias cfg_textScrollingResetOnPause: textScrollingResetOnPauseCheckbox.checked

property alias cfg_useCustomFont: customFontCheckbox.checked
property alias cfg_customFont: fontDialog.fontChosen
property alias cfg_volumeStep: volumeStepSpinbox.value

Kirigami.FormLayout {
Kirigami.Separator {
Expand Down Expand Up @@ -174,6 +174,15 @@ KCM.SimpleKCM {
text: i18n("Show music controls in the panel (play/pause/previous/next)")
Kirigami.FormData.label: i18n("Show controls:")
}

SpinBox {
id: volumeStepSpinbox
Kirigami.FormData.label: i18n("Volume step:")
from: 1
to: 100
textFromValue: function(text) { return text + "%"; }
valueFromText: function(value) { return parseInt(value); }
}
}

QtDialogs.FontDialog {
Expand Down
2 changes: 1 addition & 1 deletion src/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ PlasmoidItem {
readonly property font boldTextFont: Qt.font(Object.assign({}, textFont, {weight: Font.Bold}))
readonly property bool textScrollingEnabled: plasmoid.configuration.textScrollingEnabled
readonly property bool textScrollingResetOnPause: plasmoid.configuration.textScrollingResetOnPause
readonly property int volumeStep: 5
readonly property int volumeStep: plasmoid.configuration.volumeStep

toolTipTextFormat: Text.PlainText
toolTipMainText: player.playbackStatus > Mpris.PlaybackStatus.Stopped ? player.title : i18n("No media playing")
Expand Down

0 comments on commit 7f850bc

Please sign in to comment.