Krita Source Code Documentation
Loading...
Searching...
No Matches
photobash_images.photobash_images_modulo.Photobash_Button Class Reference
+ Inheritance diagram for photobash_images.photobash_images_modulo.Photobash_Button:

Public Member Functions

 __init__ (self, parent)
 
 contextMenuEvent (self, event)
 
 enterEvent (self, event)
 
 leaveEvent (self, event)
 
 mouseDoubleClickEvent (self, event)
 
 mouseMoveEvent (self, event)
 
 mousePressEvent (self, event)
 
 paintEvent (self, event)
 
 setFavourite (self, newFavourite)
 
 setFitCanvas (self, newFit)
 
 setImage (self, path, image)
 
 setImageScale (self, newScale)
 
 setNumber (self, number)
 
 sizeHint (self)
 
 wheelEvent (self, event)
 

Public Attributes

 fitCanvasChecked
 
 isFavourite
 
 number
 
 path
 
 scale
 
 scaled_height
 
 scaled_width
 

Static Public Attributes

bool fitCanvasChecked = False
 
bool isFavourite = False
 
 PREVIOUS_DRAG_X = None
 
int scale = 100
 
 SIGNAL_DRAG = pyqtSignal(int)
 
 SIGNAL_FAVOURITE = pyqtSignal(str)
 
 SIGNAL_HOVER = pyqtSignal(str)
 
 SIGNAL_LMB = pyqtSignal(int)
 
 SIGNAL_OPEN_NEW = pyqtSignal(str)
 
 SIGNAL_PREVIEW = pyqtSignal(str)
 
 SIGNAL_REFERENCE = pyqtSignal(str)
 
 SIGNAL_UN_FAVOURITE = pyqtSignal(str)
 
 SIGNAL_WDN = pyqtSignal(int)
 
 SIGNAL_WUP = pyqtSignal(int)
 

Detailed Description

Definition at line 183 of file photobash_images_modulo.py.

Constructor & Destructor Documentation

◆ __init__()

photobash_images.photobash_images_modulo.Photobash_Button.__init__ ( self,
parent )

Definition at line 199 of file photobash_images_modulo.py.

199 def __init__(self, parent):
200 super(Photobash_Button, self).__init__(parent)
201 # Variables
202 self.number = -1
203 # QImage
204 customSetImage(self, None)
205
206 self.scaled_width = 1
207 self.scaled_height = 1
208

References photobash_images.photobash_images_modulo.Photobash_Button.__init__().

Member Function Documentation

◆ contextMenuEvent()

photobash_images.photobash_images_modulo.Photobash_Button.contextMenuEvent ( self,
event )

Definition at line 251 of file photobash_images_modulo.py.

251 def contextMenuEvent(self, event):
252 cmenu = QMenu(self)
253
254 cmenuDisplay = cmenu.addAction("Preview in Docker")
255 favouriteString = "Unpin" if self.isFavourite else "Pin to Beginning"
256 cmenuFavourite = cmenu.addAction(favouriteString)
257 cmenuOpenNew = cmenu.addAction("Open as New Document")
258 cmenuReference = cmenu.addAction("Place as Reference")
259
260 background = QApplication().instance().palette().color(QPalette.ColorRole.Window).name().split("#")[1]
261 cmenuStyleSheet = f"""QMenu {{ background-color: #AA{background}; border: 1px solid #{background}; }}"""
262 cmenu.setStyleSheet(cmenuStyleSheet)
263
264 action = cmenu.exec(self.mapToGlobal(event.pos()))
265 if action == cmenuDisplay:
266 self.SIGNAL_PREVIEW.emit(self.path)
267 if action == cmenuFavourite:
268 if self.isFavourite:
269 self.SIGNAL_UN_FAVOURITE.emit(self.path)
270 else:
271 self.SIGNAL_FAVOURITE.emit(self.path)
272 if action == cmenuOpenNew:
273 self.SIGNAL_OPEN_NEW.emit(self.path)
274 if action == cmenuReference:
275 self.SIGNAL_REFERENCE.emit(self.path)
276
PythonPluginManager * instance
rgba palette[MAX_PALETTE]
Definition palette.c:35

References KisPipeBrushParasite.dim, KisSpinBoxUnitManager.dim, FlattenSpec.dim, xcfLayer.dim, instance, photobash_images.photobash_images_modulo.Photobash_Button.isFavourite, and palette.

◆ enterEvent()

photobash_images.photobash_images_modulo.Photobash_Button.enterEvent ( self,
event )

◆ leaveEvent()

photobash_images.photobash_images_modulo.Photobash_Button.leaveEvent ( self,
event )

Definition at line 227 of file photobash_images_modulo.py.

227 def leaveEvent(self, event):
228 self.SIGNAL_HOVER.emit("None")
229

References photobash_images.photobash_images_modulo.Photobash_Display.SIGNAL_HOVER, and photobash_images.photobash_images_modulo.Photobash_Button.SIGNAL_HOVER.

◆ mouseDoubleClickEvent()

photobash_images.photobash_images_modulo.Photobash_Button.mouseDoubleClickEvent ( self,
event )

Definition at line 236 of file photobash_images_modulo.py.

236 def mouseDoubleClickEvent(self, event):
237 # Prevent double click to open the same image twice
238 pass
239

◆ mouseMoveEvent()

photobash_images.photobash_images_modulo.Photobash_Button.mouseMoveEvent ( self,
event )

Definition at line 240 of file photobash_images_modulo.py.

240 def mouseMoveEvent(self, event):
241 customMouseMoveEvent(self, event)
242

◆ mousePressEvent()

photobash_images.photobash_images_modulo.Photobash_Button.mousePressEvent ( self,
event )

Definition at line 230 of file photobash_images_modulo.py.

230 def mousePressEvent(self, event):
231 if event.modifiers() == Qt.KeyboardModifier.NoModifier and event.buttons() == Qt.MouseButton.LeftButton:
232 self.SIGNAL_LMB.emit(self.number)
233 if event.modifiers() == Qt.KeyboardModifier.AltModifier:
234 self.PREVIOUS_DRAG_X = event.x()
235

References KisNameServer.number(), KoXmlNS.number, photobash_images.photobash_images_modulo.Photobash_Button.number, photobash_images.photobash_images_modulo.Photobash_Button.PREVIOUS_DRAG_X, and photobash_images.photobash_images_modulo.Photobash_Button.SIGNAL_LMB.

◆ paintEvent()

photobash_images.photobash_images_modulo.Photobash_Button.paintEvent ( self,
event )

Definition at line 281 of file photobash_images_modulo.py.

281 def paintEvent(self, event):
282 customPaintEvent(self, event)

References photobash_images.photobash_images_modulo.customPaintEvent().

◆ setFavourite()

photobash_images.photobash_images_modulo.Photobash_Button.setFavourite ( self,
newFavourite )

Definition at line 209 of file photobash_images_modulo.py.

209 def setFavourite(self, newFavourite):
210 self.isFavourite = newFavourite
211

◆ setFitCanvas()

photobash_images.photobash_images_modulo.Photobash_Button.setFitCanvas ( self,
newFit )

Definition at line 215 of file photobash_images_modulo.py.

215 def setFitCanvas(self, newFit):
216 self.fitCanvasChecked = newFit
217

◆ setImage()

◆ setImageScale()

photobash_images.photobash_images_modulo.Photobash_Button.setImageScale ( self,
newScale )

Definition at line 212 of file photobash_images_modulo.py.

212 def setImageScale(self, newScale):
213 self.scale = newScale
214

◆ setNumber()

photobash_images.photobash_images_modulo.Photobash_Button.setNumber ( self,
number )

Definition at line 218 of file photobash_images_modulo.py.

218 def setNumber(self, number):
219 self.number = number
220

References KisNameServer.number(), KoXmlNS.number, and photobash_images.photobash_images_modulo.Photobash_Button.number.

◆ sizeHint()

photobash_images.photobash_images_modulo.Photobash_Button.sizeHint ( self)

Definition at line 221 of file photobash_images_modulo.py.

221 def sizeHint(self):
222 return QSize(2000,2000)
223

◆ wheelEvent()

photobash_images.photobash_images_modulo.Photobash_Button.wheelEvent ( self,
event )

Definition at line 243 of file photobash_images_modulo.py.

243 def wheelEvent(self,event):
244 delta = event.angleDelta()
245 if delta.y() > 20:
246 self.SIGNAL_WUP.emit(0)
247 elif delta.y() < -20:
248 self.SIGNAL_WDN.emit(0)
249

References photobash_images.photobash_images_modulo.Photobash_Button.SIGNAL_WDN, and photobash_images.photobash_images_modulo.Photobash_Button.SIGNAL_WUP.

Member Data Documentation

◆ fitCanvasChecked [1/2]

bool photobash_images.photobash_images_modulo.Photobash_Button.fitCanvasChecked = False
static

Definition at line 195 of file photobash_images_modulo.py.

◆ fitCanvasChecked [2/2]

photobash_images.photobash_images_modulo.Photobash_Button.fitCanvasChecked

Definition at line 216 of file photobash_images_modulo.py.

◆ isFavourite [1/2]

bool photobash_images.photobash_images_modulo.Photobash_Button.isFavourite = False
static

Definition at line 197 of file photobash_images_modulo.py.

◆ isFavourite [2/2]

photobash_images.photobash_images_modulo.Photobash_Button.isFavourite

Definition at line 210 of file photobash_images_modulo.py.

◆ number

photobash_images.photobash_images_modulo.Photobash_Button.number

Definition at line 202 of file photobash_images_modulo.py.

◆ path

photobash_images.photobash_images_modulo.Photobash_Button.path

Definition at line 266 of file photobash_images_modulo.py.

◆ PREVIOUS_DRAG_X

photobash_images.photobash_images_modulo.Photobash_Button.PREVIOUS_DRAG_X = None
static

Definition at line 194 of file photobash_images_modulo.py.

◆ scale [1/2]

int photobash_images.photobash_images_modulo.Photobash_Button.scale = 100
static

Definition at line 196 of file photobash_images_modulo.py.

◆ scale [2/2]

photobash_images.photobash_images_modulo.Photobash_Button.scale

Definition at line 213 of file photobash_images_modulo.py.

◆ scaled_height

photobash_images.photobash_images_modulo.Photobash_Button.scaled_height

Definition at line 207 of file photobash_images_modulo.py.

◆ scaled_width

photobash_images.photobash_images_modulo.Photobash_Button.scaled_width

Definition at line 206 of file photobash_images_modulo.py.

◆ SIGNAL_DRAG

photobash_images.photobash_images_modulo.Photobash_Button.SIGNAL_DRAG = pyqtSignal(int)
static

Definition at line 193 of file photobash_images_modulo.py.

◆ SIGNAL_FAVOURITE

photobash_images.photobash_images_modulo.Photobash_Button.SIGNAL_FAVOURITE = pyqtSignal(str)
static

Definition at line 189 of file photobash_images_modulo.py.

◆ SIGNAL_HOVER

photobash_images.photobash_images_modulo.Photobash_Button.SIGNAL_HOVER = pyqtSignal(str)
static

Definition at line 184 of file photobash_images_modulo.py.

◆ SIGNAL_LMB

photobash_images.photobash_images_modulo.Photobash_Button.SIGNAL_LMB = pyqtSignal(int)
static

Definition at line 185 of file photobash_images_modulo.py.

◆ SIGNAL_OPEN_NEW

photobash_images.photobash_images_modulo.Photobash_Button.SIGNAL_OPEN_NEW = pyqtSignal(str)
static

Definition at line 191 of file photobash_images_modulo.py.

◆ SIGNAL_PREVIEW

photobash_images.photobash_images_modulo.Photobash_Button.SIGNAL_PREVIEW = pyqtSignal(str)
static

Definition at line 188 of file photobash_images_modulo.py.

◆ SIGNAL_REFERENCE

photobash_images.photobash_images_modulo.Photobash_Button.SIGNAL_REFERENCE = pyqtSignal(str)
static

Definition at line 192 of file photobash_images_modulo.py.

◆ SIGNAL_UN_FAVOURITE

photobash_images.photobash_images_modulo.Photobash_Button.SIGNAL_UN_FAVOURITE = pyqtSignal(str)
static

Definition at line 190 of file photobash_images_modulo.py.

◆ SIGNAL_WDN

photobash_images.photobash_images_modulo.Photobash_Button.SIGNAL_WDN = pyqtSignal(int)
static

Definition at line 187 of file photobash_images_modulo.py.

◆ SIGNAL_WUP

photobash_images.photobash_images_modulo.Photobash_Button.SIGNAL_WUP = pyqtSignal(int)
static

Definition at line 186 of file photobash_images_modulo.py.


The documentation for this class was generated from the following file: