! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
[PATCH] Further reorganize code and fix vertical mode
Status:
CLOSED: DUPLICATE
Product:
Xfce4-netload-plugin
Component:
General

Comments

Description Harald Judt 2012-05-24 13:05:17 CEST
Created attachment 4457 
xfce4-netload-plugin-further-reorganize-code-and-fix-vertical-mode.patch

Let's do away with the two GtkBoxes and use only one. Some more code
used for widget layout and presentation is moved to setup_monitor,
additionally to more general code cleanup.

Vertical mode layout is now consistent with the other plugins in
regard to widget rotation etc. However, gtk_label_set_width_chars
messes up the alignment in vertical mode and the label sizes would
not be respected, so we set the label size manually using an
arbitrary size of 60, which seems to have the same effect as
the old method.

Deskbar mode / Panel-4.9 features are not yet accounted for.

This needs several other patches to be applied before, look at attachment #4456  from bug #8852.
Comment 1 Mike Massonnet editbugs 2012-06-01 17:09:53 CEST
I applied only one part of the patch (double gtkbox), pushed in git.

You might explain more about the vertical layout. In which other plugins do you see monitors with vertical labels? I don't think the current layout is mistaken. This should be discussed through the HIG first before making changes.

I don't notice anything odd with set_width_chars.

(I'll look now for the deskbar mode)
Comment 2 Harald Judt 2012-06-01 22:29:30 CEST
(In reply to comment #1)
> I applied only one part of the patch (double gtkbox), pushed in git.
> 
> You might explain more about the vertical layout. In which other plugins do
> you see monitors with vertical labels? I don't think the current layout is
> mistaken. This should be discussed through the HIG first before making
> changes.

The HIG recommends to use vertical labels in vertical mode and horizontal labels in horizontal and deskbar mode. Other plugins that conform to this layout (though some currently only do so in git) are
* xfce menu (panel built-in)
* clock (panel built-in)
* systemload plugin
* places plugin
* cpugraph plugin
* diskperf plugin
* weather plugin
* ...

> I don't notice anything odd with set_width_chars.

When I tried to keep set_width_chars, the space reserved for the labels in vertical mode was not the same as in horizontal mode. Horizontal mode worked fine. In vertical mode, set_width_chars was not respected, and the labels only took as much space as needed, which would cause constant resizes on network activity and looked wrong in comparison to horizontal mode.

Another negative effect of set_width_chars was that the labels were not aligned correctly in vertical mode according to the GtkMisc setting. For example, they were not really centered horizontally, but a few pixels off. The cause for all this might be a bug in gtk+-2.24.10, but I'm not sure, maybe I just did something wrong and did not notice it. I tried several things, but could not get it to work, and the new approach with setting the label width seemed simpler and solved all issues. As a bonus, it might be easier and more exact to adjust the width to your liking. BTW: Does set_width_chars respect unicode?
Comment 3 Mike Massonnet editbugs 2012-07-14 18:39:23 CEST
Will be fixed in one commit, for deskbar mode.

Marking as DUPLICATE of Bug 8941.

*** This bug has been marked as a duplicate of bug 8941 ***

Bug #8937

Reported by:
Harald Judt
Reported on: 2012-05-24
Last modified on: 2012-07-15

People

Assignee:
Mike Massonnet
CC List:
1 user

Version

Attachments

Additional information