Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-106675

QTabBar / QMdiArea Mac::TabbedView: empty space on tabs unused

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.2.0
    • Widgets: Layout
    • None
    • macOS

    Description

      When using a QTabBar / QMdiArea Mac::TabbedView: on the Mac, on the right side of the text a empty space is kept as large as the space on the left (for the close icon). This area never is used in the normal case and should be used as well for the text when not enough space is available:

      I just added the following lines in MainWindow::MainWindow() of the mdi sample

          mdiArea->setViewMode(QMdiArea::TabbedView);
          mdiArea->setTabsClosable(true);
          mdiArea->setTabsMovable(true);
          mdiArea->setDocumentMode(true);
      

      I think that the problem lies in

      QMacStylePrivate::tabLayout
      ...
              // make text aligned to center
              if (opt->rightButtonSize.isEmpty())
                  tr.setRight(tr.right() - 4 - buttonSize);
      

      This just creates the same area on the right. If space is too little this area should be used as well - and the text should be centered within the whole area.

      On Windows i dont see such a problem or at least in less extend:

      Attachments

        1. screenshot-2.png
          screenshot-2.png
          19 kB
        2. screenshot-1.png
          screenshot-1.png
          29 kB

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            stefanwoe Stefan Wörthmüller
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: