Commit Graph
56 Commits
Author SHA1 Message Date
Manuel Quiñones 1baebb2051 Merge branch 'gir' of https://github.com/dnarvaez/sugar-toolkit-gtk3 into dnarvaez-gir 2013-11-20 10:57:06 -03:00
Manuel Quiñones fa7a765f4e Drop session.py
SessionManager has been moved to shell, and the other class has
nothing inside.
2013-09-02 21:38:49 +02:00
Manuel Quiñones d45560e3c7 Web activity: quit the GTK main loop when activity is destroyed
Fixes #4603 .

In GTK activities, this is done by _ActivitySession when the activity
unregisters itself, in _complete_close method.

Making the web activity aware of session logout will be handled in
another patch for the shell, see http://bugs.sugarlabs.org/ticket/4611
2013-08-30 08:36:28 -03:00
Manuel Quiñones c8fa6bd694 Web activity: set activity name as the title of the window - SL #4605
At least View Source uses it.
2013-08-30 08:22:10 -03:00
Manuel Quiñones 9e766327b3 Merge branch 'master' of https://github.com/sugarlabs/sugar-toolkit-gtk3 2013-07-10 11:09:14 -03: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
Manuel Quiñones 2643a0b25c Merge branch 'at' of https://github.com/dnarvaez/sugar-toolkit-gtk3 into dnarvaez-at 2013-07-04 19:20:46 -03:00
Manuel Quiñones 7156e67aa2 Color Palette: get back horizontal padding - SL #4325
The PaletteWindow lost the horizontal padding when it started to be
used as replacement of palette menus.  So now each implementation has
to add the padding.

Signed-off-by: Manuel Quiñones <[email protected]>
2013-04-17 17:09:45 -03:00
Manuel Quiñones a3cda7c49f Revert "icon.py: move all imports to the top"
We have circular imports if we do this.

This reverts commit 355ca09a8c.
2013-03-20 12:34:13 -03:00
Manuel Quiñones 355ca09a8c icon.py: move all imports to the top
Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2013-03-20 12:24:21 -03:00
Manuel Quiñones b9234202ab Add testcase for Gtk.ComboBox
Signed-off-by: Manuel Quiñones <[email protected]>
2013-02-05 14:11:04 -03:00
Manuel Quiñones a7e0e5ae57 Make the size of the preview image a public constant
Instead of hardcoding it.

Signed-off-by: Manuel Quiñones <[email protected]>
2013-02-04 11:51:03 -03:00
Manuel Quiñones d32523655c Fix subtoolbars height - SL #4019
Remove the vertical padding from the box that contain the toolbar, and
change the order of drawings in the container widget so that the
outline looks right.  This has been tested with screenshots, see the
gif animation attached to the ticket.

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2013-01-23 10:48:06 -03:00
Manuel Quiñones ee0e15b95d Fixup for previous commit, 693eaab9 - SL #4384
Forgot this change from my reviewers.

Signed-off-by: Manuel Quiñones <[email protected]>
2013-01-17 14:28:52 -03:00
Manuel Quiñones 693eaab975 New ProgressIcon widget - SL #4384
A new icon widget useful to display progress.  It is compatible with
sugar3.graphics.icon.Icon .  The progress is represented filling the
icon.

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2013-01-17 14:23:30 -03:00
Manuel Quiñones 5fd2dd8a98 Testsuite: set theme before running the test
Otherwise tests can't load icons before running because the icon theme
is not set.

Signed-off-by: Manuel Quiñones <[email protected]>
2013-01-16 16:24:53 -03:00
Manuel Quiñones e36513f925 Adapt to icon changes - SL #3569
- In IconEntry: dialog-cancel -> entry-cancel

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2013-01-15 10:34:00 -03:00
Manuel Quiñones 83efac4c57 Add testcase for CellRendererProgress - SL #1395
Signed-off-by: Manuel Quiñones <[email protected]>
2013-01-07 13:25:30 -03:00
Manuel Quiñones 1dd2aec650 get_mime_description, use Gio from dynamic bindings - SL #4323 #4307
'import gio' was importing static gobject, and mixing static and
dynamic bindings provoked a crash.

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-12-18 13:44:06 -03:00
Manuel Quiñones b6152b023a ActivityBundle: don't wrap the temporal icon path in a TempFilePath - SL #4276
In the Journal, CellRendererActivityIcon is calling its do_render
method after the temporal file is removed.  This is because we wrap
the icon path in a TempFilePath to control its deletion, but as we
don't maintain any reference to it, its __del__ method deletes the
temporal file.

Note that returning the path directly has one disadventage: the
temporal file is left in /tmp .

As a comment in the get_icon method of ActivityBundle say, ideally we
should return the icon data.  But that implies a major change in the
Journal model and views, and in the CellRendererIcon class.

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-12-17 18:23:10 -03:00
Manuel Quiñones 0231969bba PaletteWindowWidget: set border width to make outer space in the container - SL #4295
In the palette reimplamentation, commit 48ad255a, set_border_width was
removed.  Add it again to the corresponding widget, and get the value
from the theme.  Previously the value was given by:
self.get_style().xthickness .  Now we can use the widget border.

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-12-15 10:23:10 -03:00
Manuel Quiñones 8a9d10cda7 ColorToolButton, ToggleToolButton: do the drawing in the correct order - SL #4303
1. if the palette is up, draw the black background
2. draw the button itself
3. if the palette is up, draw the grey outline

Exactly as the ToolButton does.  Otherwise the outline is not visible.

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-12-11 09:47:21 -03:00
Manuel Quiñones 2a6ad05bc9 RadioToolButton: draw the outline properly - SL #3936
Now the do_draw method is exactly the same as the one for ToolButton.
This considers the border that the radio button can have, which is
needed for the changes made in the theme to get back the original
style.

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-12-10 09:25:43 -03:00
Manuel Quiñones 7931e104f4 Add Gtk.ProgressBar testcase.
Signed-off-by: Manuel Quiñones <[email protected]>
2012-12-03 12:52:32 -03:00
Manuel Quiñones e456cf1c9e Fixup for previous commit - SL #4224
The palette can be None.

Signed-off-by: Manuel Quiñones <[email protected]>
2012-11-29 15:10:18 -03:00
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 <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-11-29 08:28:48 -03:00
Manuel Quiñones 9c230ea498 Alert: fix for traceback in the draw - SL #4251
The Gtk.StyleContext get_background_color method needs a
Gtk.StateFlags as a parameter.  Feeding it with a GtkStateType doesn't
work anymore in recent gtk+.

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-11-22 14:20:27 -03:00
Manuel Quiñones 2d9e9ec526 Add insensitive button to buttons testcase - SL #4172
Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-11-14 16:15:46 -03:00
Manuel Quiñones ac3b0a3a14 Update style of Description palette - SL #4167
We can now use the PaletteMenuBox.

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-11-10 11:30:30 +01:00
Manuel Quiñones 5505eb30bf Set correct padding and size for the palette, window implementation - SL #4144
A new API is provided: PaletteMenuBox is a container to be used in
Palette.set_content().  This is to hide the implementation details and
set the corresponding paddings and sizes.

Usage:

  box = PaletteMenuBox()
  palette.set_content(box)

Then we can append items to it, like:

  item = PaletteMenuItem(text_label, icon, xo_color=xo_color)
  box.append_child(item)

  separator = PaletteMenuItemSeparator()
  box.append_child(item)

We can also append any widget, and the box will handle the paddings:

  box.append_child(widget)

style.DEFAULT_PADDING for horizontal and vertical padding is the
default.  But can be overriden:

  box.append_child(widget, horizontal_padding=0, vertical_padding=0)

Details:

- move palettemenuitem.py to palettemenu.py

- Width of palette: make it a minimun size of 3 Sugar grid cells.

- Padding of content, secondary box: we need top and bottom padding,
  which can be set when packing the items container inside the
  secondary box.

- Padding of menu items: needs to be just for left and right, so move
  the padding to a new horizontal box.

