Today was another productive day!
We did finish installing all the rpms on the XO and installed the latest Browse activity who have been ported to GTK3 and Webkit and Read who has been moved to evince with gobject-introspection and to GTK3 as well.
So today we finally put our theme in the XO:
You can see the current status here.
We have two activities for testing, both show the same widgets, one using gtk2 and the other gtk3.
We are facing things that should be done in upstream GTK+3 and gnome-themes-standard before we can use them, like styling the up and down arrows of the spin button, for example. This is needed if we want to preserve the look and the size of the original sugar theme, or even improve it for touch interaction, for example. It seems to be done in git already!
Radio buttons and check buttons have been styled and there are pseudo-classes that can be used to match different states of a widget. For example:
.radio,
.radio row:selected,
.radio row:selected:focused {
background-image: url("assets/radio-unselected.svg");
}
.radio:active,
.radio row:selected:active,
.radio row:selected:focused:active {
background-image: url("assets/radio-selected.svg");
}
There are also particular options for the widgets, like this one that sets
the size of the check indicator (and also the radio indicator, because it
inherits from the check):
* {
-GtkCheckButton-indicator-size: 26; /* $radio_size */
}
The comment in that line is to indicate that we should change that value, 26, for the $radio_size variable in our CSS template.
I did make a quick check if the latest librsvg can be backported in jhbuild, does not seem to be so easy because it depends on the latest libpng (see). I also did a quick check if the new librsvg does provide what we need on the XO. The code in icon.py in the toolkit would be translated to something like this:
from gi.repository import Rsvg
f = open('lala.svg')
icon = f.read()
Rsvg.Handle.new_from_data(icon)
Rsvg.Handle.new_from_file('lala.svg')
I uploaded the Hello-world gtk3 version (version 4) to ASLO some time ago and marked it 0.96 only. However it did not appear when browsing the page. With the help from Aleksey I found out that ASLO is parsing the user agent of the Browser to provide appropriate activity version, if it fails to get the SP version from the agent string, it uses the last stable, which is 0.94 at the moment. A quick hack with adding “Sugar Labs/0.96″ to the user agent string in Browse had the expected result (API refs: webkit-web-view-set-settings, WebKitWebSettings–user-agent).
@@ -386,7 +390,9 @@ class Browser(WebKit.WebView):
def __init__(self):
WebKit.WebView.__init__(self)
-
+ s = WebKit.WebSettings()
+ s.props.user_agent = 'Mozilla/5.0 (X11; Linux i686)' \
'AppleWebKit/535.4+ (KHTML, like Gecko)' \
'Version/5.0 Safari/535.4 Sugar Labs/0.9'
+ self.set_settings(s)







