07月 4th, 2008 对awn-applet的notification area的一个小改动
话说,用了awn-extra-applet之后,腰不疼了,腿不酸了,吃饭也香了,身体也有劲儿了……还能做两个半俯卧撑了……
不过有点不爽的就是,awn applets里面的notification area(用来代替panel上的notification area的东东)显示图标有问题。当某程序的status icon使用的是高像素图标(比如128x128)时,整个notification area就被撑满了,高度也撑破了。
于是好好的一个awn的美观就被破坏殆尽。
最近对代码有点犯怵,不过还是去看了看notification area的代码,发现只有三个文件。
在applet.c中,找到这么一段代码:
1 2 3 4 5 6 7 | height = awn_applet_get_height (applet); gtk_widget_set_size_request (GTK_WIDGET (applet), -1, height* 2 ); table = gtk_table_new (1, 1, FALSE); app->table = table; gtk_table_set_col_spacings (GTK_TABLE (table), 2); gtk_table_set_row_spacings (GTK_TABLE (table), 1); |
第一行说明notification area中显示的图标高度是由applet的实际高度决定的。applet的实际高度可以很高,比如128的那个更新图标之类的。
于是修改起来也很简单,把第一行注释掉,再在开头height声明时初始化为24即可。
声明部分:
1 2 3 4 5 | static GQuark new_quark = 0; static GQuark del_quark = 0; static gint n_rows = 0; static int height = 24; //原来这里是0 static int icon_size = 24; |
改完后重新编译,重新使用awn后,图标果然正常了。
如果您喜欢本站的内容,欢迎订阅我的RSS以获取本站最新资讯。
RSS地址1:http://feed.casparant.com/
RSS地址2:http://feeds.casparant.com/casparant
Related Posts
---------- COPYRIGHT (C) CasparAnt.COM 2008 ----------
本站所有文章均遵循“创作共用条款(CC)3.0版本”, 允许转载演绎本站文章,仅需遵循以下原则:保留文章出处(URL及站名Caspar Ant), 并且给我一个 引用通告(trackback)。如果您觉得本站的文章很好,欢迎选择下面的网络书签收藏本文; 如果您觉得本站值得浏览,欢迎点击侧边栏进行订阅;欢迎您对文章发表评论,您的留言是对我最好的鼓励!
This entry is under CREATIVE COMMON ATTRIBUTION 3.0 LICENSE. Please remain "Caspar Ant" and the URL stay in your site when you share or remix this entry. It's necessary to give me a trackback from your own site. If you think this entry is good enough, welcome to put it to your own web bookmark. You can select from the bookmark sites at follows:




















07月 5th, 2008 at 7:25 pm Quote
8错8错,当时我用的时候也遇到了这个问题
[回复]
09月 4th, 2008 at 12:30 am Quote
[...] Posted by Ant in Linux Softwares, Programming | 1 views 曾经写过一篇文章《对awn-applet的notification area的一个小改动》,目的是为了避免高像素图标将notification [...]