Commit Graph

111 Commits

Author SHA1 Message Date
Sander Dijkhuis
47af454115 Bug 591437 - Rename overlay.js to overview.js
Replace 'overlay' with the more descriptive name 'overview'
where the Activities Overview is meant. Call it Overview
(capitalized) in code comments.

The overlay-group and overlay-key provided by Mutter are not
affected, since they may be used for other components than
the Activities Overview.
2009-08-11 15:15:25 +02:00
Colin Walters
9fa88caded Bug 591316 - Fix bad notify:: parameters
We weren't using them, and they were wrong.
2009-08-10 11:18:19 -04:00
Colin Walters
9bd22dc033 ShellAppSystem: Support loading a .desktop file directly
Previously, ShellAppSystem only loaded (and cached) the set of
.desktop files from applications.menu and settings.menu, using
the gnome-menus library.  The ShellAppInfo structure was
a "hidden typedef" for GMenuTreeEntry.

But we need to support loading an arbitrary .desktop file.  Thus,
refactor the ShellAppInfo into a real struct, with a refcount,
and allow it to point to either a GMenuTreeEntry or a GKeyFile.

Also, in the case where we fail to lookup an icon for an
application, ensure we return a 0 opacity texture.
2009-08-09 09:53:06 -04:00
Siegfried-Angel Gevatter Pujals
4495f98dce Fix negative height request in WellGrid
When WellGrid had no child it was doing a division by zero,
which screwed up the calculation for the height request and
having it ask for a negative number. This commit fixes this
by always requesting 0 in this case.
2009-08-09 03:34:35 +02:00
Colin Walters
ebd6f4bc8f appDisplay: Reimplement well layout to be width-independent
Use ShellGenericContainer to implement a fully dynamic layout
for the application well.  It's still fixed to 4 columns by default,
but no longer requires a fixed width to be passed in on start.

With another chunk of work, it could likely try to adjust to
the case where we can only fit fewer than 4 items in the well.

Remove the border highlighting on mouseover, since that caused
reallocations, and the grid layout isn't trivial.

Delete the unused shell_global_get_word_with function.
2009-08-08 15:47:49 -04:00
Colin Walters
91911da302 Bug 590985 - Fix frequent apps list being empty
We shouldn't append .desktop again, that was a leftover from
the old WM_CLASS based application code.
2009-08-08 11:57:09 -04:00
Colin Walters
4e23f4cfc9 Bug 591077 - Hide overlay when activating an application
It's easier to explicitly call Main.overlay.hide() instead
of chaining activation signals, this got lost in a mix between
the big dash rewrite and ongoing changes to the Application well.
2009-08-07 15:45:52 -04:00
Siegfried-Angel Gevatter Pujals
be95ca553a Fix indentation issues in altTab.js, plus minor cleanup in some other files. 2009-08-06 01:54:22 +02:00
Colin Walters
85b4b97b7b Rewrite Dash, remove hardcoded width/height from GenericDisplay
This patch is a near-total rewrite of the Dash.  First, the dash
code moves into a separate file, dash.js.

Inside dash.js, the components are more broken up into separate
classes; in particular there's now a Pane class and a MoreLink
class.  Instead of each section of the dash, when activated,
attempting to close all N-1 other sections, instead there
is the concept of a single "active pane", and when e.g. activating
the More link for documents, if we know there's an active pane
which happens to be the apps, close it.

Many redundant containers were removed from the dash, and all
manual width, height and x/y offsets are entirely gone.  We move
the visual apperance closer to the design by using the view-more.svg,
etc.

To complete the removal of height/width calculations from the dash,
we also had to do the same for GenericDisplay.  Also clean up
the positioning inside overlay.js so calculation of children's
positioning is inside a single function that flows from screen.width
and screen.height, so in the future we can stop passing the width
into the Dash constructor and call this once and work on screen
resizing.
2009-08-05 04:04:27 -04:00
Colin Walters
2726fdb831 Bug 588343 - Major rework of window monitoring to be application-based
The previous application monitoring code was originally designed
to be based on WM_CLASS, which was then resolved on a server.
We have that resolution code locally now, so instead
of saving WM_CLASS data, save application IDs.

Also, inside the WM we have a much better
infrastructure for tracking windows.  In particular, rather
than polling, we can just watch for focus notification on
the display, and window add/remove.

Instead of polling XScreensaver, use DBus to watch org.gnome.Session
which already has an idle time watch.

Now there is no polling at all inside the monitor.
2009-08-04 18:40:37 -04:00
Colin Walters
026f014d32 Bug 589937 - Raise clone on window activation
We had duplicate code in appDisplay and workspaces for handling activating
a window; unify that inside workspaces, add an API to Main.overlay to
access it from both contexts.

Also, explicitly raise the clone we're activating to the top
before starting the animation to leave the overlay.
2009-07-31 19:26:32 -04:00
Colin Walters
29ffa46d08 Move drawing functions from shell-global into new shell-drawing.c file
Just to avoid shell-global.c bloat.
2009-07-31 17:26:47 -04:00
Marina Zhurakhinskaya
f7fff83647 Fix showing small item previews
Don't use a clone of an actor that's not part of the scene graph for the
item previews. This patch fixes previews in the details pane for documents
for which we don't have full previews and for applications.

Use create_icon_texture() from AppInfo instead of looking up the file
for gicon when creating an application icon for the details pane.
2009-07-29 17:56:13 -04:00
Marina Zhurakhinskaya
efcf8bae9d Align category labels vertically
Add a box to contain the MenuItem labels and align them vertically.

Clean up the style in the MenuItem code.
2009-07-27 19:02:46 -04:00
Colin Walters
adfb419ceb Don't line wrap application names in wells, fix running alignment
The experiment with avoiding ellipsization was a definite failure;
several translations have very long names, and we'd end up
with a single column.

Also fix extra padding; we only want some space at the top, not
left/right.
2009-07-27 18:35:41 -04:00
Colin Walters
96cf9c739e Avoid ellipsizing app names; Draw glow around running
Corresponding with the design, if an application is in a running
state (has > 0 windows open), draw a glow behind the name.

To make the display look a bit nicer, set the width of each item
to be equal to the longest word among all the items.
2009-07-27 12:45:22 -04:00
Colin Walters
2cc650e389 Bug 589437 - Switch to workspace of target app to activate
The user explicitly selected a window, so take them to it.
2009-07-23 12:28:31 -04:00
Colin Walters
3b603ef7e0 Don't fail if we can't find an application
Instead of logging and passing null through, explicitly skip
apps we don't know about.  It's valid to have say uninstalled
an app.
2009-07-08 11:54:15 -04:00
Colin Walters
c136acc879 Remove inadvertent early return in apps search 2009-07-08 11:38:22 -04:00
Colin Walters
cc2d3fd56d Major rework of application data structures and caching
Before, we looked up application data in several ways; the ShellAppSystem
exported just application ids (though it parsed the .desktop files internally),
and we'd create a Gio.DesktopAppInfo object (reparsing the desktop file again),
wrapping that inside a JavaScript AppInfo class, and finally the AppDisplay
would again parse the .desktop file to get the categories.

Also, to look up applications by id previously, we traversed the entire
menu structure each time.

Some qualities such as the NoDisplay flag were not easily exposed in the old
system.  And if we wanted to expose them we'd have to change several different
application information wrapper classes.

All in all, it was quite suboptimal.

The theme of this new code is basically "just use libgnome-menus".  We do
not call into Gio for app lookups anymore.  The new Shell.AppInfo class
is a disguised pointer for the GMenuTreeEntry item.

To fix the caching, we keep a simple hash table of desktop id -> ShellAppInfo.
2009-07-08 11:33:47 -04:00
Siegfried-Angel Gevatter Pujals
72e6e7839f Reset page number when changing the active category 2009-07-07 11:59:51 +01:00
Colin Walters
db630b2945 More for applications now displays a category list
Rework the previously extant Application category code to display
in the expanded list.  Add a "Frequent" category which corresponds
to the most_used_apps, and selected by default.

Instead of adding the background and shadow as expanded items to
the results/details panes as fixed, we slave the background/shadow
sizes to the results using notify::allocation.

Also clean up the code for sizing the details pane, using a common
function which adjusts its x position in one place.
2009-07-06 16:15:12 -04:00
Colin Walters
92e9bc85a1 AppWell: If an application is running, activate an existing window
Instead of relaunching, pick the first window and activate
2009-07-06 13:43:19 -04:00
Colin Walters
15e862f974 Switch GenericDisplay to ShellOverflowList for dynamic height
This converts GenericDisplay to totally dynamic layout, where
we display as many items as we can, and the rest cleanly overflow
into pages.

For now, remove multi-column; to readd this, we can pack multiple
display items into a single ShellOverflowList item.
2009-07-04 15:30:12 -04:00
Owen W. Taylor
f44b3e0553 Hide the running-apps area when empty
It looks funny to have the "more running apps area" there as a gap
when empty and dragging to it is an unintuitive way to remove stuff
from the favorites list, in any case, so just hide the area when
empty.

http://bugzilla.gnome.org/show_bug.cgi?id=587720
2009-07-04 14:19:25 +01:00
Colin Walters
66ea19fbfb Switch to dynamic layout for Dash
Instead of laying out the dash contents "manually" and having
the content items explicitly passed their height, just give them
a set width.
2009-07-04 13:45:27 +01:00
Colin Walters
a71ae65f8b Allow dragging a Workspace.WindowClone into favorites well
It's a natural thing to do, though in the future we may want
to split the WindowClone into js/misc/window.js or the like.
2009-07-02 05:04:33 -04:00
Colin Walters
8a0cebccdc Display full application title, allow DnD from More
For now display the full application name, centered to avoid
excessive ellipsization.

Highlight on mouseover, and allow DnD from the More display.
2009-07-02 01:04:40 -04:00
Marina Zhurakhinskaya
db52e024e8 Use a separate icon image as a drag actor instead of using the clone of the icon
Clutter no longer allows using a clone of an actor that is not a part of
the scene graph. This is what used to happen when we created a clone for
the icon of the item that was being dragged, and then closed the More panes
with the original item, removing the icon from the scene graph. This was
also when happened when the user hit Esc while dragging, which prompted the
overlay to close, removing the original icon from the scene graph.

Rename getIcon() methods to createIcon() to better reflect on the fact that
a new icon is created each time the method is called (we do use cache in
some cases).

Remove a stray log message in overlay.js

Fixes http://bugzilla.gnome.org/show_bug.cgi?id=585490
and http://bugzilla.gnome.org/show_bug.cgi?id=585489
2009-06-30 16:42:00 -04:00
Colin Walters
04fbaf4f27 Avoid duplicating most used applications in the AppDisplay cache
All used applications should be in the database from the menus
anyways.
2009-06-30 16:42:00 -04:00
Colin Walters
12f78a08cd Replace Dash application display with AppWell
The new class AppWell implements the application favorite well
in the Dash component.  The previous AppDisplay remains for use
in the More... mode now.

Delete DEFAULT_APPLICATIONS; this is now in GConf.

Rename getMostUsedApps to getTopApps since we now have the
idea of explicit favorites.

Delete some GenericDisplay-related calls from overlay related
to the seletion - we'll reimplement keyboard nav in a more
coherent way later.
2009-06-30 16:41:54 -04:00
Colin Walters
e7771b4eb0 Make ShellAppMonitor and ShellAppSystem singletons, remove unused code in appDisplay
We shouldn't create multiple instances of either.  Also remove a bit
of unused code in appDisplay.
2009-06-18 12:27:19 -04:00
Marina Zhurakhinskaya
dd1c95b3ce Make sure we have information about all applications returned by the AppMonitor
The list of all applications was based on the items that show up in
the menus, and might not have contained all applications returned
by the AppMonitor for the most used applications request. One example of
such an application was Evince. This resulted in a crash when an
application we did not prepare the info for was returned as one of the
matches by the AppMonitor, so we now include all applications returned
by the AppMonitor in the list, in addition to the ones from the menus.

Also mark apps as stale when we catch a "changed" signal from the AppMonitor
to ensure that the cache is refreshed.
2009-06-17 18:42:05 -04:00
Siegfried-Angel Gevatter Pujals
71cad8cd3f Fix a regression: search in the overlay not working anymore
With commit a3d35af444 variable
itemInfo in js/ui/appDisplay.js was changed to a new object
(AppInfo from js/misc/appInfo.js) but some of the code in
js/ui/appDisplay.js wasn't updated accordingly. This commit
fixes that and makes the search box in the overlay usable
again.
2009-06-17 12:53:47 -04:00
Dan Winship
a3d35af444 Split appDisplay and docDisplay into "model" and "view" parts
This lets us share the recent-app-tracking, recent-file-tracking, and
icon-drawing code between the overlay and the sidebar, without the
sidebar having to poke into AppDisplayItem and DocDisplayItem's guts.
2009-06-16 18:50:42 -04:00
Colin Walters
278a44caf1 Rework internals of ShellAppMonitor to use Metacity library
The code here is significantly cleaner if we use the data Metacity
already has cached and validated, rather than talking to X directly.

Also some preparatory work for extending the monitor API by
clarifying the name of the (current) main entry point.
2009-06-01 14:19:47 -04:00
Colin Walters
36775c9a58 Fix syntax error in previous patch
Also some style/logic cleanups pointed out by Marina.
2009-05-26 13:55:51 -04:00
Colin Walters
5416f53351 Bug 581944 - Fully rebase on ShellAppSystem, don't use Gio to load apps
To avoid loading applications from two different systems, use
ShellAppSystem solely.  This unifies the initial load and the
reload.

Extend ShellAppSystem to also load settings/preferences, and
ensure they appear in the search.
2009-05-26 10:52:56 -04:00
Colin Walters
d024dbd779 Bug 582248 - Async loading of pixbufs and icon caching
Add a ShellTextureCache class which loads (and can cache)
pixmap->texture conversions.  This fixes a problem with the
async code in ClutterTexture that it was lower priority
than animations, and also ensures we're really only
loading these pixbufs once in the icon case.
2009-05-20 11:22:56 -04:00
Owen W. Taylor
20e755023b Clean up underscores in function and variable names
Try to fix all places where we accidentally used foo_bar instead
of fooBar for function names, function parameters, and variables.

(Lucas Rocha pointed out one example.)

http://bugzilla.gnome.org/show_bug.cgi?id=581141
2009-05-04 13:50:49 -04:00
Owen W. Taylor
bb69afc830 Set the workspace when launching apps
main.js: Add create_app_launch_context() with code from appDisplay;
  additionally set the workspace on the launch context to the current
  workspace so that the application launches on the right workspace
  even if the user switches before the app starts.

appDisplay.js docDisplay.js: Use Main.create_app_launch_context()

http://bugzilla.gnome.org/show_bug.cgi?id=580658 (Reported by Igor Vatavuk)
2009-05-01 15:18:51 -04:00
Milan Bouchet-Valat
63821f1ae7 use application monitoring to show most used apps in the menu
The menu is filled with apps that are know to ShellAppMonitor, and then with default apps if there are not enough of them.
2009-04-29 11:05:03 -04:00
Colin Walters
b632801c7c Rename ShellAppMonitor to ShellAppSystem
This makes it clearer that really we're now an API, not just a
monitor.
2009-04-22 15:34:14 -04:00
Colin Walters
5f01854c62 Bug 578807 - Menu selection not reset on mouse selection
Clean up how we handle transitions a bit so that in the
case of selection by mouse instead of keynav we correctly
reset state.
2009-04-13 15:41:13 -04:00
Colin Walters
0a9226f7f2 Add a menu display to applications
ShellAppMonitor now depends on gmenu to load menus.

Use the menu data from ShellAppMonitor to show a menu list.

GenericDisplay implementations can now have a sidebar area.  We
handle keystrokes such as left/right explicitly.

Some internal API changes to account for the fact that a display
can have another filter in addition to the search.
2009-04-07 17:07:35 -04:00
Marina Zhurakhinskaya
dcc0f368bd Add tooltip delay to the preview pop-ups.
Showing previews after a delay allows the user to move the mouse around
the screen without triggering constant pop-ups.

Make sure we remove the pop-up when the user hits Escape and redisplay
the pop-up if we are updating the section results due to a change in space
allocated for it.

Rename protected variable _hasPreview to _showPreview in order to not have
the naming conflict with a new private variable _havePointer, which we
name in first person.
2009-03-21 10:37:15 -04:00
Marina Zhurakhinskaya
288fb7a837 Bug 571426 - Show pop-up previews of sideshow items
The pop-up previews have larger images than the item displays, which is
particularly nice when we are displaying thumbnails for documents. The
previews are also at least as wide as is required to fit the item title
on one line and the item description inside them is wrapped. Therefore
they act as tooltips showing the full title and description text.

The preview updates when the item under the mouse pointer changes. Changes
in overlay.js ensure that we keep the sideshow on top when the
workspaces are not being animated so that we can find the item over which the
pointer is located.

The preview is removed when the item it is shown for starts being dragged.

_hideInProgress variable was added to represent the state of the overlay
when the code for hiding it was already triggered. This fixes the error
which was happening when the code for hiding the overlay was triggered
multiple times (for example by the user clicking the Activities button
twice when exiting the overlay).
2009-03-20 12:06:34 -04:00
Marina Zhurakhinskaya
30a9c6b2f4 Don't reset the page selection if the results have changed while the user
was browsing exiting results

This is most noticeable when viewing results in xephyr, and then opening
a document in your regular session. But it could also be noticeable if
downloading a new file completes while the user is in the overlay.

This patch also moves the call to _displayMatchedItems() to _redisplay
instead of making it in both _setDefaultList() and _doSearchFilter().
2009-03-11 17:56:22 -04:00
Marina Zhurakhinskaya
5af37f140e Bug 574117 - Allow paging through the application and document results in the overlay
Add a display control that contains page numbers for the result
pages and is shown in the expanded results view. All of the page selection and
switching is handled by the GenericDisplay which exposes a displayControl
actor, which is then displayed by the Sideshow.
2009-03-09 16:52:11 -04:00
Colin Walters
85dae56a31 Bug 571203 - Handle spaces in overlay search
Previously we were stripping all whitespace.  Instead, just strip leading+trailing
whitespace, split the remaining search into individual terms which we search
for independently.

Items are grouped by the number of terms they match, then sorted
alphabetically.
2009-02-11 16:50:42 -05:00
Marina
2d3988c5fc Bug 570579: Redo the layout of overlay components
Divide the screen into a grid and use it to determine the layout of the overlay components in a more consistent manner.

Remove the 'Add workspace' control and slide the workspaces
display to the side without scaling it when switching to the 'More' mode.
2009-02-10 17:38:06 -05:00
Colin Walters
7d474b2217 Bug 51081 - Add startup notification information for application launching
Set the event timestamp and icon in application launch context to
support startup notification.
2009-02-10 10:59:28 -05:00
Marina Zhurakhinskaya
e9826ecb45 Add a 'More' control to the applications display in the overlay
mode. When this control is clicked, documents display section slides down,
workspaces display slides to the side, and a multi-column applications view is
presented to the user. "More' control is replaced with a 'Less' control. When
the 'Less' control is clicked a default overlay view is restored.

Clean up positioning of the components of the overlay sideshow
and the items within generic item displays.


svn path=/trunk/; revision=179
2009-02-03 22:58:33 +00:00
Dan Winship
87a3088719 sort imports consistently; everything-but-our-javascript, alphabetically,
then a blank line, then all of our javascript, alphabetically

svn path=/trunk/; revision=176
2009-02-02 23:02:16 +00:00
Marina Zhurakhinskaya
b2fbf5a2d8 shell-global.c: remove a log message about missing 'Categories' key in the desktop file, as this key is not required
main.js: set desktop environment to "GNOME" so that GIO can determine correctly which applications should be shown in the menus.

appDisplay.js: filter out applications that should not be shown in the menus, check if get_executable() for GAppInfo is not null before using it   

svn path=/trunk/; revision=163
2009-01-22 21:28:19 +00:00
Marina Zhurakhinskaya
9949d75fcc Get categories from the desktop files for all applications
and use them when finding matching applications for the search in the overlay mode.

svn path=/trunk/; revision=159
2009-01-21 21:50:57 +00:00
Dan Winship
b3860314b2 load the GAppInfos at startup time rather than waiting until the overlay
is opened for the first time

svn path=/trunk/; revision=146
2009-01-13 20:45:54 +00:00
Dan Winship
84cfdcd244 update default apps list a little more: remove evince, totem, file-roller,
which you don't launch on their own, only with a document

svn path=/trunk/; revision=144
2009-01-13 20:07:57 +00:00
Marina Zhurakhinskaya
849ddbd3f6 Display thumbnails of recent files in the overlay mode by using GnomeThumbnailFactory to get them. Fall back to the system icon for the file type provided by GtkRecentInfo when a thumbnail is not available.
svn path=/trunk/; revision=143
2009-01-09 01:09:35 +00:00
Marina Zhurakhinskaya
48cda5b179 Create two base classes: GenericDisplayItem and GenericDisplay, as
well as corresponding classes for applications and documents that inherit from
them. 

Use half the height of the sideshow in the overlay mode for the
AppDisplay, and the other half for the DocDisplay. 

Enable moving the selection between the two displays by using up and down arrow keys. 

Enable activating any item by clicking on it, in addition to activating the currently selected item by pressing Enter.

Apply search entry content to both sets of items.


svn path=/trunk/; revision=132
2008-12-20 04:27:57 +00:00
Marina Zhurakhinskaya
98860733bb Convert some variable and file names to lowerCamelCase.
Remove unused variables in AppDisplay::_filterAdd().

svn path=/trunk/; revision=123
2008-12-09 22:10:43 +00:00