- Handle lack of GSettings gracefully.
- Still requires sugar-datastore.
- Supports avoiding X11 docks/panels.
- Provides icons for Activity windows.
Try it outside Sugar. Go to an Activity directory and run 'sugar-activity'.
Tested it with Terminal, Finance, Write, Browse, Memorize under XFCE4.
Tested in Gnome under OLPC-OS.
Also works from Sugar Terminal Activity.
Does not affect regular Sugar operation.
This is patch v.2 -
Addresses most concerns:
- Removed commented code, sorry.
- Changed code to use profile.get_nickname and get_color where possible.
Couldn't the launcher just pass this info?
Maybe the launcher could set the activity root as well?
- It is intended to be usable from the command line also.
Should put sugar version in the environment
- It is intended to work even without Sugar Shell installed.
Why don't we always set the icon?
- On XO it might use some memory. I was concerned to degrade
performance.
Also, imports should be at the top of the file?
- Also a concern about performance on XO.
This way it is only loaded in this use case.
Maybe it is insignificant -moved as requested.
It would be nice if the changes to the POT for sugar-toolkit-gtk3
could be incorporated in this pull request, please.
- There were no changes to POT files as part of this patch. Maybe
it is worth translating low level command line tools, not sure.
Suggest packaged activities might also provide .desktop files.
- Intriguing but not sure within scope of this patch. You mean generate
a .desktop file automatically as an option? Sounds nice!
Suggest sugar-activity might also accept path to unpacked bundle.
- Implemented!
In Gtk+ 3.20, you need to use the css name to select elements,
rather than the gtype name. Therefore, these must be added.
The css name must be set before the class instances are created, as
it effects the class rather than the instance. This is why it must
be places after the class definition.
A rework of the TreeViewInvoker used by the journal and activity list.
Fixes a persistent journal entry palette that reappears in journal or
home view. https://bugs.sugarlabs.org/ticket/4918
Also fixes an over-sensitive journal icon; with the journal mostly
empty, rapidly move the mouse from the bottom of the screen into the
lowest icon and then out again. Before this patch, the palette was
shown. After this patch, the mouse must rest in the icon.
Changes made:
- override _ensure_palette_exists in parent class Invoker,
- remove reference to MouseSpeedDetector, it is no longer required,
- remove enter and leave events; they are for the TreeView as a whole,
and are not required,
- properly detect that None is returned by get_path_at_pos, when the
coordinates are outside the TreeView cells.
Not fixed:
- moving the mouse out of the journal icon invoker does not popdown the
palette, but it does when moving the mouse out of the activity icon in
the activity list; so this is a problem beyond the invoker,
Tested on Fedora 18 and Ubuntu 15.10.
Test cases:
- check a click will activate item,
- check a right-click will show palette,
- check a mouse hover will show palette,
- check a brief mouse passing will not show palette,
- check if mouse leaving palette will popdown.
Instead of getting the position of the mouse later in the code,
this commit uses the coords given to sugar by Gtk that say where
the event happened. This means that if the system is busy, or
the user is fast with the mouse, the palette will pop up where
they originally clicked.
Create a private class for the button, timeout and response. Use the
private class as parent for both NotifyAlert and TimeoutAlert.
Extends the spurious response fix (cfeabdc) to NotifyAlert.
Also use g_timeout_add in preference to g_timeout_add_seconds, because
the latter is less precise in implementation.
Tested by changing the Register alert temporarily.
For an object of class TimeoutAlert, an OK response occurs on timeout,
even if user has clicked a button.
Remove the timeout when the user clicks a button.
A new method _response is added which overrides the parent method.
To solve ticket #4673, we calculate the palette size using the size
of all the widgets [2]. That solves the problem on Palettes based on
_PaletteMenuWidget but on _PaletteWindowWidget produce a wrong value
when the secondary_label is not null, and as a consequence
the palette position is wrong.
The solution is do the calculation only for _PaletteMenuWidget based
palettes.
[1] https://bugs.sugarlabs.org/ticket/4673
[2] b9d6b628a9
With the introduction of 'activate' signal on [1], and the use of that
signal in Sugar Home, we introduced a bug, now, pressing the secondary button
starts the activity instead of open the palette.
This patch solves the issue checking the putton pressed before send the signal.
[1] a19cf9ed27
Commit a19cf9e changed the logic for handling CanvasIcon clicks. Therefore,
the visual state indicators must be updated to fit the new logic.
Test Case: Hold the mouse down on a home view icon. Move the mouse
in and out of the icon. See that the states correspond with what
happens if you release the mouse.
The mouse detector have a variable to store the id for the timeout.
The stop() method check if the id is null but do not set the id to null
after remove the GObject timeout, then try to remove the timeout multiple times.
The efect can be seen if a user move the mouse slowly over the icons
in the Sugar home, in shell.log we see many lines like:
sugar3/graphics/palettewindow.py:443: Warning: Source ID 2464 was not found
when attempting to remove it
The industry convention for mouse driven menu options is for them
to be activated when two conditions are met:
* a button down event occurs with the pointer inside the option, and;
* a button up event occurs with the pointer inside the option.
This issue was already solved on the PaletteMenuItem,
but the EventIcon have the same problem. This change add a 'activate' event,
that control that the two conditions are meet.
The code in Sugar need use this event instead of button-release-event.
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
The palette using a Gtk.Menu, had a separator displayed using a custom widget,
but that was not well displayed (the line didn't had the palette width
due to margin on the palette) and was broken on Gtk >= 3.16
Instead of use that widget to draw the separator line between at the bottom
of _HeaderItem, as we do with the toolbar buttons when the palette is displayed.