21 Commits (aa8a5e70c415e6c2acf4ff373d9b366ac4692bb1)

Author SHA1 Message Date
Pro-Panda aa8a5e70c4 Port from Python 2 to six
Signed-off-by: James Cameron <quozl@laptop.org>
5 years ago
James Cameron 85fc4680e9 Fedora 18 backport - GObject.ParamFlags does not have READWRITE 5 years ago
James Cameron 84a7286986 Review: Port from GObject to GLib
Fix new flake8 issues introduced by cb0d6e2.
6 years ago
Rahul Bothra 13a2282e5e Port from GObject to GLib 6 years ago
Sam Parkinson 8d0cc98e43 Set css name for widgets
In Gtk+ 3.20, you need to use the css name to select elements,
rather than the gtype name.  Therefore, these must be added.

The css name must be set before the class instances are created, as
it effects the class rather than the instance.  This is why it must
be places after the class definition.
8 years ago
Gonzalo Odiard 8af97e3e17 Replace use of deprecated icon_size by pixel_size
It's a trivial change, but the warning message was filling the logs.
9 years ago
William Orr edbc8f53b3 pep8'd sugar3.graphics 11 years ago
Manuel Kaufmann 0788e546f6 TrayViewport: handle the case of the widget not yet allocated in the size-allocate callback - SL #4279
In the callback, the allocation can be 1x1 if it is yet unknown [1].
This is the case of trays that start hidden by default, like the one
in Browse activity.

[1] http://developer.gnome.org/gtk3/stable/GtkWidget.html#gtk-widget-size-allocate

Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
12 years ago
Simon Schampijer e49f621110 TrayIcon: get the black background and outline for palette popup - SL #4089
Do the same as in ToolButton, update do_draw method to do the drawing
in the code.

Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Manuel Quiñones <manuq@laptop.org>
12 years ago
Manuel Quiñones d418d1cbdd Tray: wrap them in EventBoxes in order to make them themeable - SL #3565
We have to convert the boxes to EventBoxes because otherwise the
background is not themeable [1]

[1] https://bugzilla.gnome.org/show_bug.cgi?id=678790

Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
12 years ago
Simon Schampijer de7c5b90bd TrayIcon: set the touch mask on the event box, part of SL #4127
We do need to add the mask if we want to receive
the 'touch-event' signal. The Gtk.EventBox does
set the touch event mask by default.

[1] http://developer.gnome.org/gtk3/3.4/GtkWidget.html#GtkWidget-touch-event
[2] http://git.gnome.org/browse/gtk+/tree/gtk/gtkeventbox.c#n411

Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Manuel Quiñones <manuq@laptop.org>
12 years ago
Manuel Quiñones e2ddd70c13 Fix the drawing method of _IconWidget, used by IconTray
Invoker draw_rectangle() now receives a Cairo context, as can be seen in [1]

The testcase is also fixed by this commit.

Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>

[1] http://git.sugarlabs.org/sugar-toolkit-gtk3/sugar-toolkit-gtk3/blobs/master/src/sugar3/graphics/palettewindow.py#line1018
12 years ago
Carlos Garnacho f36fc4ae85 Tray: set a minimum size in the viewport so that it allows scrolling
The minimum height/width requested by the GtkViewport still tries to cater
for all contained children, which makes the [VH]Tray widgets to grow as
new items are added. Instead, request a minimum width/height of 0 to avoid
the Tray from growing, and having scrolling kick in instead.

Also, fixed what seemed to be a typo in do_get_preferred_height(), where
the viewport width was requested instead.

http://bugs.sugarlabs.org/ticket/3522

Signed-off-by: Carlos Garnacho <carlos@lanedo.com>
Acked-by: Simon Schampijer <simon@laptop.org>
12 years ago
Daniel Drake 15946211cf Trivial GTK3 porting fixes
Fix some trivial issues missed earlier: various missing imports,
some minor API changes to adapt to, do_size_request simple porting,
etc.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
13 years ago
Daniel Drake 157124af5b Tray: replace deprecated get_child_requisition() invocation
Widget.get_child_requisition() has been replaced by
Widget.get_preferred_size() in GTK 3 [1].

[1] http://developer.gnome.org/gtk3/3.0/GtkWidget.html#gtk-widget-get-child-requisition

Signed-off-by: Daniel Drake <dsd@laptop.org>
[changed description]
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
13 years ago
Simon Schampijer 20319cb3c4 Use GObject constructor for Gtk.Alignment
With PyGTK, all parameters of the Alignment constructor had defaults [1].
With GTK3+pygi, when using the explicit constructor (Alignment.new() resp.
gtk_alignment_new() [2]), all values would need to be passed. However when
using the GObject constructor, named properties can be passed in instead and
we only need to pass those that different from the default.

[1] http://developer.gnome.org/pygtk/stable/class-gtkalignment.html#constructor-gtkalignment
[2] http://developer.gnome.org/gtk/stable/GtkAlignment.html#gtk-alignment-new

Signed-off-by: Simon Schampijer <simon@schampijer.de>
[assembled from several patches; replaced description]
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
13 years ago
Sascha Silbe c82a775267 Use accessor functions for data fields
The following data fields that were provided by PyGTK are not accessible
directly in GTK3+pygi and need to be replaced by accessor calls:

Adjustment.lower
Adjustment.page_size
Adjustment.upper
Adjustment.value
Bin.child
Widget.parent
Widget.style
Widget.window

Based on patches by Daniel Drake <dsd@laptop.org>.

Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
13 years ago
Sascha Silbe 820efa56b9 Run pygi-convert.sh for automatic conversion from GTK2 to GTK3 + pygi.
This is only on a best-effort basis; the code will be in a broken state after
this patch and need to be fixed manually.

The purpose of committing the intermediate, non-working output is to make it
reproducible. It's impractical to manually review the changes.

The exact version used was 4f637212f13b197a95c824967a58496b9e3b877c from the
main pygobject repository [1] plus a custom patch [2] that hasn't been sent
upstream yet.

[1] git://git.gnome.org/pygobject
[2] https://sascha.silbe.org/patches/pygobject-convert-sugar-20111122.patch

Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
13 years ago
Daniel Drake 2f7f95f9af Pass all parameters to Box.pack_start() and ...pack_end()
With PyGTK, several Box.pack_{start,end}() parameters had defaults [1,2].
With GTK3+pygi all values must be passed [3,4].

[1] http://developer.gnome.org/pygtk/stable/class-gtkbox.html#method-gtkbox--pack-start
[2] http://developer.gnome.org/pygtk/stable/class-gtkbox.html#method-gtkbox--pack-end
[3] http://developer.gnome.org/gtk/stable/GtkBox.html#gtk-box-pack-start
[4] http://developer.gnome.org/gtk/stable/GtkBox.html#gtk-box-pack-end

[assembled from several patches; replaced description]
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
13 years ago
Simon Schampijer 8f1a821d68 Rename imports from sugar to sugar3
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Sascha Silbe <silbe@activitycentral.com>
13 years ago
Simon Schampijer 000ed75cbe Rename the module to sugar3
The old gtk-2 based module will be present in
the 0.94 branch in the sugar-toolkit.

Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Sascha Silbe <silbe@activitycentral.com>
13 years ago