
from __future__ import absolute_import
from PyQt4 import QtGui
from PyQt4.QtGui import QPushButton, QIcon 

class CloseButton(QPushButton):
    def __init__(self, window):
        super(CloseButton, self).__init__(parent=window)
        self.icon = QIcon(u"focus1desktop/ui/fi-power.png")
        self.icon_pressed = QIcon(u"focus1desktop/ui/fi-pressed.png")
        self.setIcon(self.icon)
        self.setFlat(True)
        self.window = window
        #self.setAutoFillBackground(True)

    def mousePressEvent(self, event):
        #super().mousePressEvent(event)
        self.setIcon(self.icon_pressed)
        event.accept()

    def mouseReleaseEvent(self, event):
        #super().mouseReleaseEvent(event)
        if (self.rect().contains(event.pos())):
            self.window.close()
        self.setIcon(self.icon)
        event.accept()

    def mouseMoveEvent(self, event):
        event.accept()
    


17c9721d630ac75ef10650b29e945be34f7d21bd
<mask token>


class CloseButton(QPushButton):
    <mask token>
    <mask token>

    def mouseReleaseEvent(self, event):
        if self.rect().contains(event.pos()):
            self.window.close()
        self.setIcon(self.icon)
        event.accept()

    def mouseMoveEvent(self, event):
        event.accept()

<mask token>


class CloseButton(QPushButton):
    <mask token>

    def mousePressEvent(self, event):
        self.setIcon(self.icon_pressed)
        event.accept()

    def mouseReleaseEvent(self, event):
        if self.rect().contains(event.pos()):
            self.window.close()
        self.setIcon(self.icon)
        event.accept()

    def mouseMoveEvent(self, event):
        event.accept()

<mask token>


class CloseButton(QPushButton):

    def __init__(self, window):
        super(CloseButton, self).__init__(parent=window)
        self.icon = QIcon(u'focus1desktop/ui/fi-power.png')
        self.icon_pressed = QIcon(u'focus1desktop/ui/fi-pressed.png')
        self.setIcon(self.icon)
        self.setFlat(True)
        self.window = window

    def mousePressEvent(self, event):
        self.setIcon(self.icon_pressed)
        event.accept()

    def mouseReleaseEvent(self, event):
        if self.rect().contains(event.pos()):
            self.window.close()
        self.setIcon(self.icon)
        event.accept()

    def mouseMoveEvent(self, event):
        event.accept()

from __future__ import absolute_import
from PyQt4 import QtGui
from PyQt4.QtGui import QPushButton, QIcon


class CloseButton(QPushButton):

    def __init__(self, window):
        super(CloseButton, self).__init__(parent=window)
        self.icon = QIcon(u'focus1desktop/ui/fi-power.png')
        self.icon_pressed = QIcon(u'focus1desktop/ui/fi-pressed.png')
        self.setIcon(self.icon)
        self.setFlat(True)
        self.window = window

    def mousePressEvent(self, event):
        self.setIcon(self.icon_pressed)
        event.accept()

    def mouseReleaseEvent(self, event):
        if self.rect().contains(event.pos()):
            self.window.close()
        self.setIcon(self.icon)
        event.accept()

    def mouseMoveEvent(self, event):
        event.accept()


from __future__ import absolute_import
from PyQt4 import QtGui
from PyQt4.QtGui import QPushButton, QIcon 

class CloseButton(QPushButton):
    def __init__(self, window):
        super(CloseButton, self).__init__(parent=window)
        self.icon = QIcon(u"focus1desktop/ui/fi-power.png")
        self.icon_pressed = QIcon(u"focus1desktop/ui/fi-pressed.png")
        self.setIcon(self.icon)
        self.setFlat(True)
        self.window = window
        #self.setAutoFillBackground(True)

    def mousePressEvent(self, event):
        #super().mousePressEvent(event)
        self.setIcon(self.icon_pressed)
        event.accept()

    def mouseReleaseEvent(self, event):
        #super().mouseReleaseEvent(event)
        if (self.rect().contains(event.pos())):
            self.window.close()
        self.setIcon(self.icon)
        event.accept()

    def mouseMoveEvent(self, event):
        event.accept()
    