- Padding of separators: unlike GtkSeparatorMenuItem, GtkSeparator
  doesn't support padding.  But we can wrap it in a GtkEventBox and
  force the height of the widget there.

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-11-07 09:57:33 -03:00
Manuel Quiñones f0fe248e30 Palette Menu Item: set/unset INSENSITIVE state flag - SL #4144
The theme will display the insensitive items grayed out.

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-11-06 10:17:53 -03:00
Manuel Quiñones dd5a68e8ce Add two testcases: tabs with and without buttons, and sensitive text
Signed-off-by: Manuel Quiñones <[email protected]>
2012-11-01 10:23:49 -03:00
Manuel Quiñones 25497c7677 Set correct background for subtoolbars - SL #3987
- remove set_app_paintable from _Box to fix the bad coloring of
  subtoolbars.  The documentation say we can't rely on it to paint the
  themed background when this is set [1].

- don't call Gtk.EventBox.do_draw in the _Box do_draw because that
  will not paint the child toolbar.  Call the child do_draw instead.

- revert 7fc29c9d which was a workaround for the most frequent usage

[1] http://developer.gnome.org/gtk3/stable/GtkWidget.html#gtk-widget-set-app-paintable

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-11-01 08:54:21 -03:00
Manuel Quiñones 2a76b10ce0 CellRendererIcon: add active state - SL #3989
For press feedback.  Do this connecting to the treeview press and
release signals, as the palette invoker does.  After this, the active
state can be styled in the artwork.

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-10-30 11:14:26 -03:00
Manuel Quiñones f5b96e1fbd CellRendererIcon: add prelight state and render background - SL #3989
This is to provide feedback on mouse over.  The styling needs to be
done in the artwork component.

Because cell renderers don't inherit GtkWidget anymore, the styling
can't be done using the __gtype_name__ .  Instead, it has to be done
adding a css class [1] to the style context, and rendering the background
in the reimplementation of the do_render method.

For reference, see how GtkCellRendererToggle implements render [2] and
how Baobab app does it [3].

[1] http://developer.gnome.org/gtk3/3.2/GtkStyleContext.html#gtk-style-context-add-class
[2] http://git.gnome.org/browse/gtk+/tree/gtk/gtkcellrenderertoggle.c#n338
[3] http://git.gnome.org/browse/baobab/tree/src/baobab-cellrenderers.vala#n125

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-10-30 11:13:48 -03:00
Manuel Quiñones e4e1881662 CanvasIcon: use set_state_flags and unset_state_flags instead of deprecated set_state - SL #3989
set_state is deprecated [1] and using flags improves the code and
makes it less error prone, because there is no need to handle the
prelight state in a variable _in_prelight_state .

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

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-10-15 17:25:18 -03:00
Manuel Quiñones e591d9aa80 CanvasIcon: check if we have a palette in the button release callback
The buddy icon in the home view has the mouse pointer inside at boot,
moving the pointer outside provokes an error because the icon doesn't
have a palette attached yet.

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-10-15 17:24:55 -03:00
Manuel Quiñones 845371f2bc Icon: add new class CanvasIcon - SL #3989
Move code from shell ActivityIcon to new class CanvasIcon, that will
allow to reuse it in other icons.  This class inherits EventIcon and
adds state and drawing handling.  The right-click callback for the
palette invoker is not needed.

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-10-12 15:00:58 -03:00
Manuel Quiñones df1397dcf6 Update toolbar buttons testcase with API change for the icon name
Follow up of fe11a3aa23 .

Signed-off-by: Manuel Quiñones <[email protected]>
2012-10-10 00:20:31 -03:00
Manuel Quiñones 76da9331a4 Alert: use GtkStyleContext instead of deprecated GtkStyle - SL #3907
Using the deprecated GtkStyle is giving an error [1] in the sugar
alert.

[1] http://bugs.sugarlabs.org/ticket/3907#comment:3

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-10-01 22:57:05 -03:00
Manuel Quiñones 1f9684c7bf Add testcase for intro window - SL #3904
Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-20 09:56:02 -03:00
Manuel Quiñones dbe32ec7cf Style the palette menu header - SL #3879 #3836
Make the first item of the menu a custom class, to make the children
widget allocate using all the available space.  And so it can be
styled in the theme.

Remove the set_sensitive(False) from the header item, because the icon
was greyed out.  This was to make it an informational, unclickeable
item.  I am making it look like an informational item in the theme
instead.  This has the problem that its still navigateable with
keyboard and clickeable, so it has to be fixed later.

Add a separator below the header.  Is a custom class so it can be
styled in the theme.

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-13 12:10:43 -03:00
Manuel Quiñones 7fc29c9d58 Set an initial background color for the subtoolbar container - SL #3890
The styling of this toolbar elements should be ported to the theme at
one point.

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-12 13:33:56 -03:00
Manuel Quiñones c0756f48d4 Fix the badge position at the icon attach point - SL #3835
The convert script pygi-convert.sh commented out the call to
info.get_attach_points() in commit 820efa56

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-06 18:15:28 +02:00
Manuel Quiñones bb515893ab Add testcase for icon badges - SL #3835
Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-09-06 18:15:02 +02:00
Manuel Quiñones a14574c666 Finish the port of the CellRendererIcon
In pygtk custom cellrenderers were done inheriting
gtk.GenericCellRenderer, and overriding the on_* methods.  Now we
inherit Gtk.CellRenderer and the methods to override changed to do_* .

The destroy signal was moved to Gtk.Widget [1] so the Gtk.CellRenderer
doesn't have it anymore.  Now we do the cleanup in the python
destructor method.  A testcase tests/graphics/customdestroy.py shows
how is done.

tests/graphics/cellrenderericon.py tests the usage.

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>

[1] http://developer.gnome.org/gtk3/stable/ch24s02.html#id1459754
2012-09-03 22:55:35 +02:00
Manuel Quiñones 1334cd5768 Release 0.97.1 2012-08-28 09:59:43 -03:00
Manuel Quiñones cb141505fb Add testcase for Gtk buttons
Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-08-27 21:24:02 +02:00
Manuel Quiñones 305384be3c Fix the drawing of ColorToolButton, RadioToolButton and ToggleToolButton
Draw a black background in the buttons when the palette is up, as
commit 01a06943 did with the ToolButton.  As the comment for that
commit states, we can change the prelight background color in the
theme, but not when the mouse moves over the Palette.

Also add testcase to test the three toolbuttons.

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-08-27 14:13:42 -03:00
Manuel Quiñones cd590b552b Fix the Handle Rsvg get_width() -> props.width, get_height() -> props.height
Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-08-27 08:42:53 -03:00
Manuel Quiñones be14c34d35 Use the Sugar Theme in the testsuite
To make useful tests for the Sugar widgets, the theme must be the
same.

Signed-off-by: Manuel Quiñones <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-08-24 10:18:10 -03:00
Manuel Quiñones 00761f3d01 Revert "Fix the drawing of ColorToolButton, RadioToolButton and ToggleToolButton"
This reverts commit 1e6cba8474.
2012-08-23 18:13:47 -03:00
Manuel Quiñones 1e6cba8474 Fix the drawing of ColorToolButton, RadioToolButton and ToggleToolButton
gtk_paint_box is deprecated [1] and now we can use the CSS to change
the style of the button's prelight state.

To test the buttons, I provide a patch for HelloWorld activity [2].
They are added in the main toolbar.

Signed-off-by: Manuel Quiñones <[email protected]>

[1] http://developer.gnome.org/gtk3/stable/GtkStyle.html#gtk-paint-box
[2] http://dev.laptop.org/~manuq/shell-port/test_gtk3_buttons.patch
2012-08-23 14:28:56 +02:00
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 <[email protected]>
Acked-by: Simon Schampijer <[email protected]>

[1] http://git.sugarlabs.org/sugar-toolkit-gtk3/sugar-toolkit-gtk3/blobs/master/src/sugar3/graphics/palettewindow.py#line1018
2012-08-23 08:27:45 -03:00
Manuel Quiñones f70075323c Solve errors in ColorToolButton to enable activities to use it
This patch solves the following problems:

* API changed in the drag and drop code in Gtk.
  Drag and drop is not working yet (SL #3796)
  but the code needed to enable drag and drop is ported.
* Changes in the way to get color information from the theme
  this is because Gtk.Style was deprecated by Gtk.StyleContext.
* The internal button was not visible.

Signed-of-by: Gonzalo Odiard <[email protected]>

-----
v2: Fixed comment based on manuq feedback, and add a note
    about the non working drag and drop.
2012-08-08 10:32:31 -03:00
Manuel Quiñones 1beb8757c1 ToolButton: add 'icon_name' as a GObject property SL #3658
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 <[email protected]>
Acked-by: Simon Schampijer <[email protected]>
2012-06-01 11:12:52 -03:00