15 Commits (aa8a5e70c415e6c2acf4ff373d9b366ac4692bb1)

Author SHA1 Message Date
Pro-Panda aa8a5e70c4 Port from Python 2 to six
Signed-off-by: James Cameron <quozl@laptop.org>
5 years ago
Rahul Bothra 13a2282e5e Port from GObject to GLib 6 years ago
James Cameron c92d0009df Write documentation for sugar3.graphics.ToolButton
- add two examples,

- document critical properties as keyword arguments in the class init,

- ensure documentation is consistent between RadioToolButton and
  ToolButton, (as some of the text is similar),

- part of feature Sugar3 Docs,
  https://wiki.sugarlabs.org/go/Features/Sugar3_Docs

- follow How To Guide
  https://wiki.sugarlabs.org/go/Features/Sugar3_Docs/How_To_Write

Derived from work by

- Hrishi <hrishipatel99@gmail.com> (31176ea) and

- radicalonion <ndefilippis98@gmail.com> (db89aca).
8 years ago
James Cameron a11639eb86 demote warning to debug for sugar_accel_group 9 years ago
William Orr edbc8f53b3 pep8'd sugar3.graphics 11 years ago
Daniel Narvaez 9f71aa864f Remove various unused bits 11 years ago
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 <simon@laptop.org>
Acked-by: Manuel Quiñones <manuq@laptop.org>
12 years ago
Simon Schampijer 2bedec55ed RadioToolButton, ToolButton, ToggleToolButton: add back the getter for the icon_name property
Follow up of fe11a3aa23
12 years ago
Gonzalo Odiard fe11a3aa23 Make icon_name api consistent between the different toolbuttons
As discused in the mailing list [1] the api to set the icon in sugar
ToolButton, RadioToolButton and ToggleToolButton is inconsistent,
and with the port to GTK+ 3 the differences are visible (SL #3849).

This patch changes the API of ToolButton, RadioToolButton and
ToggleToolButton to override the icon-name property and add an
Icon instance with the set_icon_widget method.

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>

[1] http://lists.sugarlabs.org/archive/sugar-devel/2012-September/039624.html
12 years ago
Simon Schampijer af320f91f8 Replacing set_data/get_data with a python attribute
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>
12 years ago
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 <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
12 years ago
Simon Schampijer 01a06943a2 Mimic the behaviour and style of the Sugar GTK+ 2 toolbutton palettes in GTK+ 3
First we needed to port the Palette code to use a minimum size. The default size
is two times the GRID_CELL_SIZE. Since the request-phase of the traditional GTK+
geometry management has been replaced by a height-for-width system [1] we have
to compensate for that. Furthermore we need to pass the invoker from the
PaletteWindow to the _PaletteWindowWidget for the gap calculation code for
drawing the border around the Palette.

We do the drawing of the border for the toolbutton in the base class, moved
this from the ToolbarButton and made sure we are drawing in the right order.
In the ToolButton we draw as well a black background for the ToolButton when
the Palette is up. While the mouse is over the button we can do that in the
theme, but not when the mouse moves over the Palette.

[1] http://developer.gnome.org/gtk3/3.0/ch25s02.html#id1525688

Signed-off-by: Simon Schampijer <simon@laptop.org>
12 years ago
Sascha Silbe 820efa56b9 Run pygi-convert.sh for automatic conversion from GTK2 to GTK3 + pygi.
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>
13 years ago
Simon Schampijer 8f1a821d68 Rename imports from sugar to sugar3
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Sascha Silbe <silbe@activitycentral.com>
13 years ago
Simon Schampijer 000ed75cbe Rename the module to sugar3
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>
13 years ago