18 Commits (13a2282e5e179b243281de3586bb227114a534d5)

Author SHA1 Message Date
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
radicalonion db89aca86a Write docs for sugar3.graphics.radiotoolbutton 8 years ago
Gonzalo Odiard 7a3d23e2b6 Don't add a label on RadioToolButton when set icon_widget - Fixes #4875
When we use set_icon_widget(), GtkToolButton set a private property
contents_invalid = TRUE [1], and gtk_tool_button_construct_content [2]
is called. Then if the label widget not exist, a GtkLabel is added.
This is a problem for us, by example in the Clipboard buttons in the frame.
By adding a empty Gtk.Box instead of a label, we avoid the label creation.

But as this is a internal implementation of Gtk, can change in the future,
in fact the issue is not visible with Gtk < 3.16

This patch is based in a pr sent by Sam Parkinson

[1] https://github.com/GNOME/gtk/blob/master/gtk/gtktoolbutton.c#L1415
[2] https://github.com/GNOME/gtk/blob/master/gtk/gtktoolbutton.c#L357
9 years ago
William Orr edbc8f53b3 pep8'd sugar3.graphics 11 years ago
Daniel Narvaez 9f71aa864f Remove various unused bits 11 years ago
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 <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
12 years ago
Simon Schampijer 06fab044e2 RadioToolButton: make sure _hide_tooltip_on_click is initialized in time
If we pass the active property to the constructor do_clicked seem
to get called. Before chaining up to the Gtk.RadioToolButton
constructor we need to initialize the variable.

This is a followup of 5a1b380dd6

Signed-off-by: Simon Schampijer <simon@laptop.org>
Tested-by: Gonzalo Odiard <gonzalo@laptop.org>
Acked-by: Manuel Quiñones <manuq@laptop.org>
12 years ago
Simon Schampijer 5a1b380dd6 RadioToolButton: hide tooltip on click, SL #4268
This is the same behaviour as with the ToolButton.

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
Simon Schampijer c411190178 RadioToolButton: remove incomplete and not as descriptive documentation 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
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 <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
12 years ago
Manuel Quiñones 00761f3d01 Revert "Fix the drawing of ColorToolButton, RadioToolButton and ToggleToolButton"
This reverts commit 1e6cba8474.
12 years ago
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 <manuq@laptop.org>

[1] http://developer.gnome.org/gtk3/stable/GtkStyle.html#gtk-paint-box
[2] http://dev.laptop.org/~manuq/shell-port/test_gtk3_buttons.patch
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