From fdd47f83e883d78e9ac0af41915dfbf3ab112ac0 Mon Sep 17 00:00:00 2001 From: Zack Rauen Date: Sat, 5 Feb 2022 18:13:38 -0500 Subject: [PATCH] Add hover and quick suggestion options --- assets/locales/en-us.json | 8 ++++++++ renderer/src/data/settings.js | 4 +++- renderer/src/ui/customcss/editor.jsx | 6 ++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/assets/locales/en-us.json b/assets/locales/en-us.json index 1bd4be40..ac6b12c5 100644 --- a/assets/locales/en-us.json +++ b/assets/locales/en-us.json @@ -91,6 +91,14 @@ "name": "Minimap", "note": "Enables showing the code minimap on the side of the editor" }, + "hover": { + "name": "Reference Tooltips", + "note": "Enables showing the reference tooltips when hovering rules and selectors" + }, + "quickSuggestions": { + "name": "Quick Suggestions", + "note": "Enables showing the autocomplete suggestions as you type" + }, "renderWhitespace": { "name": "Show Whitespace", "note": "When whitespace should be shown by the editor", diff --git a/renderer/src/data/settings.js b/renderer/src/data/settings.js index d9559f84..10d50b82 100644 --- a/renderer/src/data/settings.js +++ b/renderer/src/data/settings.js @@ -40,8 +40,10 @@ export default [ shown: false, settings: [ {type: "switch", id: "lineNumbers", value: true}, - {type: "number", id: "fontSize", min: 2, value: 14}, {type: "switch", id: "minimap", value: true}, + {type: "switch", id: "hover", value: true}, + {type: "switch", id: "quickSuggestions", value: true}, + {type: "number", id: "fontSize", min: 2, value: 14}, {type: "dropdown", id: "renderWhitespace", value: "selection", options: [{value: "none"}, {value: "all"}, {value: "selection"}]} ] }, diff --git a/renderer/src/ui/customcss/editor.jsx b/renderer/src/ui/customcss/editor.jsx index a9aaec50..daf83b90 100644 --- a/renderer/src/ui/customcss/editor.jsx +++ b/renderer/src/ui/customcss/editor.jsx @@ -39,6 +39,12 @@ export default class CodeEditor extends React.Component { fontSize: Settings.get("settings", "editor", "fontSize"), lineNumbers: Settings.get("settings", "editor", "lineNumbers"), minimap: {enabled: Settings.get("settings", "editor", "minimap")}, + hover: {enabled: Settings.get("settings", "editor", "hover")}, + quickSuggestions: { + other: Settings.get("settings", "editor", "quickSuggestions"), + comments: Settings.get("settings", "editor", "quickSuggestions"), + strings: Settings.get("settings", "editor", "quickSuggestions") + }, renderWhitespace: Settings.get("settings", "editor", "renderWhitespace") });