diff --git a/__init__.py b/__init__.py index ebeb905..8308b53 100644 --- a/__init__.py +++ b/__init__.py @@ -45,6 +45,16 @@ "ignore" : ["SettingsProjectScope", "SettingsResourceScope"] } """) +Settings().register_setting("snippets.onTopOfWindows", """ + { + "title": "Keep on Top of Windows", + "type": "boolean", + "default": false, + "description" : "Always stays on top of other windows", + "ignore": ["SettingsProjectScope", "SettingsResourceScope"] + } + """) + snippetPath = os.path.realpath(os.path.join(user_plugin_path(), "..", "snippets")) @@ -280,6 +290,9 @@ def __init__(self, context, parent=None): super(Snippets, self).__init__(parent) # Create widgets self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) + if Settings().get_bool("snippets.onTopOfWindows"): + self.setWindowFlag(Qt.WindowType.WindowStaysOnTopHint, True) + self.setFocusPolicy(Qt.ClickFocus) self.title = QLabel(self.tr("Snippet Editor")) self.saveButton = QPushButton(self.tr("&Save")) self.saveButton.setShortcut(QKeySequence(self.tr("Ctrl+Shift+S")))