|
13 | 13 | import pprint |
14 | 14 | from datetime import datetime |
15 | 15 | import sys |
| 16 | +import random |
16 | 17 |
|
17 | 18 |
|
18 | 19 | from .GetKritaAPI import * |
@@ -90,8 +91,15 @@ class PluginDevToolsWelcome(): |
90 | 91 | def __init__(self, caller): |
91 | 92 | super().__init__() |
92 | 93 | self.caller = caller |
| 94 | + self.tips = [ |
| 95 | + "Inspector: Right click the splitter if you want it to display vertically instead of horizontally", |
| 96 | + "Inspector: Use the Event and Signal Viewer/Debugger to latch onto signals and events, be aware some events are only visible at QApplication level so if you see events missing, change widget.installEventFilter to QApplication.installEventFilter under Events", |
| 97 | + "Inspector: Some fields like QString, bools, int, QSize and other can be modified in realtime by double clicking the value field as long as the field has a corresponding 'set', such as 'height' can be changed because 'setHeight' exists", |
| 98 | + "Console: Use your favorite text editor as your Scripter using the buttons on the top right" |
| 99 | + ] |
93 | 100 |
|
94 | 101 | def selected(self): |
| 102 | + self.caller.centralWidget.welcomeLabel.setText("Welcome to Plugin Developer Tools!\n\nRandom Tip:\n\n" + random.choice(self.tips) ) |
95 | 103 | pass |
96 | 104 |
|
97 | 105 | def unselected(self): |
@@ -1193,19 +1201,18 @@ def __init__(self, caller): |
1193 | 1201 | self.caller.centralWidget.inspectorFilter.textChanged.connect(self.searchTreeFilter) |
1194 | 1202 | self.caller.centralWidget.inspectorTableFilter.textChanged.connect(self.searchTableFilter) |
1195 | 1203 |
|
1196 | | - self.caller.centralWidget.inspectorSplitter.setContextMenuPolicy(Qt.CustomContextMenu) |
1197 | | - self.caller.centralWidget.inspectorSplitter.customContextMenuRequested.connect(self.splitterAdjust) |
| 1204 | + self.splitHandle = self.caller.centralWidget.inspectorSplitter.handle(1) |
| 1205 | + self.splitHandle.setToolTip("Right click to change orientation") |
| 1206 | + self.splitHandle.setContextMenuPolicy(Qt.CustomContextMenu) |
| 1207 | + self.splitHandle.customContextMenuRequested.connect(self.splitterAdjust) |
1198 | 1208 | self.firstRun = False |
1199 | 1209 |
|
1200 | 1210 | def splitterAdjust(self,pos): |
1201 | | - splitter = self.caller.centralWidget.inspectorSplitter |
1202 | | - |
1203 | | - if splitter.orientation() == Qt.Vertical: |
1204 | | - if pos.y() >= splitter.sizes()[0] and pos.y() <= splitter.sizes()[0]+splitter.handleWidth(): |
1205 | | - splitter.setOrientation(Qt.Horizontal) |
| 1211 | + |
| 1212 | + if self.splitHandle.orientation() == Qt.Vertical: |
| 1213 | + self.splitHandle.splitter().setOrientation(Qt.Horizontal) |
1206 | 1214 | else: |
1207 | | - if pos.x() >= splitter.sizes()[0] and pos.x() <= splitter.sizes()[0]+splitter.handleWidth(): |
1208 | | - splitter.setOrientation(Qt.Vertical) |
| 1215 | + self.splitHandle.splitter().setOrientation(Qt.Vertical) |
1209 | 1216 |
|
1210 | 1217 | def selected(self): |
1211 | 1218 | if not self.firstRun: |
|
0 commit comments