Closes a full view panel.

def closePanel(self):
        """
        Closes a full view panel.
        """
        # make sure we can close all the widgets in the view first
        for i in range(self.count()):
            if not self.widget(i).canClose():
                return False

        container = self.parentWidget()
        viewWidget = self.viewWidget()

        # close all the child views
        for i in xrange(self.count() - 1, -1, -1):
            self.widget(i).close()

        self.tabBar().clear()

        if isinstance(container, XSplitter):
            parent_container = container.parentWidget()
            
            if container.count() == 2:
                if isinstance(parent_container, XSplitter):
                    sizes = parent_container.sizes()
                    widget = container.widget(int(not container.indexOf(self)))
                    index = parent_container.indexOf(container)
                    parent_container.insertWidget(index, widget)
                    
                    container.setParent(None)
                    container.close()
                    container.deleteLater()
                    
                    parent_container.setSizes(sizes)
                
                elif parent_container.parentWidget() == viewWidget:
                    widget = container.widget(int(not container.indexOf(self)))
                    widget.setParent(viewWidget)
                    
                    if projexui.QT_WRAPPER == 'PySide':
                        _ = viewWidget.takeWidget()
                    else:
                        old_widget = viewWidget.widget()
                        old_widget.setParent(None)
                        old_widget.close()
                        old_widget.deleteLater()
                        QtGui.QApplication.instance().processEvents()
                    
                    viewWidget.setWidget(widget)
            else:
                container.setParent(None)
                container.close()
                container.deleteLater()
        else:
            self.setFocus()

        self._hintLabel.setText(self.hint())
        self._hintLabel.show()

        return True