Commit Graph

174 Commits

Author SHA1 Message Date
James Cameron
4c22ba5b35 Add escape key to palette windows
Popdown a palette window in response to escape key.
2015-05-25 12:41:24 +10:00
Gonzalo Odiard
8224fefc50 Pep8 and pyflakes fixes 2015-05-16 19:13:34 +10:00
Gonzalo Odiard
2186c53aeb Palettes based in GtkMenu do not have present() method
There are two different palette widgets in Sugar.
_PaletteMenuWidget is a Gtk.Menu and  _PaletteWindowWidget is a Gtk.Window.
Only the palettes where the widget is a Gtk.Window can do present()
2015-05-16 19:13:34 +10:00
Gonzalo Odiard
7a9510a187 Remove CellRendererInvoker
This invoker is not used anymore, now is replaced by TreeViewInvoker.
2015-05-14 19:05:34 -03:00
Gonzalo Odiard
49365e132c New invoker, TreeViewInvoker
This new invoker is able to handle all the palettes on a treeview,
removing the need of one invoker per cell renderer (CellRendererInvoker).
This simplifies the code and makes it more efficient.
Also removes the logic from the CellRendererIcon, which
should only care about drawing itself. [1]

Is important to note than in Gtk3 a CellRenderer is not a GtkWidget
then can't know when the mouse is over it or have the usual events
used by other invokers, making the implementation CellRendererInvoker
very complicate.

This commit also removes the invoker of CellRendererIcon.

The ScrollingDetector logic is simplified too,
because now there are only one invoker instead of one by renderer
and the example code updated.

[1] https://developer.gnome.org/gtk3/stable/GtkCellRenderer.html
2015-05-14 12:04:07 -03:00
Gonzalo Odiard
5626a6c182 Detect scrolling in treviews and optimize drawing
Detecting if the treeview is scrolling we can improve the performance of
the CellRendererIcon by avoiding unneeded calculations.

The example scrollingdetector.py shows how this can be used.  The
changes are backward compatible.

Signed-off-by: Manuel Quiñones <manuel.por.aca@gmail.com>
Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
2015-05-14 12:04:07 -03:00
Gonzalo Odiard
d9e6fa6813 CellRendererIcon: cache offsets
Instead of calculating them on each render.  The cache is removed when
the size is changed.

Signed-off-by: Manuel Quiñones <manuel.por.aca@gmail.com>
2015-05-13 19:24:17 -03:00
Gonzalo Odiard
f08757d75f CellRendererIcon: remove unused frame
The white frame is not visible over the white background.

Signed-off-by: Manuel Quiñones <manuel.por.aca@gmail.com>
2015-05-13 19:24:11 -03:00
Gonzalo Odiard
3a6427cdc6 CellRendererIcon: improve calculation in do_render
Use a more efficient method to check if the pointer is inside the cell,
because we have the cell_area in the do_render method.

Signed-off-by: Manuel Quiñones <manuel.por.aca@gmail.com>
Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
2015-05-13 19:24:01 -03:00
Gonzalo Odiard
f7966382b8 Read icon attach points when is not possible get the info from gtk
Gtk has deprecated gtk-icon-get-attach-points on version 3.14
We need that information to place pur badges,
this fix read the information from the .icon file

[1] https://developer.gnome.org/gtk3/stable/GtkIconTheme.html#gtk-icon-info-get-attach-points
2015-04-09 11:36:19 -04:00
Ignacio Rodríguez
ee564948bc Raise the palette window when its mapped
This patch raise the palette window when its mapped
Its use: Gtk.Window.present [1] the user will
be able to saw the palette now when your apply the
test case of #4463

[1] https://developer.gnome.org/gtk3/stable/GtkWindow.html#gtk-window-present
Fixes #4463
2015-01-14 16:14:29 -03:00
Goutam
b5cae5fb56 Ellipses defaulted to end of long activity titles;fixes 1429 2014-12-17 10:14:23 -03:00
Ignacio Rodríguez
cef1ad7590 Get markup text as default
Now sugar-toolkit get markup (glib.markup_escape_text) and
set it.

This fixes SL#4456
2014-12-12 17:51:26 -03:00
Gonzalo Odiard
50ac9f36d6 Revert "Use consistent ellipsis mode"
This reverts commit 0d428fc913.

