Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/sugar3/graphics/icon.py
Commit message (Collapse)AuthorAgeFilesLines
* Icon: remove documentation that has not much of a valueSimon Schampijer2012-06-211-70/+0
|
* EventIcon: Have a default create_palette methodSimon Schampijer2012-06-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | The create_palette mechanism allows to create palettes on demand and not for each icon upfront whether it will be needed or not. If you hover over an EventIcon and there is no palette already associated with the Invoker, the Invoker will call create_palette to see if it can be created on demand. With this patch the EventIcon will return None here (see as well CellRendererIcon or ToggleToolButton which are having the same default behavior). When subclassing EventIcon the create_palette method can be overwritten and a Palette returned (see for example the ActivityIcon in the HomeView). Without this patch you can see tracebacks when hovering over the EventIcon because the Invoker tries to call create_palette. Signed-off-by: Simon Schampijer <simon@laptop.org> Reviewed-by: Benjamin Berg <benzea@sugarlabs.org> Acked-by: Manuel Quiñones <manuq@laptop.org>
* EventIcon: all the events go directly to the event boxSimon Schampijer2012-06-211-0/+1
| | | | | | | | | | | | | Position the event box window above the windows of its child, that way all events inside the event box will go to the event box. If the window is below, events in windows of child widgets will first go to that widget, and then to its parents [1]. [1] http://developer.gnome.org/gtk3/3.4/GtkEventBox.html#gtk-event-box-set-above-child Signed-off-by: Simon Schampijer <simon@laptop.org> Reviewed-by: Benjamin Berg <benzea@sugarlabs.org> Acked-by: Manuel Quiñones <manuq@laptop.org>
* EventIcon: Make the child window of the event box invisibleSimon Schampijer2012-06-211-0/+2
| | | | | | | | | | | | | We do use the EventBox only to receive events, hence the window that the even box creates should be a GDK_INPUT_ONLY window, which means that it is invisible and only serves to receive events [1]. [1] http://developer.gnome.org/gtk3/3.4/GtkEventBox.html#gtk-event-box-set-visible-window Signed-off-by: Simon Schampijer <simon@laptop.org> Reviewed-by: Benjamin Berg <benzea@sugarlabs.org> Acked-by: Manuel Quiñones <manuq@laptop.org>
* Remove the workaround for missing gobject-introspection bindings of RsvgSimon Schampijer2012-03-221-5/+4
| | | | | | | | | | | | | | | | | | | | gobject introspection bindings for librsvg have been pushed to librsvg master [1] in 2.35.0, which solved [2]. We only have slight adopts to make in our usage, for example we can not pass the data property to the default constructor anymore and get_width and get_height is not available anymore for the handle, but we can use the properties instead. The sugar-toolkit-gtk3 and therefore Activities that have been ported to it do need a version of librsvg >= 2.35.0 to be able to work, which ships for example with Fedora 17. Signed-off-by: Simon Schampijer <simon@laptop.org> Acked-by: Daniel Drake <dsd@laptop.org> [1] http://git.gnome.org/browse/librsvg/ [2] https://bugzilla.gnome.org/show_bug.cgi?id=663049 [3] http://developer.gnome.org/rsvg/stable/RsvgHandle.html
* Trivial GTK3 porting fixesDaniel Drake2011-12-201-0/+2
| | | | | | | | | 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>
* Add EventIcon/CursorInvoker similar to CanvasIcon/CanvasInvokerDaniel Drake2011-12-201-0/+70
| | | | | | | | | | | | | | | | | | | CanvasIcon and CanvasInvoker were removed in a previous GTK3-porting commit as they were based on hippocanvas. However, this leaves the toolkit with some missing functionality: there is no longer a trivial way to show an icon which can receive mouse events and pop up a palette. Such functionality is used in various places throughout the shell and activities. Reimplement this functionality as EventIcon and CursorInvoker. Instead of reimplementing much of the Icon class (like CanvasIcon did), EventIcon opts for a more simplistic encapsulation of an Icon object. This means trivial API changes for CanvasIcon users who must now use the 'icon' property with the Icon API. Signed-off-by: Daniel Drake <dsd@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org>
* Use rsvg wrapper while rsvg gains introspection supportRaul Gutierrez Segales2011-12-131-9/+6
| | | | Signed-off-by: Raul Gutierrez Segales <rgs@collabora.co.uk>
* Replace "expose-event" signal by a new "draw" signalSimon Schampijer2011-12-131-3/+1
| | | | | | | | | | | | | | | GtkWidget "expose-event" signal has been replaced by a new "draw" signal [1]. The context is already clipped [2], so do not base it on the values returned by get_allocation like before. [1] http://developer.gnome.org/gtk3/3.0/ch25s02.html#id1467092 [2] http://developer.gnome.org/gtk3/3.0/GtkWidget.html#GtkWidget-draw Signed-off-by: Simon Schampijer <simon@schampijer.de> [squashed with a patch by Benjamin Berg <benjamin@sipsolutions.net>; removed useless additions] Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
* Use accessor functions for data fieldsSascha Silbe2011-12-131-4/+5
| | | | | | | | | | | | | | | | | | 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>
* icon: fix set_source_pixbuf() invocationsDaniel Drake2011-12-131-3/+3
| | | | | | | | | | | The previous set_source_pixbuf() invocation (on a Cairo context) involves Gdk data types, so in the new introspection world we need to call a Gdk function rather than operating on the Cairo object (even if Cairo had already been converted to introspection). Signed-off-by: Daniel Drake <dsd@laptop.org> [added description; split out from another patch] Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
* Icon: port to new Height-for-width Geometry ManagementBenjamin Berg2011-12-131-18/+18
| | | | | | | | | | | | | | GTK3 has replaced [1] the GTK2 geometry management with Height-for-width Geometry Management [2]. This means we need to replace size_request() methods with get_preferred_{width,height}(). [1] http://developer.gnome.org/gtk3/3.0/ch25s02.html#id1525688 [2] http://developer.gnome.org/gtk3/3.0/GtkWidget.html#geometry-management Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net> [assembled from several patches; fixed up left-over plus sign; added description] Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
* Adapt to Widget.get_child_requisition() API changesSascha Silbe2011-12-131-2/+2
| | | | | | | | | | | | In PyGTK Widget.get_child_requisition() returned a tuple [1]. In GTK3+pygi a Requisition object is returned instead. Based on a patch by Benjamin Berg <benjamin@sipsolutions.net>. [1] http://developer.gnome.org/pygtk/stable/class-gtkwidget.html#method-gtkwidget--get-child-requisition [2] http://developer.gnome.org/gtk/stable/GtkWidget.html#gtk-widget-get-child-requisition Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
* Adapt to Gtk.icon_size_lookup*() API changesSimon Schampijer2011-12-131-1/+1
| | | | | | | | | | | | | | | In PyGTK, icon_size_lookup*() returned just the icon size as a 2-tuple [1]. In GTK3+pygi, an additional boolean value indicating whether the passed-in value was valid is returned. [3,4] [1] http://developer.gnome.org/pygtk/stable/class-gtkiconsource.html#function-gtk--icon-size-lookup [2] http://developer.gnome.org/pygtk/stable/class-gtkiconsource.html#function-gtk--icon-size-lookup-for-settings [3] http://developer.gnome.org/gtk/stable/gtk-Themeable-Stock-Images.html#gtk-icon-size-lookup [4] http://developer.gnome.org/gtk/stable/gtk-Themeable-Stock-Images.html#gtk-icon-size-lookup-for-settings Signed-off-by: Simon Schampijer <simon@schampijer.de> [marked unused local variables, fixed overlong line] Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
* Run pygi-convert.sh for automatic conversion from GTK2 to GTK3 + pygi.Sascha Silbe2011-12-131-44/+44
| | | | | | | | | | | | | | | | | 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>
* Remove Canvas* widgets and other hippo-canvas using partsSimon Schampijer2011-12-131-433/+0
| | | | | | | | | | hippo-canvas isn't available in the GTK3 world, so we need to remove anything that depends on it. Activities that still use it will need replace hippo-canvas based widgets with native GTK ones before they can be ported to GTK3. [replaced description] Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
* Don't use hippo-canvas for rendering pixbufsSimon Schampijer2011-12-131-6/+3
| | | | | | | | hippo-canvas isn't available in the GTK3 world and we can do fine without it for rendering pixbufs. [split out from another patch; added description] Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
* Rename imports from sugar to sugar3Simon Schampijer2011-11-141-6/+6
| | | | | Signed-off-by: Simon Schampijer <simon@laptop.org> Acked-by: Sascha Silbe <silbe@activitycentral.com>
* Rename the module to sugar3Simon Schampijer2011-11-141-0/+1217
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>