Cinnamon: 更改主题中的屏幕顶部边缘#notification css 属性不起作用

创建于 2016-03-11  ·  3评论  ·  资料来源: linuxmint/cinnamon

我正在尝试更改通知弹出窗口的位置,例如http://www.webupd8.org/2012/06/how-to-change-notifications-position-in.html 。 但是添加或更改margin-from-top-edge-of-screen根本没有效果。 相比之下,更改margin-from-right-edge-of-screen工作正常。

我正在使用带有Linux Mint主题的 Linux Mint 17.3,我的 #notifications 如下所示:

#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
}

知道为什么更改margin-from-top-edge-of-screen没有效果吗?

最有用的评论

好的,有没有办法移动这个弹出窗口,这样它就不会超过最小化/最大化/关闭按钮? 在屏幕的右上角放置弹出窗口真的很烦人......

//编辑

好的,我找到了负责放置通知的代码, /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'
                    });

},

cinnamon 更新后它将停止工作,因为此文件将被覆盖。

所有3条评论

那是因为屏幕顶部边缘的边距不是真正的财产。 没有这样的事情,所以肉桂只是忽略它。 你指向的帖子真的很旧。 从那时起,情况可能发生了变化。

好的,有没有办法移动这个弹出窗口,这样它就不会超过最小化/最大化/关闭按钮? 在屏幕的右上角放置弹出窗口真的很烦人......

//编辑

好的,我找到了负责放置通知的代码, /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'
                    });

},

cinnamon 更新后它将停止工作,因为此文件将被覆盖。

关闭这个是因为最初的问题是关于一个甚至不存在的属性,我们还有其他关于能够移动通知的未决问题。

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

stefan-niedermann picture stefan-niedermann  ·  4评论

pviotti picture pviotti  ·  3评论

ivanjermakov picture ivanjermakov  ·  4评论

Odyseus picture Odyseus  ·  4评论

elboulangero picture elboulangero  ·  3评论