https://bugs.kde.org/show_bug.cgi?id=523137

            Bug ID: 523137
           Summary: Horizontal Bars Sensor Face progress direction is
                    inverted in RTL (Arabic) locales
    Classification: Plasma
           Product: plasmashell
      Version First master
       Reported In:
          Platform: Fedora RPMs
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: System Monitor widgets
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
  Target Milestone: 1.0

Created attachment 194350
  --> https://bugs.kde.org/attachment.cgi?id=194350&action=edit
Current DiskUsage RTL

DESCRIPTION
When using an RTL interface (such as Arabic), the Disk Usage widget displays
inverted progress charts.

Instead of filling from right-to-left starting at 0%, the progress bar stays
anchored on the left side (at x: 0) while its width shrinks/expands using the
mirrored value. This makes a 70% full drive look like it only has 30% space
used, and vice versa.


STEPS TO REPRODUCE
To isolate and reproduce the issue without changing your entire desktop layout,
run the Disk Usage plasmoid standalone using plasmoidviewer forced into an
Arabic (RTL) locale:

1. Install the Plasma SDK (if not already installed) to get plasmoidviewer.
2. Run the following command in your terminal to launch the applet in Arabic:
LANG=ar_EG.UTF-8 LANGUAGE=ar LC_ALL=ar_EG.UTF-8 plasmoidviewer -a
org.kde.plasma.systemmonitor.diskusage

OBSERVED RESULT
Observe the progress bars: they fill from left to right, but their visual width
is inverted relative to the actual percentage values (e.g., a higher percentage
yields a smaller visual bar). See the screenshot Current_DiskUsage_RTL.png

EXPECTED RESULT
In an RTL layout, progress bars should start on the right side and visually
fill towards the left as the value increases. See screenshot:
Correct_DiskUsage_in_RTL.png

Possible fix:
The issue lies in
/usr/share/ksysguard/sensorfaces/org.kde.ksysguard.horizontalbars/contents/ui/Bar.qml
I modified the contentItem property from:
    contentItem: Item {
        Rectangle {
            width: bar.visualPosition * parent.width
            height: parent.height
            color: bar.color
            radius: height / 2
        }
    }

to:
    contentItem: Item {
        Rectangle {
            width: bar.position * parent.width
            x: bar.mirrored ? parent.width - width : 0
            height: parent.height
            color: bar.color
            radius: height / 2
        }

The AI explain this as following:
Currently, the inner progress indicator `Rectangle` relies on
`bar.visualPosition` to determine width, but it is missing a dynamic `x`
coordinate mapping for mirrored layouts.

Using `bar.position` (which is direction-agnostic) combined with a conditional
`x` offset fixes the alignment and fill direction perfectly.



SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 45
KDE Plasma Version: 6.7.2
KDE Frameworks Version: 6.28.0
Qt Version: 6.11.1
Kernel Version: 7.2.0-0.rc3.260715g58717b2a1365.29.fc45.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × AMD Ryzen 9 3900X 12-Core Processor
Memory: 8.5 غ.بايت of usable RAM
Graphics Processor: SVGA3D; build: RELEASE;  LLVM;
Manufacturer: innotek GmbH
Product Name: VirtualBox
System Version: 1.2
ADDITIONAL INFORMATION

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to