Cinnamon: Modification de la propriété css de la marge à partir du bord supérieur de l'écran #notification dans le thème ne fonctionne pas

Créé le 11 mars 2016  ·  3Commentaires  ·  Source: linuxmint/cinnamon

J'essaie de changer la position de la fenêtre contextuelle de notification comme ici http://www.webupd8.org/2012/06/how-to-change-notifications-position-in.html . Mais ajouter ou modifier margin-from-top-edge-of-screen n'a aucun effet. En revanche, changer margin-from-right-edge-of-screen fonctionne très bien.

J'utilise Linux Mint 17.3 avec le thème Linux Mint et mes #notifications ressemblent à ceci :

#notification {
font-size: 8.5pt;
border-radius: 10px 10px 10px 10px;
border: 2px solid rgba(214,214,214,0.5);
background-gradient-direction: vertical;
background-gradient-start: rgba(66,66,66,0.9);
background-gradient-end: rgba(55,55,55,0.9);
padding: 8px 8px 8px 8px;
spacing-rows: 10px;
spacing-columns: 10px;
margin-from-right-edge-of-screen: 80px;  
margin-from-top-edge-of-screen: 350px;
width: 34em;
color: white;    
/* The px are a temporary fix until get_theme_node() can return raw numbers. */
opacity:255px;
mouseover-opacity:96px
}

Avez-vous une idée de pourquoi changer margin-from-top-edge-of-screen n'a aucun effet ?

Commentaire le plus utile

Ok, y a-t-il un moyen de déplacer cette fenêtre contextuelle pour qu'elle ne dépasse pas les boutons minimiser/maximiser/fermer ? C'est vraiment ennuyeux de placer des popups dans le coin supérieur droit de l'écran...

//ÉDITER

ok j'ai trouvé le code responsable de la notification, /usr/share/cinnamon/js/ui/messageTray.js :

_onNotificationExpanded: function() {
    let expandedY = this._notification.actor.height - this._notificationBin.height;
    // Don't animate the notification to its new position if it has shrunk:
    // there will be a very visible "gap" that breaks the illusion.

    // This isn't really working at the moment, but it was just crashing before
    // if it encountered a critical notification.  expandedY is always 0.  For now
    // just make sure it's not covering the top panel if there is one.

    let monitor = Main.layoutManager.primaryMonitor;
    let panel = Main.panelManager.getPanel(0, false); // We only want the top panel in monitor 0
    let height = 5;
    if (panel)
        height += panel.actor.get_height();
    let newY = monitor.y + height + 50; // ADDED 50 HERE SO POPUP IS NOT OVER WINDOW CONTROLS

    if (this._notificationBin.y < expandedY)
        this._notificationBin.y = expandedY;
    else if (this._notification.y != expandedY)
        this._tween(this._notificationBin, '_notificationState', State.SHOWN,
                    { y: newY,
                      time: ANIMATION_TIME,
                      transition: 'easeOutQuad'
                    });

},

Il cessera de fonctionner après la mise à jour de cannelle car ce fichier sera écrasé.

Tous les 3 commentaires

C'est parce que la marge à partir du bord supérieur de l'écran n'est pas une propriété réelle. Il n'y a rien de tel, donc Cinnamon l'ignore. Le message que vous avez indiqué est vraiment ancien. Les choses ont probablement changé depuis.

Ok, y a-t-il un moyen de déplacer cette fenêtre contextuelle pour qu'elle ne dépasse pas les boutons minimiser/maximiser/fermer ? C'est vraiment ennuyeux de placer des popups dans le coin supérieur droit de l'écran...

//ÉDITER

ok j'ai trouvé le code responsable de la notification, /usr/share/cinnamon/js/ui/messageTray.js :

_onNotificationExpanded: function() {
    let expandedY = this._notification.actor.height - this._notificationBin.height;
    // Don't animate the notification to its new position if it has shrunk:
    // there will be a very visible "gap" that breaks the illusion.

    // This isn't really working at the moment, but it was just crashing before
    // if it encountered a critical notification.  expandedY is always 0.  For now
    // just make sure it's not covering the top panel if there is one.

    let monitor = Main.layoutManager.primaryMonitor;
    let panel = Main.panelManager.getPanel(0, false); // We only want the top panel in monitor 0
    let height = 5;
    if (panel)
        height += panel.actor.get_height();
    let newY = monitor.y + height + 50; // ADDED 50 HERE SO POPUP IS NOT OVER WINDOW CONTROLS

    if (this._notificationBin.y < expandedY)
        this._notificationBin.y = expandedY;
    else if (this._notification.y != expandedY)
        this._tween(this._notificationBin, '_notificationState', State.SHOWN,
                    { y: newY,
                      time: ANIMATION_TIME,
                      transition: 'easeOutQuad'
                    });

},

Il cessera de fonctionner après la mise à jour de cannelle car ce fichier sera écrasé.

Nous fermons ceci car le problème d'origine concerne une propriété qui n'existe même pas et nous avons d'autres problèmes ouverts concernant la possibilité de déplacer des notifications.

Cette page vous a été utile?
0 / 5 - 0 notes