Commit Graph
33 Commits
Author SHA1 Message Date
Simon Schampijer 8af0d49591 GtkMenu: use point_in_cell_renderer for CellRendereInvoker to check if a point is in, part of SL #3921
We use get_rect to check if the mouse is still over the invoker
in order to know when to popdown the Palette. The CellRendererInvoker
did return the allocation of the TreeView so far.

We already have a point_in_cell_renderer method in the
CellRendererInvoker so we can use this to check if the mouse pointer
is over the cell or not. The method point_in_cell_renderer is made
public to make it clearer that it can be used from the outside.

Signed-off-by: Simon Schampijer <[email protected]>
Acked-by: Manuel Quiñones <[email protected]>
2012-10-31 08:49:22 +01:00
Simon Schampijer 63a34191b1 Release 0.97.8 2012-10-25 16:25:20 +02:00
Simon Schampijer a36ada99fd CursurInvoker: add long-press gesture to raise Palette
This adds long-press gesture detection to the CursorInvoker
used in the EventIcon. This will make this gesture available
for the View icons for example.

We need to keep a boolean around to detect when a lon-press
event has happened and ignore the button-release event in
that case.

We add as well checks in the CursorInvoker and WidgetInvoker
for the enter events if they are of type Gdk.CrossingMode.NORMAL,
otherwise the Gdk.CrossingMode.TOUCH_BEGIN enter events that are detected
when a touch starts are handled and interfere.

Signed-off-by: Simon Schampijer <[email protected]>
Acked-by: Manuel Quiñones <[email protected]>
2012-10-25 15:55:02 +02:00
Simon Schampijer 590785f7d1 EventIcon: make sure we are able to dismiss the Palette
Without this patch when tapping on an EventIcon
we do get a GDK_CROSSING_UNGRAB leave event when
the Palette is raised. Because of this the Invoker
does not know how to popdown the Palette when
you tap outside or when clicking on actions in the
Palette itself.

Signed-off-by: Simon Schampijer <[email protected]>
Acked-by: Manuel Quiñones <[email protected]>
2012-10-25 15:54:46 +02:00
Simon Schampijer 1d9965c972 SugarLongPress gesture controller: remove animation
We found out that the animation does not solve the issue
of visually indicating the long-press gesture to our
satisfaction. This is because you do not know upfront
which icon does have a primary action and more options
that can be revealed with the long-press gesture and
the animation itself. We would need to theme the gesture
better first as well. That the animation is a separate
window does raise several side effects as well which we
would need to solve first.

Signed-off-by: Simon Schampijer <[email protected]>
Reviewed-by: Carlos Garnacho <[email protected]>
2012-10-25 12:25:01 +02:00
Simon Schampijer 20ef297526 Window: show unfullscreen button on button and touch events
We did track mouse motion events so far to show the unfullscreen
button. This adds the tracking of button events (left, middle, right
click) and touch tap.

Signed-off-by: Simon Schampijer <[email protected]>
Acked-by: Manuel Quiñones <[email protected]>
2012-10-23 16:14:13 +02:00
Simon Schampijer 1224ab1451 Palettes: move PRIMARY and SECONDARY constant to the base class
Signed-off-by: Simon Schampijer <[email protected]>
Acked-by: Manuel Quiñones <[email protected]>
2012-10-23 11:29:02 +02:00
Simon Schampijer 063e40d77d ActivityButton: set the toggle_palette option to True
Setting this option will popup the Palette on left click or tap
and popdown the Palette if it is up. This functionality has been
added with c4165967d5e05607db8b3e0969b516da87855431.

Signed-off-by: Simon Schampijer <[email protected]>
Acked-by: Manuel Quiñones <[email protected]>
2012-10-23 11:29:02 +02:00
Simon Schampijer 1a8f89226b Add toggle_palette property for Palette invoker, SL #4065
The property does specify whether the invoker will popup/popdown
the Palette on button left click/touch tap. It defaults to False.

In the toolbutton we add a property if the tooltip should be popped
down on a click, this is set to true to have the same behavior as
before.

