diff --git a/Changes.md b/Changes.md index 1187138f2c5..e058c16cefe 100644 --- a/Changes.md +++ b/Changes.md @@ -5,6 +5,7 @@ Improvements ------------ - SetFilter, StandardAttributes, StandardOptions : Added syntax highlighting and auto-complete for set expressions. +- NodeEditor, UIEditor, PythonEditor : Added popup hint for the Ctrl+Return shortcut. - CodeWidget : Added highlighting of braces and operators. Fixes diff --git a/python/GafferUI/MultiLineTextWidget.py b/python/GafferUI/MultiLineTextWidget.py index de94f2cabdd..2237e1d03c8 100644 --- a/python/GafferUI/MultiLineTextWidget.py +++ b/python/GafferUI/MultiLineTextWidget.py @@ -327,6 +327,8 @@ def dropTextSignal( self ) : def _emitEditingFinished( self ) : self.editingFinishedSignal()( self ) + # Hide our activation hint + self._qtWidget().document().setModified( False ) def __textChanged( self ) : @@ -407,9 +409,12 @@ def __drop( self, widget, event ) : class _PlainTextEdit( QtWidgets.QPlainTextEdit ) : def __init__( self, parent = None ) : + QtWidgets.QPlainTextEdit.__init__( self, parent ) self.__fixedLineHeight = None + self.document().modificationChanged.connect( self.update ) + def setFixedLineHeight( self, fixedLineHeight ) : self.__fixedLineHeight = fixedLineHeight @@ -480,7 +485,10 @@ def paintEvent( self, event ) : QtWidgets.QPlainTextEdit.paintEvent( self, event ) + painter = QtGui.QPainter( self.viewport() ) + if self.isEnabled() : + self.__paintActivationHint( painter ) return # Disabled. We want the text to use faded colours but we can't @@ -488,7 +496,20 @@ def paintEvent( self, event ) : # colours and/or a highlighter. So instead we draw a semi-transparent # overlay the same colour as our background. - painter = QtGui.QPainter( self.viewport() ) color = self.palette().base().color() color.setAlpha( 128 ) painter.fillRect( 0, 0, self.width(), self.height(), color ) + + def __paintActivationHint( self, painter ) : + + if self.isReadOnly() or not self.document().isModified() : + return + + widget = GafferUI.Widget._owner( self ) + if widget is None or ( widget.activatedSignal().numSlots() + widget.editingFinishedSignal().numSlots() ) == 0 : + return + + viewport = self.viewport() + pixmap = GafferUI.Image._qtPixmapFromFile( "ctrlEnter.png" ) + painter.setOpacity( 0.75 ) + painter.drawPixmap( viewport.width() - ( pixmap.width() + 4 ), viewport.height() - ( pixmap.height() + 4 ), pixmap ) diff --git a/resources/graphics.py b/resources/graphics.py index caf4b32c7d6..e4c0ac8d842 100644 --- a/resources/graphics.py +++ b/resources/graphics.py @@ -334,6 +334,7 @@ "ids" : [ "colorPlugValueWidgetSlidersOff", "colorPlugValueWidgetSlidersOn", + "ctrlEnter", ] }, diff --git a/resources/graphics.svg b/resources/graphics.svg index 5c5af7e7e6c..096006ce339 100644 --- a/resources/graphics.svg +++ b/resources/graphics.svg @@ -134,7 +134,8 @@ + inkscape:swatch="solid" + gradientTransform="matrix(1.8190548,0,0,2.0056446,-986.3615,7605.2818)"> + inkscape:snap-to-guides="false" + inkscape:snap-grids="true" + inkscape:snap-global="true" + inkscape:snap-others="false"> This document contains in-application graphics for core gaffer apps. Exports are registered in the sidecar graphics.py file, which lists object IDs (as set in Object Properties -> ID) along with any associated size validation options.This document contains in-application graphics for core gaffer apps. Exports are registered in the sidecar graphics.py file, which lists object IDs (as set in Object Properties -> ID) along with any associated size validation options.All graphics must be aligned to pixel boundaries. It is reccomended to create an export boundary rect with the correct ID in the ExportAreas layer, then construct the artwork on the Artwork layer on top, within its bounds.All graphics must be aligned to pixel boundaries. It is reccomended to create an export boundary rect with the correct ID in the ExportAreas layer, then construct the artwork on the Artwork layer on top, within its bounds. UI GRAPHICS + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#f4f4f4;fill-opacity:1">UI GRAPHICS - Mouse cursors are registered in src/GafferUI/Pointer.cpp.- Cursors should be 32x32 (see https://doc.qt.io/qt-5/qcursor.html#QCursor-3)- The x,y coordinate of the pointer should be set to the coordinates of the pixel to be used when computing mouse/object intersection.- All exports should use the 'pointer' prefix. POINTERS - Use integer pixel width lines where possible.- Use integer pixel width lines where possible.- Align 1px lines to 1/2 pixel gridlines to prevent anti-aliasing.- Odd sized images are valid if its assists center alignment, especially at small scales. - Use standard swatch fills/strokes where possible. POINTERS - PathFilterUI, SetFilterUI + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#f4f4f4;fill-opacity:1">POINTERS - PathFilterUI, SetFilterUI ARROWS 10x10 CATALOGUE STATUS + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#f4f4f4;fill-opacity:1">CATALOGUE STATUS SCENE VIEW IMAGE VIEW + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#f4f4f4;fill-opacity:1">IMAGE VIEW TOOLS BROWSER ICONS + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#f4f4f4;fill-opacity:1">BROWSER ICONS @@ -1020,19 +1023,19 @@ id="path1808" /> CONTROLS - checkBox CONTROLS - switch + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#f4f4f4;fill-opacity:1;stroke-width:1.00001">CONTROLS - switch Editor Focus Menu + style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> Viewer 25x25 + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#f4f4f4;fill-opacity:1;stroke-width:1">Viewer 25x25 Notifications + style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:20.0224px;line-height:125%;font-family:'Apple LiSung';-inkscape-font-specification:'Apple LiSung Light';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#3c3c3c;fill-opacity:1;stroke:none"> @@ -1262,7 +1265,7 @@ inkscape:label="#path3908" sodipodi:nodetypes="sssss" inkscape:connector-curvature="0" - style="opacity:0.98999999;fill:none;stroke:#3c3c3c;stroke-width:0.99999994;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" + style="opacity:0.99;fill:none;stroke:#3c3c3c;stroke-width:1;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1" d="m 374.40125,245.77892 c -7.16587,0 -12.97497,5.80909 -12.97497,12.97496 0,7.16589 5.8091,12.97497 12.97497,12.97497 7.16587,0 12.97496,-5.80908 12.97496,-12.97497 0,-7.16587 -5.80909,-12.97496 -12.97496,-12.97496 z" id="path4261" /> + style="opacity:1;fill:url(#foreground);fill-opacity:1;stroke:none;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> Tab icons + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#f4f4f4;fill-opacity:1;stroke-width:1">Tab icons Color Inspector Icons + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#f4f4f4;fill-opacity:1;stroke-width:1.00001">Color Inspector Icons + style="display:inline;opacity:1;fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> GraphEditor + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#f4f4f4;fill-opacity:1;stroke-width:1">GraphEditor + style="fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> PlugValueWidgets + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#f4f4f4;fill-opacity:1;stroke-width:1">PlugValueWidgets LightEditor + style="display:inline;opacity:1;fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> TweakModes + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#f4f4f4;fill-opacity:1;stroke-width:1">TweakModes + style="display:inline;opacity:1;fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> Menus + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#f4f4f4;fill-opacity:1;stroke-width:1">Menus HierarchyView + y="2708.5918" /> SetEditor + style="display:inline;opacity:1;fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> LocalJobs + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:16px;font-family:'Liberation Sans';-inkscape-font-specification:'Liberation Sans';fill:#f4f4f4;fill-opacity:1;stroke-width:1">LocalJobs + style="display:inline;fill:#69ffa5;fill-opacity:0.992157;stroke:#3c3c3c;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + inkscape:label="#path3352" + d="" /> RenderPassEditor + + + + + + + + + + + + + +