一、证明Opera的高度可定制性;
二、解决一些使用中不顺手的地方;
三、释放你我的想象力,将Opera改造的面目全非。
---------------------------------------------------------------------------------------------------------------------
Opera的对话框配置是保存在.\opera\dialog.ini文件中,在这个文件中定义了对话框中各元素的属性,比如大小、位置、名字等等。这是个文本文档,用记事本或者其他文本编辑器均可打开和编辑,修改前请先备份。强烈建议将本文档以UTF-8编码保存。
在文件开头显示了配置文件的版本以及一些其他信息,这些不是我们需要关心的,可以无视了。紧接其下可以看到类似的代码:
[Advanced Windows Options Dialog]
Title = 11519
Group, 0, 0, 65, 70, 300, 300, Center
Label, 11324, Cycle_pages_label, 0, 60, 150, 23, Fixed
Dropdown, 0, Cycle_pages_dropdown, 150, 60, 200, 23, Fixed
Label, 69362, Loading_label, 0, 90, 150, 23, Fixed
Dropdown, 0, Loading_dropdown, 150, 90, 200, 23, Fixed
Label, 68072, New_pages_label, 0, 120, 150, 23, Fixed
Dropdown, 0, New_pages_dropdown, 150, 120, 200, 23, Fixed
Checkbox, 25372, Reuse_page_checkbox, 150, 150, 300, 23, Fixed
Checkbox, 69262, Open_next_to_current_checkbox, 150, 180, 300, 23, Fixed, End方括号中是对话框的名字,常见的对话框有:
启动对话框:[Startup Dialog]
首选项对话框:[New Preferences Dialog]
语言对话框:[Language Preferences Dialog]
搜索引擎对话框:[Search Engine Dialog]
安全协议对话框:[Trusted Protocol Dialog]
中键设置对话框:[Midclick Dialog]
Cookies信息对话框:[Cookie Edit Dialog]
证书管理对话框:[Manage Certificates Dialog]
下载对话框:[Download Dialog]
外观工具栏对话框:[Customize Toolbar Dialog]
删除邮件对话框:[Delete Mail Dialog]
新建账户对话框:[New Account Wizard]
账户信息对话框:[Account Properties Dialog]
邮件过滤对话框:[Mail Filter Dialog]
会话管理对话框:[Session Manager Dialog]
添加书签对话框:[Add Bookmark Dialog]
清除隐私数据对话框:[Clear Private Data Dialog]
打印对话框:[Print Dialog]
*敏感詞*服务器对话框:[Proxy Servers Dialog]
内容过滤对话框:[Content Block Dialog]
Title定义了对话框的标题,数字代表的是语言包中的相应字符串,也可以使用自定义字符串,且允许为空值。比如:
Title = "Opera"
Title = ""接下来就是对话框中各元素的定义
元素的基本语法结构如下:
元素类型,元素名,名字|数据指针,x,y,宽度,高度,定位方式[=命令][,End]先说简单的
元素名就是该元素显示出来的字符串,可以自定义,可以置空,比如:
Checkbox4, "我是复选框", Continue_lasttime_radio, 0, 80, 200, 20, Fixed
Radiobutton5, , Continue_lasttime_radio, 0, 100, 200, 20, Fixed名字|数据指针,这个我也不太了解,如果你知道名字就写名字,不知道名字置空即可,比如:
Radiobutton5, 67224, Continue_session_radio, 0, 160, 0, 0, fixed
button6, 67399, , 92, 40, 138, 23, fixedx,y定义的是元素左上角的位置,这是相对位置,以Group左上角为0,0。
宽度,高度定义的是元素的宽高,对话框的宽高由对话框内元素的最大宽高决定。
定位方式有下面几种:
Fixed:元素大小和位置均固定;
Center:元素居中;
Size Right:元素起始位置和高度固定,宽度随对话框宽度改变而改变;
Size Down:元素起始位置和宽度固定,高度随对话框高度改变而改变;
Move Right:适用于多列排版,当第一列使用“Size Right”定位,则其后的列就要使用“Move Right”来重新定位x以适应对话框宽度;
Move Down:适用于多行排版,当第一行使用“Size Down”定位,则其下的行就要使用“Move Down”来重新定位y以适应对话框高度;
Size:兼具Size Right和Size Down的属性;
Combinations:自适应位置。
[=命令],这是个可选项,定义了该元素执行的命令。
命令列表在这里查阅:
语法请看这里:
[,End],这也是个可选项,如果Group语句后没有End,那么在Group中定义最后一个元素的语句末尾处需要添加这个参数。
回头来说元素类型
元素类型包括:
Group、Label、MultilineLabel、Separator、Checkbox、Listbox、Button、Radiobutton、Edit、MultilineEdit、Dropdown、Quickfind、Folderchooser、Treeview、Progress、Browser、Toolbar、WebImage。
Group定义的是一个容器,是对话框的基本元素,其他元素必须被包含在Group中。其写法有两种,一种如上面的代码,End置于所有元素的最后;另一种是置于Group语句的最后,如:
Group, 0, 0, 65, 70, 300, 300, Center, EndLabel,单行标签。例子:
Label, 68107, Java_path_label, 0, 30, 390, 23, Size rightMultilineLabel,多行标签。例子:
MultilineLabel, 70676, Cookie_info_label, 0, 0, 390, 40, FixedSeparator,分割线。例子:
Separator0, , , 0, 90, 420, 20, FixedCheckbox,复选按钮。例子:
Checkbox, 70645, Enable_wand_checkbox, 0, 30, 300, 23, FixedRadiobutton,单选按钮。例子:
Radiobutton, 69426, Targeted_ads_radio, 0, 0, 400, 23, FixedListbox,列表框。例子:
Listbox, 0, Cert_listbox, 0, 70, 250, 70, Size rightButton,按钮。例子:
Button, 70450, Startpage_use_current_button, 310, 60, 110, 23, Fixed = Choose current pageEdit,单行文本框。例子:
Edit, 0, City_edit, 100, 220, 100, 23, FixedMultilineEdit,多行文本框。例子:
MultilineEdit, 69217, Help_label, 0, 0, 290, 80, Size rightDropdown,下拉列表框。例子:
Dropdown, 0, 0, 100, 290, 150, 23, Move down = Disable skin coloring,,,67433 | Use system skin coloring,,,67434 | Set skin coloring, #803C00,,67435 | Set skin coloring, #BD9431,,67436 | Set skin coloring, #2FB35E,,67437 | Set skin coloring, #2F83B3,,67438 | Set skin coloring, #001E80,,67439 | Set skin coloring, #606090,,67440 | Set skin coloring, #4B0082,,67441 | Set skin coloring, #DC143C,,67442 | Set skin coloring, #900000,,67443Quickfind,快速搜索框。例子:
Quickfind, 0, Filetypes_quickfind, 0, 0, 100, 23, FixedFolderchooser,带文本框的文件夹选择按钮。例子:
Folderchooser, 0, My_user_javascript_chooser, 0, 280, 280, 23, FixedTreeview,树形列表框。例子:
Treeview, 0, Web_language_treeview, 0, 130, 290, 170, SizeProgress,进度条。例子:
Progress, 0, Download_progress_bar, 0, 30, 300, 15, Size rightBrowser。例子:
Browser, 0, Imagedetails_browserview, 0, 160, 300, 115, SizeToolbar,工具栏。例子:
Toolbar, 0, Customize Toolbar Custom, 120, 0, 380, 310, Size, EndWebImage,图片。例子:
WebImage, 0, Info_image, 70, 20, 120, 200, Fixed, End上几张图,让大家认识一下这些元素长的是啥样:)
嗯,差不多就这些了,如有缺漏错误之处,欢迎大家跟帖补充
下面给出几个例子,抛砖引玉
用以下代码替换dialog.ini中相应部分,编辑前请先备份!
例一、启动对话框样式一
[Startup Dialog]
Title = 67222
Group0, 0, , 34, 20, 367, 160, size, End
Group1, 0, , 0, 20, 367, 160, size , End
Radiobutton2, 67223, Continue_lasttime_radio, 97, 70, 230, 23, fixed
Radiobutton3, 67225, Start_homepage_radio, 97, 100, 270, 23, fixed
Radiobutton4, 67226, Start_nowindows_radio, 97, 130, 270, 23, fixed
Radiobutton5, 67224, Continue_session_radio, 0, 160, 0, 0, fixed
button6, 67399, , 92, 40, 138, 23, fixed = Show popup menu, "Browser Session menu"
Button7, 67398, , 237, 40, 130, 23, move right = Show popup menu, "Internal Bookmark Folder"
Address8, , , 0, 7, 230, 23, size right
search9, 0, , 237, 7, 130, 23, move right
Button10, 67397, , 0, 40, 85, 23,? fixed = Show popup menu, "Startup Mail Menu"
Button10, 50836, , 0, 70, 85, 23,? fixed = Manage, "transfers"
Button11, 19053, , 0, 100, 85, 23, fixed = Show popup menu, "Advanced Startup Options Menu"
Button12, 50006, , 0, 130, 85, 23, fixed = Exit
Treeview13, , Sessions_treeview, 0, 160, 367, 0, size,end效果图:
例二、启动对话框样式二
[Startup Dialog]
Title = "欢迎使用 Opera"
Group0, 0, , 0, 0, 0, 0, Fixed, End
Group1, 0, , 0, 50, 300, 100, Fixed, End
Radiobutton2, "继续上次页面", Continue_lasttime_radio, 20, 10, 180, 23, Fixed
Radiobutton3, 67225, Start_homepage_radio, 20, 40, 180, 23, Fixed
Radiobutton4, 67224, Continue_session_radio, 0, 0, 0, 0, Fixed
Treeview5, 0, Sessions_treeview, 0, 0, 0, 0, Fixed
Radiobutton6, 67226, Start_nowindows_radio, 20, 70, 180, 23, Fixed, End效果图:
例三、账户管理对话框
[Account Manager Dialog]
Title = 67122
Group0, 0, , 10, 10, 339, 100, Size, End
Treeview1, 0, Accounts_treeview, 0, 0, 339, 70, Size
Button2, 67218, Delete_button,0, 77, 80, 23, Move down=Delete
Button3, 67344, New_button, 172, 77, 80, 23, Move down=New account
Button4, 67346, Edit_button, 259, 77, 80, 23, Move down, End=Edit properties效果图:
例四、添加书签对话框
[Add Bookmark Dialog]
Title = 70495
Group0, 67000, , 10, 10, 330, 323, Center, End
Label1, 25103, Name_label, 0, 0, 90, 23, Fixed
Edit2, 0, Name_edit, 100, 0, 230, 23, Size right
Label3, 10943, Nick_label, 0, 30, 90, 23, Fixed
Edit4, 0, Nick_edit, 100, 30, 230, 23, Size right
Label5, 10944, URL_label, 0, 60, 90, 23, Fixed
Edit6, 0, URL_edit, 100, 60, 230, 23, Size right
Label7, 10945, Description_label, 0, 90, 90, 23, Fixed
MultilineEdit8, 0, Description_edit, 100, 90, 230, 53, Size
Label13, 70496, Parent_label, 0, 150, 90, 23, Move down
Dropdown, , Parent_dropdown, 100, 150, 230, 23, Size right Move down
Button, 70497, New_folder_button,100,180,150,23,Move down = New folder
Checkbox15, 54023, ShowOnPersonalbar_check, 100, 210, 230, 23, Move down
Checkbox16, 70498, ViewInPanel_check, 100, 240, 230, 23, Move down效果图:
例五、删除隐私数据对话框
[Clear Private Data Dialog]
Title = 19011
Group, 0, , 0, 0, 0, 0, Size, End
Checkbox, 25156, Delete_temporary_cookies, 0, 0, 250, 23, Size right
Checkbox, 25159, Delete_all_cookies, 0, 30, 250, 23, Size right
Checkbox, 25157, Delete_passworddocs_and_data, 0, 60, 250, 23, Size right
Checkbox, 25164, Clear_cache, 0, 90, 250, 23, Size right
Checkbox, 25160, Clear_visited_pages, 0, 120, 250, 23, Size right
Checkbox, 25161, Clear_typedin_addresses, 0, 150, 250, 23, Size right
Checkbox, 25163, Clear_visited_links, 0, 180, 250, 23, Size right
Checkbox, 25165, Clear_transferred_files_history, 0, 210, 250, 23, Size right
Checkbox, 68044, Clear_bookmark_visited_time, 0, 240, 250, 23, Size right
Checkbox, 25162, Clear_email_account_passwords, 0, 270, 250, 23, Size right
Checkbox, 25169, Clear_wand_passwords, 0, 300, 250, 23, Size right
Checkbox, 70446, Close_all_windows, 0, 330, 250, 23, Size right, End
效果图:
例六、外观对话框之配色方案
[Customize Toolbar Dialog]
Title = 70627
Group, 68062, , 10, 10, 400, 325, Size
Radiobutton, 70628, Show_installed_skins_button, 0, 0, 200, 23, Fixed
Radiobutton, 70629, Find_more_skins_button, 200, 0, 200, 23, Fixed
Treeview, 0, Skin_file_treeview, 0, 30, 400, 220, Size
Button, 67218, Delete_skinconfig, 410, 30, 80, 23, Move right = Delete skin
Browser, 0, Find_mode_skins_browserview,? 0, 30, 490, 220, Size
Checkbox,67503, Special_effects_checkbox, 0, 260, 300, 23, Move down
Label, 70452, 0, 0, 290, 100, 23, Move down
Dropdown, 0, 0, 100, 290, 150, 23, Move down = Disable skin coloring,,,67433 | Use system skin coloring,,,67434 | Set skin coloring, #3366CC,,"Windows 3366CC" | Set skin coloring, #6699CC,,"Windows 6699CC" | Set skin coloring, #1875E7,,"Windows 1875E7" | Set skin coloring, #5083CC,,"Windows 5083CC" | Set skin coloring, #2D437D,,"Windows 2D437D" | Set skin coloring, #2F83B3,,"Windows 2F83B3" | Set skin coloring, #44859D,,"Windows 44859D" | Set skin coloring, #466F9B,,"Windows 466F9B"
Label, 70630, 0, 310, 290, 100, 23, Move down
Dropdown, 0, Skin_zoom_dropdown, 410, 290, 80, 23, Move down, End效果图:
例七、搜索引擎对话框
[Search Engine Dialog]
Title = 819599123
Group, 0, 0, 0, 0, 450, 400, Size right
Label, 359962014, , 0, 0, 80, 23, Fixed
Edit, , Search_engine_name, 80, 0, 370, 23, Size right
Label, 17061, , 0, 30, 50, 23, Fixed
Edit, , Search_engine_key, 80, 30, 50, 23, Fixed
Label, "", Search_engine_status, 135, 30, 170, 23, Size right
Label, 10944, , 0, 60, 80, 23, Fixed
Edit, , Search_engine_url, 80, 60, 370, 23, Size right
Label, -458107340, , 0, 90, 80, 23, Fixed
Edit, , Search_engine_query, 80, 90, 270, 23, Size right
Checkbox, -1853882022, Search_engine_use_post, 360, 90, 90, 23, Move right
Checkbox, 217241825, Default_search_checkbox, 80, 120, 370, 23, Size right
Checkbox, 420293095, Default_speeddial_checkbox, 80, 150, 370, 23, Size right, End效果图:



























