22
'''Auto code generator for overlay widgets related parameters in Preferences/View
26
from os import sys, path
29
sys.path.append(path.join(path.dirname(path.dirname(path.abspath(__file__))), 'Tools'))
32
from params_utils import ParamBool, ParamInt, ParamString, ParamUInt, ParamHex, \
33
ParamFloat, ParamProxy, ParamLinePattern, ParamFile, \
34
ParamComboBox, ParamColor, ParamSpinBox, auto_comment
37
ClassName = 'OverlayParams'
38
ParamPath = 'User parameter:BaseApp/Preferences/View'
39
ClassDoc = 'Convenient class to obtain overlay widgets related parameters'
41
AnimationCurveTypes = (
85
class ParamAnimationCurve(ParamProxy):
86
WidgetType = 'Gui::PrefComboBox'
88
def widget_setter(self, _param):
91
def init_widget(self, param, row, group_name):
92
super().init_widget(param, row, group_name)
95
for (const auto &item : OverlayParams::AnimationCurveTypes)
96
{param.widget_name}->addItem(item);''')
98
{param.widget_name}->setCurrentIndex({param.namespace}::{param.class_name}::default{param.name}());''')
101
ParamBool('DockOverlayAutoView', True, on_change=True, title="Auto hide in non 3D view"),
102
ParamInt('DockOverlayDelay', 200, "Overlay dock (re),layout delay.", title="Layout delay (ms)", proxy=ParamSpinBox(0, 5000, 100)),
103
ParamInt('DockOverlayRevealDelay', 2000),
104
ParamInt('DockOverlaySplitterHandleTimeout', 0, title="Splitter auto hide delay (ms)", proxy=ParamSpinBox(0, 99999, 100),
105
doc="Overlay splitter handle auto hide delay. Set zero to disable auto hiding."),
106
ParamBool('DockOverlayActivateOnHover', True, title="Activate on hover",
107
doc="Show auto hidden dock overlay on mouse over.\n"
108
"If disabled, then show on mouse click."),
109
ParamBool('DockOverlayAutoMouseThrough', True,
110
"Auto mouse click through transparent part of dock overlay.", title="Auto mouse pass through"),
111
ParamBool('DockOverlayWheelPassThrough', True,
112
"Auto pass through mouse wheel event on transparent dock overlay.", title="Auto mouse wheel pass through"),
113
ParamInt('DockOverlayWheelDelay', 1000, title="Delay mouse wheel pass through (ms)", proxy=ParamSpinBox(0, 99999, 1),
114
doc="Delay capturing mouse wheel event for passing through if it is\n"
115
"previously handled by other widget."),
116
ParamInt('DockOverlayAlphaRadius', 2, title="Alpha test radius", proxy=ParamSpinBox(1, 100, 1), doc=\
117
"If auto mouse click through is enabled, then this radius\n"
118
"defines a region of alpha test under the mouse cursor.\n"
119
"Auto click through is only activated if all pixels within\n"
120
"the region are non-opaque."),
121
ParamBool('DockOverlayCheckNaviCube', True, on_change=True, title="Check Navigation Cube",
122
doc="Leave space for Navigation Cube in dock overlay"),
123
ParamInt('DockOverlayHintTriggerSize', 16, title="Hint trigger size", proxy=ParamSpinBox(1, 100, 1),
124
doc="Auto hide hint visual display triggering width"),
125
ParamInt('DockOverlayHintSize', 8, title="Hint width", proxy=ParamSpinBox(1, 100, 1),
126
doc="Auto hide hint visual display width"),
127
ParamInt('DockOverlayHintLeftLength', 100, title='Left panel hint length', proxy=ParamSpinBox(0, 10000, 10),
128
doc="Auto hide hint visual display length for left panel. Set to zero to fill the space."),
129
ParamInt('DockOverlayHintRightLength', 100, title='Right panel hint length', proxy=ParamSpinBox(0, 10000, 10),
130
doc="Auto hide hint visual display length for right panel. Set to zero to fill the space."),
131
ParamInt('DockOverlayHintTopLength', 100, title='Top panel hint length', proxy=ParamSpinBox(0, 10000, 10),
132
doc="Auto hide hint visual display length for top panel. Set to zero to fill the space."),
133
ParamInt('DockOverlayHintBottomLength', 100, title='Bottom panel hint length', proxy=ParamSpinBox(0, 10000, 10),
134
doc="Auto hide hint visual display length for bottom panel. Set to zero to fill the space."),
135
ParamInt('DockOverlayHintLeftOffset', 0, title='Left panel hint offset', proxy=ParamSpinBox(0, 10000, 10),
136
doc="Auto hide hint visual display offset for left panel"),
137
ParamInt('DockOverlayHintRightOffset', 0, title='Right panel hint offset', proxy=ParamSpinBox(0, 10000, 10),
138
doc="Auto hide hint visual display offset for right panel"),
139
ParamInt('DockOverlayHintTopOffset', 0, title='Top panel hint offset', proxy=ParamSpinBox(0, 10000, 10),
140
doc="Auto hide hint visual display offset for top panel"),
141
ParamInt('DockOverlayHintBottomOffset', 0, title='Bottom panel hint offset', proxy=ParamSpinBox(0, 10000, 10),
142
doc="Auto hide hint visual display offset for bottom panel"),
143
ParamBool('DockOverlayHintTabBar', False, "Show tab bar on mouse over when auto hide", title="Hint show tab bar"),
144
ParamBool('DockOverlayHideTabBar', True, on_change=True, doc="Hide tab bar in dock overlay", title='Hide tab bar'),
145
ParamInt('DockOverlayHintDelay', 200, "Delay before show hint visual", title="Hint delay (ms)", proxy=ParamSpinBox(0, 1000, 100)),
146
ParamInt('DockOverlayAnimationDuration', 200, "Auto hide animation duration, 0 to disable",
147
title="Animation duration (ms)", proxy=ParamSpinBox(0, 5000, 100)),
148
ParamInt('DockOverlayAnimationCurve', 7, "Auto hide animation curve type", title="Animation curve type", proxy=ParamAnimationCurve()),
149
ParamBool('DockOverlayHidePropertyViewScrollBar', False, "Hide property view scroll bar in dock overlay", title="Hide property view scroll bar"),
150
ParamInt('DockOverlayMinimumSize', 30, on_change=True,
151
doc="Minimum overlay dock widget width/height",
152
title="Minimum dock widget size"),
161
params_utils.declare_begin(sys.modules[__name__])
164
static const std::vector<QString> AnimationCurveTypes;
166
params_utils.declare_end(sys.modules[__name__])
169
params_utils.define(sys.modules[__name__])
172
const std::vector<QString> OverlayParams::AnimationCurveTypes = {{''')
173
for item in AnimationCurveTypes:
175
QStringLiteral("{item}"),''')
181
params_utils.init_params(Params, NameSpace, ClassName, ParamPath)