Commit 012a26e5 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Use mnemonics for the section items Alt+Letter shortcuts

They will localize better and it won't collide with other mnemonics
parent 1943cb97
......@@ -18,19 +18,30 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
import QtQml 2.0
import QtQuick 2.5
import QtQuick.Controls 2.0
import org.kde.kirigami 2.0 as Kirigami
import org.kde.kirigami 2.3 as Kirigami
Kirigami.BasicListItem {
Kirigami.BasicListItem
{
id: item
property QtObject action: null
checked: action.checked
icon: action.iconName
label: action.text
separatorVisible: false
visible: action.enabled
onClicked: {
drawer.resetMenu()
action.trigger()
}
Kirigami.MnemonicData.enabled: item.enabled && item.visible
Kirigami.MnemonicData.controlType: Kirigami.MnemonicData.MenuItem
Kirigami.MnemonicData.label: action.text
label: Kirigami.MnemonicData.richTextLabel
readonly property var p0: Shortcut {
sequence: item.Kirigami.MnemonicData.sequence
onActivated: item.clicked()
}
}
......@@ -48,7 +48,6 @@ Kirigami.ApplicationWindow
text: i18n("Discover")
component: topBrowsingComp
objectName: "discover"
shortcut: "Alt+D"
}
TopLevelPageData {
......@@ -65,7 +64,6 @@ Kirigami.ApplicationWindow
text: i18n("Installed")
component: topInstalledComp
objectName: "installed"
shortcut: "Alt+I"
}
TopLevelPageData {
id: updateAction
......@@ -73,7 +71,6 @@ Kirigami.ApplicationWindow
text: ResourcesModel.updatesCount<=0 ? (ResourcesModel.isFetching ? i18n("Checking for updates...") : i18n("No Updates") ) : i18nc("Update section name", "Update (%1)", ResourcesModel.updatesCount)
component: topUpdateComp
objectName: "update"
shortcut: "Alt+U"
}
TopLevelPageData {
id: settingsAction
......@@ -81,7 +78,6 @@ Kirigami.ApplicationWindow
text: i18n("Settings")
component: topSourcesComp
objectName: "settings"
shortcut: "Alt+S"
}
Action {
......
......@@ -33,6 +33,7 @@
<file>qml/ActionListItem.qml</file>
<file>qml/LoadingPage.qml</file>
<file>qml/SearchField.qml</file>
<file>qml/MnemonicSupport.qml</file>
<file>qml/navigation.js</file>
</qresource>
......
......@@ -146,6 +146,7 @@ void DummyBackend::checkForUpdates()
toggleFetching();
populate(QStringLiteral("Moar"));
QTimer::singleShot(500, this, &DummyBackend::toggleFetching);
qDebug() << "DummyBackend::checkForUpdates";
}
AbstractResource * DummyBackend::resourceForFile(const QUrl& path)
......
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