https://bugs.documentfoundation.org/show_bug.cgi?id=173509

            Bug ID: 173509
           Summary: Incorrect positioning of rounded corners for the first
                    and last tabs in the tabbed interface with kf5/6
           Product: LibreOffice
           Version: 7.2.7.2 release
          Hardware: All
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: UI
          Assignee: [email protected]
          Reporter: [email protected]

Description:
When using the kf5 plugin, the first tab in the tabbed interface displays its
rounded corner at the top-right instead of the top-left. Similarly, the last
tab has its rounded corner at the top-left instead of the top-right. This was
less noticeable previously because the panel and tab colors shared the same
palette, but now the incorrectly rounded gray tabs stand out starkly against
the colored (blue, green) panels.

It looks like the problem is in the following code fragment
(vcl/source/control/tabctrl.cxx TabControl::Paint):

// Even though there is a tab overlap with GTK+, the first tab is not
// overlapped on the left side. Other toolkits ignore this option.
if (bDrawTabsRTL)
{
    pFirstTab = mpTabCtrlData->maItemList.data();
    pLastTab = pFirstTab + nItemListSize - 1;
    idx = nItemListSize - 1;
}
else
{
    pLastTab = mpTabCtrlData->maItemList.data();
    pFirstTab = pLastTab + nItemListSize - 1;
    idx = 0;
}

It is possible that the values ​​of pFirstTab and pLastTab are swapped for RTL
and LTR cases, since in left-to-right order, it seems logical that the first
tab should be the zero element, not size - 1. The following code correctly sets
the rounding with kf5:

if (bDrawTabsRTL)
{
    pLastTab = mpTabCtrlData->maItemList.data();
    pFirstTab = pLastTab + nItemListSize - 1;
    idx = nItemListSize - 1;
}
else
{
    pFirstTab = mpTabCtrlData->maItemList.data();
    pLastTab = pFirstTab + nItemListSize - 1;
    idx = 0;
}

This change doesn't seem to affect GTK3, since tab rounding isn't displayed
there anyway. The behavior was tested only on Linux with kf5, gtk3, and gen, it
is unknown whether this change will cause issues with Windows VCL plugins.

Steps to Reproduce:
1. Open any module (for example, Writer)
2. Open the View > User Interface... menu and switch to Tabbed

Actual Results:
For the first tab in the interface, the rounding appears at the top right; for
the last one, at the top left.

Expected Results:
For the first tab in the interface, the rounding appears at the top left; for
the last one, at the top right.


Reproducible: Always


User Profile Reset: No

Additional Info:
Still repro with:

Version: 27.2.0.0.alpha0+ (X86_64)
Build ID: e07ef10cc0d8201e5ece8e4d8b7d85a452964dc5
CPU threads: 32; OS: Linux 6.12; UI render: default; VCL: kf5 (cairo+xcb)
Locale: ru-RU (ru_RU.UTF-8); UI: en-US
Calc: CL threaded

Repro at least with:
Version: 7.2.7.2 / LibreOffice Community
Build ID: 8d71d29d553c0f7dcbfa38fbfda25ee34cce99a2
CPU threads: 32; OS: Linux 6.12; UI render: default; VCL: kf5 (cairo+xcb)
Locale: ru-RU (ru_RU.UTF-8); UI: en-US
Calc: CL

Tagged as "Linux (All)" since it is unknown whether this issue affects Windows
plugins.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to