'Get the completion size according to the config.'

def sizeHint(self):

    confheight = str(config.get('completion', 'height'))
    if confheight.endswith('%'):
        perc = int(confheight.rstrip('%'))
        height = ((self.window().height() * perc) / 100)
    else:
        height = int(confheight)
    if config.get('completion', 'shrink'):
        contents_height = (self.viewportSizeHint().height() + self.horizontalScrollBar().sizeHint().height())
        if (contents_height <= height):
            height = contents_height
    else:
        contents_height = (-1)
    return QSize((-1), height)
