Make settings icon open a more complete menu
This commit is contained in:
parent
22e7dc7e8d
commit
03e4f9b85e
|
@ -420,6 +420,12 @@ class Backend:
|
||||||
return Path(self.appdirs.user_config_dir)
|
return Path(self.appdirs.user_config_dir)
|
||||||
|
|
||||||
|
|
||||||
|
async def get_theme_dir(self) -> Path:
|
||||||
|
path = Path(self.appdirs.user_data_dir) / "themes"
|
||||||
|
path.mkdir(parents=True, exist_ok=True)
|
||||||
|
return path
|
||||||
|
|
||||||
|
|
||||||
async def load_settings(self) -> tuple:
|
async def load_settings(self) -> tuple:
|
||||||
"""Return parsed user config files."""
|
"""Return parsed user config files."""
|
||||||
|
|
||||||
|
|
|
@ -15,11 +15,41 @@ Rectangle {
|
||||||
HButton {
|
HButton {
|
||||||
backgroundColor: "transparent"
|
backgroundColor: "transparent"
|
||||||
icon.name: "settings"
|
icon.name: "settings"
|
||||||
toolTip.text: qsTr("Open config folder")
|
toolTip.text: qsTr("Settings")
|
||||||
|
onClicked: settingsMenu.open()
|
||||||
onClicked: py.callCoro("get_config_dir", [], Qt.openUrlExternally)
|
|
||||||
|
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
||||||
|
HMenu {
|
||||||
|
id: settingsMenu
|
||||||
|
y: parent.height
|
||||||
|
|
||||||
|
HMenuItem {
|
||||||
|
icon.name: "more-settings"
|
||||||
|
text: qsTr("Open config folder")
|
||||||
|
onTriggered:
|
||||||
|
py.callCoro("get_config_dir", [], Qt.openUrlExternally)
|
||||||
|
}
|
||||||
|
|
||||||
|
HMenuItem {
|
||||||
|
icon.name: "theme"
|
||||||
|
text: qsTr("Open theme folder")
|
||||||
|
onTriggered:
|
||||||
|
py.callCoro("get_theme_dir", [], Qt.openUrlExternally)
|
||||||
|
}
|
||||||
|
|
||||||
|
HMenuItem {
|
||||||
|
icon.name: "reload-config-files"
|
||||||
|
text: qsTr("Reload config & theme")
|
||||||
|
onTriggered: mainUI.reloadSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
HMenuItem {
|
||||||
|
icon.name: "debug"
|
||||||
|
text: qsTr("Developer console")
|
||||||
|
onTriggered: mainUI.debugConsole.toggle()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HButton {
|
HButton {
|
||||||
|
|
3
src/icons/thin/more-settings.svg
Normal file
3
src/icons/thin/more-settings.svg
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="m17 10.645v-2.29c-1.17-.417-1.907-.533-2.28-1.431-.373-.9.07-1.512.6-2.625l-1.618-1.619c-1.105.525-1.723.974-2.626.6-.9-.373-1.017-1.116-1.431-2.28h-2.29c-.412 1.158-.53 1.907-1.431 2.28h-.001c-.9.374-1.51-.07-2.625-.6l-1.617 1.619c.527 1.11.973 1.724.6 2.625-.375.901-1.123 1.019-2.281 1.431v2.289c1.155.412 1.907.531 2.28 1.431.376.908-.081 1.534-.6 2.625l1.618 1.619c1.107-.525 1.724-.974 2.625-.6h.001c.9.373 1.018 1.118 1.431 2.28h2.289c.412-1.158.53-1.905 1.437-2.282h.001c.894-.372 1.501.071 2.619.602l1.618-1.619c-.525-1.107-.974-1.723-.601-2.625.374-.899 1.126-1.019 2.282-1.43zm-8.5 1.689c-1.564 0-2.833-1.269-2.833-2.834s1.269-2.834 2.833-2.834 2.833 1.269 2.833 2.834-1.269 2.834-2.833 2.834zm15.5 4.205v-1.077c-.55-.196-.897-.251-1.073-.673-.176-.424.033-.711.282-1.236l-.762-.762c-.52.248-.811.458-1.235.283s-.479-.525-.674-1.073h-1.076c-.194.545-.25.897-.674 1.073s-.711-.033-1.235-.283l-.762.762c.248.523.458.812.282 1.236s-.528.479-1.073.673v1.077c.544.193.897.25 1.073.673.177.427-.038.722-.282 1.236l.762.762c.521-.248.812-.458 1.235-.283.424.175.479.526.674 1.073h1.076c.194-.545.25-.897.676-1.074h.001c.421-.175.706.034 1.232.284l.762-.762c-.247-.521-.458-.812-.282-1.235s.529-.481 1.073-.674zm-4 .794c-.736 0-1.333-.597-1.333-1.333s.597-1.333 1.333-1.333 1.333.597 1.333 1.333-.597 1.333-1.333 1.333zm-4 3.071v-.808c-.412-.147-.673-.188-.805-.505s.024-.533.212-.927l-.572-.571c-.389.186-.607.344-.926.212s-.359-.394-.506-.805h-.807c-.146.409-.188.673-.506.805-.317.132-.533-.024-.926-.212l-.572.571c.187.393.344.609.212.927s-.396.359-.805.505v.808c.408.145.673.188.805.505.133.32-.028.542-.212.927l.572.571c.39-.186.608-.344.926-.212s.359.395.506.805h.807c.146-.409.188-.673.507-.805h.001c.315-.131.529.025.924.213l.572-.571c-.186-.391-.344-.609-.212-.927s.397-.361.805-.506zm-3 .596c-.552 0-1-.447-1-1s.448-1 1-1 1 .447 1 1-.448 1-1 1z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.9 KiB |
3
src/icons/thin/theme.svg
Normal file
3
src/icons/thin/theme.svg
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="m0 21.398c5.504.456 3.533-5.392 8.626-5.445l2.206 1.841c.549 6.645-7.579 8.127-10.832 3.604zm16.878-8.538c1.713-2.687 7.016-11.698 7.016-11.698.423-.747-.515-1.528-1.17-.976 0 0-7.887 6.857-10.213 9.03-1.838 1.719-1.846 2.504-2.441 5.336l2.016 1.681c2.67-1.098 3.439-1.248 4.792-3.373z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 393 B |
Loading…
Reference in New Issue
Block a user