...is not the seventh installment in an exciting saga of pirate
adventure on the high seas, but a side effect of a cleanup of the
button styling. Misty Rose is a color, that was and is again used
for buttons created by clicking the script-button button.
Prior to two revisions ago there was a bg parameter to the button
creation commands which did nothing, although it was required, and a
little known way to style individual buttons in the master stylesheet
with
QPushButton#<button text>-button { <style> }
because the button creation machinery sets the QObject name of each
button to the text of the button plus '-button'.
I've tidied up the style code to take advantage of the new stylesheet
macro expansion, and added another property to buttons so they can be
styled by kind (or class or type, but I used the work kind for obvious
reasons :-), as well as individual name. The settings in the
stylesheet are now:
*color names*
@MistyRose1 = #FFE4E1
@LightSteelBlue1 = #CAE1FF
@LightBlue = #ADD8E6
Buttons may be styled by name:
QPushButton#<button text>-button { <style> }
or by kind:
QPushButton[button_kind="<button kind>"] { <style> }
Button kinds are:
'run-script' (the singleton run-script button),
'debug-script',
'script-button-button' (the singleton script-button button),
'script-button' (buttons created by the script-button button),
'generic-button' (default),
'quick-move' from the quickMove plugin,
'interact' from the interact plugin,
'at-button' (created from @button nodes)
Search 'button_kind' below for button styling examples.
*button background colors*
@run-script-btn-bg = @MistyRose1
@debug-script-btn-bg = @MistyRose1
@script-button-button-btn-bg = #ffffcc
@script-button-btn-bg = @MistyRose1
@generic-button-btn-bg = @LightSteelBlue1
@quick-move-btn-bg = @LightSteelBlue1
@interact-btn-bg = @LightBlue
@at-button-btn-bg = @LightSteelBlue1
and then further down a bunch of
QPushButton[button_kind="at-button"] {
background-color: @at-button-btn-bg; }
If a script wants to specifically style a button it creates it can just
call setStyleSheet on the button, although it should use
b.button.setStylesheet("QPushButton { ... }")
and not
b.button.setStylesheet("QWidget { ... }")
because the style will also apply to the context menu for the button.
Cheers -Terry
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.