Ejemplo n.º 1
0
 def move_to_bottom(self):
     geo = self.parent().geometry()
     centre = geo.center()
     x = centre.x() - (self.width() / 2)
     y = geo.bottom() - 70
     pos = QtCore.QPoint(x, y)
     pos = self.parent().mapToGlobal(pos)
     self.move(pos)
Ejemplo n.º 2
0
    def move_tab_close_button(self, pos):
        i = self.tabAt(pos)
        rect = self.tabRect(i)
        btn = self.tab_close_button
        x = rect.right() - btn.width() - 2
        y = rect.center().y() - (btn.height() / 2)
        if i != self.currentIndex():
            y += 2
        btn_pos = QtCore.QPoint(x, y)

        btn.move(btn_pos)
        btn.raise_()

        if not self.tab_only_rect().contains(btn_pos):
            btn.hide()
        elif not self.tab_pressed:
            btn.show()