Skip to content

Create a group widget for metrics of the same device - #577

Open
stsdc wants to merge 4 commits into
mainfrom
stsdc/better-indicator
Open

stsdc wants to merge 4 commits into
mainfrom
stsdc/better-indicator

Conversation

@stsdc

@stsdc stsdc commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Grouping allows to save some space by using a single icon for all metrics of a device.
image
NEW:
image
OLD:
image

@stsdc
stsdc marked this pull request as ready for review September 26, 2026 15:06
@stsdc
stsdc requested a review from a team September 26, 2026 15:10
@danirabbit

Copy link
Copy Markdown
Member

I'm a fan. Seems more easily parsable at a glance too

@danirabbit danirabbit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lint is failing :)

construct {
var icon = new Gtk.Image.from_icon_name (icon_name) {
margin_start = 6,
margin_end = 2,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't love to have hardcoded margins. If we can solve the spacing with Granite.Box that would be best, otherwise we should use CSS so that the spacing scales with text size

Object (
orientation: Gtk.Orientation.HORIZONTAL,
icon_name: icon_name,
visible: false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we put these in a revealer instead so we get nice animations?


label.label = Utils.Strings.format_network_speed (bandwidth);
label.width_chars = 9;
label.label = "<span font-features='tnum'>%s</span>".printf (Utils.Strings.format_network_speed (bandwidth));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to use markup there's a CSS feature for this: Granite.CssClass.NUMERIC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants