'Update horizontal dendrogram and text list widgets margins to
include the space for average stripe.'

def __update_margins(self):

    def offset(hm):
        if hm.show_averages:
            return hm.averages_item.size().width()
        else:
            return 0
    hm_row = self.heatmap_widget_grid[0]
    dendrogram_col = self.col_dendrograms
    col_annot = zip(self.col_annotation_widgets_top, self.col_annotation_widgets_bottom)
    for (hm, annot, dendrogram) in zip(hm_row, col_annot, dendrogram_col):
        left_offset = offset(hm)
        if (dendrogram is not None):
            (_, top, right, bottom) = dendrogram.getContentsMargins()
            dendrogram.setContentsMargins(left_offset, top, right, bottom)
        (_, top, right, bottom) = annot[0].getContentsMargins()
        annot[0].setContentsMargins(left_offset, top, right, bottom)
        (_, top, right, bottom) = annot[1].getContentsMargins()
        annot[1].setContentsMargins(left_offset, top, right, bottom)
