New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

agw/aui/AuiToolBar may not show all overflow items in dropdown menu #863

Closed
tianzhuqiao opened this Issue May 27, 2018 · 2 comments

Comments

Projects
2 participants
@tianzhuqiao

tianzhuqiao commented May 27, 2018

agw/aui/AuiToolBar may not show all overflow items in dropdown menu. For example, in the following image, Item 6 is not shown on either toolbar or dropdown menu.

virtualbox_2018-05-27_15-36-04

It looks like the problem is in function

    def GetToolFitsByIndex(self, tool_id):
        """
        Returns whether the tool identified by `tool_id` fits into the toolbar or not.

        :param integer `tool_id`: the toolbar item identifier.
        """

        if tool_id < 0 or tool_id >= len(self._items):
            return False

        if not self._items[tool_id].sizer_item:
            return False

        cli_w, cli_h = self.GetClientSize()
        rect = self._items[tool_id].sizer_item.GetRect()

        if self._agwStyle & AUI_TB_VERTICAL:
            # take the dropdown size into account
            if self._overflow_visible:
                cli_h -= self._overflow_sizer_item.GetSize().y

            if rect.y+rect.height < cli_h:
                return True

        else:

            # take the dropdown size into account
            if self._overflow_visible:
                cli_w -= self._overflow_sizer_item.GetSize().x

            if rect.x+rect.width < cli_w:
                return True

        return False

After replacing self._overflow_sizer_item.GetSize().x/y with dropdown_size (to match the calculation in OnPaint), the problem goes away

dropdown_size = self._art.GetElementSize(AUI_TBART_OVERFLOW_SIZE)
@tianzhuqiao

This comment has been minimized.

tianzhuqiao commented May 27, 2018

After the patch

virtualbox_2018-05-27_15-39-30

@RobinD42 RobinD42 added this to In progress in 4.0.2 May 31, 2018

@RobinD42

This comment has been minimized.

Member

RobinD42 commented May 31, 2018

Fixed by #864

@RobinD42 RobinD42 closed this May 31, 2018

4.0.2 automation moved this from In progress to Done May 31, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment