Skip to content

Commit 794d287

Browse files
committed
Added missing tooltips and better handling of splitter
1 parent aa71ccc commit 794d287

File tree

3 files changed

+53
-9
lines changed

3 files changed

+53
-9
lines changed

plugindevtools/PluginDevTools/DockerWidget.ui

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,9 @@
343343
<layout class="QHBoxLayout" name="horizontalLayout_5">
344344
<item>
345345
<widget class="QToolButton" name="consoleClearBtn">
346+
<property name="toolTip">
347+
<string>Clear Console</string>
348+
</property>
346349
<property name="text">
347350
<string>...</string>
348351
</property>
@@ -377,6 +380,9 @@
377380
</item>
378381
<item>
379382
<widget class="QToolButton" name="consoleTempScriptFileBtn">
383+
<property name="toolTip">
384+
<string>Create a temporary file and open it in a default text editor. If execute on save is selected, saving will automatically execute the script inside krita making your favorite text editor work like scripter</string>
385+
</property>
380386
<property name="text">
381387
<string>...</string>
382388
</property>
@@ -387,6 +393,9 @@
387393
</item>
388394
<item>
389395
<widget class="QToolButton" name="consoleSetScriptFileBtn">
396+
<property name="toolTip">
397+
<string>Pick a file and open it in a default text editor. If execute on save is selected, saving will automatically execute the script inside krita making your favorite text editor work like scripter</string>
398+
</property>
390399
<property name="text">
391400
<string>...</string>
392401
</property>

plugindevtools/PluginDevTools/EventViewerWidget.ui

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
</property>
4444
<item>
4545
<widget class="QToolButton" name="startBtn">
46+
<property name="toolTip">
47+
<string>Start/Stop monitoring events</string>
48+
</property>
4649
<property name="text">
4750
<string>...</string>
4851
</property>
@@ -54,6 +57,9 @@
5457
</item>
5558
<item>
5659
<widget class="QToolButton" name="clearBtn">
60+
<property name="toolTip">
61+
<string>Clear events</string>
62+
</property>
5763
<property name="text">
5864
<string>...</string>
5965
</property>
@@ -65,6 +71,14 @@
6571
</item>
6672
<item>
6773
<widget class="QComboBox" name="outputCmb">
74+
<property name="toolTip">
75+
<string>Where to output?
76+
ev = where events are outputed
77+
std = where stdout/stderr is outputted
78+
show = show events/stdout/stderr into this gui
79+
terminal = show events/stdout/stderr into terminal
80+
</string>
81+
</property>
6882
<item>
6983
<property name="text">
7084
<string>ev: show|std: terminal</string>
@@ -84,6 +98,13 @@
8498
</item>
8599
<item>
86100
<widget class="QComboBox" name="formatOutputCmb">
101+
<property name="toolTip">
102+
<string>How to handle duplicate signal/event output in a row?
103+
First = show only first, ignore the rest
104+
All folded = Show them all but fold them
105+
All unfolded = Show them all unfolded
106+
</string>
107+
</property>
87108
<item>
88109
<property name="text">
89110
<string>First only</string>
@@ -186,6 +207,13 @@
186207
</property>
187208
<item>
188209
<widget class="QComboBox" name="eventFilterTypeCmb">
210+
<property name="toolTip">
211+
<string>Events are monitored via installEventFilter.
212+
widget.installEventFilter = installs the event filter on the widget itself
213+
QApplication.instance().installEventFilter = installs event filter on the QApplication.
214+
(This is slower than widget as QApplication process a lot of events, but some events don't bubble down and this is the only way)
215+
</string>
216+
</property>
189217
<item>
190218
<property name="text">
191219
<string>widget.installEventFilter(self)</string>

plugindevtools/PluginDevTools/PluginDevToolsWidget.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import pprint
1414
from datetime import datetime
1515
import sys
16+
import random
1617

1718

1819
from .GetKritaAPI import *
@@ -90,8 +91,15 @@ class PluginDevToolsWelcome():
9091
def __init__(self, caller):
9192
super().__init__()
9293
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+
]
93100

94101
def selected(self):
102+
self.caller.centralWidget.welcomeLabel.setText("Welcome to Plugin Developer Tools!\n\nRandom Tip:\n\n" + random.choice(self.tips) )
95103
pass
96104

97105
def unselected(self):
@@ -1193,19 +1201,18 @@ def __init__(self, caller):
11931201
self.caller.centralWidget.inspectorFilter.textChanged.connect(self.searchTreeFilter)
11941202
self.caller.centralWidget.inspectorTableFilter.textChanged.connect(self.searchTableFilter)
11951203

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)
11981208
self.firstRun = False
11991209

12001210
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)
12061214
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)
12091216

12101217
def selected(self):
12111218
if not self.firstRun:

0 commit comments

Comments
 (0)