Skip to content

cpu-monitor-text@gnemonix : Improve percentage display so applet width does not change #7080

@DoneWorkin

Description

@DoneWorkin

Applet name and maintainer

cpu-monitor-text@gnemonix @gnemonix

What would you like to see?

When the CPU percentage changes number of digits the width of the applet changes and moves things around.
Improve the functionality by padding the percentage with Figure Space characters.

Suggested code change to _pad function as follows (will attempt to create pull request for this)

    _pad: function(percent) {
        let str = percent.toString();
        let str_length = this.max_percentage.toString().length;
        
        while(str.length < str_length) {
            str = "\u2007" + str;
        }
        return (str);
    },

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions