예제 #1
0
    def _get_over_window_geometry(self):
        geo = Gdk.Rectangle()
        boxwidth = self.get_allocation().width
        expand = True
        fill = True
        padding = 0
        actual_min = self._get_actual_min()

        if self.overWidget:
            expand = uihelpers.child_get_property(self, self.overWidget,
                                                  "expand")
            fill = uihelpers.child_get_property(self, self.overWidget, "fill")
            padding = uihelpers.child_get_property(self, self.overWidget,
                                                   "padding")

        if expand and fill:
            width = boxwidth
            x = 0
        elif fill:
            width = min(self.overWidth, boxwidth - padding)
            x = padding
        else:
            width = min(self.overWidth, boxwidth)
            x = ((boxwidth - width) / 2)

        y = (((self.overHeight - actual_min) * (self.fraction - 1)) +
             self.verticalOffset)
        height = self.overHeight

        geo.x = x
        geo.y = y
        geo.width = width
        geo.height = height
        return geo
예제 #2
0
    def do_size_request(self, req):
        under = self.underWidget.get_preferred_size()[0]
        over = self.overWidget.get_preferred_size()[0]

        self.overWidth = over.width
        self.overHeight = over.height

        expand = uihelpers.child_get_property(self, self.overWidget, "expand")
        fill = uihelpers.child_get_property(self, self.overWidget, "fill")
        padding = uihelpers.child_get_property(self, self.overWidget, "padding")

        if expand or fill:
            wpad = 0
        else:
            wpad = padding

        req.width = max(under.width, over.width + wpad)
        req.height = max(under.height + self._get_actual_min(), over.height)