Signed-off-by: Simon Schampijer <[email protected]>
Acked-by: Manuel Quiñones <[email protected]>
2012-10-23 11:28:15 +02:00
Simon Schampijer a2d2c79d5d Release 0.97.7 2012-10-16 20:47:10 +02:00
Simon Schampijer f91cfbfc8a Cursor tracker: only display the cursor in mouse/trackpad mode
Listen on RawEvents: listen for raw events on the root
window and decide whether the cursor is shown or not. A
touch begin event will hide the cursor a motion or button
press event will show it.

There is no API in XFixes to know whether a cursor is shown
or not so we keep track of the current state. Furthermore
we trap X errors if any bad access should happen.

Signed-off-by: Simon Schampijer <[email protected]>
Reviewed-by: Carlos Garnacho <[email protected]>
Acked-by: Manuel Quiñones <[email protected]>
2012-10-15 20:53:17 +02:00
Simon Schampijer 23399f51dd Release 0.97.6 2012-10-10 23:03:47 +02:00
Simon Schampijer f569e7ef98 Cleanup: remove unused variable 2012-10-08 13:03:43 +02:00
Simon Schampijer 31d6e6dd1e Release 0.97.5 2012-10-05 20:43:52 +02:00
Simon Schampijer d16afa8f16 Build fixup of c635ee5dd7 2012-10-02 21:35:05 +02:00
Simon Schampijer 1da1f4a1ca Release 0.97.4 2012-09-26 15:27:33 +02:00
Simon Schampijer 6387b20c31 Release 0.97.3 2012-09-20 15:54:08 +02:00
Simon Schampijer b44a235d9f OSK support: canvas auto panning based on input focus
Listen to the 'request-clear-area' and 'unset-clear-area'
of the widget and adjust allocation accordingly.

Signed-off-by: Carlos Garnacho <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-20 15:26:19 +02:00
Simon Schampijer 2bedec55ed RadioToolButton, ToolButton, ToggleToolButton: add back the getter for the icon_name property
Follow up of fe11a3aa23
2012-09-20 09:38:39 +02:00
Simon Schampijer c411190178 RadioToolButton: remove incomplete and not as descriptive documentation 2012-09-20 09:19:04 +02:00
Simon Schampijer d4934d73a7 IconEntry, set_icon_from_name: handle case when icon can not be found cleanly
Sugar crashes if the sugar theme has not been set (in sugar-session)
in the set_icon_from_name method since some if the requested icons
can not be found. Handle that case cleanly.

Signed-off-by: Simon Schampijer <[email protected]>
Acked-by: Manuel Quiñones <[email protected]>
2012-09-17 15:54:26 +02:00
Simon Schampijer 39226e69c5 event-controller: Don't install headers 2012-09-16 12:23:15 +02:00
Simon Schampijer ad950f4d06 event-controller: Put event-controller in alphabetical order in the Makefile 2012-09-16 12:23:15 +02:00
Simon Schampijer 4cf9ce0357 Release 0.97.2 2012-09-13 18:30:49 +02:00
Simon Schampijer 2d0ac2a952 Add new PaletteMenuItem widget for usage in mixed content Palettes
As Palettes can either include a Gtk.Menu or a Gtk.Window we
have to use a "false" menu when we want to have both
functionality in a Palette. This is a new class PaletteMenuItem
for those use cases.

Code highly based on the work from Gonzalo Odiard. The API is
based on the one from GtkImageMenuItem [1].

[1] http://developer.gnome.org/gtk3/3.4/GtkImageMenuItem.html

Signed-off-by: Simon Schampijer <[email protected]>
Acked-by: Manuel Quiñones <[email protected]>
2012-09-13 17:40:14 +02:00
Simon Schampijer 5cb4a48c5b Subtoolbar Palettes do not display at correct position, SL #3891
GTK_WIDGET_NO_WINDOW has been deprecated but we can use
gtk_widget_get_has_window() instead [1]. This brings back the
old code.

Follow up of: 5ab2b80546

[1] http://developer.gnome.org/gtk/stable/GtkWidget.html#GTK-WIDGET-NO-WINDOW:CAPS

