The icon consists of an GtkEventBox and an IconBuffer. The
GtkEventBox is a subclass of GtkBin which has its own window and
therefor is used to catch events for our IconBuffer which does
not have it's own window. The window of the EventBox is
made invisible.
The EventIcon does not emit the 'activated' signal when clicked
anymore, you can listen to 'button-release-event' to know
when the icon has been clicked. The EventIcon uses the
CursorInvoker to invoke a palette the same way as the
CanvasIcon did.
We keep the same API as with the CanvasIcon, only the 'size'
property is changed to be called 'pixel_size' in order to
make clearer which values it expects to be passed. We don't
expect a GtkIconSize to be passed here.
Another option would have been to put a SugarIcon inside a
a GtkEventBox and make the properties available through an
icon property but the API would have not been as nice and
logically it seems to make more sense to have the IconBuffer
being the base for both the SugarIcon and the SugarEventIcon.
This patch has ben developed based on the one that is
used in the shell port.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Reviewd-by: Benjamin Berg <benzea@sugarlabs.org>
This code was still using regular Telepathy properties to
set important configuration such as Anonymous=False.
However, as of Telepathy specification 0.24.0, these properties have
gone away.
http://telepathy.freedesktop.org/spec/Channel_Type_Text.html
Changed in 0.24.0. This interface used to have a bunch of clunky
Telepathy.Properties. They have been removed in favour of D-Bus
properties on the Room2, Subject2 and RoomConfig1 interfaces.
Switch to using RoomConfig1 (where available) to set this
configuration. The invite-restricted flag is no longer available and
actually seems to have been removed a long while back.
Fixes sharing of activities over gabble on new platforms such
as Fedora 17.
Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Sascha Silbe <silbe@activitycentral.com>
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>
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>
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>
The _ToolbarPalette does get passed the invoker on
initialisation. But we do create the PaletteWindowWidget
later. We do attach the invoker to the widget when calling
_setup_widget that is why it was still working without that
patch.
This patch prevents the traceback that we had because of not
having a widget at this point.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Tested-by: Manuel Quiñones <manuq@laptop.org>
set_data/get_data not available anymore is not available anymore [1]. The
recommended approach is using a python attribute, which we do.
Changing to use the attribute in the activity class slipped by mistake
into 6330204e91.
[1] https://bugzilla.gnome.org/show_bug.cgi?id=641944
Signed-off-by: Simon Schampijer <simon@laptop.org>
Tested-by: Manuel Quiñones <manuq@laptop.org>
Must be done early, some activities set translations globally. Remove
the support for the langpackdir.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Sugar ToolButton inherits from Gtk.ToolButton but is not overwriting
'icon_name' property. So 'icon_name' can be passed to the constructor
of Sugar ToolButton but the result is different than setting it via
ToolButton.props.icon_name.
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
In GDK3 the 'xid' attribute is gone and is replaced with
gdk_x11_window_get_xid(), or the get_xid() method in Python.
Needed to be able to open the object chooser from Browse without hassle.
Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
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>
The accelerator in the primary information in the Palette
has not been drawn because there was not enough space
reserved for it. The preferred size we get back for the
Palette window does not include the accelerator of the
Gtk.AccelLabel. We need to include that in our calculation for
the Palette size.
In order to make that information available which is part
of the Palette class we need to pass the instance to the
PaletteWindowWidget instance.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Daniel Drake <dsd@laptop.org>