diff options
| author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2012-09-07 17:46:44 +0200 |
|---|---|---|
| committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2012-09-07 17:46:44 +0200 |
| commit | e1599c07d0112030407f5b81a242d806b6d45ef8 (patch) | |
| tree | e34a9798cb13a1cf38535c592e1997f26c5a271f /unity-standalone | |
| parent | 558ab9e6eaab3511082180a9af768af1e58a487c (diff) | |
LauncherController: refactor the internals to use the new LauncherModel and FavoriteStore
Semplified the constructor, we really don't need to have a Display parameter here; use initialization list more, remove timeout on icons initialization (also use a new main function to initialize all the non-fixed launcher icons). The icons ordering has changed a lot: now the favorites control everything (except BFB and trash) and we add the icons based on their defined position. Added two special places: local::RUNNING_APPS_URI and local::DEVICES_URI that optionally defines where these kind of icons should be placed. This is not strict by the way, because if these uris are not defined we add them by default at the bottom of the launcher main model. So to get that, I refactored CreateFavorite so that it's like an icon factory that returns us an icon based on its icon-uri. It does this job only if the icon is not already available. Also, added GetFavoriteIcon that returns us the icon in the model with the requested uri. SetupIcons does the work of reading the favorite store and add the icons in order; it also set up the signals. When a new Device or Application icon is added to the launcher, we append it to the list of the non-sticky devices or applications. Favorites reordering, removal or additions have been refactored to fit to our new system; when we save the favorites, the position of the "running-apps" or "attached-devices" is computed based on where the first icon of this type is placed. The expo icon is handled differently, since it is not added if we have no workspaces available. SoftwareCenterLauncher icons are now handled differently: we consider them as sticky application icons, so we firstly add them to the model (setting their priority based on the last sticky icon we have), then we animate them. They already know where they should go, based on model computions (also fixed a bug that caused them not to get the overlay shourtcut when added). OnLauncherAddRequest: always stick the favorite icon (bzr r2529.14.48)
Diffstat (limited to 'unity-standalone')
| -rw-r--r-- | unity-standalone/StandaloneUnity.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/unity-standalone/StandaloneUnity.cpp b/unity-standalone/StandaloneUnity.cpp index fa0662bed..fdc75beeb 100644 --- a/unity-standalone/StandaloneUnity.cpp +++ b/unity-standalone/StandaloneUnity.cpp @@ -86,7 +86,7 @@ UnityStandalone::~UnityStandalone () void UnityStandalone::Init () { - launcher_controller.reset(new launcher::Controller(0)); + launcher_controller.reset(new launcher::Controller()); panel_controller.reset(new panel::Controller()); dash_controller.reset(new dash::Controller()); dash_controller->launcher_width = launcher_controller->launcher().GetAbsoluteWidth() - 1; @@ -117,7 +117,7 @@ UnityStandaloneTV::~UnityStandaloneTV() {}; void UnityStandaloneTV::Init() { - launcher_controller.reset(new launcher::Controller(0)); + launcher_controller.reset(new launcher::Controller()); dash_controller.reset(new dash::Controller()); dash_controller->launcher_width = launcher_controller->launcher().GetAbsoluteWidth() - 1; |
