'Create a button for the action.'

def createButtonForAction(self, action):

    button = ToolGrid.createButtonForAction(self, action)
    item = action.data()
    if (item.data(Qt.BackgroundRole) is not None):
        brush = item.background()
    elif (item.data(QtWidgetRegistry.BACKGROUND_ROLE) is not None):
        brush = item.data(QtWidgetRegistry.BACKGROUND_ROLE)
    else:
        brush = self.palette().brush(QPalette.Button)
    palette = button.palette()
    palette.setColor(QPalette.Button, brush.color())
    palette.setColor(QPalette.Window, brush.color())
    button.setPalette(palette)
    button.setProperty('quick-category-toolbutton', True)
    style_sheet = 'QToolButton    {\n                background:    %s;\n                border:    none;\n                border-bottom:    1px    solid    palette(mid);\n}'
    button.setStyleSheet((style_sheet % create_css_gradient(brush.color())))
    return button
