Skip to content

Monitor GTK4 port #443

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

Draft
wants to merge 51 commits into
base: main
Choose a base branch
from
Draft

Monitor GTK4 port #443

wants to merge 51 commits into from

Conversation

stsdc
Copy link
Member

@stsdc stsdc commented May 15, 2025

Note: Indicator build is disabled for now. Waiting for Wingpanel GTK4 port to finish.
Note: Deprecation warnings connected to TreeView, TreeIter, TreeViewColumn, CellRendererPixbuf are out of scope for this PR.

To Fix:

  • ProcessInfoView not showing
  • ProcessInfoView graphs and file list not showing
  • Restore button_more_info
  • Search box loosing focus after 1-2 character input
  • SystemView bad layout
  • Some labels are now invisible due to wrong colour (stylesheet problem?)
  • Fix statusbar labels
  • Merge LabelRoundy
  • Memory usage of pid's window (Wnck port)

@stsdc stsdc added this to the Version 1.0.0 milestone May 15, 2025
@stsdc stsdc linked an issue May 15, 2025 that may be closed by this pull request
core_label_list[i].get_style_context ().remove_class ("core_badge-mild-warning");
core_label_list[i].get_style_context ().remove_class ("core_badge-strong-warning");
core_label_list[i].get_style_context ().remove_class ("core_badge-critical-warning");
core_label_list[i].remove_css_class ("core_badge-mild-warning");
Copy link
Member

Choose a reason for hiding this comment

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

Another case where you can use css_classes to set what it should be without having to manually remove

Copy link
Member Author

Choose a reason for hiding this comment

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

css_classes also overwrites base widget styles. The solution would be to have a special method for a specific styles, e.g. core_label_list[i].set_state_warning (). I think it can be done in another PR :)

var button_more_info = new Gtk.ToggleButton () {
has_focus = false,
var button_more_info = new Gtk.MenuButton () {
focusable = false,
Copy link
Member

Choose a reason for hiding this comment

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

Probably don't want to do this. This will make the button unable to be navigated to by keyboard

Copy link
Member Author

@stsdc stsdc Jul 23, 2025

Choose a reason for hiding this comment

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

For me, It prevents to be focused by default when opening SystemView, but I'm still able to select it with a tab button.

@@ -156,9 +166,10 @@ public class Monitor.SystemCPUView : Monitor.WidgetResource {
}
}
var threads_label = new Gtk.Label (_("THREADS"));
threads_label.get_style_context ().add_class ("small-text");
threads_label.add_css_class ("small-text");
Copy link
Member

Choose a reason for hiding this comment

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

Should this be constant instead?

Suggested change
threads_label.add_css_class ("small-text");
threads_label.add_css_class (Granite.STYLE_CLASS_SMALL_LABEL);

Copy link
Member Author

Choose a reason for hiding this comment

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

This constant is indeed close to small-text style, however I would restrain from visual changes in this PR. We can come back to that in another PR with a proper CPU widget overhaul.

@@ -19,6 +19,8 @@ public class Monitor.CPUProcessTreeView : Gtk.TreeView {
regex = /(?i:^.*\.(xpm|png)$)/; // vala-lint=space-before-paren,
/* *INDENT-ON* */

enable_search = false;
Copy link
Member

Choose a reason for hiding this comment

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

Something leftover from a bad merge?

Copy link
Member Author

@stsdc stsdc Jul 26, 2025

Choose a reason for hiding this comment

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

Not really. But I did use regex to match icon path in multiple places. In past, there were issues with getting the right icon for some apps. But I can't see any issues now, so removed this regex together with the if block.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry this comment was about adding the "enable_search = false" which doesn't seem to be used anywhere

Copy link
Member Author

Choose a reason for hiding this comment

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

It is used in CPUTreeView. I have added it to disable searchbox to appear in tree view.

@stsdc stsdc requested a review from danirabbit August 1, 2025 16:57
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.

Port Monitor to GTK4
2 participants