This is not the right solution. We should ellipse at the end.
The change was not discussed or approved.
2014-12-04 18:19:05 -03:00
Ezequiel Pereira Lopez
0d428fc913 Use consistent ellipsis mode 2014-12-04 12:00:37 -02:00
Martin Abente Lahaye
85b173eb25 Remove Palette logic out of PaletteWindow
PaletteWindow is the parent class of two different subclases,
Palette and _ToolBarPalette. Palette uses state changes intensively
in order to display secondary content, but _ToolBarPalette does not.

Because of this, Palette overwrites PaletteWindow's popup and popdown
methods adding one extra param called "state". This param is not required
either in PaletteWindow and specially not in _ToolBarPalette.

Therefore, any piece of code inside PaletteWindow which is meant for
Palette subclassing, should be moved out of PaletteWindow and placed
in the Palette class, where it corresponds.

This patch fixes the cases where _ToolBarPalette breaks because of this
mismatch.

Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>
2014-06-24 16:27:05 -03:00
Martin Abente Lahaye
2f19a41432 Fix black palettes
Push the palette widget opening process to the latest
in order to avoid the race condition where the animation
takes of the place of the real palette.

Fixes #2184

Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>
2014-06-24 15:57:35 -03:00
Gonzalo Odiard
c70e5c678d Fix regression introduced by b9d6b628a9
When calculated the palette height based in the size of children,
forgoten add the border size. That moved the palette in the device icons
4 pixels to the bottom, then the gap was miscalcuated and the border
button border was not draw.

Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
2014-05-30 15:51:11 -04:00
Gonzalo Odiard
dfeba6184e Fix drawing of gap on palettes attached to widget - Fixes #4776
In Gtk 3.10, Gtk.Window is drawing a gray border around the palette.
This patch draw a black rectangle defore we draw Gtk.render_frame_gap
to draw the border but with a gap to connect to the attached widget.

Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
2014-05-30 15:50:37 -04:00
Martin Abente Lahaye
45e7ba5ed6 Fix and clean Palette secondary label
Removes unnecessary code ie., changing label color.

Refactor label settings, to put all in the same place.

Fix changes to label_alignment that does not honor
original vertical padding settings.

Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>
2014-05-28 17:26:45 -03:00
Gonzalo Odiard
b9d6b628a9 Show palettes at the screen bottom with the right size - Fixes #4673
On Gtk 3.10, Gtk.Menu at the bottom of the screen are resized
to avoid fall out of the screen, then report a wrong height.
We need calculate the size of the children and move the Menu up.

This problem is visible on the Clipboard icon palettes,
and in journal objects palettes at the bottom of the screen.

This patch also rename a variable 'rect' to 'req', because is
a Requisition (width, height) and not a Rectangle (x, y, width, height).

Finally, to avoid a error with the secondary text on the palette,
when copy text from the terminal, reove the '¬r' character.

Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
2014-05-28 14:35:20 -04:00
Martin Abente Lahaye
72994bd73c Add Icon.get_badge_size
Add get_badge_size method to Icon class, so it can be accessed
by other Icon sub-classes.

ie., jarabe.frame.notification.NotificationPulsingIcon.

Signed-off-by: Martin Abente Lahaye <tch@sugarlabs.org>
2014-04-25 15:46:20 -03:00
Prasoon Shukla
9e253b5965 Add description in journal object palette - Fixes #4686 2014-04-07 10:20:46 -03:00
Daniel Narvaez
01ed63ee4b Fixes for pep8 1.5 2014-03-29 19:25:34 +00:00
Daniel Narvaez
f92f0efe06 Fix pep8 2014-03-24 09:43:20 +00:00
Sebastian Silva
2a7d4da38a Implementation of pixbufs for use with X11 window icons. 2014-03-23 22:23:02 -05:00
Gonzalo Odiard
e762fa938c Add accelerator to PaletteMenuItem - Fixes #4716
With the port to Gtk3, we lost the display of the keybord shortcut
available in MenuItem.

Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
2014-01-31 18:56:42 -03:00
Martin Abente Lahaye
6c64a7d020 Revert "Keep updated CellRendererInvoker self.path updated - Fixes #4717"
This reverts commit 353e05a086.
2014-01-23 00:57:27 -03:00
Gonzalo Odiard
353e05a086 Keep updated CellRendererInvoker self.path updated - Fixes #4717
Since CellRendererInvoker can set the path at None if a mouse event
is out of the area of the renderer, can break the use of touch,
if happen after the mouse movement. This patch set the path,
in the point_in_cell_renderer test, for the positive case,
solving the issue.

Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
2014-01-17 17:41:46 -03:00
Manuel Quiñones
5802d67ee1 Icon: deprecate icon_size
pixel_size should be always used now.

Change SMALL_ICON_SIZE to cover the other sizes at settings.ini.

Adds a transformation to keep backwards compatibility for some
time. This will be removed in the future.
2014-01-13 22:58:58 -03:00
Ignacio Rodriguez
1ced93e14b pep8 fixes for 'Add menu width chars' 2014-01-08 11:51:10 -02:00
Ignacio Rodriguez
463101b19d Add menu width chars to sugar3 2014-01-08 11:35:16 -02:00
Emil Dudev
c0319389e8 Touch UI: esc fullscreen
This patch moves sugar3.graphics.Window key-press-event handling.
It will now be after any other event handling from deived classes.
Fixes #475
2014-01-01 22:01:45 -02:00
Emil Dudev
db2ba3e579 GConf to GSettings port 2013-12-27 17:39:02 +00:00
akskumarnot
81b388c554 Use proper formatting syntax, fixes #2170 2013-12-26 15:57:33 +01:00
Gonzalo Odiard
dee29c0e75 Be able to click in a tooltip - Fixes #991
This issue was reported many times, when new users see a tooltip
try to click, and are confused when there are no action.

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
2013-12-18 22:49:21 +01:00
Diego Naula
ddd566c847 Fixes #3665: add is_fullscreen() method to Window class
Signed-off-by: Diego Naula <dnaula1997@gmail.com>
2013-11-19 22:38:14 -06:00
Daniel Narvaez
d12a1d5131 Fix translations domains to point to new toolkit 2013-09-11 16:02:47 +02:00
Daniel Narvaez
b83ddaefaf Revert "Fix translations domains to point to new toolkit"
This reverts commit abe0de3ef8.
2013-09-11 15:59:34 +02:00
Daniel Narvaez
abe0de3ef8 Fix translations domains to point to new toolkit 2013-09-11 15:27:46 +02:00
Walter Bender
ec5f064c10 Ensure entity value is type str
There are times when the entity value passed in for substitution
is of type unicode. This causes Rsvg to fail when processing the
SVG. This patch checks for unicode and converts it to utf-8.

Fixes #4621
2013-09-08 22:51:00 +02:00
Manuel Quiñones
0b47dd37b1 Merge branch 'objectchooser_preview-try2' of https://github.com/godiard/sugar-toolkit-gtk3 into godiard-objectchooser_preview-try2 2013-07-08 17:17:22 -03:00
Gonzalo Odiard
3e6507af6e Add a option to the objectchooser to show the object preview
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
2013-07-08 15:52:18 -03:00
Gonzalo Odiard
8e975bd5c9 Add a method to create a Pixbuf with the preview in the metadata
This code was moved from sugar expandedentry.py to be available to use
in other places. Some activities like Portfolio or JournalShare
have this code copied.

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
2013-07-08 15:51:27 -03:00
Daniel Drake
670fc44b1a Icon: handle image loading errors
If the icon can't be found, fall back on showing a generic icon.

Useful when activity/content bundles specify a bad icon, which is
unfortunately true for most content bundles in current existance
(because the icon field was previously unused).
2013-07-05 01:13:52 +02:00
Daniel Narvaez
6d2b97daec Fix pep8 errors
pep8 1.6.4 detects more issues
2013-07-04 19:00:57 +02:00
Gonzalo Odiard
ad3c163023 Fix ObjectChooser backwards compatibility
The last change brak compatibility with the use in activities
without set the filter_type parameter, because None is not
a allowed value in the dbus call.

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
2013-06-24 02:14:57 -03:00
Gonzalo Odiard
da3786d2fb Add filter_type optative parameter to objectchooser
Constants are defined to select the different filter_type
values. A comment was added to document the use.

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
2013-06-20 17:42:19 -03:00
William Orr
edbc8f53b3 pep8'd sugar3.graphics 2013-06-11 15:18:15 +02:00
William Orr
e649070aa2 Replaced deprecated GObject methods with GLib methods 2013-06-10 15:46:53 +02:00