diff --git a/direct/src/gui/DirectDialog.py b/direct/src/gui/DirectDialog.py index 44cb182ab0..17ace40dca 100644 --- a/direct/src/gui/DirectDialog.py +++ b/direct/src/gui/DirectDialog.py @@ -94,8 +94,8 @@ class DirectDialog(DirectFrame): ('text', '', None), ('text_align', TextNode.ALeft, None), ('text_scale', 0.06, None), - ('image', None, None), - ('relief', DGG.RAISED, None), + ('image', DGG.getDefaultDialogGeom(), None), + ('relief', DGG.getDefaultDialogRelief(), None), ('borderWidth', (0.01, 0.01), None), ('buttonTextList', [], DGG.INITOPT), ('buttonGeomList', [], DGG.INITOPT), @@ -316,7 +316,8 @@ class DirectDialog(DirectFrame): # reduce bottom by pad, button height and 2*button pad b = min(b - self['midPad'] - bpad[1] - bHeight - bpad[1], b) - pad[1] t = t + self['topPad'] + pad[1] - self['frameSize'] = (l, r, b, t) + if self['frameSize'] is None: + self['frameSize'] = (l, r, b, t) self['image_scale'] = (r - l, 1, t - b) # Center frame about text and buttons self['image_pos'] = ((l+r)*0.5, 0.0, (b+t)*0.5) diff --git a/direct/src/gui/DirectGuiGlobals.py b/direct/src/gui/DirectGuiGlobals.py index 167d2a99b4..7f42fd0a78 100644 --- a/direct/src/gui/DirectGuiGlobals.py +++ b/direct/src/gui/DirectGuiGlobals.py @@ -14,6 +14,7 @@ defaultFontFunc = TextNode.getDefaultFont defaultClickSound = None defaultRolloverSound = None defaultDialogGeom = None +defaultDialogRelief = PGFrameStyle.TBevelOut drawOrder = 100 panel = None @@ -132,13 +133,16 @@ def setDefaultFontFunc(newFontFunc): def getDefaultDialogGeom(): global defaultDialogGeom - if defaultDialogGeom == None: - defaultDialogGeom = loader.loadModel('models/gui/dialog_box_gui', okMissing = True) return defaultDialogGeom -def setDefaultDialogGeom(newDialogGeom): - global defaultDialogGeom +def getDefaultDialogRelief(): + global defaultDialogRelief + return defaultDialogRelief + +def setDefaultDialogGeom(newDialogGeom, relief=None): + global defaultDialogGeom, defaultDialogRelief defaultDialogGeom = newDialogGeom + defaultDialogRelief = relief def getDefaultDrawOrder(): return drawOrder diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index d1616722a7..da1575fcdd 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -67,6 +67,8 @@ Fixes for the Python API: * MouseWatcherGroup was erroneously not exposed in 1.9.0 * ShowBase no longer unmounts VFS when shutting down * No longer requires setting PATH to import panda3d.* +* DirectDialog default geom is once again respected +* DirectDialog no longer overrides custom frameSize * Fix WebcamVideo/MicrophoneAudio.getOptions() methods Changes relating to the OpenGL renderer: