def reparentPopup(self): """""" # Need to keep the popup from getting covered up by the GLCanvas when # switching back and forth from canvas only view. if self.popupframe.isVisible(): self.popupframe.setParent(None) self.popupframe.hide() self.popupframe.setParent( Krita().instance().activeWindow().qwindow()) self.popupframe.show() self.popupframe.setFocus()
def showhide(self): """""" if self.popupframe.isVisible(): self.popupframe.setParent(None) self.popupframe.hide() else: # Center the frame on the cursor point. cursorPos = QCursor.pos() textureWidth, textureHeight = 512, 512 cursorWidth, cursorHeight = 24, 24 self.popupframe.move( cursorPos.x() - textureWidth // 2, cursorPos.y() - textureHeight // 2 - cursorHeight) mainWindow = Krita().instance().activeWindow().qwindow() self.popupframe.setParent(mainWindow) self.popupframe.show() self.popupframe.activateWindow()