27 Commits (6fc675e848fa0bde3fea78b08b77d530e4a850a3)

Author SHA1 Message Date
Srevin Saju 6fc675e848 Fix icon size in ColorButton
ColorButton did not show button icon, and swatches were too small
making it almost unusable. Color chooser toolbar had been using
Gtk.IconSize.LARGE_TOOLBAR which return 0 as size.
style.GRID_CELL_SIZE was used as size reference
4 years ago
Ibiam Chihurumnaya fc81121f19 Dash in signal names
GLib accepts signal names with dash or underscore and
documents the signals with a dash.

Use of signal names in Sugar was mixed, change to using
dash only.

No functional change.
5 years ago
Aniket21mathur 3b28597486 flake8 fixes 5 years ago
Pro-Panda aa8a5e70c4 Port from Python 2 to six
Signed-off-by: James Cameron <quozl@laptop.org>
5 years ago
James Cameron 85fc4680e9 Fedora 18 backport - GObject.ParamFlags does not have READWRITE 5 years ago
Rahul Bothra 13a2282e5e Port from GObject to GLib 6 years ago
Hrishi f4fc8c0d1f
Write documentation for sugar3.graphics.ColorToolButton
- add one example,

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

Added documentation and example for Colorbutton
7 years ago
James Cameron ae80df7725 Fix remaining icon_size references
icon_size was changed to pixel_size, yet references remained, causing
extra log data.

Additional change missed from already merged 70bc4db.
9 years ago
James Cameron 70bc4dbe6a Fix remaining icon_size references
icon_size was changed to pixel_size, yet references remained, causing
extra log data.
9 years ago
James Cameron a11639eb86 demote warning to debug for sugar_accel_group 9 years ago
Daniel Narvaez d12a1d5131 Fix translations domains to point to new toolkit 11 years ago
Daniel Narvaez b83ddaefaf Revert "Fix translations domains to point to new toolkit"
This reverts commit abe0de3ef8.
11 years ago
Daniel Narvaez abe0de3ef8 Fix translations domains to point to new toolkit 11 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 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 <manuq@laptop.org>
11 years ago
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 <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
12 years ago
Simon Schampijer 6064fb30cc Add support for locking Palettes, SL #4008
This adds a property that indicates that a Palette should
behave in a locking manner. The behaviour is the same
as with the secondary Toolbars: when you hover over the invoking
widget the Palette will popdown and react to mouse movements,
leaving the invoker area or the Palette itself will popdown
the Palette again. When you click the invoking widget
the Palette will be locked. You have to unlock it again
to pop it down.

This patch makes the DescriptionButton and the Colorbutton
work.

If the DescriptionButton or the Colorbutton are placed in
the primary toolbar they will share the locked state with
the secondary toolbars. Only one can be locked at a time.

When a secondary toolbar is unlocked we do force that the
open Palettes are closed. Having a locking Palette in
a subtoolbar will also work (Activity Toolbar case or
ColorButton case in a few examples). There is no state
sharing implemented here at the moment, but so far we
do only have cases with one lockable Palette in a
subtoolbar.

This will also fix the case where we want to use the
OSK to edit the description of the activity SL #3887.

Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Manuel Quiñones <manuq@laptop.org>
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
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 <gonzalo@laptop.org>

-----
v2: Fixed comment based on manuq feedback, and add a note
    about the non working drag and drop.
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
Daniel Drake 15946211cf Trivial GTK3 porting fixes
Fix some trivial issues missed earlier: various missing imports,
some minor API changes to adapt to, do_size_request simple porting,
etc.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
13 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