Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| configuration-avancee-unity-2d [Le 15/02/2012, 21:33] – 92.106.10.107 | configuration-avancee-unity-2d [Le 12/07/2017, 11:42] (Version actuelle) – obsolète L'Africain | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | {{tag> | ||
| - | ---- | ||
| - | ====== Configuration avancée d' | ||
| - | Bon niveau en informatique nécessaire. | ||
| - | <note warning> | ||
| - | |||
| - | Les modifications expliquées ci-dessous nécessiteront de modifier des codes d' | ||
| - | |||
| - | Les changements réalisés affecteront tous les utilisateurs du système et pas seulement vous. S'il y a plus d'un utilisateur sur votre PC, demandez leur avis avant d' | ||
| - | <note tip> | ||
| - | < | ||
| - | |||
| - | |||
| - | ===== Supprimer le Home Dash ===== | ||
| - | ==== Afficher une lens par défaut au lieu de l' | ||
| - | <note important> | ||
| - | [[: | ||
| - | |||
| - | Cherchez la fonction **function activateHome() {** (ligne 110 sur ma version d' | ||
| - | |||
| - | Retirez le contenu de cette fonction en faisant attention aux parenthèses (il faut bien supprimer jusqu' | ||
| - | <code cpp-qt> | ||
| - | } | ||
| - | </ | ||
| - | Cette fonction correspond à l' | ||
| - | |||
| - | Maintenant, ajoutez entre les accolades activateLens(lensId) avec à la place de lensID le nom ou le numéro de la lens que vous voulez avoir à l' | ||
| - | |||
| - | Voici les noms des lenses par défaut : **applications.lens** , **commands.lens** , **files.lens** , **music.lens** | ||
| - | |||
| - | Après modification, | ||
| - | <code cpp-qt> | ||
| - | activateLens(" | ||
| - | } | ||
| - | </ | ||
| - | Au prochain démarrage d' | ||
| - | ==== Retirer l' | ||
| - | |||
| - | [[: | ||
| - | |||
| - | Chercher un code similaire à celui-ci (ligne 96 dans ma version d' | ||
| - | <code cpp-qt> | ||
| - | LensButton { | ||
| - | id: homeLens | ||
| - | |||
| - | Accessible.name: | ||
| - | |||
| - | focus: true | ||
| - | icon: " | ||
| - | onClicked: dash.activateHome() | ||
| - | active: ( dashView.activeLens == "" | ||
| - | iconWidth: lensBar.iconWidth | ||
| - | iconSpacing: | ||
| - | width: iconWidth+iconSpacing | ||
| - | height: lensContainer.height | ||
| - | } | ||
| - | </ | ||
| - | Et remplacez-le par : | ||
| - | <code cpp-qt> | ||
| - | LensButton { | ||
| - | id: homeLens | ||
| - | |||
| - | Accessible.name: | ||
| - | |||
| - | focus: false | ||
| - | icon: "" | ||
| - | onClicked: dash.activateHome() | ||
| - | active: | ||
| - | iconWidth: 0 | ||
| - | iconSpacing: | ||
| - | width: 0 | ||
| - | height: 0 | ||
| - | } | ||
| - | </ | ||
| - | La lens Home ne devrait plus s' | ||
| - | |||
| - | ===== Avoir les lenses en haut à droite du Dash ===== | ||
| - | Attention, ceci a été testé pour Unity 2D 5.2, il peut donc y avoir des différences avec les anciennes versions d' | ||
| - | |||
| - | ==== Déplacer les lenses ==== | ||
| - | [[: | ||
| - | |||
| - | Cherchez ce code : | ||
| - | <code cpp-qt> | ||
| - | Item { | ||
| - | id: content | ||
| - | |||
| - | anchors.fill: | ||
| - | /* Margins in DesktopMode set so that the content does not overlap with | ||
| - | the border defined by the background image. | ||
| - | */ | ||
| - | anchors.bottomMargin: | ||
| - | anchors.rightMargin: | ||
| - | |||
| - | /* Unhandled keys will always be forwarded to the search bar. That way | ||
| - | the user can type and search from anywhere in the interface without | ||
| - | | ||
| - | /* FIXME: deactivated because it makes the user lose the focus very often */ | ||
| - | // | ||
| - | |||
| - | SearchEntry { | ||
| - | id: search_entry | ||
| - | |||
| - | focus: true | ||
| - | /* FIXME: check on visible necessary; fixed in Qt Quick 1.1 | ||
| - | ref: http:// | ||
| - | */ | ||
| - | KeyNavigation.right: | ||
| - | KeyNavigation.down: | ||
| - | |||
| - | anchors.top: | ||
| - | anchors.topMargin: | ||
| - | anchors.left: | ||
| - | anchors.leftMargin: | ||
| - | anchors.right: | ||
| - | anchors.rightMargin: | ||
| - | |||
| - | height: 42 | ||
| - | |||
| - | active: dash.active | ||
| - | placeHolderText: | ||
| - | if(dash.currentPage != undefined && dash.currentPage.model.searchHint) | ||
| - | return dash.currentPage.model.searchHint | ||
| - | else | ||
| - | return u2d.tr(" | ||
| - | } | ||
| - | |||
| - | onSearchQueryChanged: | ||
| - | onActivateFirstResult: | ||
| - | } | ||
| - | |||
| - | FilterPane { | ||
| - | id: filterPane | ||
| - | |||
| - | KeyNavigation.left: | ||
| - | |||
| - | /* FilterPane is only to be displayed for lenses, not in the home page or Alt+F2 Run page */ | ||
| - | visible: declarativeView.activeLens != " | ||
| - | lens: visible && currentPage != undefined ? currentPage.model : undefined | ||
| - | |||
| - | anchors.top: | ||
| - | anchors.topMargin: | ||
| - | anchors.bottom: | ||
| - | headerHeight: | ||
| - | width: 300 | ||
| - | anchors.right: | ||
| - | anchors.rightMargin: | ||
| - | } | ||
| - | |||
| - | Loader { | ||
| - | id: pageLoader | ||
| - | objectName: " | ||
| - | |||
| - | Accessible.name: | ||
| - | /* FIXME: check on visible necessary; fixed in Qt Quick 1.1 | ||
| - | ref: http:// | ||
| - | */ | ||
| - | KeyNavigation.right: | ||
| - | KeyNavigation.up: | ||
| - | KeyNavigation.down: | ||
| - | |||
| - | anchors.top: | ||
| - | anchors.topMargin: | ||
| - | anchors.bottom: | ||
| - | anchors.left: | ||
| - | anchors.right: | ||
| - | anchors.rightMargin: | ||
| - | onLoaded: item.focus = true | ||
| - | |||
| - | /* Workaround loss of focus issue happening when the loaded item has | ||
| - | | ||
| - | lost instead of being relinquished to the Loader. | ||
| - | |||
| - | Ref.: https:// | ||
| - | */ | ||
| - | function setSource(newSource) { | ||
| - | var hadActiveFocus = activeFocus | ||
| - | source = newSource | ||
| - | if (hadActiveFocus) forceActiveFocus() | ||
| - | } | ||
| - | } | ||
| - | |||
| - | LensBar { | ||
| - | id: lensBar | ||
| - | |||
| - | KeyNavigation.up: | ||
| - | |||
| - | anchors.bottom: | ||
| - | anchors.left: | ||
| - | anchors.right: | ||
| - | height: 44 | ||
| - | visible: declarativeView.expanded | ||
| - | } | ||
| - | } | ||
| - | </ | ||
| - | Et remplacez le par : | ||
| - | <code cpp-qt> | ||
| - | Item { | ||
| - | id: content | ||
| - | |||
| - | anchors.fill: | ||
| - | /* Margins in DesktopMode set so that the content does not overlap with | ||
| - | the border defined by the background image. | ||
| - | */ | ||
| - | anchors.bottomMargin: | ||
| - | anchors.rightMargin: | ||
| - | |||
| - | visible: dashView.active | ||
| - | |||
| - | /* Unhandled keys will always be forwarded to the search bar. That way | ||
| - | the user can type and search from anywhere in the interface without | ||
| - | | ||
| - | /* FIXME: deactivated because it makes the user lose the focus very often */ | ||
| - | // | ||
| - | |||
| - | |||
| - | SearchEntry { | ||
| - | id: search_entry | ||
| - | |||
| - | focus: true | ||
| - | /* FIXME: check on visible necessary; fixed in Qt Quick 1.1 | ||
| - | ref: http:// | ||
| - | */ | ||
| - | KeyNavigation.right: | ||
| - | KeyNavigation.down: | ||
| - | |||
| - | anchors.top: | ||
| - | anchors.topMargin: | ||
| - | anchors.left: | ||
| - | anchors.leftMargin: | ||
| - | anchors.right: | ||
| - | anchors.rightMargin: | ||
| - | |||
| - | height: 42 | ||
| - | } | ||
| - | |||
| - | LensBar { | ||
| - | id: lensBar | ||
| - | |||
| - | KeyNavigation.up: | ||
| - | | ||
| - | anchors.top: | ||
| - | anchors.topMargin: | ||
| - | anchors.left: | ||
| - | anchors.right: | ||
| - | anchors.rightMargin: | ||
| - | | ||
| - | height: 42 | ||
| - | } | ||
| - | |||
| - | Loader { | ||
| - | id: pageLoader | ||
| - | |||
| - | Accessible.name: | ||
| - | /* FIXME: check on visible necessary; fixed in Qt Quick 1.1 | ||
| - | ref: http:// | ||
| - | */ | ||
| - | KeyNavigation.right: | ||
| - | KeyNavigation.up: | ||
| - | KeyNavigation.down: | ||
| - | |||
| - | anchors.top: | ||
| - | anchors.topMargin: | ||
| - | anchors.bottom: | ||
| - | anchors.left: | ||
| - | anchors.right: | ||
| - | anchors.rightMargin: | ||
| - | onLoaded: item.focus = true | ||
| - | } | ||
| - | | ||
| - | FilterPane { | ||
| - | id: filterPane | ||
| - | |||
| - | KeyNavigation.left: | ||
| - | |||
| - | /* FilterPane is only to be displayed for lenses, not in the home page or Alt+F2 Run page */ | ||
| - | visible: dashView.activeLens != "" | ||
| - | lens: visible && currentPage != undefined ? currentPage.model : undefined | ||
| - | |||
| - | anchors.top: | ||
| - | anchors.topMargin: | ||
| - | anchors.bottom: | ||
| - | headerHeight: | ||
| - | width: 300 | ||
| - | anchors.right: | ||
| - | anchors.rightMargin: | ||
| - | } | ||
| - | } | ||
| - | </ | ||
| - | |||
| - | ==== Retirer le rectangle noir transparent derrière les lenses | ||
| - | |||
| - | [[: | ||
| - | |||
| - | Dans le haut du fichier, cherchez : | ||
| - | < | ||
| - | FocusScope { | ||
| - | id: lensBar | ||
| - | |||
| - | /* declare width & spacing of icons as required for layout calculations */ | ||
| - | property int iconWidth: 24 | ||
| - | property int iconSpacing: | ||
| - | |||
| - | property variant visibleLenses: | ||
| - | model: dash.lenses | ||
| - | dynamicSortFilter: | ||
| - | |||
| - | filterRole: Lenses.RoleVisible | ||
| - | filterRegExp: | ||
| - | } | ||
| - | |||
| - | Rectangle { | ||
| - | id: background | ||
| - | |||
| - | anchors.fill: | ||
| - | color: " | ||
| - | opacity: 0.22 | ||
| - | } | ||
| - | </ | ||
| - | Remplacez opacity: 0.22 par opacity: 0 | ||
