Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down Expand Up @@ -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")))
Expand Down