diff -Nru deepin-ui-1.0~raring~NoobsLab.com/debian/changelog deepin-ui-1.1~raring~NoobsLab.com/debian/changelog --- deepin-ui-1.0~raring~NoobsLab.com/debian/changelog 2013-06-21 00:56:51.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/debian/changelog 2013-11-23 18:26:38.000000000 +0000 @@ -1,8 +1,206 @@ -deepin-ui (1.0~raring~NoobsLab.com) raring; urgency=medium +deepin-ui (1.1~raring~NoobsLab.com) raring; urgency=high - * for Ubuntu and it's Derivatives + * Added to PPA - -- Umair Riaz Wed, 19 Jun 2013 17:51:48 +0300 + -- Umair Riaz Sat, 23 Nov 2013 20:19:40 +0200 + +deepin-ui (1+git20131108164648~e369b783df) raring; urgency=low + + * Build from git revision e369b783dfae31955a08e51a46f951a34d2f09e2 + + -- Deepin Packages Builder Fri, 08 Nov 2013 16:46:48 +0800 + +deepin-ui (1+git20131107203635~4996c50024) raring; urgency=low + + * Build from git revision 4996c5002463de0fdea9a03a1fbed5e44fb1f217 + + -- Deepin Packages Builder Thu, 07 Nov 2013 20:36:35 +0800 + +deepin-ui (1+git20131107144358~46e752e746) raring; urgency=low + + * Build from git revision 46e752e746e0041c934b06170958cf4b70ca991e + + -- Deepin Packages Builder Thu, 07 Nov 2013 14:43:58 +0800 + +deepin-ui (1+git20131107102651~fa1a09b84d) raring; urgency=low + + * Build from git revision fa1a09b84d8b3f42aa63ff4c8571d1a8e32960c4 + + -- Deepin Packages Builder Thu, 07 Nov 2013 10:26:52 +0800 + +deepin-ui (1+git20131029140825~c635fd2981) raring; urgency=low + + * Build from git revision c635fd298102ffb55f8ab8164bf51394aad12100 + + -- Deepin Packages Builder Tue, 29 Oct 2013 14:08:26 +0800 + +deepin-ui (1+git20131025130040~8371783898) raring; urgency=low + + * Build from git revision 8371783898e3f3e2e7d19a7f1d589ef0234284dd + + -- Deepin Packages Builder Fri, 25 Oct 2013 13:00:40 +0800 + +deepin-ui (1+git20131025092335~fb4bc72506) raring; urgency=low + + * Build from git revision fb4bc7250640c0921efc8a6c2f1b3626db8009bc + + -- Deepin Packages Builder Fri, 25 Oct 2013 09:23:35 +0800 + +deepin-ui (1+git20131025090123~d302cc13f3) raring; urgency=low + + * Build from git revision d302cc13f3074766f7f132faeca5eb3739d48b56 + + -- Deepin Packages Builder Fri, 25 Oct 2013 09:01:23 +0800 + +deepin-ui (1+git20131023174341~dde4505fe2) raring; urgency=low + + * Build from git revision dde4505fe20ed63ce133f5a45cecebcd006cc1e4 + + -- Deepin Packages Builder Wed, 23 Oct 2013 17:43:41 +0800 + +deepin-ui (1+git20131023172505~dde4505fe2) raring; urgency=low + + * Build from git revision dde4505fe20ed63ce133f5a45cecebcd006cc1e4 + + -- Deepin Packages Builder Wed, 23 Oct 2013 17:25:05 +0800 + +deepin-ui (1+git20131023172326~812adf0e73) raring; urgency=low + + * Build from git revision 812adf0e73d0cac32df9a75605bc61eaa8e481d2 + + -- Deepin Packages Builder Wed, 23 Oct 2013 17:23:26 +0800 + +deepin-ui (1+git20131019132028~45f7e8f327) raring; urgency=low + + * Build from git revision 45f7e8f3272587b4c7cd3d287ce57af7ec14c8f4 + + -- Deepin Packages Builder Sat, 19 Oct 2013 13:20:28 +0800 + +deepin-ui (1+git20131019123144~f3c7fac60e) raring; urgency=low + + * Build from git revision f3c7fac60e7b921210ebf4e00bbe3be83b77766b + + -- Deepin Packages Builder Sat, 19 Oct 2013 12:31:45 +0800 + +deepin-ui (1+git20131017200607~9a90a2feac) raring; urgency=low + + * Build from git revision 9a90a2feacc0ea7eac9f3c4990fcd1a8baef53b8 + + -- Deepin Packages Builder Thu, 17 Oct 2013 20:06:07 +0800 + +deepin-ui (1+git20131017145838~e46a5f0b65) raring; urgency=low + + * Build from git revision e46a5f0b65bdc9d6d0fcfaf8ec4b974dbd426263 + + -- Deepin Packages Builder Thu, 17 Oct 2013 14:58:38 +0800 + +deepin-ui (1+git20131017143012~b8bebff384) raring; urgency=low + + * Build from git revision b8bebff384148fcbf2f8579fcd8d2ccf95c7d1f7 + + -- Deepin Packages Builder Thu, 17 Oct 2013 14:30:12 +0800 + +deepin-ui (1+git20131011091548~076697778b) raring; urgency=low + + * Build from git revision 076697778bb7a6ad7936f42bfc920b05c9f0b177 + + -- Deepin Packages Builder Fri, 11 Oct 2013 09:15:48 +0800 + +deepin-ui (1+git20131009165334~b1be62126c) raring; urgency=low + + * Build from git revision b1be62126c3195820e2402be715b4788d7b23f83 + + -- Deepin Packages Builder Wed, 09 Oct 2013 16:53:34 +0800 + +deepin-ui (1+git20131009143402~3421d3f203) raring; urgency=low + + * Build from git revision 3421d3f2034f9901f0fde181614f80c58d28ac6d + + -- Deepin Packages Builder Wed, 09 Oct 2013 14:34:03 +0800 + +deepin-ui (1+git20131009132611~5ed0607c1c) raring; urgency=low + + * Build from git revision 5ed0607c1cd6f713d860fe06761c11d1ebc5c558 + + -- Deepin Packages Builder Wed, 09 Oct 2013 13:26:11 +0800 + +deepin-ui (1+git20130926095600~3adfb9b6b3) raring; urgency=low + + * Build from git revision 3adfb9b6b3cb81ed79caa0246c7c2c4042f9e0bf + + -- Deepin Packages Builder Thu, 26 Sep 2013 09:56:00 +0800 + +deepin-ui (1+git20130906164039~e07875afbd) raring; urgency=low + + * Build from git revision e07875afbdcd20e72ada4f3e8882d7960acc2e6d + + -- Deepin Packages Builder Fri, 06 Sep 2013 16:40:39 +0800 + +deepin-ui (1+git20130905132804~b72567653c) raring; urgency=low + + * Build from git revision b72567653c2217fa0b92d6ed843cc8d4e945f5eb + + -- Deepin Packages Builder Thu, 05 Sep 2013 13:28:04 +0800 + +deepin-ui (1+git20130830100546~beb063ab01) raring; urgency=low + + * Build from git revision beb063ab010eec0eeab204713c8b130e224ca9da + + -- Deepin Packages Builder Fri, 30 Aug 2013 10:05:46 +0800 + +deepin-ui (1+git20130830090057~beb063ab01) raring; urgency=low + + * Build from git revision beb063ab010eec0eeab204713c8b130e224ca9da + + -- Deepin Packages Builder Fri, 30 Aug 2013 09:00:58 +0800 + +deepin-ui (1+git20130828182805~beb063ab01) raring; urgency=low + + * Build from git revision beb063ab010eec0eeab204713c8b130e224ca9da + + -- Deepin Packages Builder Wed, 28 Aug 2013 18:28:05 +0800 + +deepin-ui (1+git20130827152349~6464b32a36) raring; urgency=low + + * Build from git revision 6464b32a3633bf04385d57307ea5f249ef5dc1e0 + + -- Deepin Packages Builder Tue, 27 Aug 2013 15:23:50 +0800 + +deepin-ui (1+git20130724160031~d431497750) raring; urgency=low + + * Build from git revision d431497750dc648ba3e8bd7ef103f731469b78af + + -- Deepin Packages Builder Wed, 24 Jul 2013 16:00:31 +0800 + +deepin-ui (1+git20130718145348~a91a72132f) raring; urgency=low + + * Build from git revision a91a72132f52570009be42f2f8da674078054d57 + + -- Deepin Packages Builder Thu, 18 Jul 2013 14:53:48 +0800 + +deepin-ui (1+git20130718145304~a91a72132f) raring; urgency=low + + * Build from git revision a91a72132f52570009be42f2f8da674078054d57 + + -- Deepin Packages Builder Thu, 18 Jul 2013 14:53:04 +0800 + +deepin-ui (1+git20130713145524~550d72534a) raring; urgency=low + + * Build from git revision 550d72534acd70e16c9d79f69f589e7d5685ffe1 + + -- Deepin Testing Packages Sat, 13 Jul 2013 14:55:24 +0800 + +deepin-ui (1+git20130705113003~3165ccefdd) raring; urgency=low + + * Build from git revision 3165ccefddd47010776ffb2457411f5a56278cac + + -- Deepin Testing Packages Fri, 05 Jul 2013 11:30:03 +0800 + +deepin-ui (1+git20130704163936~3165ccefdd) raring; urgency=low + + * Build from git revision 3165ccefddd47010776ffb2457411f5a56278cac + + -- Deepin Testing Packages Thu, 04 Jul 2013 16:39:36 +0800 deepin-ui (1+git20130618094833~90b6485f6c) raring; urgency=low diff -Nru deepin-ui-1.0~raring~NoobsLab.com/debian/control deepin-ui-1.1~raring~NoobsLab.com/debian/control --- deepin-ui-1.0~raring~NoobsLab.com/debian/control 2013-06-19 15:30:06.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/debian/control 2013-11-23 18:26:55.000000000 +0000 @@ -1,7 +1,7 @@ Source: deepin-ui Priority: extra Maintainer: Li Longyu -Uploader: Umair Riaz +Uploaders: Umair Riaz Build-Depends: debhelper (>= 8.0.0), python ( >=2.7), python-dev( >=2.7), python-cairo-dev, libcairo2-dev, libgtk2.0-dev, python-setuptools, python-gtk2-dev, libwebkitgtk-dev Standards-Version: 3.9.3 Section: libs @@ -14,7 +14,7 @@ Architecture: all Depends: ${shlibs:Depends}, ${misc:Depends}, python ( >=2.7), libgtk2.0-0, libcairo2, python-gtk2, python-imaging, gettext, python-deepin-utils, python-xlib, python-webkit, python-scipy -Description: http://www.NoobsLab.com - LinuxDeepin UI libs +Description: LinuxDeepin UI libs UI toolkit for Linux Deepin,Awesome and Beautiful UI libs with LinuxDeepin #Package: deepin-ui-demo diff -Nru deepin-ui-1.0~raring~NoobsLab.com/debian/copyright deepin-ui-1.1~raring~NoobsLab.com/debian/copyright --- deepin-ui-1.0~raring~NoobsLab.com/debian/copyright 2013-05-06 16:29:36.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/debian/copyright 2013-10-27 07:31:18.000000000 +0000 @@ -3,16 +3,9 @@ Source: Files: * -Copyright: - -License: - - - . - +Copyright: 2013 Deepin, Inc +License: GPL-2+ -# If you want to use GPL v2 or later for the /debian/* files use -# the following clauses, or change it to suit. Delete these two lines Files: debian/* Copyright: 2012 Li Longyu License: GPL-2+ diff -Nru deepin-ui-1.0~raring~NoobsLab.com/debian/deepin-ui.links deepin-ui-1.1~raring~NoobsLab.com/debian/deepin-ui.links --- deepin-ui-1.0~raring~NoobsLab.com/debian/deepin-ui.links 2013-05-06 16:29:36.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/debian/deepin-ui.links 2013-08-30 02:05:32.000000000 +0000 @@ -1 +1,2 @@ /usr/share/pyshared/dtk/theme /usr/lib/python2.7/dist-packages/dtk/theme +/usr/share/pyshared/dtk/skin /usr/lib/python2.7/dist-packages/dtk/skin diff -Nru deepin-ui-1.0~raring~NoobsLab.com/demo.py deepin-ui-1.1~raring~NoobsLab.com/demo.py --- deepin-ui-1.0~raring~NoobsLab.com/demo.py 2013-05-06 16:29:46.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/demo.py 2013-09-06 08:40:39.000000000 +0000 @@ -43,6 +43,7 @@ from dtk.ui.dialog import PreferenceDialog from dtk.ui.application import Application from dtk.ui.browser import WebView +from dtk.ui.box import Markbox from dtk.ui.button import CheckButton, RadioButton, ComboButton from dtk.ui.button import ImageButton, LinkButton, Button from dtk.ui.star_view import StarView @@ -420,6 +421,11 @@ # entry_box.pack_start(combo_box, False, False) # entry_box.pack_start(spin_box, False, False) + mark_box = Markbox(0, "#000000") + entry_box.pack_start(mark_box, False, False) + + gtk.timeout_add(2000, lambda : mark_box.set_value(5.8)) + entry_frame = HorizontalFrame(10, 0, 0, 0, 0) entry_frame.add(entry_box) tab_1_box.pack_start(entry_frame, False, False) Binary files /tmp/lShRq2haVX/deepin-ui-1.0~raring~NoobsLab.com/dtk/locale/zh_TW/LC_MESSAGES/deepin-ui.mo and /tmp/GX5lL4HXQf/deepin-ui-1.1~raring~NoobsLab.com/dtk/locale/zh_TW/LC_MESSAGES/deepin-ui.mo differ diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/locale/zh_TW.po deepin-ui-1.1~raring~NoobsLab.com/dtk/locale/zh_TW.po --- deepin-ui-1.0~raring~NoobsLab.com/dtk/locale/zh_TW.po 2013-06-06 02:43:44.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/locale/zh_TW.po 2013-10-23 09:23:26.000000000 +0000 @@ -93,7 +93,7 @@ #: ../ui/entry.py:1935 msgid "Please input new shortcuts" -msgstr "請鍵入新的快捷鍵" +msgstr "請輸入新的捷徑鍵" #: ../ui/entry.py:1975 msgid "Disabled" @@ -101,7 +101,7 @@ #: ../ui/titlebar.py:143 msgid "Change skin" -msgstr "換膚" +msgstr "更換主題" #: ../ui/titlebar.py:149 msgid "Main menu" @@ -121,7 +121,7 @@ #: ../ui/color_selection.py:150 msgid "Color value" -msgstr "顏色值" +msgstr "色彩值" #: ../ui/color_selection.py:163 msgid "Red: " @@ -137,27 +137,27 @@ #: ../ui/skin.py:125 msgid "Select Skin" -msgstr "選擇皮膚" +msgstr "選擇主題" #: ../ui/skin.py:269 msgid "Skin version mismatch" -msgstr "皮膚版本不符" +msgstr "主題版本不符" #: ../ui/skin.py:270 msgid "Import skin version is mismatch with current one!" -msgstr "導入皮膚和當前皮膚版本不符" +msgstr "導入主題和目前主題版本不符" #: ../ui/skin.py:302 msgid "Delete skin" -msgstr "刪除皮膚" +msgstr "刪除主題" #: ../ui/skin.py:303 msgid "Are you sure you want to delete this skin?" -msgstr "你確定要刪除當前皮膚?" +msgstr "你確定要刪除目前的主題?" #: ../ui/skin.py:740 msgid "Add skin from file" -msgstr "添加皮膚檔案" +msgstr "添加主題檔案" #: ../ui/skin.py:853 msgid "Zoom" @@ -165,11 +165,11 @@ #: ../ui/skin.py:854 msgid "Flip vertical" -msgstr "縱向翻轉" +msgstr "垂直翻轉" #: ../ui/skin.py:855 msgid "Flip horizontal" -msgstr "橫向翻轉" +msgstr "水平翻轉" #: ../ui/skin.py:856 msgid "Lock scaling" @@ -177,7 +177,7 @@ #: ../ui/skin.py:857 ../ui/skin.py:930 msgid "Export" -msgstr "導出皮膚" +msgstr "導出主題" #: ../ui/skin.py:878 msgid "Back" diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/blue/theme.txt deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/blue/theme.txt --- deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/blue/theme.txt 2013-05-06 16:29:44.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/blue/theme.txt 2013-10-25 05:00:40.000000000 +0000 @@ -33,6 +33,7 @@ "osd_tooltip_text" : "#77b0e5", "osd_tooltip_border" : "#000000", "link_text" : "#2030CE", + "title_text" : "#DDDDDD", "label_text" : "#000000", "label_select_text" : "#FFFFFF", "label_select_background" : "#4D78B3", @@ -67,11 +68,11 @@ "text_entry_point" : ("#FFFFFF", 0.5), "text_entry_frame_point" : ("#FFFFFF", 0.45), "text_entry_frame" : ("#FFFFFF", 0.7), - "window_frame_outside_1" : ("#000000", 0.4), - "window_frame_outside_2" : ("#000000", 0.4), - "window_frame_outside_3" : ("#000000", 0.45), + "window_frame_outside_1" : ("#000000", 0.2), + "window_frame_outside_2" : ("#000000", 0.2), + "window_frame_outside_3" : ("#000000", 0.25), "window_frame_inside_1" : ("#FFFFFF", 0.2), - "window_frame_inside_2" : ("#FFFFFF", 0.6), + "window_frame_inside_2" : ("#FFFFFF", 0.2), "window_shadow_corner" : ("#000000", 0.1), "dragable_tab_active_frame" : ("#333333", 0.8), "dragable_tab_active_background" : ("#FFFFFF", 1), diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/chartreuse/theme.txt deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/chartreuse/theme.txt --- deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/chartreuse/theme.txt 2013-05-06 16:29:44.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/chartreuse/theme.txt 2013-10-25 05:00:40.000000000 +0000 @@ -33,6 +33,7 @@ "osd_tooltip_text" : "#77b0e5", "osd_tooltip_border" : "#000000", "link_text" : "#2030CE", + "title_text" : "#DDDDDD", "label_text" : "#000000", "label_select_text" : "#FFFFFF", "label_select_background" : "#4DB373", @@ -67,11 +68,11 @@ "text_entry_point" : ("#FFFFFF", 0.5), "text_entry_frame_point" : ("#FFFFFF", 0.45), "text_entry_frame" : ("#FFFFFF", 0.7), - "window_frame_outside_1" : ("#000000", 0.4), - "window_frame_outside_2" : ("#000000", 0.4), - "window_frame_outside_3" : ("#000000", 0.45), + "window_frame_outside_1" : ("#000000", 0.2), + "window_frame_outside_2" : ("#000000", 0.2), + "window_frame_outside_3" : ("#000000", 0.25), "window_frame_inside_1" : ("#FFFFFF", 0.2), - "window_frame_inside_2" : ("#FFFFFF", 0.6), + "window_frame_inside_2" : ("#FFFFFF", 0.2), "window_shadow_corner" : ("#000000", 0.1), "dragable_tab_active_frame" : ("#333333", 0.8), "dragable_tab_active_background" : ("#FFFFFF", 1), diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/cyan/theme.txt deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/cyan/theme.txt --- deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/cyan/theme.txt 2013-05-06 16:29:44.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/cyan/theme.txt 2013-10-25 05:00:40.000000000 +0000 @@ -33,6 +33,7 @@ "osd_tooltip_text" : "#77b0e5", "osd_tooltip_border" : "#000000", "link_text" : "#2030CE", + "title_text" : "#DDDDDD", "label_text" : "#000000", "label_select_text" : "#FFFFFF", "label_select_background" : "#4DB2B3", @@ -67,11 +68,11 @@ "text_entry_point" : ("#FFFFFF", 0.5), "text_entry_frame_point" : ("#FFFFFF", 0.45), "text_entry_frame" : ("#FFFFFF", 0.7), - "window_frame_outside_1" : ("#000000", 0.4), - "window_frame_outside_2" : ("#000000", 0.4), - "window_frame_outside_3" : ("#000000", 0.45), + "window_frame_outside_1" : ("#000000", 0.2), + "window_frame_outside_2" : ("#000000", 0.2), + "window_frame_outside_3" : ("#000000", 0.25), "window_frame_inside_1" : ("#FFFFFF", 0.2), - "window_frame_inside_2" : ("#FFFFFF", 0.6), + "window_frame_inside_2" : ("#FFFFFF", 0.2), "window_shadow_corner" : ("#000000", 0.1), "dragable_tab_active_frame" : ("#333333", 0.8), "dragable_tab_active_background" : ("#FFFFFF", 1), diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/dark_grey/theme.txt deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/dark_grey/theme.txt --- deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/dark_grey/theme.txt 2013-05-06 16:29:44.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/dark_grey/theme.txt 2013-10-25 05:00:40.000000000 +0000 @@ -33,6 +33,7 @@ "osd_tooltip_text" : "#77b0e5", "osd_tooltip_border" : "#000000", "link_text" : "#2030CE", + "title_text" : "#DDDDDD", "label_text" : "#000000", "label_select_text" : "#FFFFFF", "label_select_background" : "#4D4D4D", @@ -67,11 +68,11 @@ "text_entry_point" : ("#FFFFFF", 0.5), "text_entry_frame_point" : ("#FFFFFF", 0.45), "text_entry_frame" : ("#FFFFFF", 0.7), - "window_frame_outside_1" : ("#000000", 0.4), - "window_frame_outside_2" : ("#000000", 0.4), - "window_frame_outside_3" : ("#000000", 0.45), + "window_frame_outside_1" : ("#000000", 0.2), + "window_frame_outside_2" : ("#000000", 0.2), + "window_frame_outside_3" : ("#000000", 0.25), "window_frame_inside_1" : ("#FFFFFF", 0.2), - "window_frame_inside_2" : ("#FFFFFF", 0.6), + "window_frame_inside_2" : ("#FFFFFF", 0.2), "window_shadow_corner" : ("#000000", 0.1), "dragable_tab_active_frame" : ("#333333", 0.8), "dragable_tab_active_background" : ("#FFFFFF", 1), diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/dark_purple/theme.txt deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/dark_purple/theme.txt --- deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/dark_purple/theme.txt 2013-05-06 16:29:45.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/dark_purple/theme.txt 2013-10-25 05:00:40.000000000 +0000 @@ -33,6 +33,7 @@ "osd_tooltip_text" : "#77b0e5", "osd_tooltip_border" : "#000000", "link_text" : "#2030CE", + "title_text" : "#DDDDDD", "label_text" : "#000000", "label_select_text" : "#FFFFFF", "label_select_background" : "#7333CC", @@ -67,11 +68,11 @@ "text_entry_point" : ("#FFFFFF", 0.5), "text_entry_frame_point" : ("#FFFFFF", 0.45), "text_entry_frame" : ("#FFFFFF", 0.7), - "window_frame_outside_1" : ("#000000", 0.4), - "window_frame_outside_2" : ("#000000", 0.4), - "window_frame_outside_3" : ("#000000", 0.45), + "window_frame_outside_1" : ("#000000", 0.2), + "window_frame_outside_2" : ("#000000", 0.2), + "window_frame_outside_3" : ("#000000", 0.25), "window_frame_inside_1" : ("#FFFFFF", 0.2), - "window_frame_inside_2" : ("#FFFFFF", 0.6), + "window_frame_inside_2" : ("#FFFFFF", 0.2), "window_shadow_corner" : ("#000000", 0.1), "dragable_tab_active_frame" : ("#333333", 0.8), "dragable_tab_active_background" : ("#FFFFFF", 1), diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/deep_pink/theme.txt deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/deep_pink/theme.txt --- deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/deep_pink/theme.txt 2013-05-06 16:29:44.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/deep_pink/theme.txt 2013-10-25 05:00:40.000000000 +0000 @@ -33,6 +33,7 @@ "osd_tooltip_text" : "#77b0e5", "osd_tooltip_border" : "#000000", "link_text" : "#2030CE", + "title_text" : "#DDDDDD", "label_text" : "#000000", "label_select_text" : "#FFFFFF", "label_select_background" : "#B34D95", @@ -67,11 +68,11 @@ "text_entry_point" : ("#FFFFFF", 0.5), "text_entry_frame_point" : ("#FFFFFF", 0.45), "text_entry_frame" : ("#FFFFFF", 0.7), - "window_frame_outside_1" : ("#000000", 0.4), - "window_frame_outside_2" : ("#000000", 0.4), - "window_frame_outside_3" : ("#000000", 0.45), + "window_frame_outside_1" : ("#000000", 0.2), + "window_frame_outside_2" : ("#000000", 0.2), + "window_frame_outside_3" : ("#000000", 0.25), "window_frame_inside_1" : ("#FFFFFF", 0.2), - "window_frame_inside_2" : ("#FFFFFF", 0.6), + "window_frame_inside_2" : ("#FFFFFF", 0.2), "window_shadow_corner" : ("#000000", 0.1), "dragable_tab_active_frame" : ("#333333", 0.8), "dragable_tab_active_background" : ("#FFFFFF", 1), diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/dodger_blue/theme.txt deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/dodger_blue/theme.txt --- deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/dodger_blue/theme.txt 2013-05-06 16:29:44.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/dodger_blue/theme.txt 2013-10-25 05:00:40.000000000 +0000 @@ -33,6 +33,7 @@ "osd_tooltip_text" : "#77b0e5", "osd_tooltip_border" : "#000000", "link_text" : "#2030CE", + "title_text" : "#DDDDDD", "label_text" : "#000000", "label_select_text" : "#FFFFFF", "label_select_background" : "#0086CC", @@ -67,11 +68,11 @@ "text_entry_point" : ("#FFFFFF", 0.5), "text_entry_frame_point" : ("#FFFFFF", 0.45), "text_entry_frame" : ("#FFFFFF", 0.7), - "window_frame_outside_1" : ("#000000", 0.4), - "window_frame_outside_2" : ("#000000", 0.4), - "window_frame_outside_3" : ("#000000", 0.45), + "window_frame_outside_1" : ("#000000", 0.2), + "window_frame_outside_2" : ("#000000", 0.2), + "window_frame_outside_3" : ("#000000", 0.25), "window_frame_inside_1" : ("#FFFFFF", 0.2), - "window_frame_inside_2" : ("#FFFFFF", 0.6), + "window_frame_inside_2" : ("#FFFFFF", 0.2), "window_shadow_corner" : ("#000000", 0.1), "dragable_tab_active_frame" : ("#333333", 0.8), "dragable_tab_active_background" : ("#FFFFFF", 1), diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/gold/theme.txt deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/gold/theme.txt --- deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/gold/theme.txt 2013-05-06 16:29:44.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/gold/theme.txt 2013-10-25 05:00:40.000000000 +0000 @@ -33,6 +33,7 @@ "osd_tooltip_text" : "#77b0e5", "osd_tooltip_border" : "#000000", "link_text" : "#2030CE", + "title_text" : "#DDDDDD", "label_text" : "#000000", "label_select_text" : "#FFFFFF", "label_select_background" : "#CC9E00", @@ -67,11 +68,11 @@ "text_entry_point" : ("#FFFFFF", 0.5), "text_entry_frame_point" : ("#FFFFFF", 0.45), "text_entry_frame" : ("#FFFFFF", 0.7), - "window_frame_outside_1" : ("#000000", 0.4), - "window_frame_outside_2" : ("#000000", 0.4), - "window_frame_outside_3" : ("#000000", 0.45), + "window_frame_outside_1" : ("#000000", 0.2), + "window_frame_outside_2" : ("#000000", 0.2), + "window_frame_outside_3" : ("#000000", 0.25), "window_frame_inside_1" : ("#FFFFFF", 0.2), - "window_frame_inside_2" : ("#FFFFFF", 0.6), + "window_frame_inside_2" : ("#FFFFFF", 0.2), "window_shadow_corner" : ("#000000", 0.1), "dragable_tab_active_frame" : ("#333333", 0.8), "dragable_tab_active_background" : ("#FFFFFF", 1), diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/green_yellow/theme.txt deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/green_yellow/theme.txt --- deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/green_yellow/theme.txt 2013-05-06 16:29:44.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/green_yellow/theme.txt 2013-10-25 05:00:40.000000000 +0000 @@ -33,6 +33,7 @@ "osd_tooltip_text" : "#77b0e5", "osd_tooltip_border" : "#000000", "link_text" : "#2030CE", + "title_text" : "#DDDDDD", "label_text" : "#000000", "label_select_text" : "#FFFFFF", "label_select_background" : "#9AB34D", @@ -67,11 +68,11 @@ "text_entry_point" : ("#FFFFFF", 0.5), "text_entry_frame_point" : ("#FFFFFF", 0.45), "text_entry_frame" : ("#FFFFFF", 0.7), - "window_frame_outside_1" : ("#000000", 0.4), - "window_frame_outside_2" : ("#000000", 0.4), - "window_frame_outside_3" : ("#000000", 0.45), + "window_frame_outside_1" : ("#000000", 0.2), + "window_frame_outside_2" : ("#000000", 0.2), + "window_frame_outside_3" : ("#000000", 0.25), "window_frame_inside_1" : ("#FFFFFF", 0.2), - "window_frame_inside_2" : ("#FFFFFF", 0.6), + "window_frame_inside_2" : ("#FFFFFF", 0.2), "window_shadow_corner" : ("#000000", 0.1), "dragable_tab_active_frame" : ("#333333", 0.8), "dragable_tab_active_background" : ("#FFFFFF", 1), diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/orange/theme.txt deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/orange/theme.txt --- deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/orange/theme.txt 2013-05-06 16:29:44.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/orange/theme.txt 2013-10-25 05:00:40.000000000 +0000 @@ -33,6 +33,7 @@ "osd_tooltip_text" : "#77b0e5", "osd_tooltip_border" : "#000000", "link_text" : "#2030CE", + "title_text" : "#DDDDDD", "label_text" : "#000000", "label_select_text" : "#FFFFFF", "label_select_background" : "#CC7433", @@ -67,11 +68,11 @@ "text_entry_point" : ("#FFFFFF", 0.5), "text_entry_frame_point" : ("#FFFFFF", 0.45), "text_entry_frame" : ("#FFFFFF", 0.7), - "window_frame_outside_1" : ("#000000", 0.4), - "window_frame_outside_2" : ("#000000", 0.4), - "window_frame_outside_3" : ("#000000", 0.45), + "window_frame_outside_1" : ("#000000", 0.2), + "window_frame_outside_2" : ("#000000", 0.2), + "window_frame_outside_3" : ("#000000", 0.25), "window_frame_inside_1" : ("#FFFFFF", 0.2), - "window_frame_inside_2" : ("#FFFFFF", 0.6), + "window_frame_inside_2" : ("#FFFFFF", 0.2), "window_shadow_corner" : ("#000000", 0.1), "dragable_tab_active_frame" : ("#333333", 0.8), "dragable_tab_active_background" : ("#FFFFFF", 1), diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/purple/theme.txt deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/purple/theme.txt --- deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/purple/theme.txt 2013-05-06 16:29:44.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/purple/theme.txt 2013-10-25 05:00:40.000000000 +0000 @@ -33,6 +33,7 @@ "osd_tooltip_text" : "#77b0e5", "osd_tooltip_border" : "#000000", "link_text" : "#2030CE", + "title_text" : "#DDDDDD", "label_text" : "#000000", "label_select_text" : "#FFFFFF", "label_select_background" : "#974DB3", @@ -67,11 +68,11 @@ "text_entry_point" : ("#FFFFFF", 0.5), "text_entry_frame_point" : ("#FFFFFF", 0.45), "text_entry_frame" : ("#FFFFFF", 0.7), - "window_frame_outside_1" : ("#000000", 0.4), - "window_frame_outside_2" : ("#000000", 0.4), - "window_frame_outside_3" : ("#000000", 0.45), + "window_frame_outside_1" : ("#000000", 0.2), + "window_frame_outside_2" : ("#000000", 0.2), + "window_frame_outside_3" : ("#000000", 0.25), "window_frame_inside_1" : ("#FFFFFF", 0.2), - "window_frame_inside_2" : ("#FFFFFF", 0.6), + "window_frame_inside_2" : ("#FFFFFF", 0.2), "window_shadow_corner" : ("#000000", 0.1), "dragable_tab_active_frame" : ("#333333", 0.8), "dragable_tab_active_background" : ("#FFFFFF", 1), diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/red/theme.txt deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/red/theme.txt --- deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/red/theme.txt 2013-05-06 16:29:44.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/red/theme.txt 2013-10-25 05:00:40.000000000 +0000 @@ -33,6 +33,7 @@ "osd_tooltip_text" : "#77b0e5", "osd_tooltip_border" : "#000000", "link_text" : "#2030CE", + "title_text" : "#DDDDDD", "label_text" : "#000000", "label_select_text" : "#FFFFFF", "label_select_background" : "#CC3333", @@ -67,11 +68,11 @@ "text_entry_point" : ("#FFFFFF", 0.5), "text_entry_frame_point" : ("#FFFFFF", 0.45), "text_entry_frame" : ("#FFFFFF", 0.7), - "window_frame_outside_1" : ("#000000", 0.4), - "window_frame_outside_2" : ("#000000", 0.4), - "window_frame_outside_3" : ("#000000", 0.45), + "window_frame_outside_1" : ("#000000", 0.2), + "window_frame_outside_2" : ("#000000", 0.2), + "window_frame_outside_3" : ("#000000", 0.25), "window_frame_inside_1" : ("#FFFFFF", 0.2), - "window_frame_inside_2" : ("#FFFFFF", 0.6), + "window_frame_inside_2" : ("#FFFFFF", 0.2), "window_shadow_corner" : ("#000000", 0.1), "dragable_tab_active_frame" : ("#333333", 0.8), "dragable_tab_active_background" : ("#FFFFFF", 1), diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/yellow/theme.txt deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/yellow/theme.txt --- deepin-ui-1.0~raring~NoobsLab.com/dtk/theme/yellow/theme.txt 2013-05-06 16:29:44.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/theme/yellow/theme.txt 2013-10-25 05:00:40.000000000 +0000 @@ -33,6 +33,7 @@ "osd_tooltip_text" : "#77b0e5", "osd_tooltip_border" : "#000000", "link_text" : "#2030CE", + "title_text" : "#DDDDDD", "label_text" : "#000000", "label_select_text" : "#FFFFFF", "label_select_background" : "#CACC00", @@ -67,11 +68,11 @@ "text_entry_point" : ("#FFFFFF", 0.5), "text_entry_frame_point" : ("#FFFFFF", 0.45), "text_entry_frame" : ("#FFFFFF", 0.7), - "window_frame_outside_1" : ("#000000", 0.4), - "window_frame_outside_2" : ("#000000", 0.4), - "window_frame_outside_3" : ("#000000", 0.45), + "window_frame_outside_1" : ("#000000", 0.2), + "window_frame_outside_2" : ("#000000", 0.2), + "window_frame_outside_3" : ("#000000", 0.25), "window_frame_inside_1" : ("#FFFFFF", 0.2), - "window_frame_inside_2" : ("#FFFFFF", 0.6), + "window_frame_inside_2" : ("#FFFFFF", 0.2), "window_shadow_corner" : ("#000000", 0.1), "dragable_tab_active_frame" : ("#333333", 0.8), "dragable_tab_active_background" : ("#FFFFFF", 1), diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/application.py deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/application.py --- deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/application.py 2013-06-04 08:07:10.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/application.py 2013-11-07 02:15:58.000000000 +0000 @@ -38,7 +38,9 @@ def __init__(self, app_support_colormap=True, - resizable=True + resizable=True, + window_type=gtk.WINDOW_TOPLEVEL, + destroy_func=None ): ''' Initialize the Application class. @@ -50,8 +52,10 @@ # Init. self.app_support_colormap = app_support_colormap self.resizable = resizable + self.window_type = window_type self.close_callback = self.close_window self.skin_preview_pixbuf = None + self.destroy_func = destroy_func # Start application. self.init() @@ -70,12 +74,14 @@ # Init window. if self.app_support_colormap: - self.window = Window(True) + self.window = Window(True, window_type=self.window_type) else: - self.window = MplayerWindow(True) + self.window = MplayerWindow(True, window_type=self.window_type) self.window.set_resizable(self.resizable) - self.window.set_position(gtk.WIN_POS_CENTER) - self.window.connect("destroy", self.destroy) + if hasattr(self, "destroy_func") and self.destroy_func: + self.window.connect("destroy", lambda w: self.destroy_func) + else: + self.window.connect("destroy", self.destroy) # Init main box. self.main_box = self.window.window_frame @@ -148,7 +154,10 @@ @param widget: A widget of Gtk.Widget. Passed by gtk. ''' - self.window.close_window() + if hasattr(self, "destroy_func") and self.destroy_func: + self.destroy_func() + else: + self.window.close_window() def show_titlebar(self): ''' diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/box.py deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/box.py --- deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/box.py 2013-05-06 16:29:45.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/box.py 2013-10-29 06:08:25.000000000 +0000 @@ -22,7 +22,7 @@ # along with this program. If not, see . from draw import (draw_pixbuf, propagate_expose, draw_vlinear, cairo_state, - cairo_disable_antialias) + cairo_disable_antialias, draw_text) from theme import ui_theme from skin_config import skin_config from utils import get_window_shadow_size, color_hex_to_cairo, set_cursor @@ -285,3 +285,110 @@ return True gobject.type_register(ResizableBox) + +class Markbox(EventBox): + ''' + class docs + ''' + + def __init__(self, value, font_color="#FFFFFF"): + ''' + init docs + ''' + EventBox.__init__(self) + + self.value = value + self.font_color = font_color + + self.start_value = 0 + self.range = 0 + self.in_animation = False + + self.big_number_size = 18 + self.small_number_size = 15 + self.dot_number_offset_x = 13 + self.dot_number_offset_y = 1 + self.small_number_offset_y = 1 + + self.connect("expose-event", self.expose_mark_bar) + + self.set_size_request(30, 30) + + def set_value(self, value): + if (not self.in_animation) and value != self.value: + self.start_value = self.value + self.range = value - self.value + times = int(abs(self.range)) * 10 + if times != 0: + from timeline import Timeline, CURVE_SINE + timeline = Timeline(times * 10, CURVE_SINE) + timeline.connect("start", self.start_animation) + timeline.connect("stop", self.stop_animation) + timeline.connect("update", self.update_animation) + timeline.run() + else: + self.value = value + self.queue_draw() + + return False + + def start_animation(self, timeline): + self.in_animation = True + + def stop_animation(self, timeline): + self.in_animation = False + + def update_animation(self, timeline, percent): + self.value = round(self.start_value + self.range * percent, 1) + + self.queue_draw() + + def expose_mark_bar(self, widget, event): + cr = widget.window.cairo_create() + rect = widget.allocation + + split_result = str(self.value).split(".") + if len(split_result) == 1: + big_number_str = split_result[0] + dot_str = None + small_number_str = None + else: + (big_number_str, small_number_str) = split_result + dot_str = "." + + draw_text( + cr, + "%s" % big_number_str, + rect.x, + rect.y, + rect.width, + rect.height, + text_size=self.big_number_size, + text_color=self.font_color, + ) + + if dot_str: + draw_text( + cr, + dot_str, + rect.x + self.dot_number_offset_x, + rect.y + self.dot_number_offset_y, + rect.width, + rect.height, + text_size=self.small_number_size, + text_color=self.font_color, + ) + + if small_number_str: + draw_text( + cr, + small_number_str, + rect.x + self.big_number_size, + rect.y, + rect.width, + rect.height + self.small_number_offset_y, + text_size=self.small_number_size, + text_color=self.font_color, + ) + +gobject.type_register(Markbox) diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/breadcrumb.py deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/breadcrumb.py --- deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/breadcrumb.py 2013-05-06 16:29:45.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/breadcrumb.py 2013-10-25 01:23:35.000000000 +0000 @@ -367,7 +367,7 @@ shadow_visible=False, shape_frame_function=self.shape_bread_menu_frame, expose_frame_function=self.expose_bread_menu_frame, - align_size=2 + align_size=2, ) self.set_skip_pager_hint(True) self.set_skip_taskbar_hint(True) @@ -578,13 +578,13 @@ self.set_state(gtk.STATE_PRELIGHT) if widget.state == gtk.STATE_NORMAL: - text_color = ui_theme.get_color("button_font").get_color() + text_color = ui_theme.get_color("title_text").get_color() button_color = None menu_color = None arrow_pixbuf = arrow_right elif widget.state == gtk.STATE_PRELIGHT: - text_color = ui_theme.get_color("button_font").get_color() + text_color = ui_theme.get_color("title_text").get_color() if self.menu_show: arrow_pixbuf = arrow_down else: @@ -598,7 +598,7 @@ menu_color = None elif widget.state == gtk.STATE_ACTIVE: - text_color = ui_theme.get_color("button_font").get_color() + text_color = ui_theme.get_color("title_text").get_color() if self.in_button: button_color = inner_border menu_color = None diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/button.py deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/button.py --- deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/button.py 2013-06-09 01:20:36.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/button.py 2013-09-26 01:56:00.000000000 +0000 @@ -197,7 +197,7 @@ press_dpixbuf, scale_x, content, - insensitive_dpixbuf) + insensitive_dpixbuf=insensitive_dpixbuf) def set_active(self, is_active): ''' diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/dbus_notify.py deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/dbus_notify.py --- deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/dbus_notify.py 2013-05-06 16:29:45.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/dbus_notify.py 2013-07-04 08:39:36.000000000 +0000 @@ -96,11 +96,14 @@ Call notifications dbus service to display notify message. ''' bus = dbus.SessionBus() - if not check_dbus(bus, NOTIFICATIONS_SERVICE_NAME): - return False + # if not check_dbus(bus, NOTIFICATIONS_SERVICE_NAME): + # return False + try: - proxy = bus.get_object(NOTIFICATIONS_SERVICE_NAME, - NOTIFICATIONS_PATH) - notify_interface = dbus.Interface(proxy, NOTIFICATIONS_SERVICE_NAME) - notify_interface.Notify(self.app_name, -1, self.icon, self.summary, self.body, - self.actions, self.hints, self.timeout) + proxy = bus.get_object(NOTIFICATIONS_SERVICE_NAME, + NOTIFICATIONS_PATH) + notify_interface = dbus.Interface(proxy, NOTIFICATIONS_SERVICE_NAME) + notify_interface.Notify(self.app_name, 0, self.icon, self.summary, self.body, + self.actions, self.hints, self.timeout) + except: + pass diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/dialog.py deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/dialog.py --- deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/dialog.py 2013-05-22 02:40:41.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/dialog.py 2013-10-23 09:25:05.000000000 +0000 @@ -130,7 +130,9 @@ window_hint=gtk.gdk.WINDOW_TYPE_HINT_DIALOG, window_pos=None, skip_taskbar_hint=True, - resizable=False): + resizable=False, + window_type=gtk.WINDOW_TOPLEVEL, + ): ''' Initialize DialogBox class. @@ -168,10 +170,15 @@ @param skip_taskbar_hint: Set True to make desktop environment not to display the window in the task bar, default is True. @param resizable: Whether allowed user resizable dialog, default is False. ''' - Window.__init__(self, resizable) + Window.__init__( + self, + enable_resize=resizable, + window_type=window_type, + ) self.default_width = default_width self.default_height = default_height self.mask_type = mask_type + self.close_callback = close_callback if window_pos: self.set_position(window_pos) @@ -209,15 +216,38 @@ self.window_frame.pack_start(self.body_align, True, True) self.window_frame.pack_start(self.button_box, False, False) - if close_callback: - self.titlebar.close_button.connect("clicked", lambda w: close_callback()) - self.connect("destroy", lambda w: close_callback()) + if self.close_callback: + self.titlebar.close_button.connect("clicked", lambda w: self.close_callback()) + self.connect("destroy", lambda w: self.close_callback()) + self.connect("delete-event", lambda w, e: self.close_callback()) else: self.titlebar.close_button.connect("clicked", lambda w: self.destroy()) self.connect("destroy", lambda w: self.destroy()) + self.connect("delete-event", lambda w, e: self.destroy()) self.draw_mask = self.get_mask_func(self, 1, 1, 0, 1) + self.keymap = { + "Escape" : self.close, + } + + self.connect("key-press-event", self.key_press_dialog_box) + + def key_press_dialog_box(self, widget, event): + key_name = get_keyevent_name(event) + if self.keymap.has_key(key_name): + self.keymap[key_name]() + + return True + else: + return False + + def close(self): + if self.close_callback: + self.close_callback() + else: + self.destroy() + def get_mask_func(self, widget, padding_left=0, padding_right=0, padding_top=0, padding_bottom=0): ''' Get mask function to render background, you can use this function to return \"render function\" to draw your ui to keep same style. @@ -390,6 +420,9 @@ cancel_callback=None, cancel_first=True, message_text_size=11, + window_type=gtk.WINDOW_TOPLEVEL, + close_callback=None, + text_wrap_width=None, ): ''' Initialize ConfirmDialog class. @@ -404,20 +437,30 @@ @param message_text_size: Text size of message, default is 11. ''' # Init. - DialogBox.__init__(self, title, default_width, default_height, DIALOG_MASK_SINGLE_PAGE) + DialogBox.__init__( + self, title, default_width, default_height, DIALOG_MASK_SINGLE_PAGE, + window_type=window_type, + close_callback=close_callback, + ) self.confirm_callback = confirm_callback self.cancel_callback = cancel_callback self.label_align = gtk.Alignment() self.label_align.set(0.5, 0.5, 0, 0) self.label_align.set_padding(0, 0, 8, 8) - self.label = Label(message, text_x_align=ALIGN_MIDDLE, text_size=message_text_size) + self.label = Label( + message, + text_x_align=ALIGN_MIDDLE, + text_size=message_text_size, + wrap_width=text_wrap_width, + ) self.confirm_button = Button(_("OK")) self.cancel_button = Button(_("Cancel")) self.confirm_button.connect("clicked", lambda w: self.click_confirm_button()) self.cancel_button.connect("clicked", lambda w: self.click_cancel_button()) + self.cancel_button.connect("key-press-event", self.key_press_confirm_dialog) # Connect widgets. self.body_box.pack_start(self.label_align, True, True) @@ -427,6 +470,20 @@ self.right_button_box.set_buttons([self.cancel_button, self.confirm_button]) else: self.right_button_box.set_buttons([self.confirm_button, self.cancel_button]) + + self.keymap = { + "Return" : self.click_confirm_button, + "Escape" : self.close, + } + + def key_press_confirm_dialog(self, widget, event): + key_name = get_keyevent_name(event) + if self.keymap.has_key(key_name): + self.keymap[key_name]() + + return True + else: + return False def click_confirm_button(self): ''' @@ -653,7 +710,7 @@ default_width, default_height, mask_type=DIALOG_MASK_MULTIPLE_PAGE, - close_callback=self.hide_all, + close_callback=self.hide_dialog, ) self.set_position(gtk.WIN_POS_CENTER) @@ -701,6 +758,11 @@ self.body_box.pack_start(self.main_box, True, True) self.right_button_box.set_buttons([close_button]) + def hide_dialog(self): + self.hide_all() + + return True + def button_press_preference_item(self, treeview, item, column_index, offset_x, offset_y): if self.set_item_widget(item): self.show_all() diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/draw.py deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/draw.py --- deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/draw.py 2013-05-06 16:29:45.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/draw.py 2013-10-09 08:53:34.000000000 +0000 @@ -32,7 +32,7 @@ add_color_stop_rgba, propagate_expose, alpha_color_hex_to_cairo) -def draw_radial_ring(cr, x, y, outer_radius, inner_radius, color_infos): +def draw_radial_ring(cr, x, y, outer_radius, inner_radius, color_infos, clip_corner=None): ''' Draw radial ring. @@ -44,6 +44,19 @@ @param color_infos: A list of ColorInfo, ColorInfo format as [(color_pos, (color_hex_value, color_alpha))]. ''' with cairo_state(cr): + # Clip corner. + if clip_corner: + if clip_corner == "top-left": + cr.rectangle(x - outer_radius, y - outer_radius, outer_radius, outer_radius) + elif clip_corner == "top-right": + cr.rectangle(x, y - outer_radius, outer_radius, outer_radius) + elif clip_corner == "bottom-left": + cr.rectangle(x - outer_radius, y, outer_radius, outer_radius) + elif clip_corner == "bottom-right": + cr.rectangle(x, y, outer_radius, outer_radius) + + cr.clip() + # Clip. cr.arc(x, y, outer_radius, 0, pi * 2) cr.arc(x, y, inner_radius, 0, pi * 2) diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/entry.py deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/entry.py --- deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/entry.py 2013-06-09 01:20:36.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/entry.py 2013-10-09 08:53:34.000000000 +0000 @@ -81,6 +81,7 @@ enable_clear_button=False, is_password_entry=False, shown_password=False, + cursor_color="#000000", ): ''' Initialize EntryBuffer class. @@ -114,12 +115,15 @@ self.is_password_entry = is_password_entry self.shown_password = shown_password self.sensitive = True + self.cursor_color = cursor_color self.__prop_dict = {} self.__prop_dict['cursor-visible'] = True self.__prop_dict['select-area-visible'] = True self.__prop_dict['visibility'] = True self.__prop_dict['invisible-char'] = '*' + + self.always_show_cursor = False surface = cairo.ImageSurface(cairo.FORMAT_RGB24, 0, 0) cr = cairo.Context(surface) @@ -501,8 +505,9 @@ cr.set_source_rgb(*color_hex_to_cairo(self.text_select_color)) context.update_layout(layout) context.show_layout(layout) + # Draw cursor - if self.get_cursor_visible() and grab_focus_flag: + if self.always_show_cursor or (self.get_cursor_visible() and grab_focus_flag): # Init. cursor_index = self.get_insert_index() cursor_pos = self.get_cursor_pos(cursor_index)[0] @@ -527,13 +532,10 @@ self.cursor_pos1 = cursor_pos[1] self.cursor_pos2 = cursor_pos[3] self.m_draw_cursor(cursor_alpha) - ''' - FIXME: HOW-TO flash cursor - CursorFlashThread(self).start() - ''' def m_draw_cursor(self, cursor_alpha): - self.cursor_cr.set_source_rgba(0, 0, 0, cursor_alpha) + (r, g, b) = color_hex_to_cairo(self.cursor_color) + self.cursor_cr.set_source_rgba(r, g, b, cursor_alpha) self.cursor_cr.rectangle(self.cursor_x, self.cursor_pos1 + self.cursor_y, 1, @@ -817,6 +819,7 @@ is_password_entry=False, shown_password=False, place_holder="", + cursor_color="#000000", ): ''' Initialize Entry class. @@ -844,7 +847,9 @@ content, DEFAULT_FONT, font_size, 'normal', text_color, text_select_color, background_select_color, enable_clear_button, - is_password_entry = is_password_entry) + is_password_entry = is_password_entry, + cursor_color=cursor_color, + ) self.clear_button = ClearButton(False) self.enable_clear_button = enable_clear_button self.clear_button_x = -1 @@ -867,6 +872,7 @@ self.entry_buffer.set_property("select-area-visible", self.select_area_visible_flag) self.place_holder = place_holder self.cursor_blank_id = None + self.cursor_color = cursor_color self.offset_x = 0 self.offset_y = 0 diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/keymap.py deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/keymap.py --- deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/keymap.py 2013-05-06 16:29:45.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/keymap.py 2013-10-09 05:26:11.000000000 +0000 @@ -49,13 +49,14 @@ if to_upper: key_unicode = gdk.keyval_to_unicode(gdk.keyval_to_upper(keyval)) else: - key_unicode = gdk.keyval_to_unicode(keyval) + key_unicode = gdk.keyval_to_unicode(gdk.keyval_convert_case(keyval)[0]) + if key_unicode == 0: return gdk.keyval_name(keyval) else: return str(unichr(key_unicode)) -def get_key_event_modifiers(key_event): +def get_key_event_modifiers(key_event, to_upper=False): ''' Get key modifiers with given key event. @@ -80,9 +81,13 @@ if key_event.state & gdk.MOD1_MASK: modifiers.append("Alt") - # # Don't need add Shift modifier if keyval is upper character. - if key_event.state & gdk.SHIFT_MASK and (len(get_key_name(key_event.keyval)) != 1 or not gdk.keyval_is_upper(key_event.keyval)): - modifiers.append("Shift") + # Don't need add Shift modifier if keyval is upper character. + if to_upper: + if key_event.state & gdk.SHIFT_MASK and (len(get_key_name(key_event.keyval)) != 1 or not gdk.keyval_is_upper(key_event.keyval)): + modifiers.append("Shift") + else: + if key_event.state & gdk.SHIFT_MASK: + modifiers.append("Shift") return modifiers @@ -97,7 +102,7 @@ if key_event.is_modifier: return "" else: - key_modifiers = get_key_event_modifiers(key_event) + key_modifiers = get_key_event_modifiers(key_event, to_upper) key_name = get_key_name(key_event.keyval, to_upper) if key_name == " ": key_name = "Space" @@ -107,6 +112,17 @@ else: return " + ".join(key_modifiers) + " + " + key_name +def is_no_key_press(key_event): + ''' + Return True if haven't any key press. + + @param keyevent_name: Key event name that return by function L{ I{get_keyevent_name} }. + This function used in signal key-release-event. + ''' + return ((not key_event.is_modifier) and get_key_name(key_event.keyval) == get_keyevent_name(key_event) or + key_event.is_modifier and len(get_key_event_modifiers(key_event)) == 1 + ) + def parse_keyevent_name(keyevent_name): ''' Parse keyevent name. diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/mplayer_window.py deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/mplayer_window.py --- deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/mplayer_window.py 2013-05-06 16:29:45.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/mplayer_window.py 2013-08-27 07:23:49.000000000 +0000 @@ -160,7 +160,7 @@ # Draw skin and mask. with cairo_state(cr): - if self.window.get_state() != gtk.gdk.WINDOW_STATE_MAXIMIZED: + if self.window.get_state() & gtk.gdk.WINDOW_STATE_MAXIMIZED != gtk.gdk.WINDOW_STATE_MAXIMIZED: cr.rectangle(x + 2, y, w - 4, 1) cr.rectangle(x + 1, y + 1, w - 2, 1) cr.rectangle(x, y + 2, w, h - 4) @@ -175,7 +175,7 @@ self.draw_mask(cr, x, y, w, h) # Draw window frame. - if self.window.get_state() != gtk.gdk.WINDOW_STATE_MAXIMIZED: + if self.window.get_state() & gtk.gdk.WINDOW_STATE_MAXIMIZED != gtk.gdk.WINDOW_STATE_MAXIMIZED: draw_window_frame(cr, x, y, w, h, ui_theme.get_alpha_color("window_frame_outside_1"), ui_theme.get_alpha_color("window_frame_outside_2"), @@ -223,7 +223,8 @@ if not self.shape_flag: # Don't clip corner when window is fullscreen state. cr.rectangle(x, y, w, h) - elif self.window.get_state() in [gtk.gdk.WINDOW_STATE_FULLSCREEN, gtk.gdk.WINDOW_STATE_MAXIMIZED]: + elif (self.window.get_state() & gtk.gdk.WINDOW_STATE_FULLSCREEN == gtk.gdk.WINDOW_STATE_FULLSCREEN or + self.window.get_state() & gtk.gdk.WINDOW_STATE_MAXIMIZED == gtk.gdk.WINDOW_STATE_MAXIMIZED): # Don't clip corner when window is fullscreen state. cr.rectangle(x, y, w, h) else: diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/net.py deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/net.py --- deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/net.py 2013-06-05 08:58:08.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/net.py 2013-07-13 06:55:23.000000000 +0000 @@ -122,6 +122,7 @@ "Ctrl + x" : self.cut_to_clipboard, "Ctrl + v" : self.paste_from_clipboard, "BackSpace" : self.backspace, + "Space" : self.insert_ip_dot, "." : self.insert_ip_dot, } @@ -263,8 +264,14 @@ elif event.x >= self.cursor_positions[-1]: self.set_cursor_index(len(self.ip)) else: + ip_segment_distance = self.width / self.segment_number + segment_index = int(event.x / ip_segment_distance) + for (cursor_index, cursor_position) in enumerate(self.cursor_positions): - if cursor_position < event.x <= self.cursor_positions[cursor_index + 1]: + if len(self.ip.split(self.segment_split_char)[segment_index]) == 0: + self.set_cursor_index(segment_index) + break + elif cursor_position < event.x <= self.cursor_positions[cursor_index + 1]: self.set_cursor_index(cursor_index) break @@ -701,6 +708,7 @@ "Ctrl + x" : self.cut_to_clipboard, "Ctrl + v" : self.paste_from_clipboard, "BackSpace" : self.backspace, + "Space" : self.insert_mac_dot, ":" : self.insert_mac_dot, } @@ -841,8 +849,14 @@ elif event.x >= self.cursor_positions[-1]: self.set_cursor_index(len(self.mac)) else: + ip_segment_distance = self.width / self.segment_number + segment_index = int(event.x / ip_segment_distance) + for (cursor_index, cursor_position) in enumerate(self.cursor_positions): - if cursor_position < event.x <= self.cursor_positions[cursor_index + 1]: + if len(self.mac.split(self.segment_split_char)[segment_index]) == 0: + self.set_cursor_index(segment_index) + break + elif cursor_position < event.x <= self.cursor_positions[cursor_index + 1]: self.set_cursor_index(cursor_index) break diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/scrolled_window.py deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/scrolled_window.py --- deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/scrolled_window.py 2013-05-06 16:29:45.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/scrolled_window.py 2013-07-18 06:52:48.000000000 +0000 @@ -372,9 +372,6 @@ self._vertical.last_time = e.time self._vertical.in_motion = True - # Emit signal 'vscrollbar_state_changed'. - self.emit_vscrollbar_state_changed(e) - return True def calc_vbar_length(self): @@ -438,6 +435,9 @@ self._vertical.bar_pos = value2pos(adj.value, self._vertical.virtual_len, upper) self.calc_vbar_allocation() self.vwindow.move_resize(*self.vallocation) + + self.emit_vscrollbar_state_changed() + self.queue_draw() def hadjustment_changed(self, adj): @@ -673,11 +673,14 @@ print "v_len:%f, height:%f, vir_bar_len:%d" % ( self._vertical.virtual_len, self.allocation.height, self._vertical.bar_len) - def emit_vscrollbar_state_changed(self, e): + def emit_vscrollbar_state_changed(self, e=None): value = self.vadjustment.value page_size = self.vadjustment.page_size upper = self.vadjustment.upper - if e.type == gtk.gdk.MOTION_NOTIFY: + + if e == None: + bottom_value = upper - page_size + elif e.type == gtk.gdk.MOTION_NOTIFY: bottom_value = upper - page_size elif e.type == gtk.gdk.SCROLL: bottom_value = upper - page_size - 1 diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/skin.py deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/skin.py --- deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/skin.py 2013-06-07 14:06:00.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/skin.py 2013-07-13 06:55:23.000000000 +0000 @@ -261,7 +261,7 @@ ''' Create skin from package. ''' - (load_skin_status, skin_dir, skin_image_file) = skin_config.load_skin_from_image(filepath) + (load_skin_status, skin_dir, skin_image_file) = skin_config.load_skin_from_package(filepath) if load_skin_status: self.add_skin_preview_icon(skin_dir, skin_image_file) diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/titlebar.py deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/titlebar.py --- deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/titlebar.py 2013-05-21 08:34:41.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/titlebar.py 2013-10-25 01:01:23.000000000 +0000 @@ -29,6 +29,7 @@ from constant import DEFAULT_FONT_SIZE import tooltip as Tooltip from utils import window_is_max +from theme import ui_theme import gobject import gtk import pango @@ -103,7 +104,11 @@ app_name_label = "" else: app_name_label = app_name - self.app_name_box = Label(app_name_label, enable_gaussian=enable_gaussian, text_size=name_size) + self.app_name_box = Label( + app_name_label, + text_color=ui_theme.get_color("title_text"), + enable_gaussian=enable_gaussian, text_size=name_size, + ) self.app_name_align = gtk.Alignment() self.app_name_align.set(0.5, 0.5, 0.0, 0.0) self.app_name_align.set_padding(2, 0, 5, 0) @@ -116,7 +121,9 @@ else: title_label = title self.title_box = Label( - title_label, enable_gaussian=enable_gaussian, + title_label, + text_color=ui_theme.get_color("title_text"), + enable_gaussian=enable_gaussian, text_x_align=pango.ALIGN_CENTER, text_size=title_size, ) diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/treeview.py deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/treeview.py --- deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/treeview.py 2013-06-09 03:49:49.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/treeview.py 2013-07-24 08:00:31.000000000 +0000 @@ -997,12 +997,20 @@ item.redraw_request_callback = self.redraw_request item.add_items_callback = self.add_items item.delete_items_callback = self.delete_items + item.connect("redraw-request", self.redraw_item) self.update_item_index() self.update_item_widths() self.update_vadjustment() + + def redraw_item(self, list_item): + ''' + Internal function to redraw item. + ''' + self.redraw_request_list.append(list_item) + self.update_redraw_request_list() def delete_item_by_index(self, index): ''' @@ -1831,27 +1839,33 @@ @param item: The item need to visible. ''' if item != None and item in self.visible_items: - # Get bound index. - (start_index, end_index, item_height_count) = self.get_expose_bound() - - # Get highlight item index. - item_index = item.row_index - - # Scroll viewport make sure preview row in visible area. + # Get coordinates. + item_height = item.get_height() + item_top = sum(map(lambda i: i.get_height(), self.visible_items[:item.row_index])) + item_bottom = item_top + item_height (offset_x, offset_y, viewport) = self.get_offset_coordinate(self.draw_area) vadjust = self.scrolled_window.get_vadjustment() - highlight_row_height_count = sum(map(lambda i: i.get_height(), self.visible_items[:item_index])) + visible_area_top = vadjust.get_value() + visible_area_bottom = vadjust.get_value() + vadjust.get_page_size() - max_height = vadjust.get_upper() - vadjust.get_page_size() - page_height = vadjust.get_value() + vadjust.get_page_size() - - # Don't greater than vadjustment upper value. - if highlight_row_height_count > max_height: - highlight_row_height_count = max_height + # Get height of previous item. + if 0 < item.row_index <= len(self.visible_items) - 1: + prev_item_height = self.visible_items[item.row_index - 1].get_height() + else: + prev_item_height = 0 + + # Get height of next item. + if 0 <= item.row_index < len(self.visible_items) - 1: + next_item_height = self.visible_items[item.row_index + 1].get_height() + else: + next_item_height = 0 + + # Make item in visible area. + if item_top <= visible_area_top: + vadjust.set_value(max(item_top - prev_item_height, vadjust.get_lower())) + elif item_bottom >= visible_area_bottom: + vadjust.set_value(item_bottom + next_item_height - vadjust.get_page_size()) - if vadjust.get_value >= highlight_row_height_count or page_height <= highlight_row_height_count: - vadjust.set_value(max(vadjust.get_lower(), highlight_row_height_count)) - def get_highlight_item(self): ''' Get highlight item. @@ -1900,6 +1914,10 @@ Normal, you shouldn't use this class directly, instead you should use item that base on NodeItem, NodeItem provide more simple apis than TreeItem. ''' + + __gsignals__ = { + "redraw-request" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), + } def __init__(self): ''' @@ -1922,6 +1940,14 @@ self.column_offset = 0 self.height = None + def emit_redraw_request(self): + ''' + Emit `redraw-request` signal. + + This is TreeView interface, you should implement it. + ''' + self.emit("redraw-request") + def expand(self): pass diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/utils.py deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/utils.py --- deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/utils.py 2013-05-06 16:29:45.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/utils.py 2013-10-11 01:15:48.000000000 +0000 @@ -22,6 +22,7 @@ # along with this program. If not, see . from deepin_utils import core, file, process, ipc, date_time, net +from deepin_utils.core import merge_list from contextlib import contextmanager import cairo import gobject @@ -516,6 +517,27 @@ else: return get_match_parent(parent, match_types) +def get_match_children(widget, child_type): + ''' + Get all child widgets that match given widget type. + + @param widget: The container to search. + @param child_type: The widget type of search. + + @return: Return all child widgets that match given widget type, or return empty list if nothing to find. + ''' + child_list = widget.get_children() + if child_list: + match_widget_list = filter(lambda w: isinstance(w, child_type), child_list) + match_children = (merge_list(map( + lambda w: get_match_children(w, child_type), + filter( + lambda w: isinstance(w, gtk.Container), + child_list)))) + return match_widget_list + match_children + else: + return [] + def widget_fix_cycle_destroy_bug(widget): ''' Fix bug that PyGtk destroys cycle too early. @@ -555,7 +577,7 @@ @return: Return True if widget's toplevel window is maximized. ''' toplevel_window = widget.get_toplevel() - if toplevel_window.window.get_state() == gtk.gdk.WINDOW_STATE_MAXIMIZED: + if toplevel_window.window.get_state() & gtk.gdk.WINDOW_STATE_MAXIMIZED == gtk.gdk.WINDOW_STATE_MAXIMIZED: return True else: return False diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/window.py deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/window.py --- deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/window.py 2013-05-06 16:29:45.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/window.py 2013-11-08 08:46:32.000000000 +0000 @@ -27,6 +27,7 @@ import cairo import gobject import gtk +from deepin_utils.xutils import set_window_property_by_id from utils import (cairo_state, propagate_expose, set_cursor, get_event_root_coords, enable_shadow, alpha_color_hex_to_cairo) @@ -53,6 +54,9 @@ shadow_visible=True, shape_frame_function=None, expose_frame_function=None, + expose_background_function=None, + expose_shadow_function=None, + frame_radius=2, ): ''' Initialise the Window class. @@ -71,8 +75,11 @@ self.shadow_visible = shadow_visible self.shape_frame_function = shape_frame_function self.expose_frame_function = expose_frame_function + self.expose_background_function = expose_background_function + self.expose_shadow_function = expose_shadow_function self.set_colormap(gtk.gdk.Screen().get_rgba_colormap()) self.background_color = (0, 0, 0, 0) + self.frame_radius = frame_radius self.init() @@ -82,7 +89,6 @@ self.add_events(gtk.gdk.ALL_EVENTS_MASK) self.window_shadow = gtk.Alignment() self.window_frame = gtk.VBox() - self.frame_radius = 2 self.shadow_is_visible = True self.cursor_type = None @@ -121,78 +127,81 @@ @param event: The expose event of type gtk.gdk.Event. @return: Always return True. ''' - # Init. - cr = widget.window.cairo_create() - rect = widget.allocation - - # Draw background. - self.draw_background(cr, rect.x, rect.y, rect.width, rect.height) - - # Save cairo context. - if self.shadow_is_visible: - x = rect.x + self.shadow_padding - y = rect.y + self.shadow_padding - w = rect.width - self.shadow_padding * 2 - h = rect.height - self.shadow_padding * 2 + if self.expose_background_function: + self.expose_background_function(widget, event) else: - x, y, w, h = rect.x, rect.y, rect.width, rect.height - - # Draw skin and mask. - with cairo_state(cr): - if self.window.get_state() != gtk.gdk.WINDOW_STATE_MAXIMIZED: - cr.rectangle(x + 2, y, w - 4, 1) - cr.rectangle(x + 1, y + 1, w - 2, 1) - cr.rectangle(x, y + 2, w, h - 4) - cr.rectangle(x + 2, y + h - 1, w - 4, 1) - cr.rectangle(x + 1, y + h - 2, w - 2, 1) - - cr.clip() + # Init. + cr = widget.window.cairo_create() + rect = widget.allocation # Draw background. - self.draw_skin(cr, x, y, w, h) - - # Draw mask. - self.draw_mask(cr, x, y, w, h) + self.draw_background(cr, rect.x, rect.y, rect.width, rect.height) - # Draw corner shadow. - with cairo_state(cr): - cr.set_source_rgba(*alpha_color_hex_to_cairo(ui_theme.get_alpha_color("window_shadow_corner").get_color_info())) - - cr.rectangle(x, y + 1, 1, 1) # top-left - cr.rectangle(x + 1, y, 1, 1) - - cr.rectangle(x + w - 1, y + 1, 1, 1) # top-right - cr.rectangle(x + w - 2, y, 1, 1) - - cr.rectangle(x, y + h - 2, 1, 1) # bottom-left - cr.rectangle(x + 1, y + h - 1, 1, 1) - - cr.rectangle(x + w - 1, y + h - 2, 1, 1) # bottom-right - cr.rectangle(x + w - 2, y + h - 1, 1, 1) - - cr.fill() - - # Draw background corner. - with cairo_state(cr): - cr.rectangle(x, y + 1, 1, 1) # top-left - cr.rectangle(x + 1, y, 1, 1) - - cr.rectangle(x + w - 1, y + 1, 1, 1) # top-right - cr.rectangle(x + w - 2, y, 1, 1) - - cr.rectangle(x, y + h - 2, 1, 1) # bottom-left - cr.rectangle(x + 1, y + h - 1, 1, 1) - - cr.rectangle(x + w - 1, y + h - 2, 1, 1) # bottom-right - cr.rectangle(x + w - 2, y + h - 1, 1, 1) - - cr.clip() + # Save cairo context. + if self.shadow_is_visible: + x = rect.x + self.shadow_padding + y = rect.y + self.shadow_padding + w = rect.width - self.shadow_padding * 2 + h = rect.height - self.shadow_padding * 2 + else: + x, y, w, h = rect.x, rect.y, rect.width, rect.height + + # Draw skin and mask. + with cairo_state(cr): + if self.window.get_state() & gtk.gdk.WINDOW_STATE_MAXIMIZED != gtk.gdk.WINDOW_STATE_MAXIMIZED: + cr.rectangle(x + 2, y, w - 4, 1) + cr.rectangle(x + 1, y + 1, w - 2, 1) + cr.rectangle(x, y + 2, w, h - 4) + cr.rectangle(x + 2, y + h - 1, w - 4, 1) + cr.rectangle(x + 1, y + h - 2, w - 2, 1) + + cr.clip() + + # Draw background. + self.draw_skin(cr, x, y, w, h) - self.draw_skin(cr, x, y, w, h) + # Draw mask. + self.draw_mask(cr, x, y, w, h) + + # Draw corner shadow. + with cairo_state(cr): + cr.set_source_rgba(*alpha_color_hex_to_cairo(ui_theme.get_alpha_color("window_shadow_corner").get_color_info())) + + cr.rectangle(x, y + 1, 1, 1) # top-left + cr.rectangle(x + 1, y, 1, 1) + + cr.rectangle(x + w - 1, y + 1, 1, 1) # top-right + cr.rectangle(x + w - 2, y, 1, 1) + + cr.rectangle(x, y + h - 2, 1, 1) # bottom-left + cr.rectangle(x + 1, y + h - 1, 1, 1) + + cr.rectangle(x + w - 1, y + h - 2, 1, 1) # bottom-right + cr.rectangle(x + w - 2, y + h - 1, 1, 1) + + cr.fill() + + # Draw background corner. + with cairo_state(cr): + cr.rectangle(x, y + 1, 1, 1) # top-left + cr.rectangle(x + 1, y, 1, 1) + + cr.rectangle(x + w - 1, y + 1, 1, 1) # top-right + cr.rectangle(x + w - 2, y, 1, 1) + + cr.rectangle(x, y + h - 2, 1, 1) # bottom-left + cr.rectangle(x + 1, y + h - 1, 1, 1) + + cr.rectangle(x + w - 1, y + h - 2, 1, 1) # bottom-right + cr.rectangle(x + w - 2, y + h - 1, 1, 1) + + cr.clip() + + self.draw_skin(cr, x, y, w, h) + + # Propagate expose. + propagate_expose(widget, event) - # Propagate expose. - propagate_expose(widget, event) - return True def expose_window_shadow(self, widget, event): @@ -202,7 +211,9 @@ @param widget: the window of gtk.Widget. @param event: The expose event of type gtk.gdk.Event. ''' - if self.shadow_is_visible: + if self.expose_shadow_function: + self.expose_shadow_function(widget, event) + elif self.shadow_is_visible: # Init. cr = widget.window.cairo_create() rect = widget.allocation @@ -220,7 +231,8 @@ ''' if self.expose_frame_function: self.expose_frame_function(widget, event) - elif self.window.get_state() != gtk.gdk.WINDOW_STATE_MAXIMIZED: + elif (self.window.get_state() & gtk.gdk.WINDOW_STATE_MAXIMIZED != gtk.gdk.WINDOW_STATE_MAXIMIZED and + self.window.get_state() & gtk.gdk.WINDOW_STATE_FULLSCREEN != gtk.gdk.WINDOW_STATE_FULLSCREEN): # Init. cr = widget.window.cairo_create() rect = widget.allocation @@ -244,7 +256,7 @@ if self.shape_frame_function: self.shape_frame_function(widget, rect) elif widget.window != None and widget.get_has_window() and rect.width > 0 and rect.height > 0: - if self.window.get_state() != gtk.gdk.WINDOW_STATE_MAXIMIZED: + if self.window.get_state() & gtk.gdk.WINDOW_STATE_MAXIMIZED != gtk.gdk.WINDOW_STATE_MAXIMIZED: # Init. x, y, w, h = rect.x, rect.y, rect.width, rect.height bitmap = gtk.gdk.Pixmap(None, w, h, 1) @@ -259,9 +271,13 @@ cr.set_source_rgb(1.0, 1.0, 1.0) cr.set_operator(cairo.OPERATOR_OVER) - cr.rectangle(x + 1, y, w - 2, 1) - cr.rectangle(x, y + 1, w, h - 2) - cr.rectangle(x + 1, y + h - 1, w - 2, 1) + if (self.window.get_state() & gtk.gdk.WINDOW_STATE_FULLSCREEN == gtk.gdk.WINDOW_STATE_FULLSCREEN or + self.window.get_state() & gtk.gdk.WINDOW_STATE_MAXIMIZED == gtk.gdk.WINDOW_STATE_MAXIMIZED): + cr.rectangle(x, y, w, h) + else: + cr.rectangle(x + 1, y, w - 2, 1) + cr.rectangle(x, y + 1, w, h - 2) + cr.rectangle(x + 1, y + h - 1, w - 2, 1) cr.fill() @@ -275,6 +291,9 @@ self.shadow_is_visible = False self.window_shadow.set_padding(0, 0, 0, 0) + # This code use for tag deepin-ui window for delete window shadow in deepin-screenshot. + set_window_property_by_id(self.get_window().xid, "DEEPIN_WINDOW_SHADOW", "0") + def show_shadow(self): ''' Show the window shadow. @@ -282,6 +301,9 @@ self.shadow_is_visible = True self.window_shadow.set_padding(self.shadow_padding, self.shadow_padding, self.shadow_padding, self.shadow_padding) + # This code use for tag deepin-ui window for delete window shadow in deepin-screenshot. + set_window_property_by_id(self.get_window().xid, "DEEPIN_WINDOW_SHADOW", str(self.shadow_padding)) + def motion_notify(self, widget, event): ''' Internal callback for `motion-notify` signal. @@ -328,7 +350,8 @@ ''' if enable_shadow(self) and self.shadow_visible: window_state = self.window.get_state() - if window_state in [gtk.gdk.WINDOW_STATE_MAXIMIZED, gtk.gdk.WINDOW_STATE_FULLSCREEN]: + if (window_state & gtk.gdk.WINDOW_STATE_FULLSCREEN == gtk.gdk.WINDOW_STATE_FULLSCREEN or + window_state & gtk.gdk.WINDOW_STATE_MAXIMIZED == gtk.gdk.WINDOW_STATE_MAXIMIZED): return (0, 0) else: return (self.shadow_padding, self.shadow_padding) diff -Nru deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/window_base.py deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/window_base.py --- deepin-ui-1.0~raring~NoobsLab.com/dtk/ui/window_base.py 2013-05-06 16:29:45.000000000 +0000 +++ deepin-ui-1.1~raring~NoobsLab.com/dtk/ui/window_base.py 2013-10-09 05:26:11.000000000 +0000 @@ -21,6 +21,7 @@ # along with this program. If not, see . import cairo +import gobject from constant import EDGE_DICT from skin_config import skin_config import gtk @@ -35,6 +36,11 @@ @undocumented: get_cursor_type_with_coordinate ''' + __gsignals__ = { + "window-resize" : (gobject.SIGNAL_RUN_LAST, gobject.TYPE_NONE, ()), + + } + def __init__(self, window_type=gtk.WINDOW_TOPLEVEL, ): @@ -56,7 +62,7 @@ Toggle the window size between maximized size and normal size. ''' window_state = self.window.get_state() - if window_state == gtk.gdk.WINDOW_STATE_MAXIMIZED: + if window_state & gtk.gdk.WINDOW_STATE_MAXIMIZED == gtk.gdk.WINDOW_STATE_MAXIMIZED: self.unmaximize() else: self.maximize() @@ -66,7 +72,7 @@ Toggle the window between fullscreen mode and normal size. ''' window_state = self.window.get_state() - if window_state == gtk.gdk.WINDOW_STATE_FULLSCREEN: + if window_state & gtk.gdk.WINDOW_STATE_FULLSCREEN == gtk.gdk.WINDOW_STATE_FULLSCREEN: self.unfullscreen() else: self.fullscreen() @@ -103,6 +109,8 @@ if edge != None: resize_window(self, event, self, edge) + self.emit("window-resize") + def is_disable_window_maximized(self): ''' An interface which indicates whether the window could be maximized, you should implement this function you own. @@ -121,7 +129,8 @@ @param event: The event of gtk.gdk.Event. ''' window_state = self.window.get_state() - if window_state in [gtk.gdk.WINDOW_STATE_MAXIMIZED, gtk.gdk.WINDOW_STATE_FULLSCREEN]: + if (window_state & gtk.gdk.WINDOW_STATE_MAXIMIZED == gtk.gdk.WINDOW_STATE_MAXIMIZED or + window_state & gtk.gdk.WINDOW_STATE_FULLSCREEN == gtk.gdk.WINDOW_STATE_FULLSCREEN): self.hide_shadow() if self.is_disable_window_maximized():