Skip to content

Conversation

@ryonakano
Copy link
Member

Refactoring. I'm wondering why both IndicatorWidget itself and its users need to be conscious of data type of value and how to set them. I guess state_* properties in IndicatorWidget should be actually represented as a different subclass of it instead.

@stsdc
Copy link
Member

stsdc commented Jan 11, 2026

Maybe we could put dbusclient closer to the widgets, in the DisplayWidget maybe?

@ryonakano
Copy link
Member Author

@stsdc dbusclient is used both for DisplayWidget and Indicator at the moment as you can see in the following source, so that results both of them watch for the monitor_appeared signal for example. Is this fine for you?

dbusclient = DBusClient.get_default ();
dbusclient.monitor_vanished.connect (() => this.visible = false);
dbusclient.monitor_appeared.connect (() => {
this.visible = settings.get_boolean ("indicator-state");
display_widget.cpu_widget.visible = settings.get_boolean ("indicator-cpu-state");
display_widget.cpu_frequency_widget.visible = settings.get_boolean ("indicator-cpu-frequency-state");
display_widget.cpu_temperature_widget.visible = settings.get_boolean ("indicator-cpu-temperature-state");
display_widget.memory_widget.visible = settings.get_boolean ("indicator-memory-state");
display_widget.network_up_widget.visible = settings.get_boolean ("indicator-network-upload-state");
display_widget.network_down_widget.visible = settings.get_boolean ("indicator-network-download-state");
display_widget.gpu_widget.visible = settings.get_boolean ("indicator-gpu-state");
display_widget.gpu_memory_widget.visible = settings.get_boolean ("indicator-gpu-memory-state");
display_widget.gpu_temperature_widget.visible = settings.get_boolean ("indicator-gpu-temperature-state");
});

@stsdc
Copy link
Member

stsdc commented Jan 12, 2026

I would leave dbusclient.monitor_appeared.connect (() => this.visible = true); .
The rest, I would put into display_widget or, if possible, in the specific widgets.

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.

3 participants