Skip to content
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

Use tabular numbers in file transfer dialog #1567

Closed
cassidyjames opened this issue Jan 27, 2021 · 2 comments · Fixed by #1612
Closed

Use tabular numbers in file transfer dialog #1567

cassidyjames opened this issue Jan 27, 2021 · 2 comments · Fixed by #1612
Labels
Good First Issue Easy fixed, with little code and no risk of side-effects Priority: Wishlist Desirable new features Status: Confirmed The occurrence and circumstances of the issue have been verified

Comments

@cassidyjames
Copy link
Contributor

cassidyjames commented Jan 27, 2021

Problem

When a file is being transferred, the string showing the progress jitters all over the place due to the differing widths of the numbers.

progress.mp4

Proposal

We use tabular numbers in the file transfer dialog (or really, anywhere we're showing filesizes, probably). (Idea from @alatiera@mastodon.social.)

Prior Art

GNOME Web seems to use tabular numbers in the download popover to prevent the string from jumping around.

@cassidyjames cassidyjames added Priority: Wishlist Desirable new features Needs Design Waiting for input from the UX team labels Jan 27, 2021
@danirabbit danirabbit added Good First Issue Easy fixed, with little code and no risk of side-effects Status: Confirmed The occurrence and circumstances of the issue have been verified and removed Needs Design Waiting for input from the UX team labels Jan 27, 2021
@alatiera
Copy link

If any newcomer is interested, what you'd need to do is apply the a tnum=1 font-feature attribute to the GtkLabel through gtk_label_set_attributes

The equivalent gtkbuilder xml is this.

      <object class="GtkLabel" id="current_time">
        <property name="label">0:00</property>
        <attributes>
          <attribute name="font-features" value="tnum=1"/>
        </attributes>
      </object>

@cassidyjames
Copy link
Contributor Author

Since we don't use GtkBuilder XML… here's an equivalent PR to the date/time indicator: https://github.com/elementary/wingpanel-indicator-datetime/pull/246/files

Basically, wrap the relevant string in <span font_features='tnum'>%s</span>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Easy fixed, with little code and no risk of side-effects Priority: Wishlist Desirable new features Status: Confirmed The occurrence and circumstances of the issue have been verified
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants