Commit Graph

577 Commits

Author SHA1 Message Date
Carlos Garnacho
794a056819 appDisplay: Use GAppInfo list from ShellAppSystem
It is now cached there, so the number of g_app_info_get_all() calls
is reduced to one per change.
2019-01-26 22:55:31 +01:00
Carlos Garnacho
3db52155dd appDisplay: Reduce g_app_info_get_all() calls
Whenever the AllView needs (re)populating, we used to do one general
g_app_info_get_all() to get all GAppInfo, plus one per app folder in order
to check the ones that fall within that category. This calls results in a
fair amount of I/O blocking the main loop.

In order to ease this, keep the GAppInfo list around in AllView, and make
the AppFolders use it when figuring out the contained apps. Since reloading
the AllView results in AppFolders regenerated from scratch, the app info
list is ensured to be up-to-date for any later change within the AppFolder
(eg. through the GSettings key changing).

As the list was already filtered in the first place, we can also remove
the try{}catch() in AppFolder in order to discard desktop files with
invalid encoding.

Related: https://gitlab.gnome.org/GNOME/gnome-shell/issues/832
2019-01-26 16:40:48 +01:00
Florian Müllner
e68dfed1f7 cleanup: Port GObject classes to JS6 classes
GJS added API for defining GObject classes with ES6 class syntax
last cycle, use it to port the remaining Lang.Class classes to
the new syntax.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/361
2019-01-25 14:02:44 +00:00
Florian Müllner
bacfdbbb03 cleanup: Port non-GObject classes to JS6 classes
ES6 finally adds standard class syntax to the language, so we can
replace our custom Lang.Class framework with the new syntax. Any
classes that inherit from GObject will need special treatment,
so limit the port to regular javascript classes for now.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/361
2019-01-25 14:02:44 +00:00
Jasper St. Pierre
04d7069d83 app-usage: Remove crufty old "context"s idea
Back in the day, there was a proposed system of tracking apps in a
specific context.

The inspiration was that you may have used apps in multiple modes:
Firefox may have been used in both "Programmer Reference" and
"Kitten Videos" contexts. Early user response to the feedback wasn't
too positive - context switching is something that humans have trouble
doing implicitly, let alone explicitly. The old codebase still has a
few remnants of this around; let's finally put them to rest.

Note that we still write out a dummy context tag to the XML file - old
versions of the shell will flat out crash if you don't have one of those
in there, so just leave it in for compatibility sake.

https://bugzilla.gnome.org/show_bug.cgi?id=673767
2018-11-17 12:08:33 +00:00
Florian Müllner
76117fd306 appFolder: Don't block all shortcuts
App folder popups take a grab when opened, and as we don't pass any
particular pushModal() parameters, all keybindings are blocked. While
this makes sense for most keybindings that would interfere with the
popup interaction, others like volume/brightness keys or screenshots
can be allowed safely.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/648
2018-10-11 20:12:54 +02:00
Georges Basile Stavracas Neto
8b215b2446
boxPointer: Rename show/hide to open/close
Pretty much like dd4709bb2, BoxPointer's show() and hide()
functions will clash with Clutter.Actor's ones.

In addition to that, on a conceptual level, the current API
is not great, because calling boxPointer.hide() won't result
in boxPointer.actor.visible == false.

For these reasons, rename show() and hide() to open() and
close(). A compatibility layer will be added in a following
commit, warning about the usage of show() and hide().

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:53 -03:00
Georges Basile Stavracas Neto
197c0eee29
iconGrid: Stop using Shell.GenericContainer
Removing Shell.GenericContainer from the IconGrid class was
challenging because it needs the "skip paint" API from it.
This API was added, too, as a workaround to the inability
to override vfuncs from GJS.

The overrides are largely copy-pasted and translated versions
of the Shell.GenericContainer code.

The IconGrid:key-focus-in signal was renamed to :child-focused
to avoid clashing with ClutterActor:key-focus-in.

In GridSearchResults, the internal IconGrid had it's y_expand
set to false, so it doesn't push other search elements (the
list results mainly) to the bottom of the screen.

Because skip paint wasn't and still isn't a GObject property,
rename it to _skipPaint to reflect that.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:25 -03:00
Georges Basile Stavracas Neto
034a723677
iconGrid: Rename ::key-focus-in signal
As part of our quest to obsolete Shell.GenericContainer, IconGrid will
become a Clutter.Actor subclass. As the ::key-focus-in signal would
clash with Clutter.Actor::key-focus-in, rename it to ::child-focused.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:25 -03:00
Georges Basile Stavracas Neto
81ec8215a0
baseIcon: Stop using Shell.GenericContainer
Pretty much like the previous patches, this extends St.Bin. The
most interesting aspect of this patch is that most of the sizing
routines of the icons is now delegated to the actors and layout
managers, removing quite a bunch of code.

The 'spacing' theme property is now redirected to StBoxLayout's
spacing property. Also adjust the Dash code to stop forcing a
potentially invalid width in the first icon too.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/153
2018-10-08 22:42:24 -03:00
Florian Müllner
94423151b2 dbus: Move all interface descriptions into the resource
https://gitlab.gnome.org/GNOME/gnome-shell/issues/537
2018-09-17 07:34:49 +00:00
Marco Trevisan (Treviño)
dbf993300a js: use ES6 template strings for dbus interfaces
Use multiline template strings for dbus interfaces as they're easier to maintain
2018-08-27 19:23:00 +02:00
Jonas Ådahl
47ea10b7c9 Remove usage of MetaScreen
Remove any usage of MetaScreen, as it has been removed from libmutter
in the API version 3. The corresponding functionality has been moved
into three different places: MetaDisplay, MetaX11Display (for X11
specific functionality) and MetaWorkspaceManager.

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:56:19 +02:00
Xavier Johnson
a21a22fdb5 appDisplay: Make middle-click like Ctrl+click
When middle-clicking an app icon on the Dash, it will always try to open
a new window of that app, even if the app doesn't support multiple
windows. Meanwhile, Ctrl+click on an app will only open a new window if
the app allows it.

This change prevents middle-clicks on app icons from opening new windows
for apps without multi-window support.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/316
2018-06-07 17:49:36 +00:00
Florian Müllner
f0557ea05c appDisplay: Fall back to app name in icon menu
The app icon's context menu contains a list of open windows,
identified by their title. As we currently don't handle the
case where the app didn't set a title, we end up with empty
menu items which looks clearly broken. Fall back to the app's
name in that case.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/26
2018-05-31 11:27:43 +00:00
Florian Müllner
3b1330880f cleanup: Use Function.prototype.bind()
When not using arrow notation with anonymous functions, we use Lang.bind()
to bind `this` to named callbacks. However since ES5, this functionality
is already provided by Function.prototype.bind() - in fact, Lang.bind()
itself uses it when no extra arguments are specified. Just use the built-in
function directly where possible, and use arrow notation in the few places
where we pass additional arguments.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/23
2018-02-21 13:55:02 +00:00
Florian Müllner
213e38c2ef cleanup: Use arrow notation for anonymous functions
Arrow notation is great, use it consistently through-out the code base
to bind `this` to anonymous functions, replacing the more overbose
Lang.bind(this, function() {}).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/23
2018-02-21 13:55:00 +00:00
Florian Müllner
76f09b1e49 cleanup: Use method syntax
Modern javascript has a short-hand for function properties, embrace
it for better readability and to prepare for an eventual port to
ES6 classes.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/23
2018-02-21 13:54:58 +00:00
Nikita Churaev
92f1aec3dd appDisplay: Fix small app folder icons when using HIDPI
While the scale factor is taken into account for app icons, we set
an explicit size when combining the into a folder icon - unless we
take the factor into account, the result will be too small on HiDPI
displays.

https://bugzilla.gnome.org/show_bug.cgi?id=792259
2018-02-10 00:40:48 +00:00
Marco Trevisan (Treviño)
35eac697c1 appDisplay: don't try to close the popup menu that is already destroyed
This would lead to a JS error otherwise, as we might end up
in deleting actors that have been already destructed.

https://bugzilla.gnome.org/show_bug.cgi?id=791233
2018-01-17 13:04:41 -05:00
Rares Visalom
52f604757c appDisplay: Include system actions in search results
The way system actions are displayed in the search
results is by appending them at the end of the list
returned by the ApplicationProvider.

https://bugzilla.gnome.org/show_bug.cgi?id=691900
2017-08-22 13:02:58 +02:00
Mario Sanchez Prada
d903978937 Explicitly set the width and height for subicons' containers in folders
Otherwise the smaller icons will try to take too much space since the
texture rendering the icons will be scaled up on HiDPI displays according
to the scale factor, which will push the size of the StBin containing the
texture up, causing them to completely fill the folder's total space.

Explicitly setting the size of the StBin container in this case, in a
similar fashion to what we do when creating the empty placeholders (in
case where there are less than 4 apps in a folder), ensures that each
"cell" of the grid-like widget representing the folder does not take
too much space.

https://bugzilla.gnome.org/show_bug.cgi?id=786145
2017-08-11 12:47:45 +02:00
Florian Müllner
c67eabaf62 appDisplay: Use ::paint handler to set up spring animation
The animation needs the icons' final positions, so we currently defer
it to a ::notify::allocation handler; however as starting the animation
during an allocation cycle would trigger a Clutter warning, it is
further deferred to a MetaLater. While this usually works, it is possible
that the allocation is already valid when we connect the signal, in which
case the animation is triggered at a later unexpected time. Switch to
a more robust ::paint handler instead, which also allows us to get rid
of the double-delay.

https://bugzilla.gnome.org/show_bug.cgi?id=736148
2017-07-19 10:49:54 +02:00
Florian Müllner
033277b68f Define externally accessible contants with 'var' instead of 'const'
Just as we did with classes, define other constants that are (or
may be) used from other modules with 'var' to cut down on warnings.

https://bugzilla.gnome.org/show_bug.cgi?id=785084
2017-07-18 21:52:06 +02:00
Florian Müllner
2582d16ca7 Define classes with 'var' instead of 'const'
Any symbols (including class properties) that should be visible
outside the module it's defined in need to be defined as global.
For now gjs still allows the access for 'const', but get rid of
the warnings spill now by changing it.

https://bugzilla.gnome.org/show_bug.cgi?id=785084
2017-07-18 21:52:06 +02:00
Florian Müllner
6a2af25d48 appDisplay: Define constant before using it
This is now a fatal error with current gjs, however I wonder: Did this
ever work?

https://bugzilla.gnome.org/show_bug.cgi?id=785084
2017-07-18 21:52:06 +02:00
Florian Müllner
358133e82f Initialize properties in _init()
While we've always considered it good style to initialize JS properties,
some code that relies on uninitialized properties having an implicit
value of 'undefined' has slipped in over time. The updated SpiderMonkey
version used by gjs now warns when accessing those properties, so we
should make sure that they are properly initialized to avoid log spam,
even though all warnings addressed here occur in conditionals that
produce the correct result with 'undefined'.

https://bugzilla.gnome.org/show_bug.cgi?id=781471
2017-07-13 17:23:54 +02:00
Mario Sanchez Prada
d8e7fc403b appDisplay: Add a null-check for the scrollview's fade ClutterEffect
This effect will only be created when the StScrollView actor has either
a non-zero vertical or horizontal fade offset defined, so we need to
add a null-check in these two cases before assuming it's there.

https://bugzilla.gnome.org/show_bug.cgi?id=783823
2017-06-15 15:01:51 +01:00
Florian Müllner
e08f2a4a04 Don't mix GJS and GObject signal systems
GJS implements a basic signal system that allows monkey-patching
JS objects with signal methods resembling the GObject ones. However
it's clearly not a good idea to replace the actual GObject methods,
so use the proper GObject facilities when inheriting from GObject.

https://bugzilla.gnome.org/show_bug.cgi?id=778660
2017-02-15 23:20:14 +01:00
Xiaoguang Wang
09e6bb5d56 appDisplay: Fix completion handler for empty animations
If an onComplete handler is passed to animate(), it is set to run at
the end of the animation via the icon grid's ::animation-done signal.
Currently the signal is connected after starting the animation, with
the result that the handler doesn't run when the animation completes
immediately (because there are no icons to animate). Fix this by only
starting the animation after connecting the signal.

https://bugzilla.gnome.org/show_bug.cgi?id=774381
2016-11-23 22:11:00 +01:00
Florian Müllner
e661d904de appDisplay: Use correct view for animation
We currently assume that the current view matches the 'app-picker-view'
setting. While that is usually the case, there is one notable exception:
While there isn't sufficient usage data (yet), we show all applications
instead of an empty frequent view regardless of the setting. We should
animate the actually visible icons in that case, not the (non-existent)
ones from the hidden frequent view.

https://bugzilla.gnome.org/show_bug.cgi?id=774381
2016-11-23 22:11:00 +01:00
Bastien Nocera
009d021e4f appDisplay: Add a menu item to launch on the discrete GPU
It will only show up when a discrete GPU is available (detected through
the switcheroo-control D-Bus service), and the application hasn't
alreayd been launched.

Note that this will not currently work for D-Bus activated applications,
eg. the menu item will be available, but the environment variable will
not be passed through to D-Bus to use when launching the application.

https://bugzilla.gnome.org/show_bug.cgi?id=773117
2016-10-21 19:26:49 +02:00
Michele Gaio
1545596c7e AppIconMenu: properly destroy on source destroy.
If the source actor is destroyed while the popupMenu is shown -- this
can happen if a non favorite application was closing or crashes -- the
menu actor is improperly destroyed.

This makes the popupMenu close first and does a clean ungrab instead.

https://bugzilla.gnome.org/show_bug.cgi?id=757556
2016-05-27 01:03:25 +02:00
Florian Müllner
fed79ce4e6 appDisplay: Handle non-UTF8 filename encodings more gracefully
It may be 2015, but users still stumble upon the occasional .desktop
file that uses a filename encoding other than UTF-8. We currently
fail quite spectacularly in that case by not displaying any apps at
all - handle this case more gracefully, by only filtering out the
offending apps.

https://bugzilla.gnome.org/show_bug.cgi?id=651503
2015-07-31 16:52:42 +02:00
Rui Matos
7bdd1c625c AllView: prevent accessing a NULL effect
In some cases we might be allocated a size such that
this._grid.topPadding and this._grid.bottomPadding are both 0 which
means that the ScrollView fade effect gets removed. In that case don't
try to access the effect since it will be NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=750714
2015-06-26 18:09:17 +02:00
Giovanni Campagna
1f2e53dd15 AppDisplay: use global settings object
We don't need a different GSettings object for each app or
favorite item.

While it practice it does not change much (AddMatch is still
obviously sent out), it minimally reduces the overhead on
changes, and makes for cleaner code.

https://bugzilla.gnome.org/show_bug.cgi?id=746509
2015-03-27 13:11:22 -07:00
Rui Matos
4ff489d24b appDisplay: Don't call a non-existent onComplete
Follow up to commit 6bb905895c .

https://bugzilla.gnome.org/show_bug.cgi?id=745627
2015-03-04 19:01:41 +01:00
Florian Müllner
6bb905895c appDisplay: Disable scrolling during animations
Currently scroll events during the swarm animation will make the
grid appear immediately in addition to the animating clones, and
there'll be a mismatch with the icon at the target position. This
badly breaks the illusion of launchers emerging from the dash and
positioning themselves in a grid - as scrolling icons "mid-air"
before they form a paginated grid doesn't make much sense anyway,
fix this issue by ignoring scroll events for the duration of the
animation.

https://bugzilla.gnome.org/show_bug.cgi?id=745574
2015-03-04 13:45:26 +01:00
Michele
99af774c98 appDisplay: Fix leaking signal connections
The overview has a longer life-time than dash items, so we are leaking a
signal connection each time an item is destroyed.

https://bugzilla.gnome.org/show_bug.cgi?id=745570
2015-03-04 12:56:35 +01:00
Jakub Steiner
48cfd35b65 theme: a button is a button is a button
https://bugzilla.gnome.org/show_bug.cgi?id=737785
2015-02-20 15:16:06 +01:00
Carlos Soriano
6cf53a8d1c appDisplay: Show a dot when application is running
Show a dot in the icon of running applications.
Design request.

https://bugzilla.gnome.org/show_bug.cgi?id=744680
2015-02-20 15:14:42 +01:00
Florian Müllner
12cb023050 appDisplay: Do not duplicate "New Window" action
We assume that applications that export a 'new-window' action can open
a new window, so we add an appropriate entry to the context menu.
However this duplicates functionality if the application already
exposes the action via the desktop file - don't add our own entry
in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=744446
2015-02-13 23:27:44 +01:00
Murray Cumming
1da9546c40 App Picker: Prevent drag if favorite-apps is locked.
Because there's nothing (in single-monitor setups) that could
take the drop in this case.

* js/ui/appDisplay.js:
  AllView._loadApps(), FrequentView._loadApps(): Pass
  an isDraggable parameter when creating the AppIcons,
  depending on whether the favorite-apps key is locked.
  AppIcon._init(): Check for isDraggable in the params and
  do not create _draggable if it was specified, to prevent a
  drag from starting.
  AppIcon.popupMenu(): Check _draggable before trying to call
  fakeRelease on it.
* js/ui/dash.js: Dash._createAppItem(): Check AppIcon._draggable
  before trying to connect to its signals.

https://bugzilla.gnome.org/show_bug.cgi?id=741325
2015-01-28 14:15:51 +01:00
David King
e69cc20fc7 dash: Improve feedback when favorite-apps key is locked
In a lockdown scenario, where the favorite-apps GSettings key is not
writable, hide the menu items for adding and removing favorites from the
dash menu. Additionally, reject drops to the dash for DND.

https://bugzilla.gnome.org/show_bug.cgi?id=741325
2015-01-28 14:15:51 +01:00
Yuki
24c0a1a1d4 Move style updates in AppIcon._onStateChanged out
There is currently no simple way to inject into AppIcon's state change,
so an extension that wants to do this has to destroy/remove/update all
icons in the Shell (i.e. in the Dash, AllView, FrequentView) on enable()
and disable() after updating AppIcon.prototype._onStateChange, or the
extension must require a restart of the Shell.

To solve this issue, we rename _onStateChanged to _updateRunningStyle,
and connect the notify::state signal with an anonymous function that
calls _updateRunningStyle.
This extra function call should allow extensions to just extend the
updateRunningStyle function in the prototype.

https://bugzilla.gnome.org/show_bug.cgi?id=739497
2014-11-06 21:22:33 +01:00
Florian Müllner
5180ab262c appDisplay: Use EXTERNAL scroll policy
Now that we support the new policy type, we can just use it instead
of hiding the scrollbar.

https://bugzilla.gnome.org/show_bug.cgi?id=739379
2014-10-30 00:37:55 +01:00
Florian Müllner
3ae45bddad appDisplay: Hide empty app folders
Trying to open an empty folder currently leaves the parent view in a
rather confused state. While we should look into fixing this in the
future, empty folders are not useful at all to begin with, so hide them.

https://bugzilla.gnome.org/show_bug.cgi?id=736910
2014-09-19 15:12:03 +02:00
Florian Müllner
491100c7ee appDisplay: Only allow ctrl-click for apps that can open new windows
Trust the heuristics in shell_app_can_open_new_window() to get it right
more often than not, and add an appropriate check in activate(). This
makes the behavior consistent with the dash, e.g. we will try to open
a new window (and show the corresponding animation) for apps that don't
have a "New window" item in their dash context menu.

https://bugzilla.gnome.org/show_bug.cgi?id=736329
2014-09-09 15:57:15 +02:00
Florian Müllner
3981b27d8f search: Remove DND code from GridSearchResult
Providers that need drag-and-drop behavior can implement this via the
createResultObject() hook (as the app search provider already does), no
need to duplicate that code in the generic result objects
(ListSearchResult already does not implement DND).

https://bugzilla.gnome.org/show_bug.cgi?id=734726
2014-09-02 00:07:32 +02:00
Carlos Soriano
62786c09a8 appDisplay: Animate appIcon for new window of apps
Following design mockups, animate the icons on AllView, FrequentView,
Dash and Search to zoom out when opening a new window of the app or when
the app is not running and the user execute it.

https://bugzilla.gnome.org/show_bug.cgi?id=734726
2014-09-02 00:07:32 +02:00
Florian Müllner
67c216a6fe search: Allow providers to return the complete result object
This makes the existing createResultObject() match its name better
 and avoids oddities like nested StButtons in app search results.

https://bugzilla.gnome.org/show_bug.cgi?id=734726
2014-09-02 00:07:32 +02:00
Carlos Soriano
75d5e84a4b appDisplay: Animate indicators out
Given that we animate indicator in, it makes sense to animate them out
as well.
Also make possible animating indicators between view changes as well.

https://bugzilla.gnome.org/show_bug.cgi?id=734726
2014-09-01 22:34:51 +02:00
Carlos Soriano
f160dda187 appDisplay: Animate AllView and FrequentView
Following design decision, we want to animate AllView and FrequentView
when opening and closing with a swarm spring form.

This involves a few changes needed to allow that, since from some time
now, we are animating page changes in viewSelector, using only a fade
transition. However now we want to let appDisplay and iconGrid apply its
own animation.

For that we special case the change to and from apps page on
viewSelector to let appDisplay to animate its own items, using and API
on appDisplay which at the same time uses an API on iconGrid.

Thanks Florian Müllner for the debugging work

https://bugzilla.gnome.org/show_bug.cgi?id=734726
2014-09-01 22:34:51 +02:00
Carlos Soriano
9c474a635a appDisplay: Animate folder view items
Add a new animation  to folder view based on designers mockups that
emulates pulsating icons.
The code on iconGrid is though to work well for the upcoming patches to
animate AllView and FrequentView.

https://bugzilla.gnome.org/show_bug.cgi?id=734726
2014-09-01 22:33:42 +02:00
Carlos Soriano
d1a3a000af appDisplay: sync page when changing adjustment
We were setting the value of adjustment on size changes, but we weren't
changing the page value, so adjustment and page value was not in sync.

To fix it, make sure adjustment of the view is in sync with the page
value.

https://bugzilla.gnome.org/show_bug.cgi?id=734680
2014-08-15 23:07:25 +02:00
Florian Müllner
d836194e31 appDisplay: Remove pointless return value
StButton::clicked does not have a return type, so don't return anything.
2014-08-07 18:41:28 +02:00
Florian Müllner
fe60db64e0 appDisplay: Use Clutter.GridLayout
Clutter.TableLayout has been deprecated, so move to the recommended
replacement.
2014-08-06 15:23:21 +02:00
Carlos Soriano
84cbbafaae appDisplay: Don't grow indicators more than the parent
Currently the indicators are a BoxLayout inside a BinLayout in AllView.
BinLayout doesn't have any size constraint, so if the indicators request
a bigger size than AllView the entire overview is grown, causing the
overview to go crazy.

To avoid that, create an actor for the page indicators that request as
minimum size 0, and as a natural size, the sum of all indicators natural
sizes. Then we clip_to_allocation, so it doesn't grow more than the
parent.

https://bugzilla.gnome.org/show_bug.cgi?id=723496
2014-08-06 09:41:29 +02:00
Giovanni Campagna
3182aba744 AppDisplay: don't show a "New Window" menu item if not possible
If the application reports itself as single window (through
an explicit indication in the desktop file or some heuristics),
not show a "New window" item that doesn't actually open a new window.

https://bugzilla.gnome.org/show_bug.cgi?id=722554
2014-08-01 11:45:18 +02:00
Carlos Garnacho
f8899cf274 appDisplay: Allow clicks/long presses through touch events
The long press code has been refactored so it can be used on both pointer and
touch events, and the click gesture has been made to account for button=0.

https://bugzilla.gnome.org/show_bug.cgi?id=733633
2014-07-24 18:15:02 +02:00
Carlos Soriano
554001c0ed appDisplay: Move focus to popup only when necessary
Unlike for the main app view, where we only move the key focus once the
users starts navigating, the key focus is moved immediately when opening
a folder popup. This is unexpected, so make app folders consistent with
the main view.
As arrow keys will not work while the container itself has key focus, we
handle those explicitly by translating them to TAB_FORWARD and
TAB_BACKWARD respectively.

https://bugzilla.gnome.org/show_bug.cgi?id=731477
2014-07-17 20:41:24 +02:00
Florian Müllner
2bda6db30f appDisplay: Fix folder icons for RTL locales
Unlike StTable, ClutterTableLayout does not take the actor's text
direction into account, so mirror columns ourselves now.

https://bugzilla.gnome.org/show_bug.cgi?id=731923
2014-06-24 23:37:35 +02:00
Jasper St. Pierre
83cb26d70e js: Adapt to GSettings API change
The 'schema' property has been deprecated for a long time. Even though
this will likely be reverted in glib, let's stop using it.
2014-06-24 15:17:09 -04:00
Florian Müllner
9bbb3e9c85 appDisplay: Fix app folder "modal-ness"
Commit 5d00c1a5ee moved app folder popups to GrabHelper - for some
reason, the line that ensures the current behavior of only considering
events inside the app picker to dismiss popups got lost ...
2014-06-16 10:28:59 +02:00
Florian Müllner
5d00c1a5ee appDisplay: Use GrabHelper for folder popups
As clicks outside the app picker should still be handled normally
while clicks inside should dismiss the popup, we cannot make full
use of GrabHelper. However using it at least for focus handling
fixes some minor details we are getting wrong, for instance not
restoring the previous focus after dismissing a folder popup.
2014-06-11 23:24:30 +02:00
Matthias Clasen
3cc7112283 Add a 'Show Details' menuitem in the app picker
Add a menu item that shows the details of the application
in gnome-software.

https://bugzilla.gnome.org/show_bug.cgi?id=643043
2014-04-30 19:15:06 +02:00
Jasper St. Pierre
28c1f81f4a appDisplay: Make page panning smoother on touch
Currently, our logic for page panning isn't great. If the user starts a
pan upwards and hesitates over a new page, we'll go to the *next* page
on release, since the difference is greater, but the velocity wound down
to 0.

Instead of trying to treat it like page down or scrolls, simply do the
math to find the page where the user scrolled to.

This is unfortunately broken for fast swipes, since the user doesn't get
far enough into the new page to make a difference. I'm getting the
impression we'll need a gesture recognizer for this, though, however
crude. Simple hacks I tried, like a velocity multiplier, didn't work
properly.

https://bugzilla.gnome.org/show_bug.cgi?id=729064
2014-04-28 13:30:09 -04:00
Jasper St. Pierre
82ec6c08b8 appDisplay: Fix pages getting "stuck" under touch
We often call goToPage like:

  this.goToPage(this._currentPage - 1);

(or + 1). During panning, these are based on the velocity values
of the gesture action. If we're already on the first or last page
and the panning ends, it's possible to get goToPage that's either
-1 or greater than the last page.

During normal usage, this isn't a problem, since the Y values will
be correct, always. But when panning, the Y values stick to the
finger, and thus if we return early, we won't snap to the exact page,
making it seem like things get "stuck".

Fix this the simple way by clamping to the correctly-ranged values
of pageNumber

https://bugzilla.gnome.org/show_bug.cgi?id=729064
2014-04-28 13:30:09 -04:00
Jasper St. Pierre
551e57406d appDisplay: Remove redundant checks for pageNumber
We already do these at the beginning of the function.

https://bugzilla.gnome.org/show_bug.cgi?id=729064
2014-04-28 13:30:08 -04:00
Jasper St. Pierre
9830b3b8f7 appDisplay: Don't pass too many args to add_actor 2014-04-15 17:53:34 -04:00
Bastien Nocera
cd2bd7685a js: Name all the timeouts and idles
With very uninventive names. Names now, good names later.

https://bugzilla.gnome.org/show_bug.cgi?id=727983
2014-04-10 21:08:16 +02:00
Rui Matos
d0f69a72dc appDisplay: Ensure the currently focused icon is viewable
We either scroll or paginate to the correct place when an icon gets
key focus.

https://bugzilla.gnome.org/show_bug.cgi?id=726759
2014-03-26 11:42:34 +01:00
Florian Müllner
30fb2b0d99 appDisplay: Improve icons of folders with few apps
Folders use a 2x2 grid of the first 4 app icons as icon - if a folder
contains less apps, we currently skip the corresponding grid positions.
As a result, the overall size request may be smaller than the one for
other icons, making the folder icon look out of place.
Fix this by always using a full grid as folder icon, using dummy actors
as necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=726322
2014-03-15 00:23:50 +01:00
Florian Müllner
b222d0fe44 appDisplay: Add some spacing in folder icons
With the switch to a table layout in commit f959cafb36, setting
alignments to place the individual icons at the outer edge of the grid
stopped working. Remove that code and add some explicit spacing instead.

https://bugzilla.gnome.org/show_bug.cgi?id=726323
2014-03-14 17:21:57 +01:00
Carlos Soriano
314aa024b5 appDisplay: Add time to view switch animation
Add more time to the fade in/out animation when switching
views so they don't switch abruptly and add a delay
between view switch animations to avoid morphing.

https://bugzilla.gnome.org/show_bug.cgi?id=722331
2014-02-17 13:31:52 +01:00
Cosimo Cecchi
f959cafb36 appDisplay: don't force size on folder icon actor
Use a table layout instead.

https://bugzilla.gnome.org/show_bug.cgi?id=705410
2014-02-16 07:49:25 -08:00
Florian Müllner
4d3fd7598d appDisplay: Re-add _getCategories
It was introduced by one of the commits reverted by 812a61939e,
but is now used for app folders as well; add it back.
2014-02-14 14:02:31 +01:00
Florian Müllner
620e3cef20 appDisplay: Open new window on middle-click
The current middle-click action of opening a new window on a new
workspace is a bit peculiar; it is also not overly hard to achieve
the same result by moving a new window to the desired workspace or
selecting a workspace before opening a new window. Just opening
a new window is also a more common action, so having a shortcut
available that doesn't require a modifier is a good idea as well;
change the middle-click behavior accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=695010
2014-02-14 12:01:48 +01:00
Florian Müllner
812a61939e Revert "appDisplay: Special case terminal launching"
Having terminal launchers behave differently than any other launchers
is non-obvious and confusing. Remove the special-casing to restore
consistency, we will make the new window action more accessible
instead.
This reverts commit 68faba6bde, 4ed0f3e5f0
and 887a21afb9.

https://bugzilla.gnome.org/show_bug.cgi?id=695010
2014-02-14 12:01:48 +01:00
Florian Müllner
b4680a5c25 Use meta_window_is_skip_taskbar() directly
Rather than going through ShellWindowTracker, we can just clean up
the code to use the underlying MetaWindow property directly.

https://bugzilla.gnome.org/show_bug.cgi?id=723308
2014-01-31 13:49:07 +01:00
Jasper St. Pierre
bb8397b9b1 appDisplay: Support the 'excluded-apps' key for app folders
https://bugzilla.gnome.org/show_bug.cgi?id=723179
2014-01-29 14:02:27 -05:00
Jasper St. Pierre
bb8fa61cb4 appDisplay: Support the 'categories' key for app folders
https://bugzilla.gnome.org/show_bug.cgi?id=723179
2014-01-29 14:02:27 -05:00
Jasper St. Pierre
10147ee331 appDisplay: Make refiltering folders more efficient
Rather than queueing a full redisplay, simply filter the apps inside
folders by toggling the icon's visibility.

https://bugzilla.gnome.org/show_bug.cgi?id=723179
2014-01-29 14:02:27 -05:00
Jasper St. Pierre
3779ac2c8a appDisplay: Make AllView handle the display of the all apps view
Rather than having the central component handle it. Just a code tidying-up.

https://bugzilla.gnome.org/show_bug.cgi?id=723179
2014-01-29 14:02:27 -05:00
Jasper St. Pierre
bdad4db9ec appDisplay: Only reload frequently used data when mapping the frequent view
If the user mostly uses the All Apps view and uses it as his default view,
we shouldn't reload frequent data after a timeout. Simply do it when the
view is mapped.

https://bugzilla.gnome.org/show_bug.cgi?id=723179
2014-01-29 14:02:26 -05:00
Jasper St. Pierre
887a21afb9 appDisplay: Properly check for TerminalEmulator in the Categories key
get_categories() returns an unparsed string, not a list of categories.
We need to parse the list by splitting on ';' to deterine whether the
actual 'TerminalEmulator' category is in the list, rather than something
like 'X-GNOME-TerminalEmulator'. It's an edge case, but I need to split
the list properly for the new folders, so I might as well fix this.

https://bugzilla.gnome.org/show_bug.cgi?id=723179
2014-01-28 13:32:36 -05:00
Jasper St. Pierre
974f01cef7 appDisplay: Remove unused method 2014-01-28 11:17:34 -05:00
Giovanni Campagna
7e27afb645 Introduce support for desktop actions in the dash
Using the new list_actions() API in Gio, add entries for static
actions specified in .desktop files in the right-click app menus,
in the dash, app well and search.

https://bugzilla.gnome.org/show_bug.cgi?id=669603
2014-01-19 18:47:29 +01:00
Giovanni Campagna
9ba4790b4d AppDisplay: clean up handling of right click popup menu
Instead of connecting a global activate handler on the menu,
have one on each menu item, individually doing the right thing.

https://bugzilla.gnome.org/show_bug.cgi?id=669603
2014-01-19 18:46:31 +01:00
Sebastian Keller
4ed0f3e5f0 AppDisplay: fix isTerminal() check for apps without .desktop files
If the app has no .desktop file get_app_info() returns null.
This breaks window switching using the dash for those apps.

https://bugzilla.gnome.org/show_bug.cgi?id=722494
2014-01-18 11:36:10 -05:00
Jasper St. Pierre
9df09db5fe appDisplay: Use the new org.gnome.desktop.app-folders schema for grouping
Rather than GMenu / app-folder-categories. This removes our last use of
gnome-menus in the stock gnome-shell, which is exciting, but also means
that app folders in Software start working.

Ideally, we'd have a button to launch our Software app as well from the
overview.

https://bugzilla.gnome.org/show_bug.cgi?id=722117
2014-01-14 11:25:08 -05:00
Jasper St. Pierre
8fe7f923ec appDisplay: Move from instanceof-testing to polymorphic duck typing
Instead of having _compareItems, _getItemId, etc. on the view to
pull out info about items, use the AppIcon / FolderIcon items we
create as a place to track this additional info. We now require
that these items have a '.id' property for deduplication, and a
'.name' property to sort by.

https://bugzilla.gnome.org/show_bug.cgi?id=722117
2014-01-13 17:28:32 -05:00
Giovanni Campagna
a4e019442f AppDisplay: fix isTerminal() check for apps without categories
If there is no Categories line in the .desktop file, get_categories()
returns null, not an empty array.
2014-01-13 23:13:28 +01:00
Jasper St. Pierre
03ab282f67 appDisplay: Fix style 2014-01-13 11:39:30 -05:00
Debarshi Ray
68faba6bde appDisplay: Special case terminal launching
One of the most frequent complaints about our launching behaviour is
how we handle terminals. Among all MDI applications, the terminal is
the one that is most likely to have lots of semi-independent windows
opened at the same time, and spawning new windows is much more common.
More so, if it does not support tabs.

Therefore, we special case terminal launchers to always create a new
window. It is an application that most non-technical users will not
use, so chances of them being confused by any special behaviour is
expected to be low.

https://bugzilla.gnome.org/show_bug.cgi?id=695010
2014-01-10 12:08:14 +01:00
Florian Müllner
deb2f30b37 js: Use EVENT_PROPAGATE/EVENT_STOP constants in event handlers
Just as SOURCE_CONTINUE/SOURCE_REMOVE in source functions, these
constants increase code clarity over plain true/false.

https://bugzilla.gnome.org/show_bug.cgi?id=719567
2013-12-16 18:27:19 +01:00
Florian Müllner
751a3f0e94 js: Use SOURCE_CONTINUE/SOURCE_REMOVE constants in source functions
With support for boolean constants in g-i, we can finally use the
more readable constants instead of true/false.

https://bugzilla.gnome.org/show_bug.cgi?id=719567
2013-12-16 18:27:19 +01:00
Florian Müllner
d21aa0d85f shell-app: Track all application windows
Filtering out "non-interesting" windows beforehand as we currently do
means that we may get properties that should be based on all windows,
like the last time the application was used, wrong.
Just track all windows and filter out non-interesting windows manually
in the one place we actually care about the difference.

https://bugzilla.gnome.org/show_bug.cgi?id=719824
2013-12-07 10:10:06 +01:00
Florian Müllner
7ecb5af587 appDisplay: Remove unused signal
The signal was last used in the pre-3.0 days, so we can stop dragging
it along and just remove it.
2013-11-18 16:24:13 +01:00
Jasper St. Pierre
ba602c17d4 appDisplay: Use the desktop file index for app searching
Rather than scanning all apps for searching, use Ryan's new desktop
file index and the glib support APIs for app searching instead of our
own system.

https://bugzilla.gnome.org/show_bug.cgi?id=711631
2013-11-14 14:28:52 -05:00
Florian Müllner
554d5aeb7c More invalid source fixes
https://bugzilla.gnome.org/show_bug.cgi?id=711732
2013-11-09 17:58:59 +01:00
Jasper St. Pierre
634a599db6 appDisplay: Ignore the NoDisplay flag for directories
This makes us match the native app search.

https://bugzilla.gnome.org/show_bug.cgi?id=698486
2013-11-02 20:12:37 -04:00
Jasper St. Pierre
03b0f4b16b app-system: Remove get_tree
Make clients construct their own gmenu tree if they need it.

https://bugzilla.gnome.org/show_bug.cgi?id=698486
2013-11-02 20:12:37 -04:00
Jasper St. Pierre
027c3d1661 app-system: Remove lookup_app_by_tree_entry
We want to move away from gnome-menus eventually, so the simple
utility method isn't really worth keeping around. Reimplement it
in the one place that uses it.

https://bugzilla.gnome.org/show_bug.cgi?id=698486
2013-11-02 20:12:36 -04:00
Jasper St. Pierre
4965b1ca7b search: Fix previous commit
It was pushed by accident before it was tested...
2013-11-02 20:11:13 -04:00
Jasper St. Pierre
9cd7ea9371 search: Make the internal search interface callback-based
Long ago, the search system worked in a synchronous manner: providers
were given a query, and results were collected in a single array of
[provider, results] pairs, and then the search display was updated
from that.

We introduced an asynchronous search system when we wanted to potentially
add a Zeitgeist search provider to the Shell in 3.2. For a while, search
providers were either async or sync, which worked by storing a dummy array
in the results, and adding a method for search providers to add results
later.

Later, we removed the search system entirely and ported the remaining
search providers to simply use the API to modify the empty array, but the
remains of the synchronous search system with its silly array still
lingered.

Finally, it's time to modernize. Promises^WCallbacks are the future.

Port the one remaining in-shell search engine (app search) to the new
callback based system, and simplify the remote search system in the
process.
2013-11-02 20:07:06 -04:00
Jasper St. Pierre
af06b78605 searchDisplay: Cache result display actors
When we create a result actor, cache it, so it can be used for
subsearches of the same initial. For now, to keep memory usage
and the stage graph relatively clean, don't persist the actors
across searches, but maybe we should do this in the future.

This also means that we don't query getResultMetas for items
that we've seen in the same initial search.

https://bugzilla.gnome.org/show_bug.cgi?id=704912
2013-10-30 13:01:20 -04:00
Jasper St. Pierre
3749b09366 searchDisplay: Make the search result actors stateless, by removing terms
We want to cache result actors between searches, so we shouldn't
instantiate them with search-specific info.

https://bugzilla.gnome.org/show_bug.cgi?id=704912
2013-10-30 13:01:20 -04:00
Jasper St. Pierre
27cac10d0c appDisplay: Use a proper string key for the app search provider
Since we're going to be caching results based on the result ID,
we need to return a string-based result ID to cache on.

https://bugzilla.gnome.org/show_bug.cgi?id=704912
2013-10-30 13:00:47 -04:00
Florian Müllner
5a7e854f9e appDisplay: Remember selected view across sessions
The application picker will always open with the view that was last
selected during the session, but the selection is reset on each
restart. This results in some annoyance for users that use the
ALL view exclusively, as they have to toggle views once each
session - the same would apply to exclusive FREQUENT view users
were the defaults to be changed, so the best solution is to simply
make the selected view persistent by storing it in GSettings.

https://bugzilla.gnome.org/show_bug.cgi?id=710042
2013-10-15 19:06:53 +02:00
Giovanni Campagna
002afda503 SearchDisplay: handle certain result IDs specially
Allow the prefix 'special:' applied to result IDs to mark results
that should be always shown, even when they would overflow the
maximum results cap. This will be used by epiphany for the special
"Search the Web" result.

https://bugzilla.gnome.org/show_bug.cgi?id=707055
2013-10-14 18:47:20 +02:00
Carlos Soriano
93d9c16672 appDisplay: Rework indicators animation
Previously the animation was not entirely according to the mockup.
Now we are closer to the mockup.

The padding for the indicators are decremented, since we need that
to make the animation not too quick. As a drawback, maybe visually
is not as good as before, or the area to click dots is too much little.
Just make that change for now and test it widely, and we can change
that after.

https://bugzilla.gnome.org/show_bug.cgi?id=707565
2013-09-16 18:49:24 +02:00
Carlos Soriano
7b7c4568b2 appDisplay: Change pages with page down/up keys
Add key bindings to app picker to allow change pages using
the page up/down keys.

https://bugzilla.gnome.org/show_bug.cgi?id=707979
2013-09-13 19:16:11 +02:00
Carlos Soriano
f38091d96b appDisplay: Move boundary page assertions
Since the function that manages the changes between pages is
goToPage, just move the assertions of page >= 0 and page < nPages
to that function

https://bugzilla.gnome.org/show_bug.cgi?id=707979
2013-09-13 18:58:46 +02:00
Carlos Soriano
7c78e1fbf5 appDisplay: Fix indicator animation position
The original position was calculated with the stage and the
transformed position of the indicator when mapped. The values
were wrong on some situations, so lets calculate the position
based on the dots width.

https://bugzilla.gnome.org/show_bug.cgi?id=707580
2013-09-13 18:15:33 +02:00
Giovanni Campagna
255cb8edb1 AppFolderPopup: fix the position of close buttons
We need to adjust the offset of close buttons, in case the box
pointer has the arrow at the top. To do so, extend close buttons
to hook into a boxpointer (since that's the common use for them)
and automatically adjust their position.

https://bugzilla.gnome.org/show_bug.cgi?id=707842
2013-09-12 14:33:35 +02:00
Jasper St. Pierre
2d8ed4c77f Bind "this" for various methods
For extremely silly reasons with how the class framework works, the wrapper
method requires "this" to be bound in order for it to work, or else we'll
emit errors in strict mode.

https://bugzilla.gnome.org/show_bug.cgi?id=707892
2013-09-11 15:02:32 -04:00
Florian Müllner
387184b052 appDisplay: Increase fade offset in FolderView
Just as we do in AllView, we set the offset of FolderViews' fade
effect so that no icon is faded when a full page is visible.
This works fine in AllView, however in the FolderView case where
the popup's offsets eat away from the available fade height, the
effect ends up being barely noticeable at all.
While it is not ideal to apply the fade to the edge of a "full page",
it looks less ugly than the current state, so pick the lesser evil ...

https://bugzilla.gnome.org/show_bug.cgi?id=707662
2013-09-06 23:54:46 +02:00
Carlos Soriano
6b554337ff appDisplay: Make sure we don't clip folder view
If we round up the value, we make sure we don't clip in any
case neither the folder view or the close button.
2013-09-06 23:45:50 +02:00
Carlos Soriano
85d2b9e32a appDisplay: Also scroll on focused indicators
Since now if you focus the indicators, you can't scroll and
change pages in the app picker. That was reported as odd from
some users/developers.
So allow to scroll when the focus is in the indicators.

https://bugzilla.gnome.org/show_bug.cgi?id=707609
2013-09-06 10:40:07 +02:00
Florian Müllner
b462a85c43 appDisplay: Fix obvious copy+paste error 2013-09-06 02:58:15 +02:00
Florian Müllner
420db828e9 appDisplay: Also fade ScrollView in folders 2013-09-05 18:30:18 +02:00
Florian Müllner
fd8def705d appDisplay: Remove _updateAdjustment
Provided that PaginatedIconGrid's height request is correct, we
can rely on StBoxLayout to update the adjustment correctly.
2013-09-05 18:18:05 +02:00
Florian Müllner
2980515c85 appDisplay: Fix return value for _onScroll
ClutterActor::scroll-event has a boolean return value to indicate
whether the event has been handled, or event emission should continue.
Now that we are using an StScrollView, we depend on this to avoid
propagating the event to the view's own handler.

https://bugzilla.gnome.org/show_bug.cgi?id=707409
2013-09-04 23:52:19 +02:00
Florian Müllner
36bee16781 appDisplay: Use a ScrollView for pages
While we obviously don't want any scrollbars, its fade effect
will give us some extra polish when switching pages.

https://bugzilla.gnome.org/show_bug.cgi?id=707409
2013-09-04 23:52:19 +02:00
Florian Müllner
e68b648a33 appDisplay: Don't show page indicators if there's only one page
It doesn't make sense to show the indicators in that case, so
don't show them. This has been the design in the first place,
but the code that did that was lost at some point during review ...

https://bugzilla.gnome.org/show_bug.cgi?id=707363
2013-09-03 13:54:21 +02:00
Giovanni Campagna
9ea0f7255f PageIndicators: extend the clickable area
Replace the inactive spacing with clickable padding inside the
buttons, for easier selection with a mouse.

https://bugzilla.gnome.org/show_bug.cgi?id=707314
2013-09-02 22:53:04 +02:00
Florian Müllner
938628a05f appDisplay: Default to All view when not enough usage data is available
The frequent view is not useful when it doesn't contain any applications
yet. While the previously added label makes this state appear less like
an error (OMG, my apps are gone!), it doesn't address the issue of
usefulness - default to the more helpful All view in this case.

https://bugzilla.gnome.org/show_bug.cgi?id=694710
2013-09-02 21:26:11 +02:00
Carlos Soriano
a765dfc52e appDisplay: Show label when frequent app view is empty.
Currently we show a empty view, that seems broken, so we add a label
showing that there's not enough frequent applications to show.

https://bugzilla.gnome.org/show_bug.cgi?id=694710
2013-09-02 21:25:03 +02:00
Carlos Soriano
d58f0646cf iconGrid: Also adapt icon size to available space
Similar to adapting the spacing dynamically to the available
space we already do, scale down icon sizes if the grid is too
small to fit the requested minimum number of rows/columns.

https://bugzilla.gnome.org/show_bug.cgi?id=706081
2013-09-02 20:36:39 +02:00
Florian Müllner
792b963bda iconGrid: Change IconGrid.addItem() to take an object instead of an actor
IconGrid has never really been a general purpose container, but has
always been used in conjunction with BaseIcon. IconGrid will soon
gain the ability to adjust the item size dynamically to adapt to the
available space, which will require that we can make some more
assumptions about the items added to the grid (namely: we need
access to BaseIcon's setIconSize() method).
So change addItem() to take an object instead, which should have
an actor and a (BaseIcon) icon property.

Based on a patch by Carlos Soriano.

https://bugzilla.gnome.org/show_bug.cgi?id=706081
2013-09-02 20:36:39 +02:00
Carlos Soriano
1e02081cd2 appDisplay: Add pan action to FolderView
Since we have now a ScrollView in the FolderView,
add support for the pan action

https://bugzilla.gnome.org/show_bug.cgi?id=706081
2013-09-02 20:36:39 +02:00
Carlos Soriano
3f24a87034 appDisplay: Make space on grid to fit collection when opening
Move icons out of the way to make place for the FolderView
popup before opening it.

https://bugzilla.gnome.org/show_bug.cgi?id=706081
2013-09-02 20:36:39 +02:00
Carlos Soriano
74978e84f8 appDisplay: Start always at page 0 in AllView
Reset the AllView scroll adjustment between overview openings,
following design reasons

https://bugzilla.gnome.org/show_bug.cgi?id=706081
2013-09-02 20:02:36 +02:00
Carlos Soriano
6ef775390f appDisplay: Start always at scroll 0 on FolderView
Reset the scroll adjustment between popups opennings,
following the same design we want to the AllView

https://bugzilla.gnome.org/show_bug.cgi?id=706081
2013-09-02 20:02:36 +02:00
Carlos Soriano
1313c1b157 appDisplay: Align and contain collection grid with parent view
The popup of the FolderView is now contained inside
the parent view, solving the overflow of apps with a ScrollView.
Also, solved a lot of bugs in popup/FolderView calculation
of position and size.

https://bugzilla.gnome.org/show_bug.cgi?id=706081
2013-09-02 19:54:23 +02:00
Carlos Soriano
6d6c400b25 iconGrid: Add padWithSpacing property
Add a property to also add the calculated spacing
around the grid.
This will allow FolderView to be aligned with the
main grid without cutting off any of the surrounding
boxPointer decorations or the close button

https://bugzilla.gnome.org/show_bug.cgi?id=706081
2013-09-02 19:51:28 +02:00
Carlos Soriano
46bd1b9b18 appDisplay: Add and rework pan action response
Add pan action to AllView and rework it to take
into account the velocity the user gives to the action

https://bugzilla.gnome.org/show_bug.cgi?id=706081
2013-09-02 19:51:28 +02:00
Carlos Soriano
dcea8bed6d appDisplay: Add page indicators
Add indicators to the pagination in AllView, which displays
how many pages of apps we have and allows the user to
navigate through them.

https://bugzilla.gnome.org/show_bug.cgi?id=706081
2013-09-02 19:51:00 +02:00
Carlos Soriano
ae263bb4db iconGrid: Add minRows/minColumns properties
When we adapt the grid to different display sizes,
we don't want the number of displayed items to get
too small. In the future we will scale down icons to
make sure that the grid fits add least minRows
x minColumns items, but for now we only take the
properties into account when calculating the dynamic spacing.

https://bugzilla.gnome.org/show_bug.cgi?id=706081
2013-09-02 19:43:49 +02:00
Carlos Soriano
754ca7c8f2 appDisplay: Paginate AllView
Organize applications in AllView by pages using the new PaginatedIconGrid
added previously. Pagination is generally a better pattern for collections
than scrolling, as it better suits spacial memory.
Hook into AppDisplay's allocation function to communicate the available
size to the different views before child allocations - this is only
required by the paginated view (as pages must be computed before
calling get_preferred_height/get_preferred_width), but doing it for
all views will guarantee that their dynamic spacing calculation is
based on the same values.

https://bugzilla.gnome.org/show_bug.cgi?id=706081
2013-09-02 19:06:35 +02:00
Carlos Soriano
804c02701a appDisplay: Animate _updateIconOpacities
Animate the transition between full opacity and partly opacity
to follow overall animations design of gnome-shell

https://bugzilla.gnome.org/show_bug.cgi?id=706081
2013-09-02 18:57:36 +02:00
Carlos Soriano
fbb4077812 appDisplay: Rename AlphabeticalView to BaseAppView
Since the items are not ordered in an alphabetical
way, just rename the class to be consistent.

https://bugzilla.gnome.org/show_bug.cgi?id=706081
2013-09-02 18:57:36 +02:00
Carlos Soriano
961e1b89a2 appDisplay: Move FolderView near FolderIcon for better context
Since FolderView is closely related with FolderIcon, we
have more context while working if FolderView is near
FolderIcon

https://bugzilla.gnome.org/show_bug.cgi?id=706081
2013-09-02 18:57:36 +02:00
Giovanni Campagna
415563dc6e Add a FocusApp method to org.gnome.Shell
This method, which accepts a .desktop filename, is used to highlight
a specific application in the overview, for example because it has
just been created or installed.

https://bugzilla.gnome.org/show_bug.cgi?id=654086
2013-09-02 10:51:00 +02:00
Giovanni Campagna
1b206fe94c Dash: don't show a tooltip over an application with a popup menu
If the popup menu associated with the application icon is open,
make sure that the tooltip is hidden.

https://bugzilla.gnome.org/show_bug.cgi?id=705611
2013-08-26 13:52:49 +02:00
Florian Müllner
cb4e4bb2db appDisplay: Use hookup_style() to bind app-view-controls spacing
With the monkey-patched ClutterBoxLayout, we no longer need this
code to hook up the 'spacing' property to CSS.

https://bugzilla.gnome.org/show_bug.cgi?id=703905
2013-07-24 15:22:05 +02:00
Carlos Soriano
e30d18febe appDisplay: Give more horizontal space to control buttons
Before, the text of those buttons were truncated when the text exceeded
the fixed width we had in the CSS.
Now, we give more horizontal space to the control buttons to match
the maximum text length of all buttons.

https://bugzilla.gnome.org/show_bug.cgi?id=696307
2013-06-03 19:26:26 +02:00
Jasper St. Pierre
37e2b60cd3 search: Rename pushResults to setResults
pushResults, and the original async search API, were originally intended
so search results that weren't immediate could be added as they come in.
Since then, we've decided that the design of search results is that they
should finish at once with all results. Thus, the code was modified so
that pushResults always overwrote the current result set. As such, it makes
sense to rename the method so that the name matches the behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=693836
2013-05-29 11:32:49 -04:00
Florian Müllner
0eba0f8dd3 appDisplay: Also account for folder popup's close buttons
As the close button of folder popups overlaps at the top, it ends
up being cut off if the folder is located at the very top of the
view. Fix this glitch by taking the button's overlap into account
in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=694371
2013-05-19 23:30:39 +02:00
Florian Müllner
d8d0afff0b appDisplay: Fix cut-off folders in All view
We already take care of growing the view if open folders overlap
at the bottom, however folder popups may still end up being cut
off when opening above the source icon - if the popup is high enough,
its y coordinate will be negative and therefore outside the parent's
allocation. To fix, we can either make sure that folders pop up below
their source icon in that case, or adjust the parent grid's position
as necessary while a folder is open. This implements the latter.

https://bugzilla.gnome.org/show_bug.cgi?id=694371
2013-05-19 23:30:39 +02:00
Florian Müllner
b799e8c0a6 appDisplay: Expand AllView
If the view doesn't fill the available space, content should still
start at the top rather than the center - not least the positioning
code for folder popups assumes that, so set the appropriate expand
flags.

https://bugzilla.gnome.org/show_bug.cgi?id=694371
2013-05-19 23:30:39 +02:00
Florian Müllner
731e8bfe2b Replace 'enable-app-monitoring' setting
The org.gnome.desktop.privacy schema gained a 'remember-app-usage'
key, use that instead of our own preference.

https://bugzilla.gnome.org/show_bug.cgi?id=699714
2013-05-18 20:12:49 +02:00
Florian Müllner
f88d9c06f5 appDisplay: Hide frequent view when app monitoring is disabled
Currently we stop monitoring application usage when disabling the
'enable-app-monitoring' setting, but we still expose previously
gathered data in the app picker's frequent view. This is not what
users should expect, so hide the view in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=699714
2013-05-18 20:12:49 +02:00
Florian Müllner
b79b0952b4 appDisplay: Implement folder keynav and shortcuts
When opening an application folder, it should take key focus to
allow for keynav; also, Escape closing both folder and app picker
is unexpected, it should only close the popup.

https://bugzilla.gnome.org/show_bug.cgi?id=695314
2013-05-13 19:41:23 +02:00
Giovanni Campagna
58872d162b AppDisplay/FrequentView: filter out hidden applications
Filter out all applications which have the NoDisplay, Hidden or
Not/OnlyShowIn bits, as those are not meant to be launched directly.
This also allows the user to filter apps from the frequent view
using alacarte.

https://bugzilla.gnome.org/show_bug.cgi?id=696949
2013-04-22 19:11:17 +02:00
Florian Müllner
499ae609dd appDisplay: Use a custom LayoutManager for the AllView stack
ClutterBinLayout uses the maximum width/height of all children in
size requests and positions children according to the expand/align
properties. This means that the vertical position of folder popups
is not considered in size requests, so if the main view is smaller
than a folder popup's height and offset, the popup will be truncated
and/or mispositioned. Fix those cases by using a custom LayoutManager
that behaves like ClutterFixedLayout for height requests and like
ClutterBinLayout otherwise.

https://bugzilla.gnome.org/show_bug.cgi?id=694371
2013-03-15 22:41:54 +01:00
Jasper St. Pierre
5870709fbc appDisplay: Move ensureIconVisible logic to util, make it more generic
In particular, make it work if we have multiple parents, like in the
search case.

https://bugzilla.gnome.org/show_bug.cgi?id=689681
2013-03-12 19:29:47 -04:00
Giovanni Campagna
95602eb85d AppDisplay: fix allocation loop warnings
Don't use a constraint to position the boxpointer horizontally. Instead,
use the right alignment flags and let the layout managers do their job.

https://bugzilla.gnome.org/show_bug.cgi?id=694284
2013-02-22 14:58:13 +01:00
Florian Müllner
6ea8f35343 appDisplay: Center AllView content
If the AllView is scrolled, the vertical scrollbar will take away
some horizontal space on one side, resulting in the content ending
up slightly off-center.
Account for this by using overlay-scrollbars instead.

https://bugzilla.gnome.org/show_bug.cgi?id=694261
2013-02-22 10:57:50 +01:00
Florian Müllner
7425b382d6 appDisplay: Remove scroll view hack in FrequentView
The frequent view should not be scrolled, but to work around the
icon grid overflowing, we used a (non-scrolling) scroll view anyway.
Now that IconGrid:fillParent allows us to avoid overflow, we can
remove this hack.

https://bugzilla.gnome.org/show_bug.cgi?id=694256
2013-02-22 09:50:57 +01:00
Florian Müllner
9db73767d9 appDisplay: Remove unnecessary StBin from hierarchy
The bin is used to top-align views that don't fill the entire height,
but the same can be achieved by setting appropriate expand properties.
2013-02-22 00:07:54 +01:00
Giovanni Campagna
d3f978a19d AppDisplay: fix undefined variable reference
https://bugzilla.gnome.org/show_bug.cgi?id=694282
2013-02-20 17:04:01 +01:00
Giovanni Campagna
a50ddd6d8c AppDisplay: fake a release event to dnd when opening the menu
PopupMenuManager eats the next release event, which would otherwise close
the menu, so we need to tell dnd that we're handling it, and no drag should
be started, so it can ungrab the pointer and restore state.

https://bugzilla.gnome.org/show_bug.cgi?id=694276
2013-02-20 17:01:25 +01:00
Giovanni Campagna
37700b4b1a AppDisplay: fix folder popup arrow
The arrow origin must be in the coordinate space of the box pointer,
but it cannot be calculated when the box pointer is shown, because it's
not allocated yet, so pass the source to the boxpointer and adjust
the arrow at the next paint.

https://bugzilla.gnome.org/show_bug.cgi?id=694264
2013-02-20 16:04:54 +01:00
Adel Gadllah
b922035d4f iconGrid: Dynamically adjust spacing based on columnLimit
Adjust the spacing based on the available width when a columnLimit
is set to evenly place the icons.

https://bugzilla.gnome.org/show_bug.cgi?id=694215
2013-02-20 00:39:18 +01:00
Florian Müllner
b75fc2bde3 appDisplay: Add additional view showing frequently used apps
According to the design mockups, the app picker should follow the
recent view pattern as used by applications, where the user is first
offered a subset of applications he/she is likely to start, and only
then allow switching to the full set of installed applications.
So implement the ability to manage several views in AppDisplay and add
FrequentView as additional view, which uses the existing ShellAppUsage
to display a list of frequently used applications.

https://bugzilla.gnome.org/show_bug.cgi?id=694192
2013-02-20 00:18:56 +01:00
Florian Müllner
6628214484 appDisplay: Make folder popups "view-modal"
While a group is open, we want to block events on items underneath,
but still allow interaction with components outside the app display
as well as scrolling of the view as a whole.

https://bugzilla.gnome.org/show_bug.cgi?id=694192
2013-02-20 00:18:56 +01:00
Florian Müllner
e3c9c46c1c appDisplay: Create AppFolderIcons for selected categories
App folders are intended for grouping some applications, not to
assign a category to every single application, so we will only
create folders for a selected subset of the existing categories.
Software/Alacarte will eventually allow to create/modify those
folders, so store the setting in GSettings so that it can be
shared with those applications.

https://bugzilla.gnome.org/show_bug.cgi?id=694192
2013-02-20 00:18:56 +01:00
Florian Müllner
6a1b341336 appDisplay: Add AllView.addFolder() method
Adjust AllView to be able to hold both apps and folders, and add an
addFolder() method to insert a folder.

https://bugzilla.gnome.org/show_bug.cgi?id=694192
2013-02-20 00:18:56 +01:00
Florian Müllner
65f96494f8 appDisplay: Separate app loading from filling the grid
At the moment when loading the applications, each app is inserted
at its correct (alphabetical) position. Avoid this overhead by
loading all apps first, then sort them once and fill the grid with
the sorted actors.

https://bugzilla.gnome.org/show_bug.cgi?id=694192
2013-02-20 00:18:56 +01:00
Florian Müllner
6e3e2d9f29 appDisplay: Add new FolderIcon class
FolderIcons will appear in the primary app view along AppIcons, but
represent a group of applications rather than a single application.

https://bugzilla.gnome.org/show_bug.cgi?id=694192
2013-02-20 00:18:56 +01:00
Florian Müllner
25d8debb11 appDisplay: Add intermediate stack widget to hold folder popups
AllView will be updated to allow app folders in addition to app
launchers. Folders will pop up in the existing view, so add an
additional stack widget into the hierarchy which popups will use
as parent.

https://bugzilla.gnome.org/show_bug.cgi?id=694192
2013-02-20 00:18:56 +01:00
Florian Müllner
426b227f03 appDisplay: Make AlphabeticalView an abstract base class of AllView
We are going to introduce app folders, which will also present an
alphabetical list of applications, but use a different UI. In
preparation for that, split out the item logic into an abstract
base class.

https://bugzilla.gnome.org/show_bug.cgi?id=694192
2013-02-20 00:18:56 +01:00
Florian Müllner
2fbd9b95a7 appDisplay: Set a maximum column number
In particular on widescreen monitors, the number of items in a row
can be overwhelming, so limit the number of columns and center the
view.

https://bugzilla.gnome.org/show_bug.cgi?id=694192
2013-02-20 00:08:11 +01:00
Florian Müllner
9758029c11 appDisplay: Make _loadCategory() a utility function
When we bring back categories as folders, this method will be
useful outside of AppDisplay.

https://bugzilla.gnome.org/show_bug.cgi?id=694192
2013-02-20 00:08:11 +01:00
Florian Müllner
4f8f79a907 appDisplay: Remove unused variables
https://bugzilla.gnome.org/show_bug.cgi?id=694192
2013-02-20 00:08:11 +01:00
Florian Müllner
c9e2f16404 appDisplay: Merge AllAppDisplay and ViewByCategories
With categories removed, the separation between AllAppDisplay and
ViewByCategories no longer makes sense. Also use this opportunity
to rename the outdated AllAppDisplay to AppDisplay; it will
eventually be used to manage different views.

https://bugzilla.gnome.org/show_bug.cgi?id=694192
2013-02-20 00:08:11 +01:00
Florian Müllner
2658754295 appDisplay: Merge AppIcon and AppWellIcon
AppIcon is just a tiny wrapper around BaseIcon, which does not add
anything over using BaseIcon directly, so merge its code with
AppWellIcon. As the concept of the "app well" has not been used
since well before 3.0, use AppIcon as name for the merged class.

https://bugzilla.gnome.org/show_bug.cgi?id=694192
2013-02-20 00:08:11 +01:00
Florian Müllner
77d8ff3620 appDisplay: Remove categories
We will eventually display some categories as app folders, but the
existing code doesn't help with the implementation, so remove it.

https://bugzilla.gnome.org/show_bug.cgi?id=694192
2013-02-20 00:08:11 +01:00
Florian Müllner
75885c3095 appDisplay: Fix _ensureIconVisible()
The fade effect was renamed a while ago, but we missed to update
the use in _ensureIconVisible().

https://bugzilla.gnome.org/show_bug.cgi?id=694125
2013-02-18 22:44:23 +01:00
Cosimo Cecchi
6bb38b873b appDisplay: remove unused parameter to AppWellIcon constructor
https://bugzilla.gnome.org/show_bug.cgi?id=686984
2013-02-18 14:54:53 -05:00
Giovanni Campagna
3044a6b517 Remove builtin settings search provider
It is now provided as a remote provider by gnome-control-center.

https://bugzilla.gnome.org/show_bug.cgi?id=690824
2013-02-18 16:56:45 +01:00
Cosimo Cecchi
07696086a2 appDisplay: set hscrollbar_policy = NEVER on the category view actor
https://bugzilla.gnome.org/show_bug.cgi?id=686881
2013-01-24 15:10:02 -05:00
Cosimo Cecchi
d0902fa28b search: remove SearchProvider base class
This is causing more confusion than anything else these days; the DBus
API is properly documented now and that's what people are expected to
use, the rest are implementation details we're not interested in
exposing.

https://bugzilla.gnome.org/show_bug.cgi?id=681797
2012-12-10 16:50:54 -05:00
Tanner Doshier
835d4e4b58 appDisplay: Don't use icons in results for settings
The search results are not necessarily improved by including icons, so don't.

https://bugzilla.gnome.org/show_bug.cgi?id=681797
2012-12-10 16:50:54 -05:00
Tanner Doshier
c5d8484e19 searchDisplay: Add ListSearchResult and ListSearchResults
These are for all search results except apps (and Wanda).
We also simplify a bit the packing of search results, which removes some
ugly code in navigateFocus() where we needed to call
st_widget_navigate_focus() twice, since the grid icon was composed by
two nested boxes, both focusable.

https://bugzilla.gnome.org/show_bug.cgi?id=681797
2012-12-10 16:50:53 -05:00
Tanner Doshier
9af107feff searchDisplay, and others: Switch from provider title to provider icon
Display a '+' icon on the provider icon if there are more results that are
hidden. If the provider icon is clicked, ask the provider to launch itself and
perform a search with the current terms.

https://bugzilla.gnome.org/show_bug.cgi?id=681797
2012-12-10 16:50:53 -05:00
Jasper St. Pierre
9dfc3af9d7 popupMenu: Port to GrabHelper
https://bugzilla.gnome.org/show_bug.cgi?id=689109
2012-12-07 19:55:28 -05:00
Cosimo Cecchi
a43ee41b0b app-display: use a GAppInfo for the settings provider
this._gnomecc is currently unused; we actually need a GAppInfo for this
provider if we want to display an icon next to it (see future commits),
so just turn it into one.
We might move this to an external provider altogether in the future.

https://bugzilla.gnome.org/show_bug.cgi?id=689735
2012-12-06 12:15:13 -05:00
Cosimo Cecchi
9b846cbb83 search: remove additional params from activateResult() call
The only case when we're interested in using those parameters nowadays
is for DnD, which is handled in a separate method already.
Since we're not going to support DnD for non-app search results anyway,
drop the params from all the activateResults() calls; this will be
useful later since we're going to add another parameter to it.

https://bugzilla.gnome.org/show_bug.cgi?id=689735
2012-12-06 12:15:13 -05:00
Jasper St. Pierre
5fc16bb05b searchDisplay, appDisplay: Use ClutterPanAction for re-swipe scrolling
The sooner we can kill off the custom overview swipe scroll code, the
better.

https://bugzilla.gnome.org/show_bug.cgi?id=689062
2012-11-30 16:03:34 -05:00
Cosimo Cecchi
e58fbeea17 appDisplay: don't increment counter if we didn't add a category
Or we'll later try to jump to the wrong category when clicking on it.
2012-11-29 19:21:41 -05:00
Stéphane Démurget
e6a3958e45 appDisplay: do not show empty categories
Desktop files can specify if the application should only be shown for
specified desktops with OnlyShowIn and NotShowIn directives options.

If a menu category only contained entries for a different desktop, we
were still creating the category.

We now only add a category button if there is at least one application
to be displayed in this category.

https://bugzilla.gnome.org/show_bug.cgi?id=687970
2012-11-20 21:17:57 +01:00
Stéphane Démurget
ee2f12fe81 dash: properly restore item label on popup close
We simply hide the label when the popup is opened instead of relying
on the popup state when the hover state change.

To do this we replace the flag isMenuUp by a 'menu-state-changed' signal
on the AppWellIcon. This simplifies the dash label visibility handling
code that need additional changes for the bug.

https://bugzilla.gnome.org/show_bug.cgi?id=657315
2012-11-07 00:26:11 +01:00
Jasper St. Pierre
0c4692ae58 appDisplay: Fix recursive directory NoDisplay testing
We were accidentally testing NoDisplay on the wrong directory.

https://bugzilla.gnome.org/show_bug.cgi?id=658176
2012-06-21 16:03:48 -04:00
Jasper St. Pierre
196f6c241a appDisplay: Don't show apps in NoDisplay categories in the All view
We explicitly include NoDisplay applications in the ShellAppSystem because
we want app tracking for them, but we explicitly filter NoDisplay applications
out when showing them to the user because we don't want to show them to the
user. We also based our "All" apps view on a flattened list of apps. While
we did check for NoDisplay on the app item itself, we didn't check against
its parents. Refactor the app display view to not use a separate flat list
of applications, but instead a concatenation of all the applications in all
the loaded categories.

https://bugzilla.gnome.org/show_bug.cgi?id=658176
2012-06-11 13:55:59 -04:00
Jasper St. Pierre
333e380340 search: Remove the ability to add synchronous search providers
As shown in the previous commits, synchronous search is easily implemented
by the asynchronous search API. The only reason we still have a
synchronous search API is of historical reasons. Well, we're not a museum,
and git log can keep our fossils safe if need be....

https://bugzilla.gnome.org/show_bug.cgi?id=675328
2012-05-07 15:29:46 -03:00
Jasper St. Pierre
58f77a19ed search: Port all search providers over to the async API
https://bugzilla.gnome.org/show_bug.cgi?id=675328
2012-05-07 15:29:32 -03:00
Alejandro Piñeiro
e91f4e88b5 a11y: Setting LIST_ITEM role for Categories items on Applications view 2012-03-14 12:36:33 +01:00