Gnome-system-monitor - rounded graphs: a proof of concept
- From: jordan <triplesquarednine gmail com>
- To: gnome-devel-list gnome org
- Subject: Gnome-system-monitor - rounded graphs: a proof of concept
- Date: Thu, 20 Dec 2012 16:32:48 -0500
Hi,
Recently, I have been hacking on the gnome-system-monitor code, to
implement some aesthetic changes, for things that have long bothered
me about GSM. the big change that i have been working on - adding
rounded corners to the graphs (rather than having rectangles that
don't even use the same background as the notebook bg color in many
cases (ie: you end up with notebook/graph colors not matching on many
themes + it just looks (imho) a bit ugly / unrefined). So even though
i know very little about cairo (and although, i hack on code from time
to time - wouldn't consider myself to be a 'programmer'), i decided to
see what i could do :) I ended up with decent success, to the point i
would at least think my code produces a good demo/prototype/proof of
concept.
Here is my version of gnome-system-monitor (picture);
http://postimage.org/image/c1k6h723d/
and a quick video, just showing the resizing working correctly;
http://www.youtube.com/watch?v=QgeAeCayw7Q
NOTE: pay no attention to the hardcoded background colors (that is
just to have it match my theme), nor the 2 pixel lines (again, a
personal preference). What i think is important here is that it looks
cleaner than the boxy-upstream version (again,imo). Like i said, im
not much of a programmer, so i borrowed some existing cairo code and
modified it so that the rounded rectangles would resize properly
(allocation.width/height). The rounded rectangles are actually drawn
inside of the rectangles/graphs and the (outer) rectangle is blended
into my notebook background (cairo ... rgba with 0.97, 0.97, 0.97,
0.97), making it invisible (although i need a proper solution here
that doesn't require hardcoding the color for it to work on all
themes, correctly - gtk_normal_window often looks bad - I've tested
across many themes. ie: notebook bg_color and gtk_normal_window rarely
actually match well).
all of my changes occur in load-graph.cpp; http://pastebin.com/W1FEUVNT
You can just use diff to see my changes (some of which are irrelevant
to rounded graphs). the main changes start at line 106 ~ with a few
modifications around line 90-95 to get the outer graph rectangles to
be invisible.
I'm not looking for this code to be merged upstream (it's not clean
enough, nor implemented properly), but i thought it might be nice to
share, regardless - since even though it is a minor detail - i think
it does look better (and if implemented properly, would be worth
considering). I will probably have a stab at reworking it and trying
to get it to have no hardcoded color hacks, then possibly make a patch
to submit - but if any of you think this might be worthwhile - i am
betting you could do it in 5 to 10 minutes (as opposed to me not
really knowing what i am doing..lol)
cheerz
PS: i should also mention that using black as the graph bg color -
highlights what seems to be a bug in Gnome 3.6, where the graph
flickers when moving back and fourth from other windows, after GSM has
been running for 5 to 10 minutes ~ this happens in the upstream
version too, it's just less noticable in a theme like adwaita where it
is white on white. (sorry, i wanted to make a screencast - but
couldn't capture it properly, as it flickers for a split second - but
it does look abd when it happens ... and i believe it is a regression
- ie: i never saw it in any earlier release of gnome - and i've
modified the graph colors to be black in the past).
[Date Prev][Date Next] [Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]