Signed-off-by: Simon Schampijer <[email protected]>
Acked-by: Manuel Quiñones <[email protected]>
2012-09-12 21:22:57 +02:00
Simon Schampijer 5ab2b80546 Frame Device icons: Palette is not drawn at the correct position
We are adding the x value twice (from the allocation and from the origin)
in get_rect of the WidgetInvoker which we derive from in the FrameInvoker.
In the toolkit-gtk2 code [1] we did add the allocation.x value when
the widget does not provide its own gtk.gdk.Window (gtk.NO_WINDOW) [2]. This
is the same check we do above if the widget has a window and we set x and y
to 0 there which sounds sane enough to me.

[1] http://git.sugarlabs.org/sugar-toolkit/mainline/blobs/d1f68419e79376381fc2c3b111466714f044dfc0/src/sugar/graphics/palettewindow.py#line716
[2] http://www.pygtk.org/docs/pygtk/class-gtkobject.html#method-gtkobject--flags

Signed-off-by: Simon Schampijer <[email protected]>
Acked-by: Manuel Quiñones <[email protected]>
2012-09-12 15:40:54 +02:00
Simon Schampijer 9b391fa3cf CellRendererInvoker: various fixups
- the GtkCellRenderer (which our CellRenderer derives from) is not a
  GtkWidget and therefor the 'get_display' method does not exist, we
  fallback to the default display in that case [1]
- the get_rect method should return a Gdk.Rectangle now, see other
  invokers
- check if event.mode is Gdk.CrossingMode.NORMAL to trigger a mouse
  leave see 289787e8c6 for a similar
  case
- todo: the Palette does not go away when the mouse leaves the
  widget

[1] http://developer.gnome.org/gtk3/3.4/GtkCellRenderer.html

Signed-off-by: Simon Schampijer <[email protected]>
Acked-by: Manuel Quiñones <[email protected]>
2012-09-12 15:40:26 +02:00
Simon Schampijer c6c2220f0d CellRendererIcon: clipping rectangle not applied, SL #3872
We do not apply the clipping rectangle in do_render, we
need to call clip on the cairo_t as well. This solves the
issue in the Journal and in the Activity List View where
the icons do only appear on hovering over them.

See gtk_cell_renderer_render [1] for background information.

[1] http://git.gnome.org/browse/gtk+/tree/gtk/gtkcellrenderer.c#n731

Signed-off-by: Simon Schampijer <[email protected]>
Acked-by: Manuel Quiñones <[email protected]>
2012-09-11 16:09:08 +02:00
Simon Schampijer 289787e8c6 CursorInvoker: check if event.mode is Gdk.CrossingMode.NORMAL to trigger a mouse leave
Like in the WidgetInvoker we check now first if the leave
event has the mode Gdk.CrossingMode.NORMAL, only then we trigger
a mouse leave to popdown the Palette. This stops the Palette
to appear/disappear in a loop.

Signed-off-by: Simon Schampijer <[email protected]>
2012-09-06 18:14:56 +02:00
Simon Schampijer 447cfc2df1 CellRendererInvoker: in Gtk.TreeViewColumn get_cell_renderers is now get_cells
Signed-off-by: Simon Schampijer <[email protected]>
Acked-by: Manuel Quiñones <[email protected]>
2012-09-06 18:14:56 +02:00
Simon Schampijer 1ed4eb8ad5 Icon: Gdk.CairoContext does not exist
First of all 'Gdk.CairoContext' does not exist, this has been
made up by the conversion script in 820efa56b9

We do not need the previous gtk.gdk.CairoContext here anymore, we
do only want to set the background of the context here. See the
toolkit-gtk2 commit where this has been simplified [1].

[1] http://git.sugarlabs.org/sugar-toolkit/mainline/commit/6ce463585c3f3a639392e51cb26d789c2fde6516

Signed-off-by: Simon Schampijer <[email protected]>
Acked-by: Manuel Quiñones <[email protected]>
2012-09-06 18:14:56 +02:00
Simon Schampijer f766da335c Release 0.95.1 2011-10-25 13:19:07 +02:00