Compare commits
142 Commits
Author | SHA1 | Date | |
---|---|---|---|
14a53cc43c | |||
a6be7ad6bd | |||
af05a9e268 | |||
eab96c66fd | |||
2a740448e1 | |||
94472ba9fa | |||
dfb110cd0f | |||
57dd02f6ae | |||
0b1430058a | |||
f2172c088e | |||
b93cb4b976 | |||
6744433245 | |||
01cd42bd51 | |||
bc3b208f41 | |||
049fea477b | |||
0ec4c66f96 | |||
8ad1da0db2 | |||
bd0bd22c63 | |||
e3b839360a | |||
968679f68c | |||
5d0e33e267 | |||
52f1cc6d19 | |||
1b2377370b | |||
5a6c9f176e | |||
a9fea8248c | |||
47644cad6a | |||
b7c6ec4b46 | |||
908b0fb727 | |||
e21aea6e13 | |||
6c13ca817d | |||
38009309e9 | |||
d98db2bd59 | |||
1f274c04fb | |||
ddfe9442fa | |||
8b792f8942 | |||
db96437f18 | |||
a614d72b00 | |||
ec6a6727e0 | |||
cc8a95572e | |||
d1108e1e7d | |||
744bc996db | |||
22bf4c8a93 | |||
46bce04788 | |||
9a2d883cf5 | |||
690deeb502 | |||
367eaf9161 | |||
f0e531310d | |||
cdef8bf5aa | |||
e9a9a5243c | |||
ee57dab846 | |||
9f68786547 | |||
c02b57efc3 | |||
7183aac362 | |||
011db9f34d | |||
7d8c3f1ecd | |||
087ac8470e | |||
3ce89e3c80 | |||
543a41bfea | |||
cb80dc6834 | |||
b55fd735f4 | |||
32fd323153 | |||
3aea09b614 | |||
374fd35476 | |||
20d3b1f8b1 | |||
7de5e78977 | |||
2da6507a87 | |||
5ca665bdde | |||
46f8d913a1 | |||
858a6bf827 | |||
89173544d4 | |||
163b2d0403 | |||
c83883f1f7 | |||
f6cbb14393 | |||
ffd25fe9e4 | |||
524e2ca8e2 | |||
33dca51650 | |||
58bb0044b2 | |||
79865172d3 | |||
730e8ffdf9 | |||
d128cc5af3 | |||
b5c2e1c98c | |||
2016e08f7b | |||
e752193a54 | |||
88a4256ad5 | |||
62ca7fb268 | |||
765779272f | |||
3333f30c42 | |||
732ba8576d | |||
a4481b38d2 | |||
176487834a | |||
394e01850b | |||
5f8391314a | |||
d593877548 | |||
d2bf7ec66c | |||
fe0f4060c4 | |||
40b0459174 | |||
a0b5a44fe9 | |||
5ce1e3fe92 | |||
8b3258cb09 | |||
22948b3d39 | |||
aa7de264e6 | |||
046e0609ab | |||
1a0d507316 | |||
b5853fe7e5 | |||
0f81c7efe0 | |||
0f0e3d9644 | |||
f6b4fa6e7e | |||
fbb88da134 | |||
83f11870da | |||
c635cb7016 | |||
dd23a61dbb | |||
2e00bc4aed | |||
6423cbfc92 | |||
ed3e287d91 | |||
347196d35c | |||
2ab3d069fb | |||
21641d8925 | |||
499c5737da | |||
40a8e9c1a6 | |||
2e98aab2e7 | |||
760b6ad9ed | |||
14434601a3 | |||
ae3d1423e5 | |||
d56fbf6d6a | |||
b7c60b02d1 | |||
d7075d9913 | |||
72cb4bf346 | |||
bffadf1b6e | |||
8552721983 | |||
ec36a0070e | |||
216dafd5b1 | |||
a4feb91644 | |||
778fd72e22 | |||
ff01bf68fd | |||
edbfafc5bd | |||
c20a7d4b01 | |||
c4e0e4197d | |||
71f63962a8 | |||
ef4c9b6f1f | |||
4d43424efd | |||
1f1f4432f6 | |||
98e60eb7e9 |
27
configure.ac
27
configure.ac
@ -1,5 +1,5 @@
|
||||
AC_PREREQ(2.63)
|
||||
AC_INIT([gnome-shell],[2.29.0],[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell],[gnome-shell])
|
||||
AC_INIT([gnome-shell],[2.29.1],[https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell],[gnome-shell])
|
||||
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
AC_CONFIG_SRCDIR([src/shell-global.c])
|
||||
@ -21,9 +21,11 @@ LT_PREREQ([2.2.6])
|
||||
LT_INIT([disable-static])
|
||||
|
||||
GETTEXT_PACKAGE=gnome-shell
|
||||
AC_SUBST(GETTEXT_PACKAGE)
|
||||
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE",
|
||||
[The prefix for our gettext translation domains.])
|
||||
IT_PROG_INTLTOOL(0.26)
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
AC_DEFINE([GETTEXT_PACKAGE], [PACKAGE_TARNAME], [The prefix for our gettext translation domain])
|
||||
|
||||
PKG_PROG_PKG_CONFIG([0.22])
|
||||
|
||||
@ -53,14 +55,23 @@ fi
|
||||
|
||||
AM_CONDITIONAL(BUILD_RECORDER, $build_recorder)
|
||||
|
||||
CLUTTER_MIN_VERSION=1.2.0
|
||||
GOBJECT_INTROSPECTION_MIN_VERSION=0.6.9
|
||||
GJS_MIN_VERSION=0.6
|
||||
MUTTER_MIN_VERSION=2.29.1
|
||||
|
||||
# Collect more than 20 libraries for a prize!
|
||||
PKG_CHECK_MODULES(MUTTER_PLUGIN, gio-unix-2.0 gtk+-2.0 dbus-glib-1 mutter-plugins >= 2.29.0
|
||||
gjs-gi-1.0 libgnome-menu $recorder_modules gconf-2.0
|
||||
gdk-x11-2.0 clutter-x11-1.0 clutter-glx-1.0
|
||||
gnome-desktop-2.0 >= 2.26 libstartup-notification-1.0
|
||||
gobject-introspection-1.0 >= 0.6.5)
|
||||
PKG_CHECK_MODULES(MUTTER_PLUGIN, gio-unix-2.0 gtk+-2.0 dbus-glib-1
|
||||
mutter-plugins >= $MUTTER_MIN_VERSION
|
||||
gjs-gi-1.0 >= $GJS_MIN_VERSION
|
||||
libgnome-menu $recorder_modules gconf-2.0
|
||||
gdk-x11-2.0
|
||||
clutter-x11-1.0 >= $CLUTTER_MIN_VERSION
|
||||
clutter-glx-1.0 >= $CLUTTER_MIN_VERSION
|
||||
libstartup-notification-1.0
|
||||
gobject-introspection-1.0 >= $GOBJECT_INTROSPECTION_MIN_VERSION)
|
||||
PKG_CHECK_MODULES(TIDY, clutter-1.0)
|
||||
PKG_CHECK_MODULES(ST, clutter-1.0 gtk+-2.0 libcroco-0.6)
|
||||
PKG_CHECK_MODULES(ST, clutter-1.0 gtk+-2.0 libcroco-0.6 gnome-desktop-2.0 >= 2.26)
|
||||
PKG_CHECK_MODULES(BIG, clutter-1.0 gtk+-2.0 librsvg-2.0)
|
||||
PKG_CHECK_MODULES(GDMUSER, dbus-glib-1 gtk+-2.0)
|
||||
PKG_CHECK_MODULES(TRAY, gtk+-2.0)
|
||||
|
@ -23,9 +23,11 @@ dist_theme_DATA = \
|
||||
theme/close-window.svg \
|
||||
theme/close.svg \
|
||||
theme/corner-ripple.png \
|
||||
theme/dialog-error.svg \
|
||||
theme/gnome-shell.css \
|
||||
theme/mosaic-view-active.svg \
|
||||
theme/mosaic-view.svg \
|
||||
theme/move-window-on-new.svg \
|
||||
theme/remove-workspace.svg \
|
||||
theme/scroll-button-down-hover.png \
|
||||
theme/scroll-button-down.png \
|
||||
|
@ -62,5 +62,5 @@
|
||||
clip-rule="evenodd"
|
||||
d="M10.5,3.5l2,2L10,8l2.5,2.5l-2,2L8,10l-2.5,2.5l-2-2L6,8L3.5,5.5l2-2L8,6L10.5,3.5 z M0,8c0-4.418,3.582-8,8-8s8,3.582,8,8s-3.582,8-8,8S0,12.418,0,8z"
|
||||
id="path2394"
|
||||
style="fill-opacity:1;fill:#000000" />
|
||||
</svg>
|
||||
style="fill-opacity:1;fill:#545454" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
@ -45,6 +45,18 @@
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/desktop/gnome/shell/run_dialog/history</key>
|
||||
<applyto>/desktop/gnome/shell/run_dialog/history</applyto>
|
||||
<owner>gnome-shell</owner>
|
||||
<type>list</type>
|
||||
<list_type>string</list_type>
|
||||
<default>[]</default>
|
||||
<locale name="C">
|
||||
<short>History for command (Alt-F2) dialog</short>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/desktop/gnome/shell/sidebar/visible</key>
|
||||
<applyto>/desktop/gnome/shell/sidebar/visible</applyto>
|
||||
@ -154,7 +166,7 @@
|
||||
<applyto>/desktop/gnome/shell/recorder/file_extension</applyto>
|
||||
<owner>gnome-shell</owner>
|
||||
<type>string</type>
|
||||
<default>ogg</default>
|
||||
<default>ogv</default>
|
||||
<locale name="C">
|
||||
<short>File extension used for storing the screencast</short>
|
||||
<long>
|
||||
|
222
data/theme/dialog-error.svg
Normal file
222
data/theme/dialog-error.svg
Normal file
@ -0,0 +1,222 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="24"
|
||||
height="24"
|
||||
id="svg4908"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.47 r22583"
|
||||
sodipodi:docname="dialog-error.svg"
|
||||
inkscape:output_extension="org.inkscape.output.svg.inkscape"
|
||||
inkscape:export-filename="/home/andreas/project/gnome-icon-theme/scalable/actions/process-stop.png"
|
||||
inkscape:export-xdpi="90"
|
||||
inkscape:export-ydpi="90"
|
||||
version="1.0">
|
||||
<defs
|
||||
id="defs4910">
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 24 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="48 : 24 : 1"
|
||||
inkscape:persp3d-origin="24 : 16 : 1"
|
||||
id="perspective25" />
|
||||
<radialGradient
|
||||
gradientTransform="matrix(1.349881,0,0,1.349881,-3.498814,-1.810859)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
r="9.7183542"
|
||||
fy="4.9892726"
|
||||
fx="9.6893959"
|
||||
cy="4.9892726"
|
||||
cx="9.6893959"
|
||||
id="radialGradient5177"
|
||||
xlink:href="#linearGradient5171"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
gradientTransform="matrix(2.417917,0,0,2.417917,-14.17917,-4.903184)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
r="9.7785711"
|
||||
fy="3.458019"
|
||||
fx="10"
|
||||
cy="3.458019"
|
||||
cx="10"
|
||||
id="radialGradient5157"
|
||||
xlink:href="#linearGradient5151"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(0.928125,0,0,0.3143011,0.7718789,12.358015)"
|
||||
r="9.0598059"
|
||||
fy="18.022524"
|
||||
fx="10.739184"
|
||||
cy="18.022524"
|
||||
cx="10.739184"
|
||||
id="radialGradient5145"
|
||||
xlink:href="#linearGradient5139"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
id="linearGradient5139"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop5141"
|
||||
offset="0"
|
||||
style="stop-color:black;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop5143"
|
||||
offset="1"
|
||||
style="stop-color:black;stop-opacity:0;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient5151"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop5153"
|
||||
offset="0"
|
||||
style="stop-color:white;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop5155"
|
||||
offset="1"
|
||||
style="stop-color:white;stop-opacity:0;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient5171">
|
||||
<stop
|
||||
id="stop5173"
|
||||
offset="0"
|
||||
style="stop-color:#fe3a00;stop-opacity:1" />
|
||||
<stop
|
||||
id="stop5175"
|
||||
offset="1"
|
||||
style="stop-color:#c00;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="22.627417"
|
||||
inkscape:cx="24.442987"
|
||||
inkscape:cy="10.142308"
|
||||
inkscape:current-layer="g7001"
|
||||
showgrid="false"
|
||||
inkscape:grid-bbox="true"
|
||||
inkscape:document-units="px"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true"
|
||||
inkscape:window-width="1674"
|
||||
inkscape:window-height="970"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="26"
|
||||
width="48px"
|
||||
height="48px"
|
||||
inkscape:window-maximized="0" />
|
||||
<metadata
|
||||
id="metadata4913">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title>Stop Process</dc:title>
|
||||
<dc:date>December 2006</dc:date>
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>Jakub Steiner</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<dc:contributor>
|
||||
<cc:Agent>
|
||||
<dc:title>Andreas Nilsson</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:contributor>
|
||||
<cc:license
|
||||
rdf:resource="http://creativecommons.org/licenses/GPL/2.0/" />
|
||||
<dc:subject>
|
||||
<rdf:Bag>
|
||||
<rdf:li>stop</rdf:li>
|
||||
<rdf:li>halt</rdf:li>
|
||||
</rdf:Bag>
|
||||
</dc:subject>
|
||||
</cc:Work>
|
||||
<cc:License
|
||||
rdf:about="http://creativecommons.org/licenses/GPL/2.0/">
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Reproduction" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/Distribution" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/Notice" />
|
||||
<cc:permits
|
||||
rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/ShareAlike" />
|
||||
<cc:requires
|
||||
rdf:resource="http://web.resource.org/cc/SourceCode" />
|
||||
</cc:License>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
transform="translate(0,-24)">
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
id="g7001"
|
||||
transform="matrix(1.4566048,0,0,1.4455352,0.4112881,1.2324709)">
|
||||
<path
|
||||
transform="matrix(0.91468137,0,0,0.70055266,-1.8812476,17.474032)"
|
||||
d="m 19.79899,18.022524 a 9.0598059,3.0935922 0 1 1 -18.1196115,0 9.0598059,3.0935922 0 1 1 18.1196115,0 z"
|
||||
sodipodi:ry="3.0935922"
|
||||
sodipodi:rx="9.0598059"
|
||||
sodipodi:cy="18.022524"
|
||||
sodipodi:cx="10.739184"
|
||||
id="path5137"
|
||||
style="color:#000000;fill:url(#radialGradient5145);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible"
|
||||
sodipodi:type="arc" />
|
||||
<path
|
||||
transform="matrix(0.87347736,0,0,0.83068052,-0.79308842,15.602788)"
|
||||
d="m 19.25,9.625 a 9.25,9.25 0 1 1 -18.5,0 9.25,9.25 0 1 1 18.5,0 z"
|
||||
sodipodi:ry="9.25"
|
||||
sodipodi:rx="9.25"
|
||||
sodipodi:cy="9.625"
|
||||
sodipodi:cx="10"
|
||||
id="path4262"
|
||||
style="color:#000000;fill:url(#radialGradient5177);fill-opacity:1;fill-rule:nonzero;stroke:#a40000;stroke-width:0.47435912;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
|
||||
sodipodi:type="arc" />
|
||||
<path
|
||||
sodipodi:type="arc"
|
||||
style="opacity:0.35393258;color:#000000;fill:none;stroke:url(#radialGradient5157);stroke-width:0.49999994;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
|
||||
id="path5149"
|
||||
sodipodi:cx="10"
|
||||
sodipodi:cy="9.625"
|
||||
sodipodi:rx="9.25"
|
||||
sodipodi:ry="9.25"
|
||||
d="m 19.25,9.625 a 9.25,9.25 0 1 1 -18.5,0 9.25,9.25 0 1 1 18.5,0 z"
|
||||
transform="matrix(0.82868359,0,0,0.78808147,-0.34515141,16.012803)" />
|
||||
<path
|
||||
sodipodi:nodetypes="cc"
|
||||
id="path5159"
|
||||
d="m 4.834121,20.642783 6.215127,5.91061"
|
||||
style="color:#000000;fill:none;stroke:#ffffff;stroke-width:1.21219134;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" />
|
||||
<path
|
||||
style="color:#000000;fill:none;stroke:#ffffff;stroke-width:1.21219146;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible"
|
||||
d="M 11.04925,20.622826 4.8159529,26.553393"
|
||||
id="path5161"
|
||||
sodipodi:nodetypes="cc" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 8.0 KiB |
@ -44,16 +44,16 @@ StScrollView
|
||||
StScrollView > .top-shadow
|
||||
{
|
||||
background-gradient-direction: vertical;
|
||||
background-gradient-start: rgba(0, 0, 0, 255);
|
||||
background-gradient-end: rgba(0, 0, 0, 0);
|
||||
background-gradient-start: #111111;
|
||||
background-gradient-end: rgba(17, 17, 17, 0);
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
StScrollView > .bottom-shadow
|
||||
{
|
||||
background-gradient-direction: vertical;
|
||||
background-gradient-start: rgba(0, 0, 0, 0);
|
||||
background-gradient-end: rgba(0, 0, 0, 255);
|
||||
background-gradient-start: rgba(17, 17, 17, 0);
|
||||
background-gradient-end: #111111;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
@ -98,14 +98,13 @@ StTooltip {
|
||||
#panel {
|
||||
color: #ffffff;
|
||||
font-size: 16px;
|
||||
background-gradient-direction: vertical;
|
||||
background-gradient-start: #161616;
|
||||
background-gradient-end: #000000;
|
||||
background-color: black;
|
||||
border-bottom: 1px solid #1f1f1f;
|
||||
}
|
||||
|
||||
#panelLeft, #panelCenter, #panelRight {
|
||||
spacing: 4px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#panelLeft {
|
||||
@ -117,12 +116,6 @@ StTooltip {
|
||||
}
|
||||
|
||||
#appMenu {
|
||||
spacing: 4px;
|
||||
}
|
||||
|
||||
.app-menu-icon {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.panel-button {
|
||||
@ -131,6 +124,7 @@ StTooltip {
|
||||
border-radius-bottomleft: 0px;
|
||||
border-radius-bottomright: 0px;
|
||||
font: 16px sans-serif;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.panel-button:active, .panel-button:checked, .panel-button:pressed {
|
||||
@ -174,6 +168,38 @@ StTooltip {
|
||||
border: 1px solid #666666;
|
||||
}
|
||||
|
||||
.new-workspace-area {
|
||||
border: 2px solid rgba(255, 255, 255, 0.8);
|
||||
border-radius: 10px;
|
||||
background-color: #111;
|
||||
}
|
||||
|
||||
.new-workspace-area-internal {
|
||||
background-gradient-direction: horizontal;
|
||||
background-gradient-start: rgba(16, 16, 16, 0);
|
||||
background-gradient-end: rgba(16, 16, 16, 1.0);
|
||||
background-image: url("move-window-on-new.svg");
|
||||
}
|
||||
|
||||
.new-workspace-area:hover {
|
||||
border: 2px solid rgba(255, 255, 255, 1.0);
|
||||
background-gradient-direction: horizontal;
|
||||
background-gradient-start: rgba(130, 130, 130, 0.9);
|
||||
background-gradient-end: rgba(16, 16, 16, 0.9);
|
||||
}
|
||||
|
||||
.left-workspaces-shadow {
|
||||
background-gradient-direction: horizontal;
|
||||
background-gradient-start: rgba(16, 16, 16, 1.0);
|
||||
background-gradient-end: rgba(16, 16, 16, 0.0);
|
||||
}
|
||||
|
||||
.right-workspaces-shadow {
|
||||
background-gradient-direction: horizontal;
|
||||
background-gradient-end: rgba(16, 16, 16, 1.0);
|
||||
background-gradient-start: rgba(16, 16, 16, 0);
|
||||
}
|
||||
|
||||
.workspaces {
|
||||
color: white;
|
||||
}
|
||||
@ -190,7 +216,7 @@ StTooltip {
|
||||
height: 48px;
|
||||
}
|
||||
|
||||
.workspaces-bar, .workspaces-bar * {
|
||||
.workspaces-bar {
|
||||
spacing: 5px;
|
||||
}
|
||||
|
||||
@ -277,11 +303,24 @@ StTooltip {
|
||||
|
||||
#searchEntry {
|
||||
padding: 4px;
|
||||
border-bottom: 1px solid #262626;
|
||||
border-radius: 4px;
|
||||
color: #a8a8a8;
|
||||
border: 1px solid #565656;
|
||||
background-color: #404040;
|
||||
caret-color: #fff;
|
||||
caret-size: 1px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
#searchEntry:active {
|
||||
background-color: #c4c4c4;
|
||||
#searchEntry:focus {
|
||||
color: #545454;
|
||||
border: 1px solid #3a3a3a;
|
||||
background-color: #e8e8e8;
|
||||
caret-color: #545454;
|
||||
}
|
||||
|
||||
#searchEntry:hover {
|
||||
border: 1px solid #767676;
|
||||
}
|
||||
|
||||
.dash-section {
|
||||
@ -334,16 +373,11 @@ StTooltip {
|
||||
}
|
||||
|
||||
.dash-pane {
|
||||
background-color: rgba(0,0,0,0.95);
|
||||
border: 1px solid #262626;
|
||||
padding: 4px;
|
||||
spacing: 4px;
|
||||
}
|
||||
|
||||
.dash-pane-close {
|
||||
background-image: url("close.svg");
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 10px;
|
||||
background-color: #111111;
|
||||
border: 2px solid #868686;
|
||||
color: #ffffff;
|
||||
padding: 30px 10px 10px 20px;
|
||||
}
|
||||
|
||||
.dash-search-section-header {
|
||||
@ -353,7 +387,6 @@ StTooltip {
|
||||
|
||||
.dash-search-section-results {
|
||||
color: #ffffff;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.dash-search-section-list-results {
|
||||
@ -420,10 +453,9 @@ StTooltip {
|
||||
|
||||
.all-app {
|
||||
border-radius: 10px;
|
||||
background-color: rgba(0,0,0,0.95);
|
||||
border: 1px solid #262626;
|
||||
background-color: #111111;
|
||||
border: 2px solid #868686;
|
||||
color: #ffffff;
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
.all-app-controls-panel {
|
||||
@ -451,6 +483,10 @@ StTooltip {
|
||||
background-gradient-end: #181818;
|
||||
}
|
||||
|
||||
.app-well-app.selected {
|
||||
border: 1px solid #666666;
|
||||
}
|
||||
|
||||
.app-well-app:hover {
|
||||
border: 1px solid #666666;
|
||||
}
|
||||
@ -482,10 +518,18 @@ StTooltip {
|
||||
|
||||
/* Places */
|
||||
|
||||
.places-actions {
|
||||
.places-item-box {
|
||||
spacing: 4px;
|
||||
}
|
||||
|
||||
.places-item {
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.places-actions {
|
||||
spacing: 2px;
|
||||
}
|
||||
|
||||
#placesDevices {
|
||||
padding-top: 4px;
|
||||
}
|
||||
@ -665,6 +709,22 @@ StTooltip {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.thumbnail-scroll-gradient-left {
|
||||
background-gradient-direction: horizontal;
|
||||
background-gradient-start: rgba(51, 51, 51, 1.0);
|
||||
background-gradient-end: rgba(51, 51, 51, 0);
|
||||
border-radius: 8px;
|
||||
width: 60px;
|
||||
}
|
||||
|
||||
.thumbnail-scroll-gradient-right {
|
||||
background-gradient-direction: horizontal;
|
||||
background-gradient-start: rgba(51, 51, 51, 0);
|
||||
background-gradient-end: rgba(51, 51, 51, 1.0);
|
||||
border-radius: 8px;
|
||||
width: 60px;
|
||||
}
|
||||
|
||||
.switcher-list .item-box {
|
||||
padding: 8px;
|
||||
border-radius: 4px;
|
||||
@ -677,7 +737,6 @@ StTooltip {
|
||||
|
||||
.switcher-list .thumbnail {
|
||||
width: 256px;
|
||||
height: 256px;
|
||||
}
|
||||
|
||||
.switcher-list .outlined-item-box {
|
||||
@ -716,6 +775,7 @@ StTooltip {
|
||||
border: 0px;
|
||||
border-radius: 0px;
|
||||
padding: 4px;
|
||||
spacing: 4.5px;
|
||||
}
|
||||
|
||||
.ws-switcher-active-left {
|
||||
@ -734,17 +794,44 @@ StTooltip {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.ws-switcher-spacer {
|
||||
width: 0.5px;
|
||||
height: 96px;
|
||||
border: 0px;
|
||||
background: transparent;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.ws-switcher-box {
|
||||
height: 96px;
|
||||
border: 2px solid rgba(85,85,85,0.5);
|
||||
background: transparent;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
/* Run Dialog */
|
||||
.run-dialog-label {
|
||||
font: 12px sans-serif;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.run-dialog-error-icon {
|
||||
background-image: url("dialog-error.svg");
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
.run-dialog-error-label {
|
||||
font: 16px sans-serif;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.run-dialog-entry {
|
||||
font: 14px sans-serif;
|
||||
font-weight: bold;
|
||||
width: 320px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.run-dialog {
|
||||
padding: 8px;
|
||||
border: 1px solid rgba(128,128,128,0.40);
|
||||
border-radius: 4px;
|
||||
background: rgba(0,0,0,0.8);
|
||||
}
|
||||
|
||||
.lightbox {
|
||||
background-color: rgba(0, 0, 0, 0.27);
|
||||
}
|
||||
|
89
data/theme/move-window-on-new.svg
Normal file
89
data/theme/move-window-on-new.svg
Normal file
@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="98"
|
||||
height="98"
|
||||
id="svg6375"
|
||||
version="1.1"
|
||||
inkscape:version="0.47 r22583"
|
||||
sodipodi:docname="add-workspace.svg">
|
||||
<defs
|
||||
id="defs6377">
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 16 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="32 : 16 : 1"
|
||||
inkscape:persp3d-origin="16 : 10.666667 : 1"
|
||||
id="perspective6383" />
|
||||
<inkscape:perspective
|
||||
id="perspective6366"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="3.9590209"
|
||||
inkscape:cx="56.650687"
|
||||
inkscape:cy="20.635343"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="true"
|
||||
inkscape:grid-bbox="true"
|
||||
inkscape:document-units="px"
|
||||
inkscape:window-width="1680"
|
||||
inkscape:window-height="997"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="26"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata6380">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
transform="translate(0,66)">
|
||||
<g
|
||||
id="g2824"
|
||||
transform="matrix(11.568551,0,0,11.698271,-78.828159,-304.81518)">
|
||||
<path
|
||||
style="fill:none;stroke:#666666;stroke-width:1.99999952;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
d="m 11.07363,21.36834 0,6.43903"
|
||||
id="path5322" />
|
||||
<path
|
||||
style="fill:none;stroke:#666666;stroke-width:1.99999952;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"
|
||||
d="m 14.29314,24.58786 -6.43902,0"
|
||||
id="path5324" />
|
||||
</g>
|
||||
<path
|
||||
style="fill:#000000;fill-opacity:0.98823529"
|
||||
d="m 48.239516,97.908047 c -0.41677,-0.05102 -1.269253,-0.222408 -1.894408,-0.380859 -4.088493,-1.036262 -7.520781,-4.753234 -8.330163,-9.021094 -0.154947,-0.817026 -0.257819,-6.68112 -0.257819,-14.696556 l 0,-13.337088 -13.829177,-0.08909 C 10.802042,60.298796 10.026884,60.268266 8.6851548,59.783022 3.6288503,57.954375 0.62673331,53.828648 0.62673331,48.708554 c 0,-5.625522 4.25936019,-10.425065 9.97721469,-11.242548 0.987903,-0.141242 7.368912,-0.254994 14.460646,-0.257791 l 12.692532,-0.005 0,-13.586668 c 0,-14.6441583 0.03287,-15.0698926 1.364686,-17.6753047 2.185477,-4.2754229 6.938193,-6.75739913 11.687647,-6.10355607 3.382776,0.46569661 6.737962,2.72496967 8.414081,5.66577137 1.480816,2.5981315 1.519067,3.0522448 1.519067,18.0333334 l 0,13.666424 12.692533,0.005 c 7.091733,0.0028 13.472742,0.116549 14.460646,0.257791 6.395303,0.914337 10.804785,6.623716 9.941157,12.871766 -0.698243,5.051565 -4.792685,9.104635 -9.941157,9.840713 -0.987904,0.141242 -7.368913,0.254995 -14.460646,0.257791 l -12.692533,0.005 0,13.801945 c 0,13.031417 -0.02798,13.895893 -0.501177,15.484801 -1.526902,5.127058 -6.919246,8.802262 -12.001914,8.18002 z"
|
||||
id="path2828"
|
||||
transform="translate(0,-66)" />
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.0 KiB |
@ -81,7 +81,7 @@
|
||||
sodipodi:cx="84.5"
|
||||
sodipodi:sides="3"
|
||||
id="path5497-5"
|
||||
style="fill:#5f5f5f;fill-opacity:1;stroke:#5f5f5f;stroke-width:0.59699643;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:0.59699643;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"
|
||||
sodipodi:type="star" />
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
@ -3,8 +3,9 @@
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gio = imports.gi.Gio;
|
||||
const Gtk = imports.gi.Gtk;
|
||||
const Shell = imports.gi.Shell;
|
||||
|
||||
const St = imports.gi.St;
|
||||
const Shell = imports.gi.Shell;
|
||||
const Lang = imports.lang;
|
||||
const Signals = imports.signals;
|
||||
const Search = imports.ui.search;
|
||||
@ -30,7 +31,7 @@ DocInfo.prototype = {
|
||||
},
|
||||
|
||||
createIcon : function(size) {
|
||||
return Shell.TextureCache.get_default().load_recent_thumbnail(size, this.recentInfo);
|
||||
return St.TextureCache.get_default().load_recent_thumbnail(size, this.recentInfo);
|
||||
},
|
||||
|
||||
launch : function() {
|
||||
|
330
js/ui/altTab.js
330
js/ui/altTab.js
@ -23,13 +23,16 @@ TRANSPARENT_COLOR.from_pixel(0x00000000);
|
||||
|
||||
const POPUP_APPICON_SIZE = 96;
|
||||
const POPUP_LIST_SPACING = 8;
|
||||
const POPUP_SCROLL_TIME = 0.10; // seconds
|
||||
|
||||
const DISABLE_HOVER_TIMEOUT = 500; // milliseconds
|
||||
|
||||
const THUMBNAIL_SIZE = 256;
|
||||
const THUMBNAIL_DEFAULT_SIZE = 256;
|
||||
const THUMBNAIL_POPUP_TIME = 500; // milliseconds
|
||||
const THUMBNAIL_FADE_TIME = 0.2; // seconds
|
||||
|
||||
const iconSizes = [96, 64, 48, 32, 22];
|
||||
|
||||
function mod(a, b) {
|
||||
return (a + b) % b;
|
||||
}
|
||||
@ -40,11 +43,11 @@ function AltTabPopup() {
|
||||
|
||||
AltTabPopup.prototype = {
|
||||
_init : function() {
|
||||
this.actor = new Clutter.Group({ reactive: true,
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: global.screen_width,
|
||||
height: global.screen_height });
|
||||
this.actor = new Shell.GenericContainer({ reactive: true });
|
||||
|
||||
this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
|
||||
this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
|
||||
this.actor.connect('allocate', Lang.bind(this, this._allocate));
|
||||
|
||||
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
|
||||
|
||||
@ -62,6 +65,55 @@ AltTabPopup.prototype = {
|
||||
global.stage.add_actor(this.actor);
|
||||
},
|
||||
|
||||
_getPreferredWidth: function (actor, forHeight, alloc) {
|
||||
alloc.min_size = global.screen_width;
|
||||
alloc.natural_size = global.screen_width;
|
||||
},
|
||||
|
||||
_getPreferredHeight: function (actor, forWidth, alloc) {
|
||||
alloc.min_size = global.screen_height;
|
||||
alloc.natural_size = global.screen_height;
|
||||
},
|
||||
|
||||
_allocate: function (actor, box, flags) {
|
||||
let childBox = new Clutter.ActorBox();
|
||||
let focus = global.get_focus_monitor();
|
||||
|
||||
// Allocate the appSwitcher
|
||||
// We select a size based on an icon size that does not overflow the screen
|
||||
let [childMinHeight, childNaturalHeight] = this._appSwitcher.actor.get_preferred_height(focus.width - POPUP_LIST_SPACING * 2);
|
||||
let [childMinWidth, childNaturalWidth] = this._appSwitcher.actor.get_preferred_width(childNaturalHeight);
|
||||
childBox.x1 = Math.max(POPUP_LIST_SPACING, focus.x + Math.floor((focus.width - childNaturalWidth) / 2));
|
||||
childBox.x2 = Math.min(childBox.x1 + focus.width - POPUP_LIST_SPACING * 2, childBox.x1 + childNaturalWidth);
|
||||
childBox.y1 = focus.y + Math.floor((focus.height - childNaturalHeight) / 2);
|
||||
childBox.y2 = childBox.y1 + childNaturalHeight;
|
||||
this._appSwitcher.actor.allocate(childBox, flags);
|
||||
|
||||
// Allocate the thumbnails
|
||||
// We try to avoid overflowing the screen so we base the resulting size on
|
||||
// those calculations
|
||||
if (this._thumbnails) {
|
||||
let icon = this._appIcons[this._currentApp].actor;
|
||||
let [posX, posY] = icon.get_transformed_position();
|
||||
let thumbnailCenter = posX + icon.width / 2;
|
||||
let [childMinWidth, childNaturalWidth] = this._thumbnails.actor.get_preferred_width(-1);
|
||||
childBox.x1 = Math.max(POPUP_LIST_SPACING, Math.floor(thumbnailCenter - childNaturalWidth / 2));
|
||||
if (childBox.x1 + childNaturalWidth > focus.width - POPUP_LIST_SPACING * 2) {
|
||||
let offset = childBox.x1 + childNaturalWidth - focus.width + POPUP_LIST_SPACING * 2;
|
||||
childBox.x1 = Math.max(POPUP_LIST_SPACING, childBox.x1 - offset - POPUP_LIST_SPACING * 2);
|
||||
}
|
||||
|
||||
childBox.x2 = childBox.x1 + childNaturalWidth;
|
||||
if (childBox.x2 > focus.width - POPUP_LIST_SPACING)
|
||||
childBox.x2 = focus.width - POPUP_LIST_SPACING;
|
||||
childBox.y1 = this._appSwitcher.actor.allocation.y2 + POPUP_LIST_SPACING * 2;
|
||||
this._thumbnails.addClones(focus.height - POPUP_LIST_SPACING - childBox.y1);
|
||||
let [childMinHeight, childNaturalHeight] = this._thumbnails.actor.get_preferred_height(-1);
|
||||
childBox.y2 = childBox.y1 + childNaturalHeight;
|
||||
this._thumbnails.actor.allocate(childBox, flags);
|
||||
}
|
||||
},
|
||||
|
||||
show : function(backward) {
|
||||
let tracker = Shell.WindowTracker.get_default();
|
||||
let apps = tracker.get_running_apps ("");
|
||||
@ -84,10 +136,6 @@ AltTabPopup.prototype = {
|
||||
this._appSwitcher.connect('item-activated', Lang.bind(this, this._appActivated));
|
||||
this._appSwitcher.connect('item-entered', Lang.bind(this, this._appEntered));
|
||||
|
||||
let focus = global.get_focus_monitor();
|
||||
this._appSwitcher.actor.x = focus.x + Math.floor((focus.width - this._appSwitcher.actor.width) / 2);
|
||||
this._appSwitcher.actor.y = focus.y + Math.floor((focus.height - this._appSwitcher.actor.height) / 2);
|
||||
|
||||
this._appIcons = this._appSwitcher.icons;
|
||||
|
||||
// Make the initial selection
|
||||
@ -289,6 +337,9 @@ AltTabPopup.prototype = {
|
||||
if (this._haveModal)
|
||||
Main.popModal(this.actor);
|
||||
|
||||
if (this._thumbnails)
|
||||
this._destroyThumbnails();
|
||||
|
||||
if (this._keyPressEventId)
|
||||
global.stage.disconnect(this._keyPressEventId);
|
||||
if (this._keyReleaseEventId)
|
||||
@ -375,33 +426,6 @@ AltTabPopup.prototype = {
|
||||
|
||||
this.actor.add_actor(this._thumbnails.actor);
|
||||
|
||||
let thumbnailCenter;
|
||||
if (this._thumbnails.actor.width < this._appSwitcher.actor.width) {
|
||||
// Center the thumbnails under the corresponding AppIcon.
|
||||
// If this is being called when the switcher is first
|
||||
// being brought up, then nothing will have been assigned
|
||||
// an allocation yet, and the get_transformed_position()
|
||||
// call will return 0,0.
|
||||
// (http://bugzilla.openedhand.com/show_bug.cgi?id=1115).
|
||||
// Calling clutter_actor_get_allocation_box() would force
|
||||
// it to properly allocate itself, but we can't call that
|
||||
// because it has an out-caller-allocates arg. So we use
|
||||
// clutter_stage_get_actor_at_pos(), which will force a
|
||||
// reallocation as a side effect.
|
||||
global.stage.get_actor_at_pos(Clutter.PickMode.REACTIVE, 0, 0);
|
||||
|
||||
let icon = this._appIcons[this._currentApp].actor;
|
||||
let [stageX, stageY] = icon.get_transformed_position();
|
||||
thumbnailCenter = stageX + icon.width / 2;
|
||||
} else {
|
||||
// Center the thumbnails on the monitor
|
||||
let focus = global.get_focus_monitor();
|
||||
thumbnailCenter = focus.x + focus.width / 2;
|
||||
}
|
||||
|
||||
this._thumbnails.actor.x = Math.floor(thumbnailCenter - this._thumbnails.actor.width / 2);
|
||||
this._thumbnails.actor.y = this._appSwitcher.actor.y + this._appSwitcher.actor.height + POPUP_LIST_SPACING;
|
||||
|
||||
this._thumbnails.actor.opacity = 0;
|
||||
Tweener.addTween(this._thumbnails.actor,
|
||||
{ opacity: 255,
|
||||
@ -417,7 +441,7 @@ function SwitcherList(squareItems) {
|
||||
|
||||
SwitcherList.prototype = {
|
||||
_init : function(squareItems) {
|
||||
this.actor = new St.Bin({ style_class: 'switcher-list' });
|
||||
this.actor = new St.BoxLayout({ style_class: 'switcher-list' });
|
||||
|
||||
// Here we use a GenericContainer so that we can force all the
|
||||
// children except the separator to have the same width.
|
||||
@ -428,12 +452,36 @@ SwitcherList.prototype = {
|
||||
this._list.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
|
||||
this._list.connect('allocate', Lang.bind(this, this._allocate));
|
||||
|
||||
this.actor.add_actor(this._list);
|
||||
this._clipBin = new St.Bin({style_class: 'cbin'});
|
||||
this._clipBin.child = this._list;
|
||||
this.actor.add_actor(this._clipBin);
|
||||
|
||||
this._leftGradient = new St.BoxLayout({style_class: 'thumbnail-scroll-gradient-left', vertical: true});
|
||||
this._rightGradient = new St.BoxLayout({style_class: 'thumbnail-scroll-gradient-right', vertical: true});
|
||||
this.actor.add_actor(this._leftGradient);
|
||||
this.actor.add_actor(this._rightGradient);
|
||||
|
||||
// Those arrows indicate whether scrolling in one direction is possible
|
||||
this._leftArrow = new St.DrawingArea();
|
||||
this._leftArrow.connect('repaint', Lang.bind(this,
|
||||
function (area) {
|
||||
Shell.draw_box_pointer(area, Shell.PointerDirection.LEFT, TRANSPARENT_COLOR, POPUP_ARROW_COLOR);
|
||||
}));
|
||||
|
||||
this._rightArrow = new St.DrawingArea();
|
||||
this._rightArrow.connect('repaint', Lang.bind(this,
|
||||
function (area) {
|
||||
Shell.draw_box_pointer(area, Shell.PointerDirection.RIGHT, TRANSPARENT_COLOR, POPUP_ARROW_COLOR);
|
||||
}));
|
||||
|
||||
this._leftGradient.add_actor(this._leftArrow);
|
||||
this._rightGradient.add_actor(this._rightArrow);
|
||||
|
||||
this._items = [];
|
||||
this._highlighted = -1;
|
||||
this._separator = null;
|
||||
this._squareItems = squareItems;
|
||||
this._scrollable = false;
|
||||
},
|
||||
|
||||
addItem : function(item) {
|
||||
@ -455,7 +503,7 @@ SwitcherList.prototype = {
|
||||
},
|
||||
|
||||
addSeparator: function () {
|
||||
let box = new St.Bin({ style_class: 'separator' })
|
||||
let box = new St.Bin({ style_class: 'separator' });
|
||||
this._separator = box;
|
||||
this._list.add_actor(box);
|
||||
},
|
||||
@ -472,6 +520,45 @@ SwitcherList.prototype = {
|
||||
else
|
||||
this._items[this._highlighted].style_class = 'selected-item-box';
|
||||
}
|
||||
|
||||
let monitor = global.get_focus_monitor();
|
||||
let itemSize = this._items[index].allocation.x2 - this._items[index].allocation.x1;
|
||||
let [posX, posY] = this._items[index].get_transformed_position();
|
||||
posX += this.actor.x;
|
||||
|
||||
if (posX + itemSize > monitor.width)
|
||||
this._scrollToRight();
|
||||
else if (posX < 0)
|
||||
this._scrollToLeft();
|
||||
|
||||
},
|
||||
|
||||
_scrollToLeft : function() {
|
||||
let x = this._items[this._highlighted].allocation.x1;
|
||||
this._rightGradient.show();
|
||||
Tweener.addTween(this._list, { anchor_x: x,
|
||||
time: POPUP_SCROLL_TIME,
|
||||
transition: 'easeOutQuad',
|
||||
onComplete: Lang.bind(this, function () {
|
||||
if (this._highlighted == 0)
|
||||
this._leftGradient.hide();
|
||||
})
|
||||
});
|
||||
},
|
||||
|
||||
_scrollToRight : function() {
|
||||
let monitor = global.get_focus_monitor();
|
||||
let padding = this.actor.get_theme_node().get_horizontal_padding();
|
||||
let x = this._items[this._highlighted].allocation.x2 - monitor.width + padding + POPUP_LIST_SPACING * 2;
|
||||
this._leftGradient.show();
|
||||
Tweener.addTween(this._list, { anchor_x: x,
|
||||
time: POPUP_SCROLL_TIME,
|
||||
transition: 'easeOutQuad',
|
||||
onComplete: Lang.bind(this, function () {
|
||||
if (this._highlighted == this._items.length - 1)
|
||||
this._rightGradient.hide();
|
||||
})
|
||||
});
|
||||
},
|
||||
|
||||
_itemActivated: function(n) {
|
||||
@ -553,6 +640,15 @@ SwitcherList.prototype = {
|
||||
let x = 0;
|
||||
let children = this._list.get_children();
|
||||
let childBox = new Clutter.ActorBox();
|
||||
|
||||
let focus = global.get_focus_monitor();
|
||||
if (this.actor.allocation.x2 == focus.width - POPUP_LIST_SPACING) {
|
||||
if (this._squareItems)
|
||||
childWidth = childHeight;
|
||||
else
|
||||
childWidth = children[0].get_preferred_width(childHeight)[0];
|
||||
}
|
||||
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
if (this._items.indexOf(children[i]) != -1) {
|
||||
let [childMin, childNat] = children[i].get_preferred_height(childWidth);
|
||||
@ -577,6 +673,44 @@ SwitcherList.prototype = {
|
||||
// we don't allocate it.
|
||||
}
|
||||
}
|
||||
|
||||
let leftPadding = this.actor.get_theme_node().get_padding(St.Side.LEFT);
|
||||
let rightPadding = this.actor.get_theme_node().get_padding(St.Side.RIGHT);
|
||||
let topPadding = this.actor.get_theme_node().get_padding(St.Side.TOP);
|
||||
let bottomPadding = this.actor.get_theme_node().get_padding(St.Side.BOTTOM);
|
||||
|
||||
// Show the arrows and gradients when scrolling is needed
|
||||
if (children[children.length - 1].allocation.x2 > this.actor.width - leftPadding - rightPadding && !this._scrollable) {
|
||||
this._leftGradient.set_height(this.actor.height);
|
||||
this._leftGradient.x = this.actor.x;
|
||||
this._leftGradient.y = this.actor.y;
|
||||
|
||||
this._rightGradient.set_height(this.actor.height);
|
||||
this._rightGradient.x = this.actor.x + (this.actor.allocation.x2 - this.actor.allocation.x1) - this._rightGradient.width;
|
||||
this._rightGradient.y = this.actor.y;
|
||||
|
||||
let arrowWidth = Math.floor(leftPadding / 3);
|
||||
let arrowHeight = arrowWidth * 2;
|
||||
this._leftArrow.set_size(arrowWidth, arrowHeight);
|
||||
this._leftArrow.set_position(POPUP_LIST_SPACING, this.actor.height / 2 - arrowWidth);
|
||||
|
||||
arrowWidth = Math.floor(rightPadding / 3);
|
||||
arrowHeight = arrowWidth * 2;
|
||||
this._rightArrow.set_size(arrowWidth, arrowHeight);
|
||||
this._rightArrow.set_position(this._rightGradient.width - arrowHeight, this.actor.height / 2 - arrowWidth);
|
||||
|
||||
this._scrollable = true;
|
||||
|
||||
this._leftGradient.hide();
|
||||
this._rightGradient.show();
|
||||
}
|
||||
else if (!this._scrollable){
|
||||
this._leftGradient.hide();
|
||||
this._rightGradient.hide();
|
||||
}
|
||||
|
||||
// Clip the area for scrolling
|
||||
this._clipBin.set_clip(0, -topPadding, (this.actor.allocation.x2 - this.actor.allocation.x1) - leftPadding - rightPadding, this.actor.height + bottomPadding);
|
||||
}
|
||||
};
|
||||
|
||||
@ -591,15 +725,20 @@ AppIcon.prototype = {
|
||||
this.app = app;
|
||||
this.actor = new St.BoxLayout({ style_class: "alt-tab-app",
|
||||
vertical: true });
|
||||
this._icon = this.app.create_icon_texture(POPUP_APPICON_SIZE);
|
||||
let iconBin = new St.Bin({height: POPUP_APPICON_SIZE, width: POPUP_APPICON_SIZE});
|
||||
iconBin.child = this._icon;
|
||||
this.icon = null;
|
||||
this._iconBin = new St.Bin();
|
||||
|
||||
this.actor.add(iconBin, { x_fill: false, y_fill: false } );
|
||||
this._label = new St.Label({ text: this.app.get_name() });
|
||||
this.actor.add(this._label, { x_fill: false });
|
||||
this.actor.add(this._iconBin, { x_fill: false, y_fill: false } );
|
||||
this.label = new St.Label({ text: this.app.get_name() });
|
||||
this.actor.add(this.label, { x_fill: false });
|
||||
},
|
||||
|
||||
set_size: function(size) {
|
||||
this.icon = this.app.create_icon_texture(size);
|
||||
this._iconBin.set_size(size, size);
|
||||
this._iconBin.child = this.icon;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function AppSwitcher(apps) {
|
||||
this._init(apps);
|
||||
@ -639,9 +778,50 @@ AppSwitcher.prototype = {
|
||||
this._addIcon(otherIcons[i]);
|
||||
|
||||
this._curApp = -1;
|
||||
this._iconSize = 0;
|
||||
},
|
||||
|
||||
_getPreferredHeight: function (actor, forWidth, alloc) {
|
||||
let j = 0;
|
||||
while(this._items.length > 1 && this._items[j].style_class != 'item-box') {
|
||||
j++;
|
||||
}
|
||||
let iconPadding = this._items[j].get_theme_node().get_horizontal_padding();
|
||||
let [iconMinHeight, iconNaturalHeight] = this.icons[j].label.get_preferred_height(-1);
|
||||
let iconSpacing = iconNaturalHeight + iconPadding;
|
||||
let totalSpacing = this._list.spacing * (this._items.length - 1);
|
||||
if (this._separator)
|
||||
totalSpacing += this._separator.width + this._list.spacing;
|
||||
|
||||
// We just assume the whole screen here due to weirdness happing with the passed width
|
||||
let focus = global.get_focus_monitor();
|
||||
let availWidth = focus.width - POPUP_LIST_SPACING * 2 - this.actor.get_theme_node().get_horizontal_padding();
|
||||
let height = 0;
|
||||
|
||||
for(let i = 0; i < iconSizes.length; i++) {
|
||||
this._iconSize = iconSizes[i];
|
||||
height = iconSizes[i] + iconSpacing;
|
||||
let w = height * this._items.length + totalSpacing;
|
||||
if (w <= availWidth)
|
||||
break;
|
||||
}
|
||||
|
||||
if (this._items.length == 1) {
|
||||
this._iconSize = iconSizes[0];
|
||||
height = iconSizes[0] + iconSpacing;
|
||||
}
|
||||
|
||||
alloc.min_size = height;
|
||||
alloc.natural_size = height;
|
||||
},
|
||||
|
||||
_allocate: function (actor, box, flags) {
|
||||
for(let i = 0; i < this.icons.length; i++) {
|
||||
if (this.icons[i].icon != null)
|
||||
break;
|
||||
this.icons[i].set_size(this._iconSize);
|
||||
}
|
||||
|
||||
// Allocate the main list items
|
||||
SwitcherList.prototype._allocate.call(this, actor, box, flags);
|
||||
|
||||
@ -695,9 +875,9 @@ AppSwitcher.prototype = {
|
||||
|
||||
let n = this._arrows.length;
|
||||
let arrow = new St.DrawingArea();
|
||||
arrow.connect('redraw', Lang.bind(this,
|
||||
function (area, texture) {
|
||||
Shell.draw_box_pointer(texture, Shell.PointerDirection.DOWN,
|
||||
arrow.connect('repaint', Lang.bind(this,
|
||||
function (area) {
|
||||
Shell.draw_box_pointer(area, Shell.PointerDirection.DOWN,
|
||||
TRANSPARENT_COLOR,
|
||||
this._curApp == n ? POPUP_ARROW_COLOR : POPUP_UNFOCUSED_ARROW_COLOR);
|
||||
}));
|
||||
@ -739,39 +919,69 @@ ThumbnailList.prototype = {
|
||||
// that case.
|
||||
let separatorAdded = windows.length == 0 || windows[0].get_workspace() != activeWorkspace;
|
||||
|
||||
this._labels = new Array();
|
||||
this._thumbnailBins = new Array();
|
||||
this._clones = new Array();
|
||||
this._windows = windows;
|
||||
|
||||
for (let i = 0; i < windows.length; i++) {
|
||||
if (!separatorAdded && windows[i].get_workspace() != activeWorkspace) {
|
||||
this.addSeparator();
|
||||
separatorAdded = true;
|
||||
}
|
||||
|
||||
let mutterWindow = windows[i].get_compositor_private();
|
||||
let windowTexture = mutterWindow.get_texture ();
|
||||
let [width, height] = windowTexture.get_size();
|
||||
let scale = Math.min(1.0, THUMBNAIL_SIZE / width, THUMBNAIL_SIZE / height);
|
||||
|
||||
let box = new St.BoxLayout({ style_class: "thumbnail-box",
|
||||
vertical: true });
|
||||
|
||||
let bin = new St.Bin({ style_class: "thumbnail" });
|
||||
let clone = new Clutter.Clone ({ source: windowTexture,
|
||||
reactive: true,
|
||||
width: width * scale,
|
||||
height: height * scale });
|
||||
|
||||
bin.add_actor(clone);
|
||||
box.add_actor(bin);
|
||||
this._thumbnailBins.push(bin);
|
||||
|
||||
let title = windows[i].get_title();
|
||||
if (title) {
|
||||
let name = new St.Label({ text: title });
|
||||
// St.Label doesn't support text-align so use a Bin
|
||||
let bin = new St.Bin({ x_align: St.Align.MIDDLE });
|
||||
this._labels.push(bin);
|
||||
bin.add_actor(name);
|
||||
box.add_actor(bin);
|
||||
}
|
||||
|
||||
this.addItem(box);
|
||||
}
|
||||
},
|
||||
|
||||
addClones : function (availHeight) {
|
||||
if (!this._thumbnailBins.length)
|
||||
return;
|
||||
let totalPadding = this._items[0].get_theme_node().get_horizontal_padding() + this._items[0].get_theme_node().get_vertical_padding();
|
||||
totalPadding += this.actor.get_theme_node().get_horizontal_padding() + this.actor.get_theme_node().get_vertical_padding();
|
||||
let [labelMinHeight, labelNaturalHeight] = this._labels[0].get_preferred_height(-1);
|
||||
let [found, spacing] = this._items[0].child.get_theme_node().get_length('spacing', false);
|
||||
if (!found)
|
||||
spacing = 0;
|
||||
|
||||
availHeight = Math.min(availHeight - labelNaturalHeight - totalPadding - spacing, THUMBNAIL_DEFAULT_SIZE);
|
||||
let binHeight = availHeight + this._items[0].get_theme_node().get_vertical_padding() + this.actor.get_theme_node().get_vertical_padding() - spacing;
|
||||
binHeight = Math.min(THUMBNAIL_DEFAULT_SIZE, binHeight);
|
||||
|
||||
for (let i = 0; i < this._thumbnailBins.length; i++) {
|
||||
let mutterWindow = this._windows[i].get_compositor_private();
|
||||
let windowTexture = mutterWindow.get_texture ();
|
||||
let [width, height] = windowTexture.get_size();
|
||||
let scale = Math.min(1.0, THUMBNAIL_DEFAULT_SIZE / width, availHeight / height);
|
||||
let clone = new Clutter.Clone ({ source: windowTexture,
|
||||
reactive: true,
|
||||
width: width * scale,
|
||||
height: height * scale });
|
||||
|
||||
this._thumbnailBins[i].set_height(binHeight);
|
||||
this._thumbnailBins[i].add_actor(clone);
|
||||
this._clones.push(clone);
|
||||
}
|
||||
|
||||
// Make sure we only do this once
|
||||
this._thumbnailBins = new Array();
|
||||
}
|
||||
};
|
||||
|
@ -87,7 +87,8 @@ AllAppDisplay.prototype = {
|
||||
Main.queueDeferredWork(this._workId);
|
||||
}));
|
||||
|
||||
let bin = new St.BoxLayout({ style_class: 'all-app-controls-panel' });
|
||||
let bin = new St.BoxLayout({ style_class: 'all-app-controls-panel',
|
||||
reactive: true });
|
||||
this.actor = new St.BoxLayout({ style_class: 'all-app', vertical: true });
|
||||
this.actor.hide();
|
||||
|
||||
@ -132,6 +133,136 @@ AllAppDisplay.prototype = {
|
||||
|
||||
Signals.addSignalMethods(AllAppDisplay.prototype);
|
||||
|
||||
function AppSearchResultDisplay(provider) {
|
||||
this._init(provider);
|
||||
}
|
||||
|
||||
AppSearchResultDisplay.prototype = {
|
||||
__proto__: Search.SearchResultDisplay.prototype,
|
||||
|
||||
_init: function (provider) {
|
||||
Search.SearchResultDisplay.prototype._init.call(this, provider);
|
||||
this._spacing = 0;
|
||||
this.actor = new St.Bin({ name: 'dashAppSearchResults',
|
||||
x_align: St.Align.START });
|
||||
this.actor.connect('style-changed', Lang.bind(this, this._onStyleChanged));
|
||||
let container = new Shell.GenericContainer();
|
||||
this._container = container;
|
||||
this.actor.set_child(container);
|
||||
container.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
|
||||
container.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
|
||||
container.connect('allocate', Lang.bind(this, this._allocate));
|
||||
},
|
||||
|
||||
_getPreferredWidth: function (actor, forHeight, alloc) {
|
||||
let children = actor.get_children();
|
||||
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
let [minSize, natSize] = children[i].get_preferred_width(forHeight);
|
||||
alloc.natural_size += natSize;
|
||||
}
|
||||
},
|
||||
|
||||
_getPreferredHeight: function (actor, forWidth, alloc) {
|
||||
let children = actor.get_children();
|
||||
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
let [minSize, natSize] = children[i].get_preferred_height(forWidth);
|
||||
if (minSize > alloc.min_size)
|
||||
alloc.min_size = minSize;
|
||||
if (natSize > alloc.natural_size)
|
||||
alloc.natural_size = natSize;
|
||||
}
|
||||
},
|
||||
|
||||
_allocate: function (actor, box, flags) {
|
||||
let availWidth = box.x2 - box.x1;
|
||||
let availHeight = box.y2 - box.y1;
|
||||
|
||||
let children = actor.get_children();
|
||||
|
||||
let x = 0;
|
||||
let i;
|
||||
for (i = 0; i < children.length; i++) {
|
||||
let child = children[i];
|
||||
let childBox = new Clutter.ActorBox();
|
||||
|
||||
let [minWidth, minHeight, natWidth, natHeight] = child.get_preferred_size();
|
||||
|
||||
if (x + natWidth > availWidth) {
|
||||
actor.set_skip_paint(child, true);
|
||||
continue;
|
||||
}
|
||||
|
||||
let yPadding = Math.max(0, availHeight - natHeight);
|
||||
|
||||
childBox.x1 = x;
|
||||
childBox.x2 = childBox.x1 + natWidth;
|
||||
childBox.y1 = Math.floor(yPadding / 2);
|
||||
childBox.y2 = availHeight - childBox.y1;
|
||||
|
||||
x = childBox.x2 + this._spacing;
|
||||
|
||||
child.allocate(childBox, flags);
|
||||
actor.set_skip_paint(child, false);
|
||||
}
|
||||
},
|
||||
|
||||
_onStyleChanged: function () {
|
||||
let themeNode = this.actor.get_theme_node();
|
||||
let [success, len] = themeNode.get_length('spacing', false);
|
||||
if (success)
|
||||
this._spacing = len;
|
||||
this._container.queue_relayout();
|
||||
},
|
||||
|
||||
renderResults: function(results, terms) {
|
||||
let appSys = Shell.AppSystem.get_default();
|
||||
for (let i = 0; i < results.length && i < WELL_MAX_COLUMNS; i++) {
|
||||
let result = results[i];
|
||||
let app = appSys.get_app(result);
|
||||
let display = new AppWellIcon(app);
|
||||
this._container.add_actor(display.actor);
|
||||
}
|
||||
},
|
||||
|
||||
clear: function () {
|
||||
this._container.get_children().forEach(function (actor) { actor.destroy(); });
|
||||
this.selectionIndex = -1;
|
||||
},
|
||||
|
||||
getVisibleResultCount: function() {
|
||||
let nChildren = this._container.get_children().length;
|
||||
return nChildren - this._container.get_n_skip_paint();
|
||||
},
|
||||
|
||||
selectIndex: function (index) {
|
||||
let nVisible = this.getVisibleResultCount();
|
||||
let children = this._container.get_children();
|
||||
if (this.selectionIndex >= 0) {
|
||||
let prevActor = children[this.selectionIndex];
|
||||
prevActor._delegate.setSelected(false);
|
||||
}
|
||||
this.selectionIndex = -1;
|
||||
if (index >= nVisible)
|
||||
return false;
|
||||
else if (index < 0)
|
||||
return false;
|
||||
let targetActor = children[index];
|
||||
targetActor._delegate.setSelected(true);
|
||||
this.selectionIndex = index;
|
||||
return true;
|
||||
},
|
||||
|
||||
activateSelected: function() {
|
||||
if (this.selectionIndex < 0)
|
||||
return;
|
||||
let children = this._container.get_children();
|
||||
let targetActor = children[this.selectionIndex];
|
||||
this.provider.activateResult(targetActor._delegate.app.get_id());
|
||||
}
|
||||
};
|
||||
|
||||
function BaseAppSearchProvider() {
|
||||
this._init();
|
||||
}
|
||||
@ -188,10 +319,18 @@ AppSearchProvider.prototype = {
|
||||
return this._appSys.subsearch(false, previousResults, terms);
|
||||
},
|
||||
|
||||
createResultContainerActor: function () {
|
||||
return new AppSearchResultDisplay(this);
|
||||
},
|
||||
|
||||
createResultActor: function (resultMeta, terms) {
|
||||
return new AppIcon(resultMeta.id);
|
||||
},
|
||||
|
||||
expandSearch: function(terms) {
|
||||
log("TODO expand search");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function PrefsSearchProvider() {
|
||||
this._init();
|
||||
@ -217,7 +356,7 @@ PrefsSearchProvider.prototype = {
|
||||
controlCenter.launch();
|
||||
Main.overview.hide();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function AppIcon(app) {
|
||||
this._init(app);
|
||||
@ -243,7 +382,7 @@ AppIcon.prototype = {
|
||||
this._name.clutter_text.line_alignment = Pango.Alignment.CENTER;
|
||||
box.add_actor(this._name);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function AppWellIcon(app) {
|
||||
this._init(app);
|
||||
@ -265,7 +404,8 @@ AppWellIcon.prototype = {
|
||||
this.actor.connect('clicked', Lang.bind(this, this._onClicked));
|
||||
this._menu = null;
|
||||
|
||||
this._draggable = DND.makeDraggable(this.actor, true);
|
||||
this._draggable = DND.makeDraggable(this.actor,
|
||||
{ manualMode: true });
|
||||
this._dragStartX = null;
|
||||
this._dragStartY = null;
|
||||
|
||||
@ -293,11 +433,13 @@ AppWellIcon.prototype = {
|
||||
_updateStyleClass: function() {
|
||||
let windows = this.app.get_windows();
|
||||
let running = windows.length > 0;
|
||||
if (running == this._running)
|
||||
return;
|
||||
this._running = running;
|
||||
this.actor.style_class = this._running ? "app-well-app running"
|
||||
: "app-well-app";
|
||||
let style = "app-well-app";
|
||||
if (this._running)
|
||||
style += " running";
|
||||
if (this._selected)
|
||||
style += " selected";
|
||||
this.actor.style_class = style;
|
||||
},
|
||||
|
||||
_onButtonPress: function(actor, event) {
|
||||
@ -380,6 +522,11 @@ AppWellIcon.prototype = {
|
||||
Main.overview.hide();
|
||||
},
|
||||
|
||||
setSelected: function (isSelected) {
|
||||
this._selected = isSelected;
|
||||
this._updateStyleClass();
|
||||
},
|
||||
|
||||
_onMenuPoppedUp: function() {
|
||||
if (this._getRunning()) {
|
||||
Main.overview.getWorkspacesForWindow(null).setApplicationWindowSelection(this.app.get_id());
|
||||
@ -442,7 +589,7 @@ AppWellIcon.prototype = {
|
||||
getDragActorSource: function() {
|
||||
return this._icon.icon;
|
||||
}
|
||||
}
|
||||
};
|
||||
Signals.addSignalMethods(AppWellIcon.prototype);
|
||||
|
||||
function AppIconMenu(source) {
|
||||
@ -487,8 +634,8 @@ AppIconMenu.prototype = {
|
||||
this._windowContainerBox.connect('style-changed', Lang.bind(this, this._onStyleChanged));
|
||||
|
||||
this._arrow = new St.DrawingArea();
|
||||
this._arrow.connect('redraw', Lang.bind(this, function (area, texture) {
|
||||
Shell.draw_box_pointer(texture,
|
||||
this._arrow.connect('repaint', Lang.bind(this, function (area) {
|
||||
Shell.draw_box_pointer(area,
|
||||
Shell.PointerDirection.LEFT,
|
||||
this._borderColor,
|
||||
this._backgroundColor);
|
||||
@ -549,7 +696,7 @@ AppIconMenu.prototype = {
|
||||
this._windowContainer.show();
|
||||
|
||||
let iconsDiffer = false;
|
||||
let texCache = Shell.TextureCache.get_default();
|
||||
let texCache = St.TextureCache.get_default();
|
||||
if (windows.length > 0) {
|
||||
let firstIcon = windows[0].mini_icon;
|
||||
for (let i = 1; i < windows.length; i++) {
|
||||
@ -738,7 +885,7 @@ AppIconMenu.prototype = {
|
||||
if (themeNode.get_border_color(St.Side.LEFT, color)) {
|
||||
this._borderColor = color;
|
||||
}
|
||||
this._arrow.emit_redraw();
|
||||
this._arrow.queue_repaint();
|
||||
}
|
||||
};
|
||||
Signals.addSignalMethods(AppIconMenu.prototype);
|
||||
@ -867,7 +1014,7 @@ WellGrid.prototype = {
|
||||
addItem: function(actor) {
|
||||
this._grid.add_actor(actor);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function AppWell() {
|
||||
this._init();
|
||||
|
@ -16,7 +16,7 @@ function _sameDay(dateA, dateB) {
|
||||
|
||||
function Calendar() {
|
||||
this._init();
|
||||
};
|
||||
}
|
||||
|
||||
Calendar.prototype = {
|
||||
_init: function() {
|
||||
|
360
js/ui/dash.js
360
js/ui/dash.js
@ -24,31 +24,6 @@ const Search = imports.ui.search;
|
||||
const MAX_RENDERED_SEARCH_RESULTS = 25;
|
||||
|
||||
const DEFAULT_PADDING = 4;
|
||||
const DEFAULT_SPACING = 4;
|
||||
|
||||
const BACKGROUND_COLOR = new Clutter.Color();
|
||||
BACKGROUND_COLOR.from_pixel(0x000000c0);
|
||||
|
||||
const PRELIGHT_COLOR = new Clutter.Color();
|
||||
PRELIGHT_COLOR.from_pixel(0x4f6fadaa);
|
||||
|
||||
const TEXT_COLOR = new Clutter.Color();
|
||||
TEXT_COLOR.from_pixel(0x5f5f5fff);
|
||||
const BRIGHTER_TEXT_COLOR = new Clutter.Color();
|
||||
BRIGHTER_TEXT_COLOR.from_pixel(0xbbbbbbff);
|
||||
const BRIGHT_TEXT_COLOR = new Clutter.Color();
|
||||
BRIGHT_TEXT_COLOR.from_pixel(0xffffffff);
|
||||
const SEARCH_TEXT_COLOR = new Clutter.Color();
|
||||
SEARCH_TEXT_COLOR.from_pixel(0x333333ff);
|
||||
|
||||
const SEARCH_CURSOR_COLOR = BRIGHT_TEXT_COLOR;
|
||||
const HIGHLIGHTED_SEARCH_CURSOR_COLOR = SEARCH_TEXT_COLOR;
|
||||
|
||||
const SEARCH_BORDER_BOTTOM_COLOR = new Clutter.Color();
|
||||
SEARCH_BORDER_BOTTOM_COLOR.from_pixel(0x191919ff);
|
||||
|
||||
const BROWSE_ACTIVATED_BG = new Clutter.Color();
|
||||
BROWSE_ACTIVATED_BG.from_pixel(0x303030f0);
|
||||
|
||||
const DOCS = "docs";
|
||||
const PLACES = "places";
|
||||
@ -92,13 +67,8 @@ Pane.prototype = {
|
||||
|
||||
let chromeTop = new St.BoxLayout();
|
||||
|
||||
let closeIcon = new St.Button({ style_class: "dash-pane-close" });
|
||||
closeIcon.connect('clicked', Lang.bind(this, function (b, e) {
|
||||
this.close();
|
||||
}));
|
||||
let dummy = new St.Bin();
|
||||
chromeTop.add(dummy, { expand: true });
|
||||
chromeTop.add(closeIcon, { x_align: St.Align.END });
|
||||
this.actor.add(chromeTop);
|
||||
|
||||
this.content = new St.BoxLayout({ vertical: true });
|
||||
@ -137,7 +107,7 @@ Pane.prototype = {
|
||||
else
|
||||
this.open();
|
||||
}
|
||||
}
|
||||
};
|
||||
Signals.addSignalMethods(Pane.prototype);
|
||||
|
||||
function ResultArea(displayType, flags) {
|
||||
@ -156,7 +126,7 @@ ResultArea.prototype = {
|
||||
this.resultsContainer.append(this.display.actor, Big.BoxPackFlags.EXPAND);
|
||||
this.display.load();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Utility function shared between ResultPane and the DocDisplay in the main dash.
|
||||
// Connects to the detail signal of the display, and on-demand creates a new
|
||||
@ -172,7 +142,7 @@ function createPaneForDetails(dash, display) {
|
||||
detailPane.destroyContent();
|
||||
}
|
||||
}));
|
||||
dash._addPane(detailPane);
|
||||
dash._addPane(detailPane, St.Align.START);
|
||||
}
|
||||
|
||||
if (index >= 0) {
|
||||
@ -212,7 +182,7 @@ ResultPane.prototype = {
|
||||
}));
|
||||
return resultArea.display;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function SearchEntry() {
|
||||
this._init();
|
||||
@ -220,76 +190,44 @@ function SearchEntry() {
|
||||
|
||||
SearchEntry.prototype = {
|
||||
_init : function() {
|
||||
this.actor = new St.BoxLayout({ name: "searchEntry",
|
||||
reactive: true });
|
||||
let box = new Big.Box({ orientation: Big.BoxOrientation.HORIZONTAL,
|
||||
y_align: Big.BoxAlignment.CENTER });
|
||||
this.actor.add(box, { expand: true });
|
||||
this.actor.connect('button-press-event', Lang.bind(this, function () {
|
||||
this._resetTextState(true);
|
||||
return false;
|
||||
}));
|
||||
this.actor = new St.Entry({ name: "searchEntry",
|
||||
hint_text: _("Find") });
|
||||
this.entry = this.actor.clutter_text;
|
||||
|
||||
this.actor.clutter_text.connect('text-changed', Lang.bind(this,
|
||||
function() {
|
||||
if (this.isActive())
|
||||
this.actor.set_secondary_icon_from_file(global.imagedir +
|
||||
"close-black.svg");
|
||||
else
|
||||
this.actor.set_secondary_icon_from_file(null);
|
||||
}));
|
||||
this.actor.connect('secondary-icon-clicked', Lang.bind(this,
|
||||
function() {
|
||||
this.reset();
|
||||
}));
|
||||
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
|
||||
|
||||
this.pane = null;
|
||||
|
||||
this._defaultText = _("Find...");
|
||||
this._capturedEventId = 0;
|
||||
},
|
||||
|
||||
let textProperties = { font_name: "Sans 16px" };
|
||||
let entryProperties = { editable: true,
|
||||
activatable: true,
|
||||
single_line_mode: true,
|
||||
color: SEARCH_TEXT_COLOR,
|
||||
cursor_color: SEARCH_CURSOR_COLOR };
|
||||
Lang.copyProperties(textProperties, entryProperties);
|
||||
this.entry = new Clutter.Text(entryProperties);
|
||||
show: function() {
|
||||
if (this._capturedEventId == 0)
|
||||
this._capturedEventId = global.stage.connect('captured-event',
|
||||
Lang.bind(this, this._onCapturedEvent));
|
||||
this.entry.set_cursor_visible(true);
|
||||
this.entry.set_selection(0, 0);
|
||||
},
|
||||
|
||||
this.entry.connect('notify::text', Lang.bind(this, function () {
|
||||
this._resetTextState(false);
|
||||
}));
|
||||
box.append(this.entry, Big.BoxPackFlags.EXPAND);
|
||||
|
||||
// Mark as editable just to get a cursor
|
||||
let defaultTextProperties = { ellipsize: Pango.EllipsizeMode.END,
|
||||
text: this._defaultText,
|
||||
editable: true,
|
||||
color: TEXT_COLOR,
|
||||
cursor_visible: false,
|
||||
single_line_mode: true };
|
||||
Lang.copyProperties(textProperties, defaultTextProperties);
|
||||
this._defaultText = new Clutter.Text(defaultTextProperties);
|
||||
box.add_actor(this._defaultText);
|
||||
this.entry.connect('notify::allocation', Lang.bind(this, function () {
|
||||
this._repositionDefaultText();
|
||||
}));
|
||||
|
||||
this._iconBox = new Big.Box({ x_align: Big.BoxAlignment.CENTER,
|
||||
y_align: Big.BoxAlignment.CENTER,
|
||||
padding_right: 4 });
|
||||
box.append(this._iconBox, Big.BoxPackFlags.END);
|
||||
|
||||
let magnifierUri = "file://" + global.imagedir + "magnifier.svg";
|
||||
this._magnifierIcon = Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.FOREVER,
|
||||
magnifierUri, 18, 18);
|
||||
let closeUri = "file://" + global.imagedir + "close-black.svg";
|
||||
this._closeIcon = Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.FOREVER,
|
||||
closeUri, 18, 18);
|
||||
this._closeIcon.reactive = true;
|
||||
this._closeIcon.connect('button-press-event', Lang.bind(this, function () {
|
||||
// Resetting this.entry.text will trigger notify::text signal which will
|
||||
// result in this._resetTextState() being called, but we should not rely
|
||||
// on that not short-circuiting if the text was already empty, so we call
|
||||
// this._resetTextState() explicitly in that case.
|
||||
if (this.entry.text == '')
|
||||
this._resetTextState(false);
|
||||
else
|
||||
this.entry.text = '';
|
||||
|
||||
// Return true to stop the signal emission, so that this.actor doesn't get
|
||||
// the button-press-event and re-highlight itself.
|
||||
return true;
|
||||
}));
|
||||
this._repositionDefaultText();
|
||||
this._resetTextState();
|
||||
hide: function() {
|
||||
if (this.isActive())
|
||||
this.reset();
|
||||
if (this._capturedEventId > 0) {
|
||||
global.stage.disconnect(this._capturedEventId);
|
||||
this._capturedEventId = 0;
|
||||
}
|
||||
},
|
||||
|
||||
setPane: function (pane) {
|
||||
@ -298,35 +236,93 @@ SearchEntry.prototype = {
|
||||
|
||||
reset: function () {
|
||||
this.entry.text = '';
|
||||
global.stage.set_key_focus(null);
|
||||
this.entry.set_cursor_visible(true);
|
||||
this.entry.set_selection(0, 0);
|
||||
},
|
||||
|
||||
getText: function () {
|
||||
return this.entry.text;
|
||||
return this.entry.get_text().replace(/^\s+/g, '').replace(/\s+$/g, '');
|
||||
},
|
||||
|
||||
_resetTextState: function (searchEntryClicked) {
|
||||
let text = this.getText();
|
||||
this._iconBox.remove_all();
|
||||
// We highlight the search box if the user starts typing in it
|
||||
// or just clicks in it to indicate that the search is active.
|
||||
if (text != '' || searchEntryClicked) {
|
||||
if (!searchEntryClicked)
|
||||
this._defaultText.hide();
|
||||
this._iconBox.append(this._closeIcon, Big.BoxPackFlags.NONE);
|
||||
this.actor.set_style_pseudo_class('active');
|
||||
this.entry.cursor_color = HIGHLIGHTED_SEARCH_CURSOR_COLOR;
|
||||
} else {
|
||||
this._defaultText.show();
|
||||
this._iconBox.append(this._magnifierIcon, Big.BoxPackFlags.NONE);
|
||||
this.actor.set_style_pseudo_class(null);
|
||||
this.entry.cursor_color = SEARCH_CURSOR_COLOR;
|
||||
// some search term has been entered
|
||||
isActive: function() {
|
||||
return this.actor.get_text() != '';
|
||||
},
|
||||
|
||||
// the entry does not show the hint
|
||||
_isActivated: function() {
|
||||
return this.entry.text == this.actor.get_text();
|
||||
},
|
||||
|
||||
_onCapturedEvent: function(actor, event) {
|
||||
let source = event.get_source();
|
||||
let panelEvent = false;
|
||||
|
||||
if (source) {
|
||||
let parent = source;
|
||||
do {
|
||||
if (parent == Main.panel.actor)
|
||||
break;
|
||||
} while ((parent = parent.get_parent()) != null);
|
||||
panelEvent = (parent != null);
|
||||
}
|
||||
|
||||
switch (event.type()) {
|
||||
case Clutter.EventType.BUTTON_PRESS:
|
||||
// the user clicked outside after activating the entry, but
|
||||
// with no search term entered - cancel the search
|
||||
if (source != this.entry && this.entry.text == '') {
|
||||
this.reset();
|
||||
// allow only panel events to continue
|
||||
return !panelEvent;
|
||||
}
|
||||
return false;
|
||||
case Clutter.EventType.KEY_PRESS:
|
||||
// If neither the stage nor our entry have key focus, some
|
||||
// "special" actor grabbed the focus (run dialog, looking
|
||||
// glass); we don't want to interfere with that
|
||||
let focus = global.stage.get_key_focus();
|
||||
if (focus != global.stage && focus != this.entry)
|
||||
return false;
|
||||
|
||||
let sym = event.get_key_symbol();
|
||||
|
||||
// If we have an active search, Escape cancels it - if we
|
||||
// haven't, the key is ignored
|
||||
if (sym == Clutter.Escape)
|
||||
if (this._isActivated()) {
|
||||
this.reset();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Ignore non-printable keys
|
||||
if (!Clutter.keysym_to_unicode(sym))
|
||||
return false;
|
||||
|
||||
// Search started - move the key focus to the entry and
|
||||
// "repeat" the event
|
||||
if (!this._isActivated()) {
|
||||
global.stage.set_key_focus(this.entry);
|
||||
this.entry.event(event, false);
|
||||
}
|
||||
|
||||
return false;
|
||||
default:
|
||||
// Suppress all other events outside the panel while the entry
|
||||
// is activated and no search has been entered - any click
|
||||
// outside the entry will cancel the search
|
||||
return (this.entry.text == '' && !panelEvent);
|
||||
}
|
||||
},
|
||||
|
||||
_repositionDefaultText: function () {
|
||||
// Offset a little to show the cursor
|
||||
this._defaultText.set_position(this.entry.x + 4, this.entry.y);
|
||||
this._defaultText.set_size(this.entry.width, this.entry.height);
|
||||
_onDestroy: function() {
|
||||
if (this._capturedEventId > 0) {
|
||||
global.stage.disconnect(this._capturedEventId);
|
||||
this._capturedEventId = 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
Signals.addSignalMethods(SearchEntry.prototype);
|
||||
@ -389,7 +385,7 @@ SearchResult.prototype = {
|
||||
else
|
||||
this.provider.activateResult(this.metaInfo.id);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function OverflowSearchResults(provider) {
|
||||
this._init(provider);
|
||||
@ -403,6 +399,10 @@ OverflowSearchResults.prototype = {
|
||||
this.actor = new St.OverflowBox({ style_class: 'dash-search-section-list-results' });
|
||||
},
|
||||
|
||||
getVisibleResultCount: function() {
|
||||
return this.actor.get_n_visible();
|
||||
},
|
||||
|
||||
renderResults: function(results, terms) {
|
||||
for (let i = 0; i < results.length && i < MAX_RENDERED_SEARCH_RESULTS; i++) {
|
||||
let result = results[i];
|
||||
@ -412,10 +412,6 @@ OverflowSearchResults.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
getVisibleCount: function() {
|
||||
return this.actor.get_n_visible();
|
||||
},
|
||||
|
||||
selectIndex: function(index) {
|
||||
let nVisible = this.actor.get_n_visible();
|
||||
let children = this.actor.get_children();
|
||||
@ -432,8 +428,14 @@ OverflowSearchResults.prototype = {
|
||||
targetActor._delegate.setSelected(true);
|
||||
this.selectionIndex = index;
|
||||
return true;
|
||||
},
|
||||
|
||||
activateSelected: function() {
|
||||
let children = this.actor.get_children();
|
||||
let targetActor = children[this.selectionIndex];
|
||||
targetActor._delegate.activate();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function SearchResults(searchSystem) {
|
||||
this._init(searchSystem);
|
||||
@ -546,7 +548,7 @@ SearchResults.prototype = {
|
||||
let success;
|
||||
let index = resultDisplay.getSelectionIndex();
|
||||
if (up && index == -1)
|
||||
index = resultDisplay.getVisibleCount() - 1;
|
||||
index = resultDisplay.getVisibleResultCount() - 1;
|
||||
else if (up)
|
||||
index = index - 1;
|
||||
else
|
||||
@ -597,11 +599,10 @@ SearchResults.prototype = {
|
||||
return;
|
||||
let meta = this._providerMeta[current];
|
||||
let resultDisplay = meta.resultDisplay;
|
||||
let children = resultDisplay.actor.get_children();
|
||||
let targetActor = children[resultDisplay.getSelectionIndex()];
|
||||
targetActor._delegate.activate();
|
||||
resultDisplay.activateSelected();
|
||||
Main.overview.hide();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function MoreLink() {
|
||||
this._init();
|
||||
@ -635,7 +636,7 @@ MoreLink.prototype = {
|
||||
this._expander.style_class = 'more-link-expander open';
|
||||
}));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Signals.addSignalMethods(MoreLink.prototype);
|
||||
|
||||
@ -649,7 +650,7 @@ BackLink.prototype = {
|
||||
reactive: true });
|
||||
this.actor.set_child(new St.Bin({ style_class: "section-header-back-image" }));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function SectionHeader(title, suppressBrowse) {
|
||||
this._init(title, suppressBrowse);
|
||||
@ -720,7 +721,7 @@ SectionHeader.prototype = {
|
||||
this.countText.text = countText;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Signals.addSignalMethods(SectionHeader.prototype);
|
||||
|
||||
@ -744,7 +745,7 @@ SearchSectionHeader.prototype = {
|
||||
|
||||
this.actor.connect('clicked', onClick);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function Section(titleString, suppressBrowse) {
|
||||
this._init(titleString, suppressBrowse);
|
||||
@ -760,7 +761,7 @@ Section.prototype = {
|
||||
vertical: true });
|
||||
this.actor.add(this.content);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function Dash() {
|
||||
this._init();
|
||||
@ -810,12 +811,11 @@ Dash.prototype = {
|
||||
this.actor.add(this.searchResults.actor);
|
||||
this.searchResults.actor.hide();
|
||||
|
||||
this._keyPressId = 0;
|
||||
this._searchTimeoutId = 0;
|
||||
this._searchEntry.entry.connect('text-changed', Lang.bind(this, function (se, prop) {
|
||||
let text = this._searchEntry.getText();
|
||||
text = text.replace(/^\s+/g, "").replace(/\s+$/g, "");
|
||||
let searchPreviouslyActive = this._searchActive;
|
||||
this._searchActive = text != '';
|
||||
this._searchActive = this._searchEntry.isActive();
|
||||
this._searchPending = this._searchActive && !searchPreviouslyActive;
|
||||
if (this._searchPending) {
|
||||
this.searchResults.startingSearch();
|
||||
@ -846,35 +846,6 @@ Dash.prototype = {
|
||||
this.searchResults.activateSelected();
|
||||
return true;
|
||||
}));
|
||||
this._searchEntry.entry.connect('key-press-event', Lang.bind(this, function (se, e) {
|
||||
let symbol = e.get_key_symbol();
|
||||
if (symbol == Clutter.Escape) {
|
||||
// Escape will keep clearing things back to the desktop.
|
||||
// If we have an active search, we remove it.
|
||||
if (this._searchActive)
|
||||
this._searchEntry.reset();
|
||||
// Next, if we're in one of the "more" modes or showing the details pane, close them
|
||||
else if (this._activePane != null)
|
||||
this._activePane.close();
|
||||
// Finally, just close the Overview entirely
|
||||
else
|
||||
Main.overview.hide();
|
||||
return true;
|
||||
} else if (symbol == Clutter.Up) {
|
||||
if (!this._searchActive)
|
||||
return true;
|
||||
this.searchResults.selectUp(false);
|
||||
|
||||
return true;
|
||||
} else if (symbol == Clutter.Down) {
|
||||
if (!this._searchActive)
|
||||
return true;
|
||||
|
||||
this.searchResults.selectDown(false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}));
|
||||
|
||||
/***** Applications *****/
|
||||
|
||||
@ -886,7 +857,7 @@ Dash.prototype = {
|
||||
this._appsSection.header.moreLink.connect('activated', Lang.bind(this, function (link) {
|
||||
if (this._allApps == null) {
|
||||
this._allApps = new AppDisplay.AllAppDisplay();
|
||||
this._addPane(this._allApps);
|
||||
this._addPane(this._allApps, St.Align.START);
|
||||
link.setPane(this._allApps);
|
||||
}
|
||||
}));
|
||||
@ -914,7 +885,7 @@ Dash.prototype = {
|
||||
if (this._moreDocsPane == null) {
|
||||
this._moreDocsPane = new ResultPane(this);
|
||||
this._moreDocsPane.packResults(DOCS);
|
||||
this._addPane(this._moreDocsPane);
|
||||
this._addPane(this._moreDocsPane, St.Align.END);
|
||||
link.setPane(this._moreDocsPane);
|
||||
}
|
||||
}));
|
||||
@ -928,6 +899,40 @@ Dash.prototype = {
|
||||
this.sectionArea.add(this._docsSection.actor, { expand: true });
|
||||
},
|
||||
|
||||
_onKeyPress: function(stage, event) {
|
||||
// If neither the stage nor the search entry have key focus, some
|
||||
// "special" actor grabbed the focus (run dialog, looking glass);
|
||||
// we don't want to interfere with that
|
||||
let focus = stage.get_key_focus();
|
||||
if (focus != stage && focus != this._searchEntry.entry)
|
||||
return false;
|
||||
|
||||
let symbol = event.get_key_symbol();
|
||||
if (symbol == Clutter.Escape) {
|
||||
// If we're in one of the "more" modes or showing the
|
||||
// details pane, close them
|
||||
if (this._activePane != null)
|
||||
this._activePane.close();
|
||||
// Otherwise, just close the Overview entirely
|
||||
else
|
||||
Main.overview.hide();
|
||||
return true;
|
||||
} else if (symbol == Clutter.Up) {
|
||||
if (!this._searchActive)
|
||||
return true;
|
||||
this.searchResults.selectUp(false);
|
||||
|
||||
return true;
|
||||
} else if (symbol == Clutter.Down) {
|
||||
if (!this._searchActive)
|
||||
return true;
|
||||
|
||||
this.searchResults.selectDown(false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
_doSearch: function () {
|
||||
this._searchTimeoutId = 0;
|
||||
let text = this._searchEntry.getText();
|
||||
@ -937,14 +942,21 @@ Dash.prototype = {
|
||||
},
|
||||
|
||||
show: function() {
|
||||
global.stage.set_key_focus(this._searchEntry.entry);
|
||||
this._searchEntry.show();
|
||||
if (this._keyPressId == 0)
|
||||
this._keyPressId = global.stage.connect('key-press-event',
|
||||
Lang.bind(this, this._onKeyPress));
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
this._firstSelectAfterOverlayShow = true;
|
||||
this._searchEntry.reset();
|
||||
this._searchEntry.hide();
|
||||
if (this._activePane != null)
|
||||
this._activePane.close();
|
||||
if (this._keyPressId > 0) {
|
||||
global.stage.disconnect(this._keyPressId);
|
||||
this._keyPressId = 0;
|
||||
}
|
||||
},
|
||||
|
||||
closePanes: function () {
|
||||
@ -952,7 +964,7 @@ Dash.prototype = {
|
||||
this._activePane.close();
|
||||
},
|
||||
|
||||
_addPane: function(pane) {
|
||||
_addPane: function(pane, align) {
|
||||
pane.connect('open-state-changed', Lang.bind(this, function (pane, isOpen) {
|
||||
if (isOpen) {
|
||||
if (pane != this._activePane && this._activePane != null) {
|
||||
@ -963,7 +975,7 @@ Dash.prototype = {
|
||||
this._activePane = null;
|
||||
}
|
||||
}));
|
||||
Main.overview.addPane(pane);
|
||||
Main.overview.addPane(pane, align);
|
||||
}
|
||||
};
|
||||
Signals.addSignalMethods(Dash.prototype);
|
||||
|
110
js/ui/dnd.js
110
js/ui/dnd.js
@ -6,6 +6,11 @@ const Lang = imports.lang;
|
||||
const Signals = imports.signals;
|
||||
const Tweener = imports.ui.tweener;
|
||||
|
||||
const Params = imports.misc.params;
|
||||
|
||||
// Time to scale down to maxDragActorSize
|
||||
const SCALE_ANIMATION_TIME = 0.25;
|
||||
// Time to animate to original position on cancel
|
||||
const SNAP_BACK_ANIMATION_TIME = 0.25;
|
||||
|
||||
let eventHandlerActor = null;
|
||||
@ -27,18 +32,29 @@ function _getEventHandlerActor() {
|
||||
return eventHandlerActor;
|
||||
}
|
||||
|
||||
function _Draggable(actor, manualMode) {
|
||||
this._init(actor, manualMode);
|
||||
function _Draggable(actor, params) {
|
||||
this._init(actor, params);
|
||||
}
|
||||
|
||||
_Draggable.prototype = {
|
||||
_init : function(actor, manualMode) {
|
||||
_init : function(actor, params) {
|
||||
params = Params.parse(params, { manualMode: false,
|
||||
dragActorMaxSize: undefined,
|
||||
dragActorOpacity: undefined });
|
||||
|
||||
this.actor = actor;
|
||||
if (!manualMode)
|
||||
if (!params.manualMode)
|
||||
this.actor.connect('button-press-event',
|
||||
Lang.bind(this, this._onButtonPress));
|
||||
|
||||
this.actor.connect('destroy', Lang.bind(this, function() {
|
||||
this.disconnectAll();
|
||||
}));
|
||||
this._onEventId = null;
|
||||
|
||||
this._dragActorMaxSize = params.dragActorMaxSize;
|
||||
this._dragActorOpacity = params.dragActorOpacity;
|
||||
|
||||
this._buttonDown = false; // The mouse button has been pressed and has not yet been released.
|
||||
this._dragInProgress = false; // The drag has been started, and has not been dropped or cancelled yet.
|
||||
this._snapBackInProgress = false; // The drag has been cancelled and the item is in the process of snapping back.
|
||||
@ -59,7 +75,7 @@ _Draggable.prototype = {
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
|
||||
_grabActor: function() {
|
||||
Clutter.grab_pointer(this.actor);
|
||||
this._onEventId = this.actor.connect('event',
|
||||
@ -140,8 +156,8 @@ _Draggable.prototype = {
|
||||
this._ungrabActor();
|
||||
this._grabEvents();
|
||||
|
||||
this._dragStartX = stageX;
|
||||
this._dragStartY = stageY;
|
||||
this._dragX = this._dragStartX = stageX;
|
||||
this._dragY = this._dragStartY = stageY;
|
||||
|
||||
if (this.actor._delegate && this.actor._delegate.getDragActor) {
|
||||
this._dragActor = this.actor._delegate.getDragActor(this._dragStartX, this._dragStartY);
|
||||
@ -154,10 +170,9 @@ _Draggable.prototype = {
|
||||
// the dragActor over it. Otherwise, center it
|
||||
// around the pointer
|
||||
let [sourceX, sourceY] = this._dragActorSource.get_transformed_position();
|
||||
let [sourceWidth, sourceHeight] = this._dragActorSource.get_transformed_size();
|
||||
let x, y;
|
||||
if (stageX > sourceX && stageX <= sourceX + sourceWidth &&
|
||||
stageY > sourceY && stageY <= sourceY + sourceHeight) {
|
||||
if (stageX > sourceX && stageX <= sourceX + this._dragActor.width &&
|
||||
stageY > sourceY && stageY <= sourceY + this._dragActor.height) {
|
||||
x = sourceX;
|
||||
y = sourceY;
|
||||
} else {
|
||||
@ -193,6 +208,45 @@ _Draggable.prototype = {
|
||||
|
||||
this._dragActor.reparent(this.actor.get_stage());
|
||||
this._dragActor.raise_top();
|
||||
|
||||
this._dragOrigOpacity = this._dragActor.opacity;
|
||||
if (this._dragActorOpacity != undefined)
|
||||
this._dragActor.opacity = this._dragActorOpacity;
|
||||
|
||||
this._snapBackX = this._dragStartX + this._dragOffsetX;
|
||||
this._snapBackY = this._dragStartY + this._dragOffsetY;
|
||||
this._snapBackScale = this._dragActor.scale_x;
|
||||
|
||||
if (this._dragActorMaxSize != undefined) {
|
||||
let [scaledWidth, scaledHeight] = this._dragActor.get_transformed_size();
|
||||
let currentSize = Math.max(scaledWidth, scaledHeight);
|
||||
if (currentSize > this._dragActorMaxSize) {
|
||||
let scale = this._dragActorMaxSize / currentSize;
|
||||
let origScale = this._dragActor.scale_x;
|
||||
let origDragOffsetX = this._dragOffsetX;
|
||||
let origDragOffsetY = this._dragOffsetY;
|
||||
|
||||
// The position of the actor changes as we scale
|
||||
// around the drag position, but we can't just tween
|
||||
// to the final position because that tween would
|
||||
// fight with updates as the user continues dragging
|
||||
// the mouse; instead we do the position computations in
|
||||
// an onUpdate() function.
|
||||
Tweener.addTween(this._dragActor,
|
||||
{ scale_x: scale * origScale,
|
||||
scale_y: scale * origScale,
|
||||
time: SCALE_ANIMATION_TIME,
|
||||
transition: "easeOutQuad",
|
||||
onUpdate: function() {
|
||||
let currentScale = this._dragActor.scale_x / origScale;
|
||||
this._dragOffsetX = currentScale * origDragOffsetX;
|
||||
this._dragOffsetY = currentScale * origDragOffsetY;
|
||||
this._dragActor.set_position(this._dragX + this._dragOffsetX,
|
||||
this._dragY + this._dragOffsetY);
|
||||
},
|
||||
onUpdateScope: this });
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_maybeStartDrag: function(event) {
|
||||
@ -211,6 +265,8 @@ _Draggable.prototype = {
|
||||
|
||||
_updateDragPosition : function (event) {
|
||||
let [stageX, stageY] = event.get_coords();
|
||||
this._dragX = stageX;
|
||||
this._dragY = stageY;
|
||||
|
||||
// If we are dragging, update the position
|
||||
if (this._dragActor) {
|
||||
@ -220,8 +276,7 @@ _Draggable.prototype = {
|
||||
// we have to temporarily hide this._dragActor.
|
||||
this._dragActor.hide();
|
||||
let target = this._dragActor.get_stage().get_actor_at_pos(Clutter.PickMode.ALL,
|
||||
stageX + this._dragOffsetX,
|
||||
stageY + this._dragOffsetY);
|
||||
stageX, stageY);
|
||||
this._dragActor.show();
|
||||
while (target) {
|
||||
if (target._delegate && target._delegate.handleDragOver) {
|
||||
@ -230,8 +285,8 @@ _Draggable.prototype = {
|
||||
// We can check the return value of the function and break the loop if it's true if we don't want
|
||||
// to continue checking the parents.
|
||||
target._delegate.handleDragOver(this.actor._delegate, this._dragActor,
|
||||
(stageX + this._dragOffsetX - targX) / target.scale_x,
|
||||
(stageY + this._dragOffsetY - targY) / target.scale_y,
|
||||
(stageX - targX) / target.scale_x,
|
||||
(stageY - targY) / target.scale_y,
|
||||
event.get_time());
|
||||
}
|
||||
target = target.get_parent();
|
||||
@ -280,8 +335,8 @@ _Draggable.prototype = {
|
||||
// Snap back to the actor source if the source is still around, snap back
|
||||
// to the original location if the actor itself was being dragged or the
|
||||
// source is no longer around.
|
||||
let snapBackX = this._dragStartX + this._dragOffsetX;
|
||||
let snapBackY = this._dragStartY + this._dragOffsetY;
|
||||
let snapBackX = this._snapBackX;
|
||||
let snapBackY = this._snapBackY;
|
||||
if (this._dragActorSource && this._dragActorSource.visible) {
|
||||
[snapBackX, snapBackY] = this._dragActorSource.get_transformed_position();
|
||||
}
|
||||
@ -291,6 +346,9 @@ _Draggable.prototype = {
|
||||
Tweener.addTween(this._dragActor,
|
||||
{ x: snapBackX,
|
||||
y: snapBackY,
|
||||
scale_x: this._snapBackScale,
|
||||
scale_y: this._snapBackScale,
|
||||
opacity: this._dragOrigOpacity,
|
||||
time: SNAP_BACK_ANIMATION_TIME,
|
||||
transition: "easeOutQuad",
|
||||
onComplete: this._onSnapBackComplete,
|
||||
@ -326,10 +384,24 @@ Signals.addSignalMethods(_Draggable.prototype);
|
||||
/**
|
||||
* makeDraggable:
|
||||
* @actor: Source actor
|
||||
* @manualMode: If given, do not automatically start drag and drop on click
|
||||
* @params: (optional) Additional parameters
|
||||
*
|
||||
* Create an object which controls drag and drop for the given actor.
|
||||
*
|
||||
* If %manualMode is %true in @params, do not automatically start
|
||||
* drag and drop on click
|
||||
*
|
||||
* If %dragActorMaxSize is present in @params, the drag actor will
|
||||
* be scaled down to be no larger than that size in pixels.
|
||||
*
|
||||
* If %dragActorOpacity is present in @params, the drag actor will
|
||||
* will be set to have that opacity during the drag.
|
||||
*
|
||||
* Note that when the drag actor is the source actor and the drop
|
||||
* succeeds, the actor scale and opacity aren't reset; if the drop
|
||||
* target wants to reuse the actor, it's up to the drop target to
|
||||
* reset these values.
|
||||
*/
|
||||
function makeDraggable(actor, manualMode) {
|
||||
return new _Draggable(actor, manualMode);
|
||||
function makeDraggable(actor, params) {
|
||||
return new _Draggable(actor, params);
|
||||
}
|
||||
|
@ -85,8 +85,8 @@ DocDisplayItem.prototype = {
|
||||
return null;
|
||||
|
||||
try {
|
||||
return Shell.TextureCache.get_default().load_uri_sync(Shell.TextureCachePolicy.NONE,
|
||||
this._docInfo.uri, -1, -1);
|
||||
return St.TextureCache.get_default().load_uri_sync(St.TextureCachePolicy.NONE,
|
||||
this._docInfo.uri, -1, -1);
|
||||
} catch (e) {
|
||||
// An exception will be raised when the image format isn't know
|
||||
/* FIXME: http://bugzilla.gnome.org/show_bug.cgi?id=591480: should
|
||||
|
@ -240,7 +240,7 @@ Signals.addSignalMethods(GenericDisplayItem.prototype);
|
||||
|
||||
const GenericDisplayFlags = {
|
||||
DISABLE_VSCROLLING: 1 << 0
|
||||
}
|
||||
};
|
||||
|
||||
/* This is a virtual class that represents a display containing a collection of items
|
||||
* that can be filtered with a search string.
|
||||
@ -257,13 +257,15 @@ GenericDisplay.prototype = {
|
||||
|
||||
if (disableVScrolling) {
|
||||
this.actor = this._list = new Shell.OverflowList({ spacing: 6,
|
||||
item_height: 50 });
|
||||
item_height: 50 });
|
||||
} else {
|
||||
this.actor = new St.ScrollView({ x_fill: true, y_fill: true });
|
||||
this.actor.get_hscroll_bar().hide();
|
||||
this.actor = new St.ScrollView({ x_fill: true,
|
||||
y_fill: false,
|
||||
vshadows: true });
|
||||
this._list = new St.BoxLayout({ style_class: 'generic-display-container',
|
||||
vertical: true });
|
||||
this.actor.add_actor(this._list);
|
||||
this.actor.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
|
||||
}
|
||||
|
||||
this._pendingRedisplay = RedisplayFlags.NONE;
|
||||
@ -698,7 +700,7 @@ GenericDisplay.prototype = {
|
||||
|
||||
this._selectedIndex = index;
|
||||
if (index < 0)
|
||||
return
|
||||
return;
|
||||
|
||||
// Mark the new item as selected and create its details pane
|
||||
let item = this._findDisplayedByIndex(index);
|
||||
|
@ -2,12 +2,7 @@
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Lang = imports.lang;
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const Tweener = imports.ui.tweener;
|
||||
|
||||
const SHADE_COLOR = new Clutter.Color();
|
||||
SHADE_COLOR.from_pixel(0x00000044);
|
||||
const St = imports.gi.St;
|
||||
|
||||
/**
|
||||
* Lightbox:
|
||||
@ -38,11 +33,10 @@ Lightbox.prototype = {
|
||||
_init : function(container, inhibitEvents, width, height) {
|
||||
this._container = container;
|
||||
this._children = container.get_children();
|
||||
this.actor = new Clutter.Rectangle({ color: SHADE_COLOR,
|
||||
x: 0,
|
||||
y: 0,
|
||||
border_width: 0,
|
||||
reactive: inhibitEvents });
|
||||
this.actor = new St.Bin({ x: 0,
|
||||
y: 0,
|
||||
style_class: 'lightbox',
|
||||
reactive: inhibitEvents });
|
||||
|
||||
container.add_actor(this.actor);
|
||||
this.actor.raise_top();
|
||||
|
@ -136,7 +136,7 @@ Notebook.prototype = {
|
||||
let vAdjust = tabData.scrollView.vscroll.adjustment;
|
||||
vAdjust.value = vAdjust.upper - vAdjust.page_size;
|
||||
}
|
||||
}
|
||||
};
|
||||
Signals.addSignalMethods(Notebook.prototype);
|
||||
|
||||
function Result(command, o, index) {
|
||||
@ -164,7 +164,7 @@ Result.prototype = {
|
||||
padBin.add_actor(line);
|
||||
this.actor.append(padBin, Big.BoxPackFlags.NONE);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function ActorHierarchy() {
|
||||
this._init();
|
||||
@ -215,7 +215,7 @@ ActorHierarchy.prototype = {
|
||||
let link = children[idx];
|
||||
this.emit('selection', actor);
|
||||
}
|
||||
}
|
||||
};
|
||||
Signals.addSignalMethods(ActorHierarchy.prototype);
|
||||
|
||||
function PropertyInspector() {
|
||||
@ -249,7 +249,7 @@ PropertyInspector.prototype = {
|
||||
this.actor.add_actor(propDisplay);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function Inspector() {
|
||||
this._init();
|
||||
@ -295,7 +295,14 @@ Inspector.prototype = {
|
||||
let target = global.stage.get_actor_at_pos(Clutter.PickMode.ALL,
|
||||
stageX,
|
||||
stageY);
|
||||
displayText.text = '<inspect x: ' + stageX + ' y: ' + stageY + '> ' + target;
|
||||
let id, style_class;
|
||||
if (target instanceof St.Widget) {
|
||||
id = target.get_theme_node().get_element_id();
|
||||
style_class = target.get_theme_node().get_element_class();
|
||||
}
|
||||
let position = '<inspect x: ' + stageX + ' y: ' + stageY + '>';
|
||||
let style = '<style id: ' + id + ' class: ' + style_class + '>';
|
||||
displayText.text = position + ' ' + style + ' ' + target;
|
||||
if (borderPaintTarget != null)
|
||||
borderPaintTarget.disconnect(borderPaintId);
|
||||
borderPaintTarget = target;
|
||||
@ -304,7 +311,7 @@ Inspector.prototype = {
|
||||
}));
|
||||
Clutter.grab_pointer(eventHandler);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Signals.addSignalMethods(Inspector.prototype);
|
||||
|
||||
@ -322,13 +329,13 @@ ErrorLog.prototype = {
|
||||
},
|
||||
|
||||
_formatTime: function(d){
|
||||
function pad(n) { return n < 10 ? '0' + n : n };
|
||||
function pad(n) { return n < 10 ? '0' + n : n; }
|
||||
return d.getUTCFullYear()+'-'
|
||||
+ pad(d.getUTCMonth()+1)+'-'
|
||||
+ pad(d.getUTCDate())+'T'
|
||||
+ pad(d.getUTCHours())+':'
|
||||
+ pad(d.getUTCMinutes())+':'
|
||||
+ pad(d.getUTCSeconds())+'Z'
|
||||
+ pad(d.getUTCSeconds())+'Z';
|
||||
},
|
||||
|
||||
_renderText: function() {
|
||||
@ -342,7 +349,7 @@ ErrorLog.prototype = {
|
||||
}
|
||||
this.text.text = text;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function Extensions() {
|
||||
this._init();
|
||||
@ -477,8 +484,8 @@ LookingGlass.prototype = {
|
||||
|
||||
let toolbar = new St.BoxLayout({ name: "Toolbar" });
|
||||
this.actor.add_actor(toolbar);
|
||||
let inspectIcon = Shell.TextureCache.get_default().load_gicon(new Gio.ThemedIcon({ name: 'gtk-color-picker' }),
|
||||
24);
|
||||
let inspectIcon = St.TextureCache.get_default().load_gicon(new Gio.ThemedIcon({ name: 'gtk-color-picker' }),
|
||||
24);
|
||||
toolbar.add_actor(inspectIcon);
|
||||
inspectIcon.reactive = true;
|
||||
inspectIcon.connect('button-press-event', Lang.bind(this, function () {
|
||||
|
@ -90,12 +90,6 @@ function start() {
|
||||
// when we are running inside Xephyr.
|
||||
global.stage.color = DEFAULT_BACKGROUND_COLOR;
|
||||
|
||||
// Mutter currently hardcodes putting "Yessir. The compositor is running""
|
||||
// in the Overview. Clear that out.
|
||||
let children = global.overlay_group.get_children();
|
||||
for (let i = 0; i < children.length; i++)
|
||||
children[i].destroy();
|
||||
|
||||
let themeContext = St.ThemeContext.get_for_stage (global.stage);
|
||||
let stylesheetPath = global.datadir + "/theme/gnome-shell.css";
|
||||
let theme = new St.Theme ({ application_stylesheet: stylesheetPath });
|
||||
@ -285,6 +279,9 @@ function _globalKeyPressHandler(actor, event) {
|
||||
}
|
||||
} else if (type == Clutter.EventType.KEY_RELEASE) {
|
||||
let symbol = event.get_key_symbol();
|
||||
let keyCode = event.get_key_code();
|
||||
let modifierState = Shell.get_event_state(event);
|
||||
// Check the overview key first, this isn't a Meta.KeyBindingAction yet
|
||||
if (symbol == Clutter.Super_L || symbol == Clutter.Super_R) {
|
||||
// The super key is the default for triggering the overview, and should
|
||||
// get us out of the overview when we are already in it.
|
||||
@ -292,8 +289,25 @@ function _globalKeyPressHandler(actor, event) {
|
||||
overview.hide();
|
||||
|
||||
return true;
|
||||
} else if (symbol == Clutter.F2 && (Shell.get_event_state(event) & Clutter.ModifierType.MOD1_MASK)) {
|
||||
getRunDialog().open();
|
||||
}
|
||||
|
||||
// Whitelist some of the Metacity actions
|
||||
let display = global.screen.get_display();
|
||||
let activeWorkspaceIndex = global.screen.get_active_workspace_index();
|
||||
|
||||
// This relies on the fact that Clutter.ModifierType is the same as Gdk.ModifierType
|
||||
let action = display.get_keybinding_action(symbol, keyCode, modifierState);
|
||||
switch (action) {
|
||||
case Meta.KeyBindingAction.WORKSPACE_LEFT:
|
||||
wm.actionMoveWorkspaceLeft();
|
||||
return true;
|
||||
case Meta.KeyBindingAction.WORKSPACE_RIGHT:
|
||||
wm.actionMoveWorkspaceRight();
|
||||
return true;
|
||||
case Meta.KeyBindingAction.PANEL_RUN_DIALOG:
|
||||
case Meta.KeyBindingAction.COMMAND_2:
|
||||
getRunDialog().open();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -489,6 +489,12 @@ MessageTray.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
removeSourceByApp: function(app) {
|
||||
for (let source in this._sources)
|
||||
if (this._sources[source].app == app)
|
||||
this.removeSource(this._sources[source]);
|
||||
},
|
||||
|
||||
removeNotification: function(notification) {
|
||||
if (this._notification == notification && (this._notificationState == State.SHOWN || this._notificationState == State.SHOWING)) {
|
||||
if (this._notificationTimeoutId) {
|
||||
@ -690,7 +696,6 @@ MessageTray.prototype = {
|
||||
},
|
||||
|
||||
_hideNotification: function() {
|
||||
this._notificationRemoved = false;
|
||||
this._notification.popIn();
|
||||
|
||||
this._tween(this._notificationBin, "_notificationState", State.HIDDEN,
|
||||
@ -704,6 +709,7 @@ MessageTray.prototype = {
|
||||
},
|
||||
|
||||
_hideNotificationCompleted: function() {
|
||||
this._notificationRemoved = false;
|
||||
this._notificationBin.hide();
|
||||
this._notificationBin.child = null;
|
||||
this._notification = null;
|
||||
|
@ -5,6 +5,7 @@ const GLib = imports.gi.GLib;
|
||||
const Lang = imports.lang;
|
||||
const Shell = imports.gi.Shell;
|
||||
const Mainloop = imports.mainloop;
|
||||
const St = imports.gi.St;
|
||||
|
||||
const Main = imports.ui.main;
|
||||
const MessageTray = imports.ui.messageTray;
|
||||
@ -20,17 +21,17 @@ const BusIface = {
|
||||
methods: [{ name: 'GetConnectionUnixProcessID',
|
||||
inSignature: 's',
|
||||
outSignature: 'i' }]
|
||||
}
|
||||
};
|
||||
|
||||
const Bus = function () {
|
||||
this._init();
|
||||
}
|
||||
};
|
||||
|
||||
Bus.prototype = {
|
||||
_init: function() {
|
||||
DBus.session.proxifyObject(this, 'org.freedesktop.DBus', '/org/freedesktop/DBus');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
DBus.proxifyPrototype(Bus.prototype, BusIface);
|
||||
|
||||
@ -100,6 +101,11 @@ NotificationDaemon.prototype = {
|
||||
Lang.bind(this, this._lostName));
|
||||
|
||||
this._currentNotifications = {};
|
||||
|
||||
Shell.WindowTracker.get_default().connect('notify::focus-app',
|
||||
Lang.bind(this, this._onFocusAppChanged));
|
||||
Main.overview.connect('hidden',
|
||||
Lang.bind(this, this._onFocusAppChanged));
|
||||
},
|
||||
|
||||
_acquiredName: function() {
|
||||
@ -260,6 +266,11 @@ NotificationDaemon.prototype = {
|
||||
];
|
||||
},
|
||||
|
||||
_onFocusAppChanged: function() {
|
||||
let tracker = Shell.WindowTracker.get_default();
|
||||
Main.messageTray.removeSourceByApp(tracker.focus_app);
|
||||
},
|
||||
|
||||
_actionInvoked: function(notification, action, source, id) {
|
||||
this._emitActionInvoked(id, action);
|
||||
source.destroy();
|
||||
@ -293,6 +304,9 @@ Source.prototype = {
|
||||
_init: function(sourceId, icon, hints) {
|
||||
MessageTray.Source.prototype._init.call(this, sourceId);
|
||||
|
||||
this.app = null;
|
||||
this._openAppRequested = false;
|
||||
|
||||
this.update(icon, hints);
|
||||
},
|
||||
|
||||
@ -302,13 +316,10 @@ Source.prototype = {
|
||||
this._icon = icon;
|
||||
this._iconData = hints.icon_data;
|
||||
this._urgency = hints.urgency;
|
||||
|
||||
this.app = null;
|
||||
this._openAppRequested = false;
|
||||
},
|
||||
|
||||
createIcon: function(size) {
|
||||
let textureCache = Shell.TextureCache.get_default();
|
||||
let textureCache = St.TextureCache.get_default();
|
||||
|
||||
if (this._icon) {
|
||||
if (this._icon.substr(0, 7) == 'file://')
|
||||
|
@ -89,8 +89,7 @@ InfoBar.prototype = {
|
||||
x_fill: true,
|
||||
y_fill: false });
|
||||
this._label = new St.Label();
|
||||
this._undo = new St.Button({ label: _("Undo"),
|
||||
style_class: 'info-bar-link-button' });
|
||||
this._undo = new St.Button({ style_class: 'info-bar-link-button' });
|
||||
|
||||
let bin = new St.Bin({ x_fill: false,
|
||||
y_fill: false,
|
||||
@ -153,7 +152,7 @@ InfoBar.prototype = {
|
||||
this._overviewWasHidden = true;
|
||||
},
|
||||
|
||||
setMessage: function(text, undoCallback) {
|
||||
setMessage: function(text, undoCallback, undoLabel) {
|
||||
if (this._timeoutId)
|
||||
Mainloop.source_remove(this._timeoutId);
|
||||
|
||||
@ -177,6 +176,11 @@ InfoBar.prototype = {
|
||||
|
||||
this._timeoutId = Mainloop.timeout_add_seconds(INFO_BAR_HIDE_TIMEOUT, Lang.bind(this, this._onTimeout));
|
||||
|
||||
if (undoLabel)
|
||||
this._undo.label = undoLabel;
|
||||
else
|
||||
this._undo.label = _("Undo");
|
||||
|
||||
this._undoCallback = undoCallback;
|
||||
if (undoCallback)
|
||||
this._undo.show();
|
||||
@ -197,8 +201,7 @@ Overview.prototype = {
|
||||
this.infoBar = new InfoBar();
|
||||
this._group.add_actor(this.infoBar.actor);
|
||||
|
||||
this._workspacesViewSwitch = new WorkspacesView.WorkspacesViewSwitch();
|
||||
this._workspacesViewSwitch.connect('view-changed', Lang.bind(this, this._onViewChanged));
|
||||
this._workspacesManager = null;
|
||||
|
||||
this.visible = false;
|
||||
this.animationInProgress = false;
|
||||
@ -251,43 +254,16 @@ Overview.prototype = {
|
||||
this._workspaces = null;
|
||||
},
|
||||
|
||||
_createControlsBar: function() {
|
||||
this._workspacesBar = new St.BoxLayout({ 'pack-start': true,
|
||||
style_class: 'workspaces-bar' });
|
||||
this._workspacesBar.move_by(this._workspacesBarX, this._workspacesBarY);
|
||||
|
||||
let controlsBar = this._workspacesViewSwitch.createControlsBar();
|
||||
let bar = this._workspaces.createControllerBar();
|
||||
this._workspacesBar.add(bar, { expand: true, 'x-fill': true, 'y-fill': true,
|
||||
y_align: St.Align.MIDDLE, x_align: St.Align.START });
|
||||
this._workspacesBar.add(controlsBar, {x_align: St.Align.END});
|
||||
this._workspacesBar.width = this._workspacesBarWidth;
|
||||
|
||||
this._group.add_actor(this._workspacesBar);
|
||||
this._workspacesBar.raise(this._workspaces.actor);
|
||||
},
|
||||
|
||||
_onViewChanged: function() {
|
||||
if (!this.visible)
|
||||
return;
|
||||
//Remove old worspacesView
|
||||
this._group.remove_actor(this._workspacesBar);
|
||||
this._workspaces.hide();
|
||||
this._group.remove_actor(this._workspaces.actor);
|
||||
this._workspaces.destroy();
|
||||
this._workspacesBar.destroy();
|
||||
|
||||
this._workspaces = this._workspacesViewSwitch.createCurrentWorkspaceView(this._workspacesWidth, this._workspacesHeight,
|
||||
this._workspacesX, this._workspacesY, false);
|
||||
this._workspaces = this._workspacesManager.workspacesView;
|
||||
|
||||
//Show new workspacesView
|
||||
// Show new workspacesView
|
||||
this._group.add_actor(this._workspaces.actor);
|
||||
this._workspacesBar.raise(this._workspaces.actor);
|
||||
this._dash.actor.raise(this._workspaces.actor);
|
||||
|
||||
this._createControlsBar();
|
||||
|
||||
// Set new position and scale to workspaces.
|
||||
this.emit('showing');
|
||||
},
|
||||
|
||||
_recalculateGridSizes: function () {
|
||||
@ -308,6 +284,7 @@ Overview.prototype = {
|
||||
|
||||
relayout: function () {
|
||||
let primary = global.get_primary_monitor();
|
||||
let rtl = (St.Widget.get_default_direction () == St.TextDirection.RTL);
|
||||
|
||||
this._recalculateGridSizes();
|
||||
|
||||
@ -329,10 +306,19 @@ Overview.prototype = {
|
||||
this._workspacesHeight = Math.floor(displayGridRowHeight * workspaceRowsUsed
|
||||
- WORKSPACE_GRID_PADDING * (primary.height / primary.width) * 2);
|
||||
|
||||
this._workspacesX = displayGridColumnWidth + WORKSPACE_GRID_PADDING;
|
||||
if (rtl) {
|
||||
this._workspacesX = WORKSPACE_GRID_PADDING;
|
||||
} else {
|
||||
this._workspacesX = displayGridColumnWidth + WORKSPACE_GRID_PADDING;
|
||||
}
|
||||
this._workspacesY = Math.floor(displayGridRowHeight + WORKSPACE_GRID_PADDING * (primary.height / primary.width));
|
||||
|
||||
this._dash.actor.set_position(0, contentY);
|
||||
if (rtl) {
|
||||
this._dash.actor.set_position(primary.width - displayGridColumnWidth, contentY);
|
||||
} else {
|
||||
this._dash.actor.set_position(0, contentY);
|
||||
}
|
||||
|
||||
this._dash.actor.set_size(displayGridColumnWidth, contentHeight);
|
||||
this._dash.searchArea.height = this._workspacesY - contentY;
|
||||
this._dash.sectionArea.height = this._workspacesHeight;
|
||||
@ -344,7 +330,7 @@ Overview.prototype = {
|
||||
|
||||
// place the 'Add Workspace' button in the bottom row of the grid
|
||||
this._workspacesBarX = this._workspacesX;
|
||||
this._workspacesBarWidth = primary.width - this._workspacesBarX - WORKSPACE_GRID_PADDING;
|
||||
this._workspacesBarWidth = this._workspacesWidth;
|
||||
this._workspacesBarY = primary.height - displayGridRowHeight;
|
||||
|
||||
// The parent (this._group) is positioned at the top left of the primary monitor
|
||||
@ -356,15 +342,22 @@ Overview.prototype = {
|
||||
this._workspacesY);
|
||||
// Dynamic width
|
||||
this._paneContainer.height = this._workspacesHeight;
|
||||
if (rtl) {
|
||||
this._paneContainer.connect('notify::width', Lang.bind(this, function (paneContainer) {
|
||||
paneContainer.x = this._dash.actor.x - (DEFAULT_PADDING + paneContainer.width);
|
||||
}));
|
||||
}
|
||||
|
||||
this._transparentBackground.set_position(this._paneContainer.x, this._paneContainer.y);
|
||||
this._transparentBackground.set_size(primary.width - this._paneContainer.x,
|
||||
this._paneContainer.height);
|
||||
this._transparentBackground.set_position(primary.x, primary.y);
|
||||
this._transparentBackground.set_size(primary.width, primary.height);
|
||||
|
||||
},
|
||||
|
||||
addPane: function (pane) {
|
||||
this._paneContainer.add(pane.actor, { expand: true, y_fill: false, y_align: St.Align.START });
|
||||
addPane: function (pane, align) {
|
||||
pane.actor.height = .9 * this._workspacesHeight;
|
||||
this._paneContainer.add(pane.actor, { expand: true,
|
||||
y_fill: false,
|
||||
y_align: align });
|
||||
// When a pane is displayed, we raise the transparent background to the top
|
||||
// and connect to button-release-event on it, then raise the pane above that.
|
||||
// The idea here is that clicking anywhere outside the pane should close it.
|
||||
@ -376,10 +369,17 @@ Overview.prototype = {
|
||||
this._transparentBackground.raise_top();
|
||||
this._paneContainer.raise_top();
|
||||
this._paneContainer.show();
|
||||
this._paneReady = false;
|
||||
if (backgroundEventId != null)
|
||||
this._transparentBackground.disconnect(backgroundEventId);
|
||||
backgroundEventId = this._transparentBackground.connect('button-release-event', Lang.bind(this, function () {
|
||||
this._activeDisplayPane.close();
|
||||
backgroundEventId = this._transparentBackground.connect('captured-event', Lang.bind(this, function (actor, event) {
|
||||
if (event.get_source() != this._transparentBackground)
|
||||
return false;
|
||||
if (event.type() == Clutter.EventType.BUTTON_PRESS)
|
||||
this._paneReady = true;
|
||||
if (event.type() == Clutter.EventType.BUTTON_RELEASE
|
||||
&& this._paneReady)
|
||||
this._activeDisplayPane.close();
|
||||
return true;
|
||||
}));
|
||||
this._workspaces.actor.opacity = 64;
|
||||
@ -451,8 +451,14 @@ Overview.prototype = {
|
||||
this._dash.show();
|
||||
|
||||
/* TODO: make this stuff dynamic */
|
||||
this._workspaces = this._workspacesViewSwitch.createCurrentWorkspaceView(this._workspacesWidth, this._workspacesHeight,
|
||||
this._workspacesX, this._workspacesY, true);
|
||||
this._workspacesManager =
|
||||
new WorkspacesView.WorkspacesManager(this._workspacesWidth,
|
||||
this._workspacesHeight,
|
||||
this._workspacesX,
|
||||
this._workspacesY);
|
||||
this._workspacesManager.connect('view-changed',
|
||||
Lang.bind(this, this._onViewChanged));
|
||||
this._workspaces = this._workspacesManager.workspacesView;
|
||||
this._group.add_actor(this._workspaces.actor);
|
||||
|
||||
// The workspaces actor is as big as the screen, so we have to raise the dash above it
|
||||
@ -460,7 +466,13 @@ Overview.prototype = {
|
||||
// be as big as the screen.
|
||||
this._dash.actor.raise(this._workspaces.actor);
|
||||
|
||||
this._createControlsBar();
|
||||
this._workspacesBar = this._workspacesManager.controlsBar.actor;
|
||||
this._workspacesBar.set_position(this._workspacesBarX,
|
||||
this._workspacesBarY);
|
||||
this._workspacesBar.width = this._workspacesBarWidth;
|
||||
|
||||
this._group.add_actor(this._workspacesBar);
|
||||
this._workspacesBar.raise(this._workspaces.actor);
|
||||
|
||||
// All the the actors in the window group are completely obscured,
|
||||
// hiding the group holding them while the Overview is displayed greatly
|
||||
@ -490,7 +502,7 @@ Overview.prototype = {
|
||||
onCompleteScope: this
|
||||
});
|
||||
|
||||
// Make Dash fade in so that it doesn't appear to big.
|
||||
// Make Dash fade in so that it doesn't appear too big.
|
||||
this._dash.actor.opacity = 0;
|
||||
Tweener.addTween(this._dash.actor,
|
||||
{ opacity: 255,
|
||||
@ -512,9 +524,6 @@ Overview.prototype = {
|
||||
this._activeDisplayPane.close();
|
||||
this._workspaces.hide();
|
||||
|
||||
this._workspacesBar.destroy();
|
||||
this._workspacesBar = null;
|
||||
|
||||
// Create a zoom in effect by transforming the Overview group so that
|
||||
// the active workspace fills up the whole screen. The opposite
|
||||
// transition is used in show().
|
||||
@ -579,6 +588,11 @@ Overview.prototype = {
|
||||
this._workspaces.destroy();
|
||||
this._workspaces = null;
|
||||
|
||||
this._workspacesBar.destroy();
|
||||
this._workspacesBar = null;
|
||||
|
||||
this._workspacesManager = null;
|
||||
|
||||
this._dash.hide();
|
||||
this._group.hide();
|
||||
|
||||
|
122
js/ui/panel.js
122
js/ui/panel.js
@ -39,7 +39,7 @@ const TRAY_BORDER_WIDTH = 0;
|
||||
|
||||
const HOT_CORNER_ACTIVATION_TIMEOUT = 0.5;
|
||||
|
||||
const STANDARD_TRAY_ICON_ORDER = ['keyboard', 'volume', 'bluetooth', 'network', 'battery']
|
||||
const STANDARD_TRAY_ICON_ORDER = ['keyboard', 'volume', 'bluetooth', 'network', 'battery'];
|
||||
const STANDARD_TRAY_ICON_IMPLEMENTATIONS = {
|
||||
'bluetooth-applet': 'bluetooth',
|
||||
'gnome-volume-control-applet': 'volume',
|
||||
@ -130,7 +130,7 @@ TextShadower.prototype = {
|
||||
child.allocate(childBox, flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* AppPanelMenu:
|
||||
@ -152,15 +152,17 @@ AppPanelMenu.prototype = {
|
||||
this._activeSequence = null;
|
||||
this._startupSequences = {};
|
||||
|
||||
this.actor = new St.BoxLayout({ name: 'appMenu' });
|
||||
this._iconBox = new Shell.Slicer({ name: 'appMenuIcon' });
|
||||
this.actor.add(this._iconBox);
|
||||
this._label = new TextShadower();
|
||||
this.actor.add(this._label.actor, { expand: true, y_fill: true });
|
||||
this.actor.connect('notify::allocation', Lang.bind(this, this._repositionLabel));
|
||||
this.actor = new St.Bin({ name: 'appMenu' });
|
||||
this._container = new Shell.GenericContainer();
|
||||
this.actor.set_child(this._container);
|
||||
this._container.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
|
||||
this._container.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
|
||||
this._container.connect('allocate', Lang.bind(this, this._allocate));
|
||||
|
||||
this._startupBox = new St.BoxLayout();
|
||||
this.actor.add(this._startupBox);
|
||||
this._iconBox = new Shell.Slicer({ name: 'appMenuIcon' });
|
||||
this._container.add_actor(this._iconBox);
|
||||
this._label = new TextShadower();
|
||||
this._container.add_actor(this._label.actor);
|
||||
|
||||
Main.overview.connect('hiding', Lang.bind(this, function () {
|
||||
this.actor.opacity = 255;
|
||||
@ -181,14 +183,63 @@ AppPanelMenu.prototype = {
|
||||
this._sync();
|
||||
},
|
||||
|
||||
_repositionLabel: function() {
|
||||
this._label.actor.x = Math.floor(AppDisplay.APPICON_SIZE / 2);
|
||||
let actorAlloc = this.actor.allocation;
|
||||
let actorHeight = actorAlloc.y2 - actorAlloc.y1;
|
||||
let labelAlloc = this._label.actor.allocation;
|
||||
let labelHeight = labelAlloc.y2 - labelAlloc.y1;
|
||||
this._label.actor.y = Math.floor((actorHeight - labelHeight) / 2);
|
||||
this._label.actor.fixed_position_set = true;
|
||||
_getPreferredWidth: function(actor, forHeight, alloc) {
|
||||
let [minSize, naturalSize] = this._iconBox.get_preferred_width(forHeight);
|
||||
alloc.min_size = minSize;
|
||||
alloc.natural_size = naturalSize;
|
||||
[minSize, naturalSize] = this._label.actor.get_preferred_width(forHeight);
|
||||
alloc.min_size = alloc.min_size + Math.max(0, minSize - Math.floor(alloc.min_size / 2));
|
||||
alloc.natural_size = alloc.natural_size + Math.max(0, naturalSize - Math.floor(alloc.natural_size / 2));
|
||||
},
|
||||
|
||||
_getPreferredHeight: function(actor, forWidth, alloc) {
|
||||
let [minSize, naturalSize] = this._iconBox.get_preferred_height(forWidth);
|
||||
alloc.min_size = minSize;
|
||||
alloc.natural_size = naturalSize;
|
||||
[minSize, naturalSize] = this._label.actor.get_preferred_height(forWidth);
|
||||
if (minSize > alloc.min_size)
|
||||
alloc.min_size = minSize;
|
||||
if (naturalSize > alloc.natural_size)
|
||||
alloc.natural_size = naturalSize;
|
||||
},
|
||||
|
||||
_allocate: function(actor, box, flags) {
|
||||
let allocWidth = box.x2 - box.x1;
|
||||
let allocHeight = box.y2 - box.y1;
|
||||
let childBox = new Clutter.ActorBox();
|
||||
|
||||
let [minWidth, minHeight, naturalWidth, naturalHeight] = this._iconBox.get_preferred_size();
|
||||
|
||||
let direction = this.actor.get_direction();
|
||||
|
||||
let yPadding = Math.floor(Math.max(0, allocHeight - naturalHeight) / 2);
|
||||
childBox.y1 = yPadding;
|
||||
childBox.y2 = childBox.y1 + Math.min(naturalHeight, allocHeight);
|
||||
if (direction == St.TextDirection.LTR) {
|
||||
childBox.x1 = 0;
|
||||
childBox.x2 = childBox.x1 + Math.min(naturalWidth, allocWidth);
|
||||
} else {
|
||||
childBox.x1 = Math.max(0, allocWidth - naturalWidth);
|
||||
childBox.x2 = allocWidth;
|
||||
}
|
||||
this._iconBox.allocate(childBox, flags);
|
||||
|
||||
let iconWidth = childBox.x2 - childBox.x1;
|
||||
|
||||
[minWidth, minHeight, naturalWidth, naturalHeight] = this._label.actor.get_preferred_size();
|
||||
|
||||
yPadding = Math.floor(Math.max(0, allocHeight - naturalHeight) / 2);
|
||||
childBox.y1 = yPadding;
|
||||
childBox.y2 = childBox.y1 + Math.min(naturalHeight, allocHeight);
|
||||
|
||||
if (direction == St.TextDirection.LTR) {
|
||||
childBox.x1 = Math.floor(iconWidth / 2);
|
||||
childBox.x2 = Math.min(childBox.x1 + naturalWidth, allocWidth);
|
||||
} else {
|
||||
childBox.x2 = allocWidth - Math.floor(iconWidth / 2);
|
||||
childBox.x1 = Math.max(0, childBox.x2 - naturalWidth);
|
||||
}
|
||||
this._label.actor.allocate(childBox, flags);
|
||||
},
|
||||
|
||||
_sync: function() {
|
||||
@ -220,7 +271,7 @@ AppPanelMenu.prototype = {
|
||||
this._label.setText('');
|
||||
let icon;
|
||||
if (this._focusedApp != null) {
|
||||
icon = this._focusedApp.create_icon_texture(AppDisplay.APPICON_SIZE);
|
||||
icon = this._focusedApp.get_faded_icon(AppDisplay.APPICON_SIZE);
|
||||
this._label.setText(this._focusedApp.get_name());
|
||||
} else if (this._activeSequence != null) {
|
||||
icon = this._activeSequence.create_icon(AppDisplay.APPICON_SIZE);
|
||||
@ -228,17 +279,15 @@ AppPanelMenu.prototype = {
|
||||
} else {
|
||||
icon = null;
|
||||
}
|
||||
|
||||
|
||||
if (icon != null) {
|
||||
let faded = Shell.fade_app_icon(icon); /* TODO consider caching */
|
||||
this._iconBox.set_child(faded);
|
||||
this._iconBox.set_child(icon);
|
||||
this._iconBox.show();
|
||||
}
|
||||
this._repositionLabel();
|
||||
|
||||
this.emit('changed');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Signals.addSignalMethods(AppPanelMenu.prototype);
|
||||
|
||||
@ -553,15 +602,22 @@ Panel.prototype = {
|
||||
displayDate.setMinutes(displayDate.getMinutes() + 1);
|
||||
msecRemaining += 60000;
|
||||
}
|
||||
/* If there is no am or pm, time format is 24h */
|
||||
let isTime24h = displayDate.toLocaleFormat("x%p") == "x";
|
||||
if (isTime24h) {
|
||||
/* Translators: This is the time format used in 24-hour mode. */
|
||||
this._clock.set_text(displayDate.toLocaleFormat(_("%a %R")));
|
||||
} else {
|
||||
/* Translators: This is a time format used for AM/PM. */
|
||||
this._clock.set_text(displayDate.toLocaleFormat(_("%a %l:%M %p")));
|
||||
}
|
||||
|
||||
// if the locale representations of 05:00 and 17:00 do not
|
||||
// start with the same 2 digits, it must be a 24h clock
|
||||
let fiveAm = new Date();
|
||||
fiveAm.setHours(5);
|
||||
let fivePm = new Date();
|
||||
fivePm.setHours(17);
|
||||
let isTime24h = fiveAm.toLocaleFormat("%X").substr(0,2) !=
|
||||
fivePm.toLocaleFormat("%X").substr(0,2);
|
||||
if (isTime24h) {
|
||||
/* Translators: This is the time format used in 24-hour mode. */
|
||||
this._clock.set_text(displayDate.toLocaleFormat(_("%a %R")));
|
||||
} else {
|
||||
/* Translators: This is a time format used for AM/PM. */
|
||||
this._clock.set_text(displayDate.toLocaleFormat(_("%a %l:%M %p")));
|
||||
}
|
||||
Mainloop.timeout_add(msecRemaining, Lang.bind(this, this._updateClock));
|
||||
return false;
|
||||
},
|
||||
|
@ -59,7 +59,7 @@ PlaceInfo.prototype = {
|
||||
isRemovable: function() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function PlaceDeviceInfo(mount) {
|
||||
this._init(mount);
|
||||
@ -77,7 +77,7 @@ PlaceDeviceInfo.prototype = {
|
||||
|
||||
iconFactory: function(size) {
|
||||
let icon = this._mount.get_icon();
|
||||
return Shell.TextureCache.get_default().load_gicon(icon, size);
|
||||
return St.TextureCache.get_default().load_gicon(icon, size);
|
||||
},
|
||||
|
||||
launch: function() {
|
||||
@ -93,13 +93,20 @@ PlaceDeviceInfo.prototype = {
|
||||
if (!this.isRemovable())
|
||||
return;
|
||||
|
||||
this._mount.unmount(0, null, Lang.bind(this, this._removeFinish), null);
|
||||
this._mount.unmount(0, null, Lang.bind(this, this._removeFinish));
|
||||
},
|
||||
|
||||
_removeFinish: function(o, res, data) {
|
||||
this._mount.unmount_finish(res);
|
||||
try {
|
||||
this._mount.unmount_finish(res);
|
||||
} catch (e) {
|
||||
let message = _("Failed to unmount '%s'").format(o.get_name());
|
||||
Main.overview.infoBar.setMessage(message,
|
||||
Lang.bind(this, this.remove),
|
||||
_("Retry"));
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function PlacesManager() {
|
||||
@ -122,7 +129,7 @@ PlacesManager.prototype = {
|
||||
let homeIcon = Shell.util_get_icon_for_uri (homeUri);
|
||||
this._home = new PlaceInfo('special:home', homeLabel,
|
||||
function(size) {
|
||||
return Shell.TextureCache.get_default().load_gicon(homeIcon, size);
|
||||
return St.TextureCache.get_default().load_gicon(homeIcon, size);
|
||||
},
|
||||
function() {
|
||||
Gio.app_info_launch_default_for_uri(homeUri, global.create_app_launch_context());
|
||||
@ -135,7 +142,7 @@ PlacesManager.prototype = {
|
||||
let desktopIcon = Shell.util_get_icon_for_uri (desktopUri);
|
||||
this._desktopMenu = new PlaceInfo('special:desktop', desktopLabel,
|
||||
function(size) {
|
||||
return Shell.TextureCache.get_default().load_gicon(desktopIcon, size);
|
||||
return St.TextureCache.get_default().load_gicon(desktopIcon, size);
|
||||
},
|
||||
function() {
|
||||
Gio.app_info_launch_default_for_uri(desktopUri, global.create_app_launch_context());
|
||||
@ -143,7 +150,7 @@ PlacesManager.prototype = {
|
||||
|
||||
this._connect = new PlaceInfo('special:connect', _("Connect to..."),
|
||||
function (size) {
|
||||
return Shell.TextureCache.get_default().load_icon_name("applications-internet", size);
|
||||
return St.TextureCache.get_default().load_icon_name("applications-internet", size);
|
||||
},
|
||||
function () {
|
||||
new Shell.Process({ args: ['nautilus-connect-server'] }).run();
|
||||
@ -310,7 +317,7 @@ PlacesManager.prototype = {
|
||||
|
||||
let item = new PlaceInfo('bookmark:' + bookmark, label,
|
||||
function(size) {
|
||||
return Shell.TextureCache.get_default().load_gicon(icon, size);
|
||||
return St.TextureCache.get_default().load_gicon(icon, size);
|
||||
},
|
||||
function() {
|
||||
Gio.app_info_launch_default_for_uri(bookmark, global.create_app_launch_context());
|
||||
@ -401,31 +408,45 @@ DashPlaceDisplayItem.prototype = {
|
||||
this.name = info.name;
|
||||
this._info = info;
|
||||
this._icon = info.iconFactory(PLACES_ICON_SIZE);
|
||||
this.actor = new Big.Box({ orientation: Big.BoxOrientation.HORIZONTAL,
|
||||
spacing: 4 });
|
||||
let text = new St.Button({ style_class: 'places-item',
|
||||
label: info.name,
|
||||
x_align: St.Align.START });
|
||||
text.connect('clicked', Lang.bind(this, this._onClicked));
|
||||
let iconBox = new St.Bin({ child: this._icon, reactive: true });
|
||||
iconBox.connect('button-release-event',
|
||||
Lang.bind(this, this._onClicked));
|
||||
this.actor.append(iconBox, Big.BoxPackFlags.NONE);
|
||||
this.actor.append(text, Big.BoxPackFlags.EXPAND);
|
||||
|
||||
this.actor = new St.Clickable({ style_class: 'places-item',
|
||||
reactive: true,
|
||||
x_align: St.Align.START,
|
||||
x_fill: true });
|
||||
|
||||
let box = new St.BoxLayout({ style_class: 'places-item-box' });
|
||||
this.actor.set_child(box);
|
||||
|
||||
let bin = new St.Bin({ child: this._icon });
|
||||
box.add(bin);
|
||||
|
||||
let text = new St.Label({ text: info.name });
|
||||
box.add(text, { expand: true, x_fill: true });
|
||||
|
||||
if (info.isRemovable()) {
|
||||
let removeIcon = Shell.TextureCache.get_default().load_icon_name ('media-eject', PLACES_ICON_SIZE);
|
||||
let removeIconBox = new St.Button({ child: removeIcon,
|
||||
reactive: true });
|
||||
this.actor.append(removeIconBox, Big.BoxPackFlags.NONE);
|
||||
let removeIcon = St.TextureCache.get_default().load_icon_name ('media-eject', PLACES_ICON_SIZE);
|
||||
let removeIconBox = new St.Clickable({ child: removeIcon,
|
||||
reactive: true });
|
||||
box.add(removeIconBox);
|
||||
removeIconBox.connect('clicked',
|
||||
Lang.bind(this, function() {
|
||||
this._info.remove();
|
||||
}));
|
||||
}
|
||||
|
||||
this.actor.connect('clicked', Lang.bind(this, this._onClicked));
|
||||
this.actor.connect('notify::hover',
|
||||
Lang.bind(this, this._onHoverChanged));
|
||||
this.actor.connect('button-press-event',
|
||||
Lang.bind(this, this._onButtonPress));
|
||||
this.actor.connect('button-release-event',
|
||||
Lang.bind(this, this._onButtonRelease));
|
||||
|
||||
this.actor._delegate = this;
|
||||
let draggable = DND.makeDraggable(this.actor);
|
||||
this._dragStartX = null;
|
||||
this._dragStartY = null;
|
||||
this._draggable = DND.makeDraggable(this.actor,
|
||||
{ manualMode: true });
|
||||
},
|
||||
|
||||
_onClicked: function(b) {
|
||||
@ -433,6 +454,36 @@ DashPlaceDisplayItem.prototype = {
|
||||
Main.overview.hide();
|
||||
},
|
||||
|
||||
_onButtonPress: function(actor, event) {
|
||||
if (event.get_button() != 1)
|
||||
return false;
|
||||
|
||||
let [stageX, stageY] = event.get_coords();
|
||||
this._dragStartX = stageX;
|
||||
this._dragStartY = stageY;
|
||||
return false;
|
||||
},
|
||||
|
||||
_onButtonRelease: function(actor, event) {
|
||||
if (event.get_button() != 1)
|
||||
return false;
|
||||
|
||||
this._dragStartX = null;
|
||||
this._dragStartY = null;
|
||||
return false;
|
||||
},
|
||||
|
||||
_onHoverChanged: function(button) {
|
||||
let hover = button.hover;
|
||||
if (!hover) {
|
||||
if (button.pressed && this._dragStartX != null) {
|
||||
button.fake_release();
|
||||
this._draggable.startDrag(this._dragStartX, this._dragStartY,
|
||||
global.get_current_time());
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
getDragActorSource: function() {
|
||||
return this._icon;
|
||||
},
|
||||
@ -581,4 +632,4 @@ PlaceSearchProvider.prototype = {
|
||||
let places = previousResults.map(function (id) { return Main.placesManager.lookupPlaceById(id); });
|
||||
return this._searchPlaces(places, terms);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -7,6 +7,7 @@ const GLib = imports.gi.GLib;
|
||||
const Lang = imports.lang;
|
||||
const Mainloop = imports.mainloop;
|
||||
const Meta = imports.gi.Meta;
|
||||
const St = imports.gi.St;
|
||||
const Shell = imports.gi.Shell;
|
||||
const Signals = imports.signals;
|
||||
const Gettext = imports.gettext.domain('gnome-shell');
|
||||
@ -15,18 +16,11 @@ const _ = Gettext.gettext;
|
||||
const Lightbox = imports.ui.lightbox;
|
||||
const Main = imports.ui.main;
|
||||
|
||||
const BOX_BACKGROUND_COLOR = new Clutter.Color();
|
||||
BOX_BACKGROUND_COLOR.from_pixel(0x000000cc);
|
||||
|
||||
const BOX_TEXT_COLOR = new Clutter.Color();
|
||||
BOX_TEXT_COLOR.from_pixel(0xffffffff);
|
||||
|
||||
const DIALOG_WIDTH = 320;
|
||||
const DIALOG_PADDING = 6;
|
||||
const ICON_SIZE = 24;
|
||||
const ICON_BOX_SIZE = 36;
|
||||
const MAX_FILE_DELETED_BEFORE_INVALID = 10;
|
||||
|
||||
const HISTORY_KEY = 'run_dialog/history';
|
||||
const HISTORY_LIMIT = 512;
|
||||
|
||||
function CommandCompleter() {
|
||||
this._init();
|
||||
}
|
||||
@ -35,6 +29,7 @@ CommandCompleter.prototype = {
|
||||
_init : function() {
|
||||
this._changedCount = 0;
|
||||
this._paths = GLib.getenv('PATH').split(':');
|
||||
this._paths.push(GLib.get_home_dir());
|
||||
this._valid = false;
|
||||
this._updateInProgress = false;
|
||||
this._childs = new Array(this._paths.length);
|
||||
@ -68,7 +63,7 @@ CommandCompleter.prototype = {
|
||||
|
||||
_onGetEnumerateComplete : function(obj, res) {
|
||||
this._enumerator = obj.enumerate_children_finish(res);
|
||||
this._enumerator.next_files_async(100, GLib.PRIORITY_LOW, null, Lang.bind(this, this._onNextFileComplete), null);
|
||||
this._enumerator.next_files_async(100, GLib.PRIORITY_LOW, null, Lang.bind(this, this._onNextFileComplete));
|
||||
},
|
||||
|
||||
_onNextFileComplete : function(obj, res) {
|
||||
@ -77,7 +72,7 @@ CommandCompleter.prototype = {
|
||||
this._childs[this._i].push(files[i].get_name());
|
||||
}
|
||||
if (files.length) {
|
||||
this._enumerator.next_files_async(100, GLib.PRIORITY_LOW, null, Lang.bind(this, this._onNextFileComplete), null);
|
||||
this._enumerator.next_files_async(100, GLib.PRIORITY_LOW, null, Lang.bind(this, this._onNextFileComplete));
|
||||
} else {
|
||||
this._enumerator.close(null);
|
||||
this._enumerator = null;
|
||||
@ -104,7 +99,7 @@ CommandCompleter.prototype = {
|
||||
}
|
||||
let file = Gio.file_new_for_path(this._paths[i]);
|
||||
this._childs[this._i] = [];
|
||||
file.enumerate_children_async(Gio.FILE_ATTRIBUTE_STANDARD_NAME, Gio.FileQueryInfoFlags.NONE, GLib.PRIORITY_LOW, null, Lang.bind(this, this._onGetEnumerateComplete), null);
|
||||
file.enumerate_children_async(Gio.FILE_ATTRIBUTE_STANDARD_NAME, Gio.FileQueryInfoFlags.NONE, GLib.PRIORITY_LOW, null, Lang.bind(this, this._onGetEnumerateComplete));
|
||||
},
|
||||
|
||||
_onChanged : function(m, f, of, type) {
|
||||
@ -176,17 +171,25 @@ CommandCompleter.prototype = {
|
||||
|
||||
function RunDialog() {
|
||||
this._init();
|
||||
};
|
||||
}
|
||||
|
||||
RunDialog.prototype = {
|
||||
_init : function() {
|
||||
this._isOpen = false;
|
||||
|
||||
let gconf = Shell.GConf.get_default();
|
||||
gconf.connect('changed::development_tools', Lang.bind(this, function () {
|
||||
this._enableInternalCommands = gconf.get_boolean('development_tools');
|
||||
this._gconf = Shell.GConf.get_default();
|
||||
this._gconf.connect('changed::development_tools', Lang.bind(this, function () {
|
||||
this._enableInternalCommands = this._gconf.get_boolean('development_tools');
|
||||
}));
|
||||
this._enableInternalCommands = this._gconf.get_boolean('development_tools');
|
||||
|
||||
this._history = this._gconf.get_string_list(HISTORY_KEY);
|
||||
this._historyIndex = -1;
|
||||
|
||||
this._gconf.connect('changed::' + HISTORY_KEY, Lang.bind(this, function() {
|
||||
this._history = this._gconf.get_string_list(HISTORY_KEY);
|
||||
this._historyIndex = this._history.length;
|
||||
}));
|
||||
this._enableInternalCommands = gconf.get_boolean('development_tools');
|
||||
|
||||
this._internalCommands = { 'lg':
|
||||
Lang.bind(this, function() {
|
||||
@ -210,87 +213,69 @@ RunDialog.prototype = {
|
||||
// All actors are inside _group. We create it initially
|
||||
// hidden then show it in show()
|
||||
this._group = new Clutter.Group({ visible: false,
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: global.screen_width,
|
||||
height: global.screen_height });
|
||||
x: 0, y: 0 });
|
||||
global.stage.add_actor(this._group);
|
||||
|
||||
let lightbox = new Lightbox.Lightbox(this._group, true);
|
||||
|
||||
this._boxH = new Big.Box({ orientation: Big.BoxOrientation.HORIZONTAL,
|
||||
x_align: Big.BoxAlignment.CENTER,
|
||||
y_align: Big.BoxAlignment.CENTER });
|
||||
this._box = new St.Bin({ x_align: St.Align.MIDDLE,
|
||||
y_align: St.Align.MIDDLE });
|
||||
|
||||
this._group.add_actor(this._boxH);
|
||||
lightbox.highlight(this._boxH);
|
||||
this._group.add_actor(this._box);
|
||||
lightbox.highlight(this._box);
|
||||
|
||||
let boxV = new Big.Box({ orientation: Big.BoxOrientation.VERTICAL,
|
||||
y_align: Big.BoxAlignment.CENTER });
|
||||
let dialogBox = new St.BoxLayout({ style_class: 'run-dialog', vertical: true });
|
||||
|
||||
this._boxH.append(boxV, Big.BoxPackFlags.NONE);
|
||||
this._box.set_child(dialogBox);
|
||||
|
||||
let label = new St.Label({ style_class: 'run-dialog-label',
|
||||
text: _("Please enter a command:") });
|
||||
|
||||
let dialogBox = new Big.Box({ orientation: Big.BoxOrientation.VERTICAL,
|
||||
background_color: BOX_BACKGROUND_COLOR,
|
||||
corner_radius: 4,
|
||||
reactive: false,
|
||||
padding: DIALOG_PADDING,
|
||||
width: DIALOG_WIDTH });
|
||||
dialogBox.add(label, { expand: true, y_fill: false });
|
||||
|
||||
this._boxH.append(dialogBox, Big.BoxPackFlags.NONE);
|
||||
let entry = new St.Entry({ style_class: 'run-dialog-entry' });
|
||||
|
||||
let label = new Clutter.Text({ color: BOX_TEXT_COLOR,
|
||||
font_name: '18px Sans',
|
||||
text: _("Please enter a command:") });
|
||||
this._entryText = entry.clutter_text;
|
||||
dialogBox.add(entry, { expand: true });
|
||||
|
||||
dialogBox.append(label, Big.BoxPackFlags.EXPAND);
|
||||
this._errorBox = new St.BoxLayout();
|
||||
|
||||
this._entry = new Clutter.Text({ color: BOX_TEXT_COLOR,
|
||||
font_name: '20px Sans Bold',
|
||||
editable: true,
|
||||
activatable: true,
|
||||
singleLineMode: true });
|
||||
dialogBox.add(this._errorBox, { expand: true });
|
||||
|
||||
dialogBox.append(this._entry, Big.BoxPackFlags.EXPAND);
|
||||
let errorIcon = new St.Button({ style_class: 'run-dialog-error-icon' });
|
||||
|
||||
this._errorBox = new Big.Box({ orientation: Big.BoxOrientation.HORIZONTAL,
|
||||
padding_top: DIALOG_PADDING });
|
||||
|
||||
dialogBox.append(this._errorBox, Big.BoxPackFlags.EXPAND);
|
||||
|
||||
let iconBox = new Big.Box({ orientation: Big.BoxOrientation.VERTICAL,
|
||||
y_align: Big.BoxAlignment.CENTER,
|
||||
x_align: Big.BoxAlignment.CENTER,
|
||||
width: ICON_BOX_SIZE,
|
||||
height: ICON_BOX_SIZE });
|
||||
|
||||
this._errorBox.append(iconBox, Big.BoxPackFlags.NONE);
|
||||
this._errorBox.add(errorIcon);
|
||||
|
||||
this._commandError = false;
|
||||
|
||||
let errorIcon = Shell.TextureCache.get_default().load_icon_name("gtk-dialog-error", ICON_SIZE);
|
||||
iconBox.append(errorIcon, Big.BoxPackFlags.EXPAND);
|
||||
this._errorMessage = new St.Label({ style_class: 'run-dialog-error-label' });
|
||||
this._errorMessage.clutter_text.line_wrap = true;
|
||||
|
||||
this._errorMessage = new Clutter.Text({ color: BOX_TEXT_COLOR,
|
||||
font_name: '18px Sans Bold',
|
||||
line_wrap: true });
|
||||
|
||||
this._errorBox.append(this._errorMessage, Big.BoxPackFlags.EXPAND);
|
||||
this._errorBox.add(this._errorMessage, { expand: true });
|
||||
|
||||
this._errorBox.hide();
|
||||
|
||||
this._entry.connect('activate', Lang.bind(this, function (o, e) {
|
||||
this._run(o.get_text());
|
||||
if (!this._commandError)
|
||||
this.close();
|
||||
}));
|
||||
|
||||
this._pathCompleter = new Gio.FilenameCompleter();
|
||||
this._commandCompleter = new CommandCompleter();
|
||||
this._group.connect('notify::visible', Lang.bind(this._commandCompleter, this._commandCompleter.update));
|
||||
this._entry.connect('key-press-event', Lang.bind(this, function(o, e) {
|
||||
this._entryText.connect('key-press-event', Lang.bind(this, function(o, e) {
|
||||
let symbol = e.get_key_symbol();
|
||||
if (symbol == Clutter.Down) {
|
||||
this._setCommandFromHistory(this._historyIndex++);
|
||||
return true;
|
||||
}
|
||||
if (symbol == Clutter.Up) {
|
||||
this._setCommandFromHistory(this._historyIndex--);
|
||||
return true;
|
||||
}
|
||||
if (symbol == Clutter.Return) {
|
||||
if (e.get_state() & Clutter.ModifierType.CONTROL_MASK)
|
||||
this._run(o.get_text(), true);
|
||||
else
|
||||
this._run(o.get_text(), false);
|
||||
if (!this._commandError)
|
||||
this.close();
|
||||
}
|
||||
if (symbol == Clutter.Escape) {
|
||||
this.close();
|
||||
return true;
|
||||
@ -335,36 +320,82 @@ RunDialog.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
_run : function(command) {
|
||||
_saveHistory : function() {
|
||||
if (this._history.length > HISTORY_LIMIT) {
|
||||
this._history.splice(0, this._history.length - HISTORY_LIMIT);
|
||||
}
|
||||
this._gconf.set_string_list(HISTORY_KEY, this._history);
|
||||
},
|
||||
|
||||
_run : function(input, inTerminal) {
|
||||
let command = input;
|
||||
|
||||
this._history.push(input);
|
||||
this._saveHistory();
|
||||
|
||||
this._commandError = false;
|
||||
let f;
|
||||
if (this._enableInternalCommands)
|
||||
f = this._internalCommands[command];
|
||||
f = this._internalCommands[input];
|
||||
else
|
||||
f = null;
|
||||
if (f) {
|
||||
f();
|
||||
} else if (command) {
|
||||
} else if (input) {
|
||||
try {
|
||||
if (inTerminal)
|
||||
command = 'gnome-terminal -x ' + input;
|
||||
let [ok, len, args] = GLib.shell_parse_argv(command);
|
||||
let p = new Shell.Process({'args' : args});
|
||||
let p = new Shell.Process({ 'args' : args });
|
||||
p.run();
|
||||
} catch (e) {
|
||||
this._commandError = true;
|
||||
/*
|
||||
* The exception contains an error string like:
|
||||
* Error invoking Shell.run: Failed to execute child process "foo"
|
||||
* (No such file or directory)
|
||||
* We are only interested in the actual error, so parse that out.
|
||||
*/
|
||||
let m = /.+\((.+)\)/.exec(e);
|
||||
let errorStr = _("Execution of '%s' failed:").format(command) + "\n" + m[1];
|
||||
this._errorMessage.set_text(errorStr);
|
||||
this._errorBox.show();
|
||||
// Mmmh, that failed - see if @input matches an existing file
|
||||
let path = null;
|
||||
if (input.charAt(0) == '/') {
|
||||
path = input;
|
||||
} else {
|
||||
if (input.charAt(0) == '~')
|
||||
input = input.slice(1);
|
||||
path = GLib.get_home_dir() + '/' + input;
|
||||
}
|
||||
|
||||
if (GLib.file_test(path, GLib.FileTest.EXISTS)) {
|
||||
let file = Gio.file_new_for_path(path);
|
||||
Gio.app_info_launch_default_for_uri(file.get_uri(),
|
||||
global.create_app_launch_context());
|
||||
} else {
|
||||
this._commandError = true;
|
||||
// The exception contains an error string like:
|
||||
// Error invoking Shell.run: Failed to execute child
|
||||
// process "foo" (No such file or directory)
|
||||
// We are only interested in the actual error, so parse
|
||||
//that out.
|
||||
let m = /.+\((.+)\)/.exec(e);
|
||||
let errorStr = _("Execution of '%s' failed:").format(command) + "\n" + m[1];
|
||||
this._errorMessage.set_text(errorStr);
|
||||
|
||||
this._errorBox.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_setCommandFromHistory: function(lastI) {
|
||||
if (this._historyIndex < 0)
|
||||
this._historyIndex = 0;
|
||||
if (this._historyIndex > this._history.length)
|
||||
this._historyIndex = this._history.length;
|
||||
|
||||
let text = this._entryText.get_text();
|
||||
if (text) {
|
||||
this._history[lastI] = text;
|
||||
}
|
||||
if (this._history[this._historyIndex]) {
|
||||
this._entryText.set_text(this._history[this._historyIndex]);
|
||||
} else
|
||||
this._entryText.set_text('');
|
||||
},
|
||||
|
||||
open : function() {
|
||||
if (this._isOpen) // Already shown
|
||||
return;
|
||||
@ -375,13 +406,15 @@ RunDialog.prototype = {
|
||||
// Position the dialog on the current monitor
|
||||
let monitor = global.get_focus_monitor();
|
||||
|
||||
this._boxH.set_position(monitor.x, monitor.y);
|
||||
this._boxH.set_size(monitor.width, monitor.height);
|
||||
this._historyIndex = this._history.length;
|
||||
|
||||
this._box.set_position(monitor.x, monitor.y);
|
||||
this._box.set_size(monitor.width, monitor.height);
|
||||
|
||||
this._isOpen = true;
|
||||
this._group.show();
|
||||
|
||||
global.stage.set_key_focus(this._entry);
|
||||
global.stage.set_key_focus(this._entryText);
|
||||
},
|
||||
|
||||
close : function() {
|
||||
@ -389,12 +422,12 @@ RunDialog.prototype = {
|
||||
return;
|
||||
|
||||
this._isOpen = false;
|
||||
|
||||
|
||||
this._errorBox.hide();
|
||||
this._commandError = false;
|
||||
|
||||
this._group.hide();
|
||||
this._entry.set_text('');
|
||||
this._entryText.set_text('');
|
||||
|
||||
Main.popModal(this._group);
|
||||
}
|
||||
|
@ -80,6 +80,13 @@ SearchResultDisplay.prototype = {
|
||||
*/
|
||||
selectIndex: function() {
|
||||
throw new Error("not implemented");
|
||||
},
|
||||
|
||||
/**
|
||||
* Activate the currently selected search result.
|
||||
*/
|
||||
activateSelected: function() {
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
};
|
||||
|
||||
@ -200,7 +207,7 @@ SearchProvider.prototype = {
|
||||
expandSearch: function(terms) {
|
||||
throw new Error("not implemented");
|
||||
}
|
||||
}
|
||||
};
|
||||
Signals.addSignalMethods(SearchProvider.prototype);
|
||||
|
||||
function SearchSystem() {
|
||||
@ -268,5 +275,5 @@ SearchSystem.prototype = {
|
||||
|
||||
return results;
|
||||
}
|
||||
}
|
||||
};
|
||||
Signals.addSignalMethods(SearchSystem.prototype);
|
||||
|
@ -36,7 +36,7 @@ StatusMenu.prototype = {
|
||||
this._iconBox = new St.Bin();
|
||||
this.actor.add(this._iconBox, { y_align: St.Align.MIDDLE });
|
||||
|
||||
let textureCache = Shell.TextureCache.get_default();
|
||||
let textureCache = St.TextureCache.get_default();
|
||||
// FIXME: these icons are all wrong (likewise in createSubMenu)
|
||||
this._availableIcon = textureCache.load_icon_name('gtk-yes', 16);
|
||||
this._busyIcon = textureCache.load_icon_name('gtk-no', 16);
|
||||
@ -233,7 +233,12 @@ StatusMenu.prototype = {
|
||||
let [panelX, panelY] = panel.get_transformed_position();
|
||||
let [panelWidth, panelHeight] = panel.get_transformed_size();
|
||||
|
||||
let menuX = Math.round(panelX + panelWidth - menuWidth);
|
||||
let menuX;
|
||||
if (St.Widget.get_default_direction() == St.TextDirection.RTL) {
|
||||
menuX = panelX;
|
||||
} else {
|
||||
menuX = Math.round(panelX + panelWidth - menuWidth);
|
||||
}
|
||||
let menuY = Math.round(panelY + panelHeight);
|
||||
|
||||
Shell.popup_menu(this._menu, event.get_button(), event.get_time(),
|
||||
|
@ -9,6 +9,7 @@ const Lang = imports.lang;
|
||||
const Pango = imports.gi.Pango;
|
||||
const Shell = imports.gi.Shell;
|
||||
const Signals = imports.signals;
|
||||
const St = imports.gi.St;
|
||||
const Gettext = imports.gettext.domain('gnome-shell');
|
||||
const _ = Gettext.gettext;
|
||||
|
||||
@ -117,10 +118,9 @@ ClockWidget.prototype = {
|
||||
// it's the same in both modes
|
||||
height: COLLAPSED_WIDTH });
|
||||
|
||||
this.collapsedActor = new Clutter.CairoTexture({ width: COLLAPSED_WIDTH,
|
||||
height: COLLAPSED_WIDTH,
|
||||
surface_width: COLLAPSED_WIDTH,
|
||||
surface_height: COLLAPSED_WIDTH });
|
||||
this.collapsedActor = new St.DrawingArea({ width: COLLAPSED_WIDTH,
|
||||
height: COLLAPSED_WIDTH });
|
||||
this.collapsedActor.connect('repaint', Lang.bind(this, this._repaintClock));
|
||||
|
||||
this._update();
|
||||
},
|
||||
@ -139,18 +139,18 @@ ClockWidget.prototype = {
|
||||
},
|
||||
|
||||
_update: function() {
|
||||
let time = new Date();
|
||||
let msec_remaining = 60000 - (1000 * time.getSeconds() +
|
||||
time.getMilliseconds());
|
||||
this.currentTime = new Date();
|
||||
let msec_remaining = 60000 - (1000 * this.currentTime.getSeconds() +
|
||||
this.currentTime.getMilliseconds());
|
||||
if (msec_remaining < 500) {
|
||||
time.setMinutes(time.getMinutes() + 1);
|
||||
this.currentTime.setMinutes(this.currentTime.getMinutes() + 1);
|
||||
msec_remaining += 60000;
|
||||
}
|
||||
|
||||
if (this.state == STATE_COLLAPSED || this.state == STATE_COLLAPSING)
|
||||
this._updateCairo(time);
|
||||
this.collapsedActor.queue_repaint();
|
||||
else
|
||||
this._updateText(time);
|
||||
this._updateText();
|
||||
|
||||
if (this.timer)
|
||||
Mainloop.source_remove(this.timer);
|
||||
@ -160,13 +160,13 @@ ClockWidget.prototype = {
|
||||
|
||||
_updateText: function(time) {
|
||||
// Translators: This is a time format.
|
||||
this.actor.set_text(time.toLocaleFormat(_("%H:%M")));
|
||||
this.actor.set_text(this.currentTime.toLocaleFormat(_("%H:%M")));
|
||||
},
|
||||
|
||||
_updateCairo: function(time) {
|
||||
Shell.draw_clock(this.collapsedActor,
|
||||
time.getHours() % 12,
|
||||
time.getMinutes());
|
||||
_repaintClock: function(area) {
|
||||
Shell.draw_clock(area,
|
||||
this.currentTime.getHours() % 12,
|
||||
this.currentTime.getMinutes());
|
||||
}
|
||||
};
|
||||
|
||||
@ -302,7 +302,7 @@ AppsWidgetInfo.prototype = {
|
||||
launch : function() {
|
||||
this._info.launch();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function AppsWidget() {
|
||||
this._init.apply(this, arguments);
|
||||
|
@ -196,7 +196,7 @@ WidgetBox.prototype = {
|
||||
this._egroup.show();
|
||||
|
||||
if (this._singleActor) {
|
||||
this._widget.actor.unparent();
|
||||
this._widget.actor.get_parent().remove_actor(this._widget.actor);
|
||||
this._ebox.append(this._widget.actor, Big.BoxPackFlags.NONE);
|
||||
}
|
||||
|
||||
@ -244,7 +244,7 @@ WidgetBox.prototype = {
|
||||
this._cgroup.show();
|
||||
|
||||
if (this._singleActor) {
|
||||
this._widget.actor.unparent();
|
||||
this._widget.actor.get_parent().remove_actor(this._widget.actor);
|
||||
this._cbox.append(this._widget.actor, Big.BoxPackFlags.NONE);
|
||||
}
|
||||
|
||||
|
@ -77,12 +77,12 @@ WindowAttentionHandler.prototype = {
|
||||
window.connect('notify::title', Lang.bind(this, function(win) {
|
||||
notification.update(this._getTitle(app, win), this._getBanner(app, win), false);
|
||||
}));
|
||||
window.connect('notify::demands-attention', Lang.bind(this, function() { source.destroy() }));
|
||||
window.connect('focus', Lang.bind(this, function() { source.destroy() }));
|
||||
window.connect('unmanaged', Lang.bind(this, function() { source.destroy() }));
|
||||
window.connect('notify::demands-attention', Lang.bind(this, function() { source.destroy(); }));
|
||||
window.connect('focus', Lang.bind(this, function() { source.destroy(); }));
|
||||
window.connect('unmanaged', Lang.bind(this, function() { source.destroy(); }));
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function Source(sourceId, app, window) {
|
||||
this._init(sourceId, app, window);
|
||||
@ -106,4 +106,4 @@ Source.prototype = {
|
||||
MessageTray.Source.prototype.clicked.call(this);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
@ -5,6 +5,7 @@ const Lang = imports.lang;
|
||||
const Mainloop = imports.mainloop;
|
||||
const Meta = imports.gi.Meta;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
|
||||
const AltTab = imports.ui.altTab;
|
||||
const WorkspaceSwitcherPopup = imports.ui.workspaceSwitcherPopup;
|
||||
@ -19,8 +20,9 @@ function WindowManager() {
|
||||
|
||||
WindowManager.prototype = {
|
||||
_init : function() {
|
||||
let shellwm = global.window_manager;
|
||||
this._shellwm = global.window_manager;
|
||||
|
||||
this._keyBindingHandlers = [];
|
||||
this._minimizing = [];
|
||||
this._maximizing = [];
|
||||
this._unmaximizing = [];
|
||||
@ -28,32 +30,35 @@ WindowManager.prototype = {
|
||||
this._destroying = [];
|
||||
|
||||
this._switchData = null;
|
||||
shellwm.connect('switch-workspace', Lang.bind(this, this._switchWorkspace));
|
||||
shellwm.connect('kill-switch-workspace', Lang.bind(this, this._switchWorkspaceDone));
|
||||
shellwm.connect('minimize', Lang.bind(this, this._minimizeWindow));
|
||||
shellwm.connect('kill-minimize', Lang.bind(this, this._minimizeWindowDone));
|
||||
shellwm.connect('maximize', Lang.bind(this, this._maximizeWindow));
|
||||
shellwm.connect('kill-maximize', Lang.bind(this, this._maximizeWindowDone));
|
||||
shellwm.connect('unmaximize', Lang.bind(this, this._unmaximizeWindow));
|
||||
shellwm.connect('kill-unmaximize', Lang.bind(this, this._unmaximizeWindowDone));
|
||||
shellwm.connect('map', Lang.bind(this, this._mapWindow));
|
||||
shellwm.connect('kill-map', Lang.bind(this, this._mapWindowDone));
|
||||
shellwm.connect('destroy', Lang.bind(this, this._destroyWindow));
|
||||
shellwm.connect('kill-destroy', Lang.bind(this, this._destroyWindowDone));
|
||||
|
||||
shellwm.takeover_keybinding('switch_windows');
|
||||
shellwm.connect('keybinding::switch_windows', Lang.bind(this, this._startAppSwitcher));
|
||||
this._shellwm.connect('switch-workspace', Lang.bind(this, this._switchWorkspace));
|
||||
this._shellwm.connect('kill-switch-workspace', Lang.bind(this, this._switchWorkspaceDone));
|
||||
this._shellwm.connect('minimize', Lang.bind(this, this._minimizeWindow));
|
||||
this._shellwm.connect('kill-minimize', Lang.bind(this, this._minimizeWindowDone));
|
||||
this._shellwm.connect('maximize', Lang.bind(this, this._maximizeWindow));
|
||||
this._shellwm.connect('kill-maximize', Lang.bind(this, this._maximizeWindowDone));
|
||||
this._shellwm.connect('unmaximize', Lang.bind(this, this._unmaximizeWindow));
|
||||
this._shellwm.connect('kill-unmaximize', Lang.bind(this, this._unmaximizeWindowDone));
|
||||
this._shellwm.connect('map', Lang.bind(this, this._mapWindow));
|
||||
this._shellwm.connect('kill-map', Lang.bind(this, this._mapWindowDone));
|
||||
this._shellwm.connect('destroy', Lang.bind(this, this._destroyWindow));
|
||||
this._shellwm.connect('kill-destroy', Lang.bind(this, this._destroyWindowDone));
|
||||
|
||||
this._workspaceSwitcherPopup = null;
|
||||
shellwm.takeover_keybinding('switch_to_workspace_left');
|
||||
shellwm.takeover_keybinding('switch_to_workspace_right');
|
||||
shellwm.takeover_keybinding('switch_to_workspace_up');
|
||||
shellwm.takeover_keybinding('switch_to_workspace_down');
|
||||
shellwm.connect('keybinding::switch_to_workspace_left', Lang.bind(this, this._showWorkspaceSwitcher));
|
||||
shellwm.connect('keybinding::switch_to_workspace_right', Lang.bind(this, this._showWorkspaceSwitcher));
|
||||
shellwm.connect('keybinding::switch_to_workspace_up', Lang.bind(this, this._showWorkspaceSwitcher));
|
||||
shellwm.connect('keybinding::switch_to_workspace_down', Lang.bind(this, this._showWorkspaceSwitcher));
|
||||
this.setKeybindingHandler('switch_to_workspace_left', Lang.bind(this, this._showWorkspaceSwitcher));
|
||||
this.setKeybindingHandler('switch_to_workspace_right', Lang.bind(this, this._showWorkspaceSwitcher));
|
||||
this.setKeybindingHandler('switch_to_workspace_up', Lang.bind(this, this._showWorkspaceSwitcher));
|
||||
this.setKeybindingHandler('switch_to_workspace_down', Lang.bind(this, this._showWorkspaceSwitcher));
|
||||
this.setKeybindingHandler('switch_windows', Lang.bind(this, this._startAppSwitcher));
|
||||
},
|
||||
|
||||
setKeybindingHandler: function(keybinding, handler){
|
||||
if (this._keyBindingHandlers[keybinding])
|
||||
this._shellwm.disconnect(this._keyBindingHandlers[keybinding]);
|
||||
else
|
||||
this._shellwm.takeover_keybinding(keybinding);
|
||||
|
||||
this._keyBindingHandlers[keybinding] =
|
||||
this._shellwm.connect('keybinding::' + keybinding, handler);
|
||||
},
|
||||
|
||||
_shouldAnimate : function(actor) {
|
||||
@ -88,11 +93,14 @@ WindowManager.prototype = {
|
||||
this._minimizing.push(actor);
|
||||
|
||||
let primary = global.get_primary_monitor();
|
||||
let xDest = primary.x;
|
||||
if (St.Widget.get_default_direction() == St.TextDirection.RTL)
|
||||
xDest += primary.width;
|
||||
|
||||
Tweener.addTween(actor,
|
||||
{ scale_x: 0.0,
|
||||
scale_y: 0.0,
|
||||
x: primary.x,
|
||||
x: xDest,
|
||||
y: 0,
|
||||
time: WINDOW_ANIMATION_TIME,
|
||||
transition: "easeOutQuad",
|
||||
@ -310,24 +318,34 @@ WindowManager.prototype = {
|
||||
if (this._workspaceSwitcherPopup == null)
|
||||
this._workspaceSwitcherPopup = new WorkspaceSwitcherPopup.WorkspaceSwitcherPopup();
|
||||
|
||||
let activeWorkspaceIndex = global.screen.get_active_workspace_index();
|
||||
|
||||
if (binding == "switch_to_workspace_left") {
|
||||
if (activeWorkspaceIndex > 0) {
|
||||
global.screen.get_workspace_by_index(activeWorkspaceIndex - 1).activate(global.get_current_time());
|
||||
this._workspaceSwitcherPopup.display(WorkspaceSwitcherPopup.LEFT, activeWorkspaceIndex - 1);
|
||||
}
|
||||
else
|
||||
this._workspaceSwitcherPopup.display(WorkspaceSwitcherPopup.LEFT, activeWorkspaceIndex);
|
||||
this.actionMoveWorkspaceLeft();
|
||||
}
|
||||
|
||||
if (binding == "switch_to_workspace_right") {
|
||||
if (activeWorkspaceIndex < global.screen.n_workspaces - 1) {
|
||||
global.screen.get_workspace_by_index(activeWorkspaceIndex + 1).activate(global.get_current_time());
|
||||
this.actionMoveWorkspaceRight();
|
||||
}
|
||||
},
|
||||
|
||||
actionMoveWorkspaceLeft: function() {
|
||||
let activeWorkspaceIndex = global.screen.get_active_workspace_index();
|
||||
if (activeWorkspaceIndex > 0) {
|
||||
global.screen.get_workspace_by_index(activeWorkspaceIndex - 1).activate(global.get_current_time());
|
||||
if (!Main.overview.visible)
|
||||
this._workspaceSwitcherPopup.display(WorkspaceSwitcherPopup.LEFT, activeWorkspaceIndex - 1);
|
||||
} else if (!Main.overview.visible) {
|
||||
this._workspaceSwitcherPopup.display(WorkspaceSwitcherPopup.LEFT, activeWorkspaceIndex);
|
||||
}
|
||||
},
|
||||
|
||||
actionMoveWorkspaceRight: function() {
|
||||
let activeWorkspaceIndex = global.screen.get_active_workspace_index();
|
||||
if (activeWorkspaceIndex < global.screen.n_workspaces - 1) {
|
||||
global.screen.get_workspace_by_index(activeWorkspaceIndex + 1).activate(global.get_current_time());
|
||||
if (!Main.overview.visible)
|
||||
this._workspaceSwitcherPopup.display(WorkspaceSwitcherPopup.RIGHT, activeWorkspaceIndex + 1);
|
||||
}
|
||||
else
|
||||
this._workspaceSwitcherPopup.display(WorkspaceSwitcherPopup.RIGHT, activeWorkspaceIndex);
|
||||
} else if (!Main.overview.visible) {
|
||||
this._workspaceSwitcherPopup.display(WorkspaceSwitcherPopup.RIGHT, activeWorkspaceIndex);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -22,6 +22,8 @@ const Tweener = imports.ui.tweener;
|
||||
|
||||
const FOCUS_ANIMATION_TIME = 0.15;
|
||||
|
||||
const WINDOW_DND_SIZE = 256;
|
||||
|
||||
const FRAME_COLOR = new Clutter.Color();
|
||||
FRAME_COLOR.from_pixel(0xffffffff);
|
||||
|
||||
@ -29,6 +31,8 @@ const SCROLL_SCALE_AMOUNT = 100 / 5;
|
||||
|
||||
const ZOOM_OVERLAY_FADE_TIME = 0.15;
|
||||
|
||||
const DRAGGING_WINDOW_OPACITY = 100;
|
||||
|
||||
// Define a layout scheme for small window counts. For larger
|
||||
// counts we fall back to an algorithm. We need more schemes here
|
||||
// unless we have a really good algorithm.
|
||||
@ -124,10 +128,12 @@ WindowClone.prototype = {
|
||||
Lang.bind(this, this._onLeave));
|
||||
this._havePointer = false;
|
||||
|
||||
this._draggable = DND.makeDraggable(this.actor);
|
||||
this._draggable = DND.makeDraggable(this.actor,
|
||||
{ dragActorMaxSize: WINDOW_DND_SIZE,
|
||||
dragActorOpacity: DRAGGING_WINDOW_OPACITY });
|
||||
this._draggable.connect('drag-begin', Lang.bind(this, this._onDragBegin));
|
||||
this._draggable.connect('drag-end', Lang.bind(this, this._onDragEnd));
|
||||
this._inDrag = false;
|
||||
this.inDrag = false;
|
||||
|
||||
this._zooming = false;
|
||||
this._selected = false;
|
||||
@ -135,7 +141,7 @@ WindowClone.prototype = {
|
||||
|
||||
setStackAbove: function (actor) {
|
||||
this._stackAbove = actor;
|
||||
if (this._inDrag || this._zooming)
|
||||
if (this.inDrag || this._zooming)
|
||||
// We'll fix up the stack after the drag/zooming
|
||||
return;
|
||||
this.actor.raise(this._stackAbove);
|
||||
@ -160,14 +166,23 @@ WindowClone.prototype = {
|
||||
},
|
||||
|
||||
_onDestroy: function() {
|
||||
this.metaWindow._delegate = null;
|
||||
this.actor._delegate = null;
|
||||
if (this._zoomLightbox)
|
||||
this._zoomLightbox.destroy();
|
||||
|
||||
if (this.inDrag) {
|
||||
this.emit('drag-end');
|
||||
this.inDrag = false;
|
||||
}
|
||||
|
||||
this.disconnectAll();
|
||||
},
|
||||
|
||||
_onEnter: function (actor, event) {
|
||||
// If the user drags faster than we can follow, he'll end up
|
||||
// leaving the window temporarily and then re-entering it
|
||||
if (this._inDrag)
|
||||
if (this.inDrag)
|
||||
return;
|
||||
|
||||
this._havePointer = true;
|
||||
@ -176,7 +191,7 @@ WindowClone.prototype = {
|
||||
_onLeave: function (actor, event) {
|
||||
// If the user drags faster than we can follow, he'll end up
|
||||
// leaving the window temporarily and then re-entering it
|
||||
if (this._inDrag)
|
||||
if (this.inDrag)
|
||||
return;
|
||||
|
||||
this._havePointer = false;
|
||||
@ -276,12 +291,12 @@ WindowClone.prototype = {
|
||||
},
|
||||
|
||||
_onDragBegin : function (draggable, time) {
|
||||
this._inDrag = true;
|
||||
this.inDrag = true;
|
||||
this.emit('drag-begin');
|
||||
},
|
||||
|
||||
_onDragEnd : function (draggable, time, snapback) {
|
||||
this._inDrag = false;
|
||||
this.inDrag = false;
|
||||
|
||||
// Most likely, the clone is going to move away from the
|
||||
// pointer now. But that won't cause a leave-event, so
|
||||
@ -589,32 +604,30 @@ const WindowPositionFlags = {
|
||||
};
|
||||
|
||||
/**
|
||||
* @workspaceNum: Workspace index
|
||||
* @parentActor: The actor which will be the parent of this workspace;
|
||||
* we need this in order to add chrome such as the icons
|
||||
* on top of the windows without having them be scaled.
|
||||
* @metaWorkspace: a #Meta.Workspace
|
||||
*/
|
||||
function Workspace(workspaceNum, parentActor) {
|
||||
this._init(workspaceNum, parentActor);
|
||||
function Workspace(metaWorkspace) {
|
||||
this._init(metaWorkspace);
|
||||
}
|
||||
|
||||
Workspace.prototype = {
|
||||
_init : function(workspaceNum, parentActor) {
|
||||
this.workspaceNum = workspaceNum;
|
||||
_init : function(metaWorkspace) {
|
||||
// When dragging a window, we use this slot for reserve space.
|
||||
this._reservedSlot = null;
|
||||
this.metaWorkspace = metaWorkspace;
|
||||
this._windowOverlaysGroup = new Clutter.Group();
|
||||
// Without this the drop area will be overlapped.
|
||||
this._windowOverlaysGroup.set_size(0, 0);
|
||||
|
||||
this._metaWorkspace = global.screen.get_workspace_by_index(workspaceNum);
|
||||
|
||||
parentActor.add_actor(this._windowOverlaysGroup);
|
||||
this._parentActor = parentActor;
|
||||
|
||||
this.actor = new Clutter.Group();
|
||||
this.actor._delegate = this;
|
||||
|
||||
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
|
||||
|
||||
// Items in _windowOverlaysGroup should not be scaled, so we don't
|
||||
// add them to this.actor, but to its parent whenever it changes
|
||||
this.actor.connect('parent-set', Lang.bind(this, this._onParentSet));
|
||||
|
||||
// Auto-sizing is unreliable in the presence of ClutterClone, so rather than
|
||||
// implicitly counting on the workspace actor to be sized to the size of the
|
||||
// included desktop actor clone, set the size explicitly to the screen size.
|
||||
@ -639,8 +652,13 @@ Workspace.prototype = {
|
||||
this._desktop.connect('selected',
|
||||
Lang.bind(this,
|
||||
function(clone, time) {
|
||||
this._metaWorkspace.activate(time);
|
||||
Main.overview.hide();
|
||||
// Only switch to the workspace when one window is open
|
||||
// We check for "2" here because the Desktop does not really count
|
||||
// as a window in this context.
|
||||
if (this._windows.length <= 2) {
|
||||
this.metaWorkspace.activate(time);
|
||||
Main.overview.hide();
|
||||
}
|
||||
}));
|
||||
this.actor.add_actor(this._desktop.actor);
|
||||
|
||||
@ -658,10 +676,11 @@ Workspace.prototype = {
|
||||
this._showOnlyWindows = null;
|
||||
|
||||
// Track window changes
|
||||
this._windowAddedId = this._metaWorkspace.connect('window-added',
|
||||
this._windowAddedId = this.metaWorkspace.connect('window-added',
|
||||
Lang.bind(this, this._windowAdded));
|
||||
this._windowRemovedId = this._metaWorkspace.connect('window-removed',
|
||||
this._windowRemovedId = this.metaWorkspace.connect('window-removed',
|
||||
Lang.bind(this, this._windowRemoved));
|
||||
this._repositionWindowsId = 0;
|
||||
|
||||
this._visible = false;
|
||||
|
||||
@ -679,6 +698,17 @@ Workspace.prototype = {
|
||||
return -1;
|
||||
},
|
||||
|
||||
_onParentSet: function(actor, old_parent) {
|
||||
let new_parent = this.actor.get_parent();
|
||||
if (new_parent == null)
|
||||
return;
|
||||
|
||||
if (old_parent)
|
||||
this._windowOverlaysGroup.reparent(new_parent);
|
||||
else
|
||||
new_parent.add_actor(this._windowOverlaysGroup);
|
||||
},
|
||||
|
||||
/**
|
||||
* lookupCloneForMetaWindow:
|
||||
* @metaWindow: A #MetaWindow
|
||||
@ -761,6 +791,16 @@ Workspace.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* setReactive:
|
||||
* @reactive: %true iff the workspace should be reactive
|
||||
*
|
||||
* Set the workspace (desktop) reactive
|
||||
**/
|
||||
setReactive: function(reactive) {
|
||||
this._desktop.actor.reactive = reactive;
|
||||
},
|
||||
|
||||
_updateFramePosition : function() {
|
||||
this._frame.set_position(this._desktop.actor.x - FRAME_SIZE / this.actor.scale_x,
|
||||
this._desktop.actor.y - FRAME_SIZE / this.actor.scale_y);
|
||||
@ -855,7 +895,7 @@ Workspace.prototype = {
|
||||
|
||||
/**
|
||||
* _computeWindowMotion:
|
||||
* @metaWindow: A #MetaWindow
|
||||
* @actor: A #WindowClone's #ClutterActor
|
||||
* @slot: An element of #POSITIONS
|
||||
* @slotGeometry: Layout of @slot
|
||||
*
|
||||
@ -864,15 +904,15 @@ Workspace.prototype = {
|
||||
* Currently this is the square of the distance between the
|
||||
* centers.
|
||||
*/
|
||||
_computeWindowMotion: function (metaWindow, slot) {
|
||||
let rect = new Meta.Rectangle();
|
||||
metaWindow.get_outer_rect(rect);
|
||||
|
||||
_computeWindowMotion: function (actor, slot) {
|
||||
let [xCenter, yCenter, fraction] = slot;
|
||||
let xDelta, yDelta, distanceSquared;
|
||||
let actorWidth, actorHeight;
|
||||
|
||||
xDelta = rect.x + rect.width / 2.0 - xCenter * global.screen_width;
|
||||
yDelta = rect.y + rect.height / 2.0 - yCenter * global.screen_height;
|
||||
actorWidth = actor.width * actor.scale_x;
|
||||
actorHeight = actor.height * actor.scale_y;
|
||||
xDelta = actor.x + actorWidth / 2.0 - xCenter * global.screen_width;
|
||||
yDelta = actor.y + actorHeight / 2.0 - yCenter * global.screen_height;
|
||||
distanceSquared = xDelta * xDelta + yDelta * yDelta;
|
||||
|
||||
return distanceSquared;
|
||||
@ -891,10 +931,10 @@ Workspace.prototype = {
|
||||
this._forEachPermutations(clones, Lang.bind(this, function (permutation) {
|
||||
let motion = 0;
|
||||
for (let i = 0; i < permutation.length; i++) {
|
||||
let metaWindow = permutation[i].metaWindow;
|
||||
let cloneActor = permutation[i].actor;
|
||||
let slot = slots[i];
|
||||
|
||||
let delta = this._computeWindowMotion(metaWindow, slot);
|
||||
let delta = this._computeWindowMotion(cloneActor, slot);
|
||||
|
||||
motion += delta;
|
||||
}
|
||||
@ -924,8 +964,8 @@ Workspace.prototype = {
|
||||
let minimumMotionIndex = -1;
|
||||
let minimumMotion = -1;
|
||||
for (let j = 0; j < clonesCopy.length; j++) {
|
||||
let metaWindow = clonesCopy[j].metaWindow;
|
||||
let delta = this._computeWindowMotion(metaWindow, slot);
|
||||
let cloneActor = clonesCopy[j].actor;
|
||||
let delta = this._computeWindowMotion(cloneActor, slot);
|
||||
if (minimumMotionIndex == -1 || delta < minimumMotion) {
|
||||
minimumMotionIndex = j;
|
||||
minimumMotion = delta;
|
||||
@ -992,11 +1032,16 @@ Workspace.prototype = {
|
||||
|
||||
let rect = new Meta.Rectangle();
|
||||
metaWindow.get_outer_rect(rect);
|
||||
let buttonOuterHeight, captionHeight;
|
||||
let buttonOuterWidth = 0;
|
||||
|
||||
let [buttonOuterHeight, captionHeight] = this._windowOverlays[1].chromeHeights();
|
||||
if (this._windowOverlays[1]) {
|
||||
[buttonOuterHeight, captionHeight] = this._windowOverlays[1].chromeHeights();
|
||||
buttonOuterWidth = this._windowOverlays[1].chromeWidth() / this.scale;
|
||||
} else
|
||||
[buttonOuterHeight, captionHeight] = [0, 0];
|
||||
buttonOuterHeight /= this.scale;
|
||||
captionHeight /= this.scale;
|
||||
let buttonOuterWidth = this._windowOverlays[1].chromeWidth() / this.scale;
|
||||
|
||||
let desiredWidth = global.screen_width * fraction;
|
||||
let desiredHeight = global.screen_height * fraction;
|
||||
@ -1010,6 +1055,19 @@ Workspace.prototype = {
|
||||
return [x, y, scale];
|
||||
},
|
||||
|
||||
setReservedSlot: function(clone) {
|
||||
if (clone && this.containsMetaWindow(clone.metaWindow)) {
|
||||
this._reservedSlot = null;
|
||||
this.positionWindows(WindowPositionFlags.ANIMATE);
|
||||
return;
|
||||
}
|
||||
if (clone)
|
||||
this._reservedSlot = clone;
|
||||
else
|
||||
this._reservedSlot = null;
|
||||
this.positionWindows(WindowPositionFlags.ANIMATE);
|
||||
},
|
||||
|
||||
/**
|
||||
* positionWindows:
|
||||
* @flags:
|
||||
@ -1017,9 +1075,16 @@ Workspace.prototype = {
|
||||
* ANIMATE - Indicates that we need animate changing position.
|
||||
*/
|
||||
positionWindows : function(flags) {
|
||||
if (this._repositionWindowsId > 0) {
|
||||
Mainloop.source_remove(this._repositionWindowsId);
|
||||
this._repositionWindowsId = 0;
|
||||
}
|
||||
|
||||
let totalVisible = 0;
|
||||
|
||||
let visibleClones = this._getVisibleClones();
|
||||
if (this._reservedSlot)
|
||||
visibleClones.push(this._reservedSlot);
|
||||
|
||||
let workspaceZooming = flags & WindowPositionFlags.ZOOM;
|
||||
let animate = flags & WindowPositionFlags.ANIMATE;
|
||||
@ -1035,9 +1100,15 @@ Workspace.prototype = {
|
||||
let mainIndex = this._lookupIndex(metaWindow);
|
||||
let overlay = this._windowOverlays[mainIndex];
|
||||
|
||||
// Positioning a window currently being dragged must be avoided;
|
||||
// we'll just leave a blank spot in the layout for it.
|
||||
if (clone.inDrag)
|
||||
continue;
|
||||
|
||||
let [x, y, scale] = this._computeWindowRelativeLayout(metaWindow, slot);
|
||||
|
||||
overlay.hide();
|
||||
if (overlay)
|
||||
overlay.hide();
|
||||
if (animate) {
|
||||
if (!metaWindow.showing_on_its_workspace()) {
|
||||
/* Hidden windows should fade in and grow
|
||||
@ -1111,8 +1182,13 @@ Workspace.prototype = {
|
||||
cloneWidth = this.scale * clone.actor.scale_x * cloneWidth;
|
||||
cloneHeight = this.scale * clone.actor.scale_y * cloneHeight;
|
||||
|
||||
overlay.updatePositions(cloneX, cloneY, cloneWidth, cloneHeight);
|
||||
overlay.fadeIn();
|
||||
if (!this._windowOverlaysGroup.visible)
|
||||
this._windowOverlaysGroup.show();
|
||||
|
||||
if (overlay) {
|
||||
overlay.updatePositions(cloneX, cloneY, cloneWidth, cloneHeight);
|
||||
overlay.fadeIn();
|
||||
}
|
||||
},
|
||||
|
||||
_fadeInAllOverlays: function() {
|
||||
@ -1132,6 +1208,36 @@ Workspace.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
_delayedWindowRepositioning: function() {
|
||||
let [child, x, y, mask] =
|
||||
Gdk.Screen.get_default().get_root_window().get_pointer();
|
||||
let wsWidth = this.actor.width * this.scale;
|
||||
let wsHeight = this.actor.height * this.scale;
|
||||
|
||||
let pointerHasMoved = (this._cursorX != x && this._cursorY != y);
|
||||
let inWorkspace = (this.gridX < x && x < this.gridX + wsWidth &&
|
||||
this.gridY < y && y < this.gridY + wsHeight);
|
||||
|
||||
if (pointerHasMoved && inWorkspace) {
|
||||
// store current cursor position
|
||||
this._cursorX = x;
|
||||
this._cursorY = y;
|
||||
return true;
|
||||
}
|
||||
|
||||
this.positionWindows(WindowPositionFlags.ANIMATE);
|
||||
return false;
|
||||
},
|
||||
|
||||
showWindowsOverlays: function() {
|
||||
this._windowOverlaysGroup.show();
|
||||
this._fadeInAllOverlays();
|
||||
},
|
||||
|
||||
hideWindowsOverlays: function() {
|
||||
this._windowOverlaysGroup.hide();
|
||||
},
|
||||
|
||||
_windowRemoved : function(metaWorkspace, metaWin) {
|
||||
let win = metaWin.get_compositor_private();
|
||||
|
||||
@ -1163,7 +1269,26 @@ Workspace.prototype = {
|
||||
}
|
||||
clone.destroy();
|
||||
|
||||
this.positionWindows(WindowPositionFlags.ANIMATE);
|
||||
|
||||
// We need to reposition the windows; to avoid shuffling windows
|
||||
// around while the user is interacting with the workspace, we delay
|
||||
// the positioning until the pointer remains still for at least 750 ms
|
||||
// or is moved outside the workspace
|
||||
|
||||
// remove old handler
|
||||
if (this._repositionWindowsId > 0) {
|
||||
Mainloop.source_remove(this._repositionWindowsId);
|
||||
this._repositionWindowsId = 0;
|
||||
}
|
||||
|
||||
// setup new handler
|
||||
let [child, x, y, mask] =
|
||||
Gdk.Screen.get_default().get_root_window().get_pointer();
|
||||
this._cursorX = x;
|
||||
this._cursorY = y;
|
||||
|
||||
this._repositionWindowsId = Mainloop.timeout_add(750,
|
||||
Lang.bind(this, this._delayedWindowRepositioning));
|
||||
},
|
||||
|
||||
_windowAdded : function(metaWorkspace, metaWin) {
|
||||
@ -1215,19 +1340,19 @@ Workspace.prototype = {
|
||||
},
|
||||
|
||||
// Animate the full-screen to Overview transition.
|
||||
zoomToOverview : function(animate) {
|
||||
zoomToOverview : function() {
|
||||
this.actor.set_position(this.gridX, this.gridY);
|
||||
this.actor.set_scale(this.scale, this.scale);
|
||||
|
||||
// Position and scale the windows.
|
||||
if (animate)
|
||||
if (Main.overview.animationInProgress)
|
||||
this.positionWindows(WindowPositionFlags.ANIMATE | WindowPositionFlags.ZOOM);
|
||||
else
|
||||
this.positionWindows(WindowPositionFlags.ZOOM);
|
||||
|
||||
let active = global.screen.get_active_workspace_index();
|
||||
let fadeInIcons = (animate &&
|
||||
active == this.workspaceNum &&
|
||||
let active = global.screen.get_active_workspace();
|
||||
let fadeInIcons = (Main.overview.animationInProgress &&
|
||||
active == this.metaWorkspace &&
|
||||
!this._haveMaximizedWindows());
|
||||
this._desktop.zoomToOverview(fadeInIcons);
|
||||
|
||||
@ -1240,8 +1365,12 @@ Workspace.prototype = {
|
||||
|
||||
this._hideAllOverlays();
|
||||
|
||||
Main.overview.connect('hidden', Lang.bind(this,
|
||||
this._doneLeavingOverview));
|
||||
if (this._repositionWindowsId > 0) {
|
||||
Mainloop.source_remove(this._repositionWindowsId);
|
||||
this._repositionWindowsId = 0;
|
||||
}
|
||||
this._overviewHiddenId = Main.overview.connect('hidden', Lang.bind(this,
|
||||
this._doneLeavingOverview));
|
||||
|
||||
// Position and scale the windows.
|
||||
for (let i = 1; i < this._windows.length; i++) {
|
||||
@ -1273,8 +1402,8 @@ Workspace.prototype = {
|
||||
}
|
||||
}
|
||||
|
||||
let active = global.screen.get_active_workspace_index();
|
||||
let fadeOutIcons = (active == this.workspaceNum &&
|
||||
let active = global.screen.get_active_workspace();
|
||||
let fadeOutIcons = (active == this.metaWorkspace &&
|
||||
!this._haveMaximizedWindows());
|
||||
this._desktop.zoomFromOverview(fadeOutIcons);
|
||||
|
||||
@ -1349,10 +1478,17 @@ Workspace.prototype = {
|
||||
},
|
||||
|
||||
_onDestroy: function(actor) {
|
||||
if (this._overviewHiddenId) {
|
||||
Main.overview.disconnect(this._overviewHiddenId);
|
||||
this._overviewHiddenId = 0;
|
||||
}
|
||||
Tweener.removeTweens(actor);
|
||||
|
||||
this._metaWorkspace.disconnect(this._windowAddedId);
|
||||
this._metaWorkspace.disconnect(this._windowRemovedId);
|
||||
this.metaWorkspace.disconnect(this._windowAddedId);
|
||||
this.metaWorkspace.disconnect(this._windowRemovedId);
|
||||
|
||||
if (this._repositionWindowsId > 0)
|
||||
Mainloop.source_remove(this._repositionWindowsId);
|
||||
|
||||
// Usually, the windows will be destroyed automatically with
|
||||
// their parent (this.actor), but we might have a zoomed window
|
||||
@ -1360,6 +1496,7 @@ Workspace.prototype = {
|
||||
// the desktop window, which is never reparented
|
||||
for (let w = 1; w < this._windows.length; w++)
|
||||
this._windows[w].destroy();
|
||||
this._windows = [];
|
||||
},
|
||||
|
||||
// Sets this.leavingOverview flag to false.
|
||||
@ -1369,13 +1506,13 @@ Workspace.prototype = {
|
||||
|
||||
// Tests if @win belongs to this workspaces
|
||||
_isMyWindow : function (win) {
|
||||
return win.get_workspace() == this.workspaceNum ||
|
||||
return win.get_workspace() == this.metaWorkspace.index() ||
|
||||
(win.get_meta_window() && win.get_meta_window().is_on_all_workspaces());
|
||||
},
|
||||
|
||||
// Tests if @win should be shown in the Overview
|
||||
_isOverviewWindow : function (win) {
|
||||
let tracker = Shell.WindowTracker.get_default()
|
||||
let tracker = Shell.WindowTracker.get_default();
|
||||
return tracker.is_window_interesting(win.get_meta_window());
|
||||
},
|
||||
|
||||
@ -1387,11 +1524,13 @@ Workspace.prototype = {
|
||||
clone.connect('selected',
|
||||
Lang.bind(this, this._onCloneSelected));
|
||||
clone.connect('drag-begin',
|
||||
Lang.bind(this, function() {
|
||||
Lang.bind(this, function(clone) {
|
||||
this.emit('window-drag-begin', clone.actor);
|
||||
overlay.hide();
|
||||
}));
|
||||
clone.connect('drag-end',
|
||||
Lang.bind(this, function() {
|
||||
Lang.bind(this, function(clone) {
|
||||
this.emit('window-drag-end', clone.actor);
|
||||
overlay.show();
|
||||
}));
|
||||
|
||||
@ -1440,14 +1579,12 @@ Workspace.prototype = {
|
||||
},
|
||||
|
||||
_onCloneSelected : function (clone, time) {
|
||||
Main.activateWindow(clone.metaWindow, time, this.workspaceNum);
|
||||
Main.activateWindow(clone.metaWindow, time,
|
||||
this.metaWorkspace.index());
|
||||
},
|
||||
|
||||
_removeSelf : function(actor, event) {
|
||||
let screen = global.screen;
|
||||
let workspace = screen.get_workspace_by_index(this.workspaceNum);
|
||||
|
||||
screen.remove_workspace(workspace, event.get_time());
|
||||
screen.remove_workspace(this.metaWorkspace, event.get_time());
|
||||
return true;
|
||||
},
|
||||
|
||||
@ -1467,12 +1604,12 @@ Workspace.prototype = {
|
||||
};
|
||||
|
||||
let metaWindow = win.get_meta_window();
|
||||
metaWindow.change_workspace_by_index(this.workspaceNum,
|
||||
metaWindow.change_workspace_by_index(this.metaWorkspace.index(),
|
||||
false, // don't create workspace
|
||||
time);
|
||||
return true;
|
||||
} else if (source.shellWorkspaceLaunch) {
|
||||
this._metaWorkspace.activate(time);
|
||||
this.metaWorkspace.activate(time);
|
||||
source.shellWorkspaceLaunch();
|
||||
return true;
|
||||
}
|
||||
|
@ -60,11 +60,6 @@ WorkspaceSwitcherPopup.prototype = {
|
||||
this._list.add(indicator);
|
||||
indicator.set_width(Math.round(indicator.get_height() * this._scaleWidth));
|
||||
|
||||
if (i < global.screen.n_workspaces - 1) {
|
||||
let spacer = new St.Bin({ style_class: 'ws-switcher-spacer' });
|
||||
this._list.add(spacer);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
@ -97,7 +92,7 @@ WorkspaceSwitcherPopup.prototype = {
|
||||
Tweener.addTween(this._container, { opacity: 0.0,
|
||||
time: ANIMATION_TIME,
|
||||
transition: "easeOutQuad",
|
||||
onComplete: function() { this.actor.hide() },
|
||||
onComplete: function() { this.actor.hide(); },
|
||||
onCompleteScope: this
|
||||
});
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -10,6 +10,7 @@ js/ui/placeDisplay.js
|
||||
js/ui/runDialog.js
|
||||
js/ui/statusMenu.js
|
||||
js/ui/widget.js
|
||||
js/ui/windowAttentionHandler.js
|
||||
src/gdmuser/gdm-user.c
|
||||
src/shell-global.c
|
||||
src/shell-uri-util.c
|
||||
|
77
po/bg.po
77
po/bg.po
@ -7,8 +7,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gnome-shell master\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2010-02-20 14:29+0200\n"
|
||||
"PO-Revision-Date: 2010-02-16 21:13+0200\n"
|
||||
"POT-Creation-Date: 2010-03-18 13:09+0200\n"
|
||||
"PO-Revision-Date: 2010-03-18 11:30+0200\n"
|
||||
"Last-Translator: Ivaylo Valkov <ivaylo@e-valkov.org>\n"
|
||||
"Language-Team: Bulgarian <dict@fsa-bg.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -25,27 +25,27 @@ msgid "Window management and application launching"
|
||||
msgstr "Управление на прозорци и стартиране на програми"
|
||||
|
||||
#. **** Applications ****
|
||||
#: ../js/ui/appDisplay.js:177 ../js/ui/dash.js:881
|
||||
#: ../js/ui/appDisplay.js:311 ../js/ui/dash.js:852
|
||||
msgid "APPLICATIONS"
|
||||
msgstr "ПРОГРАМИ"
|
||||
|
||||
#: ../js/ui/appDisplay.js:201
|
||||
#: ../js/ui/appDisplay.js:343
|
||||
msgid "PREFERENCES"
|
||||
msgstr "ПРЕДПОЧИТАНИЯ"
|
||||
|
||||
#: ../js/ui/appDisplay.js:579
|
||||
#: ../js/ui/appDisplay.js:728
|
||||
msgid "New Window"
|
||||
msgstr "Нов прозорец"
|
||||
|
||||
#: ../js/ui/appDisplay.js:583
|
||||
#: ../js/ui/appDisplay.js:732
|
||||
msgid "Remove from Favorites"
|
||||
msgstr "Премахване от „Любими“"
|
||||
|
||||
#: ../js/ui/appDisplay.js:584
|
||||
#: ../js/ui/appDisplay.js:733
|
||||
msgid "Add to Favorites"
|
||||
msgstr "Добавяне в „Любими“"
|
||||
|
||||
#: ../js/ui/appDisplay.js:936
|
||||
#: ../js/ui/appDisplay.js:1085
|
||||
msgid "Drag here to add favorites"
|
||||
msgstr "Довлачете до тук обектите за да ги добавите към „Любими“"
|
||||
|
||||
@ -59,87 +59,96 @@ msgstr "Програмата „%s“ беше добавена в „Любим
|
||||
msgid "%s has been removed from your favorites."
|
||||
msgstr "Програмата „%s“ беше премахната от „Любими“"
|
||||
|
||||
#: ../js/ui/dash.js:235
|
||||
msgid "Find..."
|
||||
msgstr "Търсене…"
|
||||
#: ../js/ui/dash.js:194
|
||||
msgid "Find"
|
||||
msgstr "Търсене"
|
||||
|
||||
#: ../js/ui/dash.js:505
|
||||
#: ../js/ui/dash.js:507
|
||||
msgid "Searching..."
|
||||
msgstr "Търсене…"
|
||||
|
||||
#: ../js/ui/dash.js:519
|
||||
#: ../js/ui/dash.js:521
|
||||
msgid "No matching results."
|
||||
msgstr "Няма съвпадения."
|
||||
|
||||
#. **** Places ****
|
||||
#. Translators: This is in the sense of locations for documents,
|
||||
#. network locations, etc.
|
||||
#: ../js/ui/dash.js:900 ../js/ui/placeDisplay.js:529
|
||||
#: ../js/ui/dash.js:871 ../js/ui/placeDisplay.js:536
|
||||
msgid "PLACES & DEVICES"
|
||||
msgstr "МЕСТА И УСТРОЙСТВА"
|
||||
|
||||
#. **** Documents ****
|
||||
#: ../js/ui/dash.js:907 ../js/ui/docDisplay.js:488
|
||||
#: ../js/ui/dash.js:878 ../js/ui/docDisplay.js:488
|
||||
msgid "RECENT ITEMS"
|
||||
msgstr "СКОРО ОТВАРЯНИ"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:356
|
||||
#: ../js/ui/lookingGlass.js:363
|
||||
msgid "No extensions installed"
|
||||
msgstr "Няма инсталирани разширения"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:393
|
||||
#: ../js/ui/lookingGlass.js:400
|
||||
msgid "Enabled"
|
||||
msgstr "Включено"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:395
|
||||
#: ../js/ui/lookingGlass.js:402
|
||||
msgid "Disabled"
|
||||
msgstr "Изключено"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:397
|
||||
#: ../js/ui/lookingGlass.js:404
|
||||
msgid "Error"
|
||||
msgstr "Грешка"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:399
|
||||
#: ../js/ui/lookingGlass.js:406
|
||||
msgid "Out of date"
|
||||
msgstr "Остаряло"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:424
|
||||
#: ../js/ui/lookingGlass.js:431
|
||||
msgid "View Source"
|
||||
msgstr "Преглед на програмния код"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:430
|
||||
#: ../js/ui/lookingGlass.js:437
|
||||
msgid "Web Page"
|
||||
msgstr "Домашна страница"
|
||||
|
||||
#: ../js/ui/overview.js:92
|
||||
#: ../js/ui/overview.js:182
|
||||
msgid "Undo"
|
||||
msgstr "Отмяна"
|
||||
|
||||
#. Button on the left side of the panel.
|
||||
#. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview".
|
||||
#: ../js/ui/panel.js:336
|
||||
#: ../js/ui/panel.js:385
|
||||
msgid "Activities"
|
||||
msgstr "Дейности"
|
||||
|
||||
#. Translators: This is the time format used in 24-hour mode.
|
||||
#: ../js/ui/panel.js:560
|
||||
#: ../js/ui/panel.js:616
|
||||
msgid "%a %R"
|
||||
msgstr "%a, %R"
|
||||
|
||||
#. Translators: This is a time format used for AM/PM.
|
||||
#: ../js/ui/panel.js:563
|
||||
#: ../js/ui/panel.js:619
|
||||
msgid "%a %l:%M %p"
|
||||
msgstr "%a, %H:%M"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:144
|
||||
#: ../js/ui/placeDisplay.js:103
|
||||
#, c-format
|
||||
msgid "Failed to unmount '%s'"
|
||||
msgstr "Неуспех при демонтиране на „%s“"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:106
|
||||
msgid "Retry"
|
||||
msgstr "Повторен опит"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:151
|
||||
msgid "Connect to..."
|
||||
msgstr "Свързване към…"
|
||||
|
||||
#: ../js/ui/runDialog.js:245
|
||||
#: ../js/ui/runDialog.js:221
|
||||
msgid "Please enter a command:"
|
||||
msgstr "Въведете команда:"
|
||||
|
||||
#: ../js/ui/runDialog.js:361
|
||||
#: ../js/ui/runDialog.js:344
|
||||
#, c-format
|
||||
msgid "Execution of '%s' failed:"
|
||||
msgstr "Неуспешно изпълнение на „%s“:"
|
||||
@ -197,32 +206,32 @@ msgstr "Програми"
|
||||
msgid "Recent Documents"
|
||||
msgstr "Скоро отваряни документи"
|
||||
|
||||
#: ../src/shell-global.c:960
|
||||
#: ../src/shell-global.c:967
|
||||
msgid "Less than a minute ago"
|
||||
msgstr "Преди по-малко от минута"
|
||||
|
||||
#: ../src/shell-global.c:964
|
||||
#: ../src/shell-global.c:971
|
||||
#, c-format
|
||||
msgid "%d minute ago"
|
||||
msgid_plural "%d minutes ago"
|
||||
msgstr[0] "преди %d минута"
|
||||
msgstr[1] "преди %d минути"
|
||||
|
||||
#: ../src/shell-global.c:969
|
||||
#: ../src/shell-global.c:976
|
||||
#, c-format
|
||||
msgid "%d hour ago"
|
||||
msgid_plural "%d hours ago"
|
||||
msgstr[0] "преди %d час"
|
||||
msgstr[1] "преди %d часа"
|
||||
|
||||
#: ../src/shell-global.c:974
|
||||
#: ../src/shell-global.c:981
|
||||
#, c-format
|
||||
msgid "%d day ago"
|
||||
msgid_plural "%d days ago"
|
||||
msgstr[0] "преди %d ден"
|
||||
msgstr[1] "преди %d дни"
|
||||
|
||||
#: ../src/shell-global.c:979
|
||||
#: ../src/shell-global.c:986
|
||||
#, c-format
|
||||
msgid "%d week ago"
|
||||
msgid_plural "%d weeks ago"
|
||||
|
175
po/cs.po
175
po/cs.po
@ -7,8 +7,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gnome-shell\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2010-01-12 21:58+0100\n"
|
||||
"PO-Revision-Date: 2010-01-12 21:57+0100\n"
|
||||
"POT-Creation-Date: 2010-03-20 03:11+0100\n"
|
||||
"PO-Revision-Date: 2010-03-20 03:11+0100\n"
|
||||
"Last-Translator: Petr Kovar <pknbe@volny.cz>\n"
|
||||
"Language-Team: Czech <gnome-cs-list@gnome.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -26,78 +26,176 @@ msgid "Window management and application launching"
|
||||
msgstr "Správa oken a spouštění aplikací"
|
||||
|
||||
#. **** Applications ****
|
||||
#: ../js/ui/appDisplay.js:252 ../js/ui/dash.js:865
|
||||
#: ../js/ui/appDisplay.js:311 ../js/ui/dash.js:852
|
||||
msgid "APPLICATIONS"
|
||||
msgstr "APLIKACE"
|
||||
|
||||
#: ../js/ui/appDisplay.js:276
|
||||
#: ../js/ui/appDisplay.js:343
|
||||
msgid "PREFERENCES"
|
||||
msgstr "PŘEDVOLBY"
|
||||
|
||||
#: ../js/ui/appDisplay.js:644
|
||||
#: ../js/ui/appDisplay.js:728
|
||||
msgid "New Window"
|
||||
msgstr "Nové okno"
|
||||
|
||||
#: ../js/ui/appDisplay.js:648
|
||||
#: ../js/ui/appDisplay.js:732
|
||||
msgid "Remove from Favorites"
|
||||
msgstr "Odstranit z oblíbených"
|
||||
|
||||
#: ../js/ui/appDisplay.js:649
|
||||
#: ../js/ui/appDisplay.js:733
|
||||
msgid "Add to Favorites"
|
||||
msgstr "Přidat mezi oblíbené"
|
||||
|
||||
#: ../js/ui/appDisplay.js:1001
|
||||
#: ../js/ui/appDisplay.js:1085
|
||||
msgid "Drag here to add favorites"
|
||||
msgstr "Oblíbené přidáte přetažením sem"
|
||||
|
||||
#: ../js/ui/dash.js:240
|
||||
msgid "Find..."
|
||||
msgstr "Najít..."
|
||||
#: ../js/ui/appFavorites.js:89
|
||||
#, c-format
|
||||
msgid "%s has been added to your favorites."
|
||||
msgstr "%s byl přidán mezi oblíbené."
|
||||
|
||||
#: ../js/ui/dash.js:493
|
||||
#: ../js/ui/appFavorites.js:107
|
||||
#, c-format
|
||||
msgid "%s has been removed from your favorites."
|
||||
msgstr "%s byl odstraněn z oblíbených."
|
||||
|
||||
#: ../js/ui/dash.js:194
|
||||
msgid "Find"
|
||||
msgstr "Najít"
|
||||
|
||||
#: ../js/ui/dash.js:507
|
||||
msgid "Searching..."
|
||||
msgstr "Hledá se..."
|
||||
|
||||
#: ../js/ui/dash.js:507
|
||||
#: ../js/ui/dash.js:521
|
||||
msgid "No matching results."
|
||||
msgstr "Neodpovídá ani jeden z výsledků."
|
||||
|
||||
#. **** Places ****
|
||||
#. Translators: This is in the sense of locations for documents,
|
||||
#. network locations, etc.
|
||||
#: ../js/ui/dash.js:885 ../js/ui/placeDisplay.js:519
|
||||
#: ../js/ui/dash.js:871 ../js/ui/placeDisplay.js:579
|
||||
msgid "PLACES & DEVICES"
|
||||
msgstr "MÍSTA A ZAŘÍZENÍ"
|
||||
|
||||
#. **** Documents ****
|
||||
#: ../js/ui/dash.js:892
|
||||
#: ../js/ui/dash.js:878 ../js/ui/docDisplay.js:488
|
||||
msgid "RECENT ITEMS"
|
||||
msgstr "NEDÁVNÉ POLOŽKY"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:363
|
||||
msgid "No extensions installed"
|
||||
msgstr "Nejsou nainstalována žádná rozšíření"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:400
|
||||
msgid "Enabled"
|
||||
msgstr "Povoleno"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:402
|
||||
msgid "Disabled"
|
||||
msgstr "Zakázáno"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:404
|
||||
msgid "Error"
|
||||
msgstr "Chyba"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:406
|
||||
msgid "Out of date"
|
||||
msgstr "Neaktuální"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:431
|
||||
msgid "View Source"
|
||||
msgstr "Zobrazit zdroj"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:437
|
||||
msgid "Web Page"
|
||||
msgstr "Webová stránka"
|
||||
|
||||
#: ../js/ui/overview.js:182
|
||||
msgid "Undo"
|
||||
msgstr "Zpět"
|
||||
|
||||
#. Button on the left side of the panel.
|
||||
#. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview".
|
||||
#: ../js/ui/panel.js:336
|
||||
#: ../js/ui/panel.js:385
|
||||
msgid "Activities"
|
||||
msgstr "Činnosti"
|
||||
|
||||
#. Translators: This is a time format.
|
||||
#: ../js/ui/panel.js:549
|
||||
msgid "%a %l:%M %p"
|
||||
msgstr "%a, %H:%M"
|
||||
# Not sure whether we've enough space for it, but anyway, looks more aesthetically with "%A".
|
||||
#. Translators: This is the time format used in 24-hour mode.
|
||||
#: ../js/ui/panel.js:616
|
||||
msgid "%a %R"
|
||||
msgstr "%A, %R"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:144
|
||||
# Not sure whether we've enough space for it, but anyway, looks more aesthetically with "%A".
|
||||
#. Translators: This is a time format used for AM/PM.
|
||||
#: ../js/ui/panel.js:619
|
||||
msgid "%a %l:%M %p"
|
||||
msgstr "%A, %l:%M %p"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:103
|
||||
#, c-format
|
||||
msgid "Failed to unmount '%s'"
|
||||
msgstr "Nelze odpojit \"%s\""
|
||||
|
||||
#: ../js/ui/placeDisplay.js:106
|
||||
msgid "Retry"
|
||||
msgstr "Opakovat"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:151
|
||||
msgid "Connect to..."
|
||||
msgstr "Připojit se k..."
|
||||
|
||||
#: ../js/ui/runDialog.js:235
|
||||
#: ../js/ui/runDialog.js:232
|
||||
msgid "Please enter a command:"
|
||||
msgstr "Zadejte prosím příkaz:"
|
||||
|
||||
#: ../js/ui/runDialog.js:351
|
||||
#: ../js/ui/runDialog.js:374
|
||||
#, c-format
|
||||
msgid "Execution of '%s' failed:"
|
||||
msgstr "Vykonání \"%s\" selhalo:"
|
||||
|
||||
#: ../js/ui/statusMenu.js:107
|
||||
msgid "Available"
|
||||
msgstr "Přítomen"
|
||||
|
||||
#: ../js/ui/statusMenu.js:112
|
||||
msgid "Busy"
|
||||
msgstr "Zaneprázdněn"
|
||||
|
||||
#: ../js/ui/statusMenu.js:117
|
||||
msgid "Invisible"
|
||||
msgstr "Neviditelný"
|
||||
|
||||
#: ../js/ui/statusMenu.js:126
|
||||
msgid "Account Information..."
|
||||
msgstr "Informace o účtu..."
|
||||
|
||||
#: ../js/ui/statusMenu.js:132
|
||||
msgid "Sidebar"
|
||||
msgstr "Postranní lišta"
|
||||
|
||||
#: ../js/ui/statusMenu.js:142
|
||||
msgid "System Preferences..."
|
||||
msgstr "Předvolby systému..."
|
||||
|
||||
#: ../js/ui/statusMenu.js:151
|
||||
msgid "Lock Screen"
|
||||
msgstr "Uzamknout obrazovku"
|
||||
|
||||
#: ../js/ui/statusMenu.js:156
|
||||
msgid "Switch User"
|
||||
msgstr "Přepnout uživatele"
|
||||
|
||||
#: ../js/ui/statusMenu.js:162
|
||||
msgid "Log Out..."
|
||||
msgstr "Odhlásit..."
|
||||
|
||||
#: ../js/ui/statusMenu.js:167
|
||||
msgid "Shut Down..."
|
||||
msgstr "Vypnout..."
|
||||
|
||||
#. Translators: This is a time format.
|
||||
#: ../js/ui/widget.js:163
|
||||
msgid "%H:%M"
|
||||
@ -111,11 +209,11 @@ msgstr "Aplikace"
|
||||
msgid "Recent Documents"
|
||||
msgstr "Nedávné dokumenty"
|
||||
|
||||
#: ../src/shell-global.c:890
|
||||
#: ../src/shell-global.c:967
|
||||
msgid "Less than a minute ago"
|
||||
msgstr "Před méně než minutou"
|
||||
|
||||
#: ../src/shell-global.c:893
|
||||
#: ../src/shell-global.c:971
|
||||
#, c-format
|
||||
msgid "%d minute ago"
|
||||
msgid_plural "%d minutes ago"
|
||||
@ -123,7 +221,7 @@ msgstr[0] "Před %d minutou"
|
||||
msgstr[1] "Před %d minutami"
|
||||
msgstr[2] "Před %d minutami"
|
||||
|
||||
#: ../src/shell-global.c:896
|
||||
#: ../src/shell-global.c:976
|
||||
#, c-format
|
||||
msgid "%d hour ago"
|
||||
msgid_plural "%d hours ago"
|
||||
@ -131,7 +229,7 @@ msgstr[0] "Před %d hodinou"
|
||||
msgstr[1] "Před %d hodinami"
|
||||
msgstr[2] "Před %d hodinami"
|
||||
|
||||
#: ../src/shell-global.c:899
|
||||
#: ../src/shell-global.c:981
|
||||
#, c-format
|
||||
msgid "%d day ago"
|
||||
msgid_plural "%d days ago"
|
||||
@ -139,7 +237,7 @@ msgstr[0] "Před %d dnem"
|
||||
msgstr[1] "Před %d dny"
|
||||
msgstr[2] "Před %d dny"
|
||||
|
||||
#: ../src/shell-global.c:902
|
||||
#: ../src/shell-global.c:986
|
||||
#, c-format
|
||||
msgid "%d week ago"
|
||||
msgid_plural "%d weeks ago"
|
||||
@ -198,27 +296,6 @@ msgstr "%1$s: %2$s"
|
||||
#~ msgid "Can't logout: %s"
|
||||
#~ msgstr "Nelze se odhlásit: %s"
|
||||
|
||||
#~ msgid "Account Information..."
|
||||
#~ msgstr "Informace o účtu..."
|
||||
|
||||
#~ msgid "Sidebar"
|
||||
#~ msgstr "Postranní lišta"
|
||||
|
||||
#~ msgid "System Preferences..."
|
||||
#~ msgstr "Předvolby systému..."
|
||||
|
||||
#~ msgid "Lock Screen"
|
||||
#~ msgstr "Uzamknout obrazovku"
|
||||
|
||||
#~ msgid "Switch User"
|
||||
#~ msgstr "Přepnout uživatele"
|
||||
|
||||
#~ msgid "Log Out..."
|
||||
#~ msgstr "Odhlásit..."
|
||||
|
||||
#~ msgid "Shut Down..."
|
||||
#~ msgstr "Vypnout..."
|
||||
|
||||
#~ msgid "Browse"
|
||||
#~ msgstr "Procházet"
|
||||
|
||||
|
259
po/da.po
259
po/da.po
@ -1,14 +1,14 @@
|
||||
# Danish translation of gnome-shell
|
||||
# Copyright (C) 2009 gnome-shell
|
||||
# Copyright (C) 2010 gnome-shell
|
||||
# This file is distributed under the same license as the gnome-shell package.
|
||||
# Kris Thomsen <lakristho@gmail.com>, 2009.
|
||||
# Kris Thomsen <lakristho@gmail.com>, 2009, 2010.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gnome-shell\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2009-10-21 22:51+0200\n"
|
||||
"PO-Revision-Date: 2009-10-18 17:32+0200\n"
|
||||
"POT-Creation-Date: 2010-02-23 22:07+0100\n"
|
||||
"PO-Revision-Date: 2010-02-11 22:32+0200\n"
|
||||
"Last-Translator: Kris Thomsen <lakristho@gmail.com>\n"
|
||||
"Language-Team: Danish <dansk@dansk-gruppen.dk>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -24,84 +24,166 @@ msgstr "Skal til GNOME"
|
||||
msgid "Window management and application launching"
|
||||
msgstr "Vinduehåndtering og åbning af programmer"
|
||||
|
||||
#: ../js/ui/appDisplay.js:332
|
||||
msgid "Frequent"
|
||||
msgstr "Ofte"
|
||||
#. **** Applications ****
|
||||
#: ../js/ui/appDisplay.js:180 ../js/ui/dash.js:881
|
||||
msgid "APPLICATIONS"
|
||||
msgstr "PROGRAMMER"
|
||||
|
||||
#: ../js/ui/appIcon.js:410
|
||||
#: ../js/ui/appDisplay.js:204
|
||||
msgid "PREFERENCES"
|
||||
msgstr "INDSTILLINGER"
|
||||
|
||||
#: ../js/ui/appDisplay.js:582
|
||||
msgid "New Window"
|
||||
msgstr "Nyt vindue"
|
||||
|
||||
#: ../js/ui/appIcon.js:414
|
||||
#: ../js/ui/appDisplay.js:586
|
||||
msgid "Remove from Favorites"
|
||||
msgstr "Fjern fra favoritter"
|
||||
|
||||
#: ../js/ui/appIcon.js:415
|
||||
#: ../js/ui/appDisplay.js:587
|
||||
msgid "Add to Favorites"
|
||||
msgstr "Tilføj til favoritter"
|
||||
|
||||
#: ../js/ui/dash.js:283
|
||||
#: ../js/ui/appDisplay.js:939
|
||||
msgid "Drag here to add favorites"
|
||||
msgstr "Træk hertil for at tilføje til favoritter"
|
||||
|
||||
#: ../js/ui/appFavorites.js:89
|
||||
#, c-format
|
||||
msgid "%s has been added to your favorites."
|
||||
msgstr ""
|
||||
|
||||
#: ../js/ui/appFavorites.js:107
|
||||
#, fuzzy, c-format
|
||||
msgid "%s has been removed from your favorites."
|
||||
msgstr "Fjern fra favoritter"
|
||||
|
||||
#: ../js/ui/dash.js:235
|
||||
msgid "Find..."
|
||||
msgstr "Find..."
|
||||
|
||||
#: ../js/ui/dash.js:400
|
||||
msgid "More"
|
||||
msgstr "Mere"
|
||||
#: ../js/ui/dash.js:505
|
||||
msgid "Searching..."
|
||||
msgstr "Søger..."
|
||||
|
||||
#: ../js/ui/dash.js:543
|
||||
msgid "(see all)"
|
||||
msgstr "(se alle)"
|
||||
|
||||
#. **** Applications ****
|
||||
#: ../js/ui/dash.js:725 ../js/ui/dash.js:787
|
||||
msgid "APPLICATIONS"
|
||||
msgstr "PROGRAMMER"
|
||||
#: ../js/ui/dash.js:519
|
||||
msgid "No matching results."
|
||||
msgstr "Ingen matchende resultater."
|
||||
|
||||
#. **** Places ****
|
||||
#. Translators: This is in the sense of locations for documents,
|
||||
#. network locations, etc.
|
||||
#: ../js/ui/dash.js:745
|
||||
msgid "PLACES"
|
||||
msgstr "STEDER"
|
||||
#: ../js/ui/dash.js:900 ../js/ui/placeDisplay.js:529
|
||||
msgid "PLACES & DEVICES"
|
||||
msgstr "STEDER & ENHEDER"
|
||||
|
||||
#. **** Documents ****
|
||||
#: ../js/ui/dash.js:752 ../js/ui/dash.js:797
|
||||
msgid "RECENT DOCUMENTS"
|
||||
msgstr "SENESTE DOKUMENTER"
|
||||
#: ../js/ui/dash.js:907 ../js/ui/docDisplay.js:488
|
||||
msgid "RECENT ITEMS"
|
||||
msgstr "SENESTE ELEMENTER"
|
||||
|
||||
#. **** Search Results ****
|
||||
#: ../js/ui/dash.js:777 ../js/ui/dash.js:961
|
||||
msgid "SEARCH RESULTS"
|
||||
msgstr "SØGERESULTATER"
|
||||
#: ../js/ui/lookingGlass.js:356
|
||||
msgid "No extensions installed"
|
||||
msgstr ""
|
||||
|
||||
#: ../js/ui/dash.js:792
|
||||
msgid "PREFERENCES"
|
||||
msgstr "INDSTILLINGER"
|
||||
#: ../js/ui/lookingGlass.js:393
|
||||
msgid "Enabled"
|
||||
msgstr ""
|
||||
|
||||
#: ../js/ui/lookingGlass.js:395
|
||||
msgid "Disabled"
|
||||
msgstr ""
|
||||
|
||||
#: ../js/ui/lookingGlass.js:397
|
||||
msgid "Error"
|
||||
msgstr ""
|
||||
|
||||
#: ../js/ui/lookingGlass.js:399
|
||||
msgid "Out of date"
|
||||
msgstr ""
|
||||
|
||||
#: ../js/ui/lookingGlass.js:424
|
||||
msgid "View Source"
|
||||
msgstr ""
|
||||
|
||||
#: ../js/ui/lookingGlass.js:430
|
||||
msgid "Web Page"
|
||||
msgstr ""
|
||||
|
||||
#: ../js/ui/overview.js:92
|
||||
msgid "Undo"
|
||||
msgstr ""
|
||||
|
||||
#. Button on the left side of the panel.
|
||||
#. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview".
|
||||
#: ../js/ui/panel.js:274
|
||||
#: ../js/ui/panel.js:336
|
||||
msgid "Activities"
|
||||
msgstr "Aktiviteter"
|
||||
|
||||
#. Translators: This is a time format.
|
||||
#: ../js/ui/panel.js:491
|
||||
#. Translators: This is the time format used in 24-hour mode.
|
||||
#: ../js/ui/panel.js:560
|
||||
msgid "%a %R"
|
||||
msgstr "%a %R"
|
||||
|
||||
#. Translators: This is a time format used for AM/PM.
|
||||
#: ../js/ui/panel.js:563
|
||||
msgid "%a %l:%M %p"
|
||||
msgstr "%a %H:%M"
|
||||
|
||||
#: ../js/ui/places.js:178
|
||||
#: ../js/ui/placeDisplay.js:144
|
||||
msgid "Connect to..."
|
||||
msgstr "Forbind til..."
|
||||
|
||||
#: ../js/ui/runDialog.js:96
|
||||
#: ../js/ui/runDialog.js:245
|
||||
msgid "Please enter a command:"
|
||||
msgstr "Indtast en kommando:"
|
||||
|
||||
#: ../js/ui/runDialog.js:173
|
||||
#: ../js/ui/runDialog.js:361
|
||||
#, c-format
|
||||
msgid "Execution of '%s' failed:"
|
||||
msgstr "Kørsel af \"%s\" mislykkedes:"
|
||||
|
||||
#: ../js/ui/statusMenu.js:107
|
||||
msgid "Available"
|
||||
msgstr ""
|
||||
|
||||
#: ../js/ui/statusMenu.js:112
|
||||
msgid "Busy"
|
||||
msgstr ""
|
||||
|
||||
#: ../js/ui/statusMenu.js:117
|
||||
msgid "Invisible"
|
||||
msgstr ""
|
||||
|
||||
#: ../js/ui/statusMenu.js:126
|
||||
msgid "Account Information..."
|
||||
msgstr "Kontoinformation..."
|
||||
|
||||
#: ../js/ui/statusMenu.js:132
|
||||
msgid "Sidebar"
|
||||
msgstr "Sidebjælke"
|
||||
|
||||
#: ../js/ui/statusMenu.js:142
|
||||
msgid "System Preferences..."
|
||||
msgstr "Systemindstillinger..."
|
||||
|
||||
#: ../js/ui/statusMenu.js:151
|
||||
msgid "Lock Screen"
|
||||
msgstr "Lås skærm"
|
||||
|
||||
#: ../js/ui/statusMenu.js:156
|
||||
msgid "Switch User"
|
||||
msgstr "Skift bruger"
|
||||
|
||||
#: ../js/ui/statusMenu.js:162
|
||||
msgid "Log Out..."
|
||||
msgstr "Log ud..."
|
||||
|
||||
#: ../js/ui/statusMenu.js:167
|
||||
msgid "Shut Down..."
|
||||
msgstr "Luk ned..."
|
||||
|
||||
#. Translators: This is a time format.
|
||||
#: ../js/ui/widget.js:163
|
||||
msgid "%H:%M"
|
||||
@ -115,99 +197,49 @@ msgstr "Programmer"
|
||||
msgid "Recent Documents"
|
||||
msgstr "Seneste dokumenter"
|
||||
|
||||
#: ../src/shell-global.c:812
|
||||
#: ../src/shell-global.c:954
|
||||
msgid "Less than a minute ago"
|
||||
msgstr "Mindre end et minut siden"
|
||||
|
||||
#: ../src/shell-global.c:815
|
||||
#: ../src/shell-global.c:958
|
||||
#, c-format
|
||||
msgid "%d minute ago"
|
||||
msgid_plural "%d minutes ago"
|
||||
msgstr[0] "%d minut siden"
|
||||
msgstr[1] "%d minutter siden"
|
||||
|
||||
#: ../src/shell-global.c:818
|
||||
#: ../src/shell-global.c:963
|
||||
#, c-format
|
||||
msgid "%d hour ago"
|
||||
msgid_plural "%d hours ago"
|
||||
msgstr[0] "%d time siden"
|
||||
msgstr[1] "%d timer siden"
|
||||
|
||||
#: ../src/shell-global.c:821
|
||||
#: ../src/shell-global.c:968
|
||||
#, c-format
|
||||
msgid "%d day ago"
|
||||
msgid_plural "%d days ago"
|
||||
msgstr[0] "%d dag siden"
|
||||
msgstr[1] "%d dage siden"
|
||||
|
||||
#: ../src/shell-global.c:824
|
||||
#: ../src/shell-global.c:973
|
||||
#, c-format
|
||||
msgid "%d week ago"
|
||||
msgid_plural "%d weeks ago"
|
||||
msgstr[0] "%d uge siden"
|
||||
msgstr[1] "%d uger siden"
|
||||
|
||||
#: ../src/shell-status-menu.c:156
|
||||
msgid "Unknown"
|
||||
msgstr "Ukendt"
|
||||
|
||||
#: ../src/shell-status-menu.c:212
|
||||
#, c-format
|
||||
msgid "Can't lock screen: %s"
|
||||
msgstr "Kan ikke låse skærm: %s"
|
||||
|
||||
#: ../src/shell-status-menu.c:227
|
||||
#, c-format
|
||||
msgid "Can't temporarily set screensaver to blank screen: %s"
|
||||
msgstr "Kan ikke midlertidigt sætte pauseskærm til blank skærm: %s"
|
||||
|
||||
#: ../src/shell-status-menu.c:351
|
||||
#, c-format
|
||||
msgid "Can't logout: %s"
|
||||
msgstr "Kan ikke logge ud: %s"
|
||||
|
||||
#: ../src/shell-status-menu.c:492
|
||||
msgid "Account Information..."
|
||||
msgstr "Kontoinformation..."
|
||||
|
||||
#: ../src/shell-status-menu.c:502
|
||||
msgid "Sidebar"
|
||||
msgstr "Sidebjælke"
|
||||
|
||||
#: ../src/shell-status-menu.c:510
|
||||
msgid "System Preferences..."
|
||||
msgstr "Systemindstillinger..."
|
||||
|
||||
#: ../src/shell-status-menu.c:525
|
||||
msgid "Lock Screen"
|
||||
msgstr "Lås skærm"
|
||||
|
||||
#: ../src/shell-status-menu.c:535
|
||||
msgid "Switch User"
|
||||
msgstr "Skift bruger"
|
||||
|
||||
#. Only show switch user if there are other users
|
||||
#. Log Out
|
||||
#: ../src/shell-status-menu.c:546
|
||||
msgid "Log Out..."
|
||||
msgstr "Log ud..."
|
||||
|
||||
#. Shut down
|
||||
#: ../src/shell-status-menu.c:557
|
||||
msgid "Shut Down..."
|
||||
msgstr "Luk ned..."
|
||||
|
||||
#: ../src/shell-uri-util.c:87
|
||||
#: ../src/shell-uri-util.c:89
|
||||
msgid "Home Folder"
|
||||
msgstr "Hjemmemappe"
|
||||
|
||||
#. Translators: this is the same string as the one found in
|
||||
#. * nautilus
|
||||
#: ../src/shell-uri-util.c:102
|
||||
#: ../src/shell-uri-util.c:104
|
||||
msgid "File System"
|
||||
msgstr "Filsystem"
|
||||
|
||||
#: ../src/shell-uri-util.c:248
|
||||
#: ../src/shell-uri-util.c:250
|
||||
msgid "Search"
|
||||
msgstr "Søg"
|
||||
|
||||
@ -216,11 +248,38 @@ msgstr "Søg"
|
||||
#. * example, "Trash: some-directory". It means that the
|
||||
#. * directory called "some-directory" is in the trash.
|
||||
#.
|
||||
#: ../src/shell-uri-util.c:298
|
||||
#: ../src/shell-uri-util.c:300
|
||||
#, c-format
|
||||
msgid "%1$s: %2$s"
|
||||
msgstr "%1$s: %2$s"
|
||||
|
||||
#~ msgid "Frequent"
|
||||
#~ msgstr "Ofte"
|
||||
|
||||
#~ msgid "More"
|
||||
#~ msgstr "Mere"
|
||||
|
||||
#~ msgid "(see all)"
|
||||
#~ msgstr "(se alle)"
|
||||
|
||||
#~ msgid "PLACES"
|
||||
#~ msgstr "STEDER"
|
||||
|
||||
#~ msgid "SEARCH RESULTS"
|
||||
#~ msgstr "SØGERESULTATER"
|
||||
|
||||
#~ msgid "Unknown"
|
||||
#~ msgstr "Ukendt"
|
||||
|
||||
#~ msgid "Can't lock screen: %s"
|
||||
#~ msgstr "Kan ikke låse skærm: %s"
|
||||
|
||||
#~ msgid "Can't temporarily set screensaver to blank screen: %s"
|
||||
#~ msgstr "Kan ikke midlertidigt sætte pauseskærm til blank skærm: %s"
|
||||
|
||||
#~ msgid "Can't logout: %s"
|
||||
#~ msgstr "Kan ikke logge ud: %s"
|
||||
|
||||
#~ msgid "Browse"
|
||||
#~ msgstr "Gennemse"
|
||||
|
||||
|
183
po/de.po
183
po/de.po
@ -12,14 +12,16 @@ msgstr ""
|
||||
"Project-Id-Version: gnome-shell master\n"
|
||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-"
|
||||
"shell&component=general\n"
|
||||
"POT-Creation-Date: 2010-01-07 23:31+0000\n"
|
||||
"PO-Revision-Date: 2010-01-15 16:54+0100\n"
|
||||
"POT-Creation-Date: 2010-03-20 22:48+0000\n"
|
||||
"PO-Revision-Date: 2010-03-21 16:27+0100\n"
|
||||
"Last-Translator: Mario Blättermann <mariobl@gnome.org>\n"
|
||||
"Language-Team: German <gnome-de@gnome.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Poedit-Language: German\n"
|
||||
"X-Poedit-Country: GERMANY\n"
|
||||
|
||||
#: ../data/gnome-shell.desktop.in.in.h:1
|
||||
msgid "GNOME Shell"
|
||||
@ -30,80 +32,174 @@ msgid "Window management and application launching"
|
||||
msgstr "Fenster verwalten und Anwendungen starten"
|
||||
|
||||
#. **** Applications ****
|
||||
#: ../js/ui/appDisplay.js:252 ../js/ui/dash.js:865
|
||||
#: ../js/ui/appDisplay.js:311 ../js/ui/dash.js:852
|
||||
msgid "APPLICATIONS"
|
||||
msgstr "ANWENDUNGEN"
|
||||
|
||||
#: ../js/ui/appDisplay.js:276
|
||||
#: ../js/ui/appDisplay.js:343
|
||||
msgid "PREFERENCES"
|
||||
msgstr "EINSTELLUNGEN"
|
||||
|
||||
#: ../js/ui/appDisplay.js:707 ../js/ui/appIcon.js:425
|
||||
#: ../js/ui/appDisplay.js:728
|
||||
msgid "New Window"
|
||||
msgstr "Neues Fenster"
|
||||
|
||||
#: ../js/ui/appDisplay.js:711 ../js/ui/appIcon.js:429
|
||||
#: ../js/ui/appDisplay.js:732
|
||||
msgid "Remove from Favorites"
|
||||
msgstr "Aus Favoriten entfernen"
|
||||
|
||||
#: ../js/ui/appDisplay.js:712 ../js/ui/appIcon.js:430
|
||||
#: ../js/ui/appDisplay.js:733
|
||||
msgid "Add to Favorites"
|
||||
msgstr "Zu Favoriten hinzufügen"
|
||||
|
||||
#: ../js/ui/appDisplay.js:1064
|
||||
#: ../js/ui/appDisplay.js:1085
|
||||
msgid "Drag here to add favorites"
|
||||
msgstr "Hier ablegen, um zu Favoriten hinzuzufügen"
|
||||
|
||||
#: ../js/ui/dash.js:240
|
||||
msgid "Find..."
|
||||
msgstr "Suchen …"
|
||||
#: ../js/ui/appFavorites.js:89
|
||||
#, c-format
|
||||
msgid "%s has been added to your favorites."
|
||||
msgstr "%s wurde zu Ihren Favoriten hinzugefügt"
|
||||
|
||||
#: ../js/ui/dash.js:493
|
||||
#| msgid "Search"
|
||||
#: ../js/ui/appFavorites.js:107
|
||||
#, c-format
|
||||
msgid "%s has been removed from your favorites."
|
||||
msgstr "%s wurde aus Ihren Favoriten entfernt"
|
||||
|
||||
#: ../js/ui/dash.js:194
|
||||
msgid "Find"
|
||||
msgstr "Suchen"
|
||||
|
||||
#: ../js/ui/dash.js:507
|
||||
msgid "Searching..."
|
||||
msgstr "Suche läuft …"
|
||||
|
||||
#: ../js/ui/dash.js:507
|
||||
#: ../js/ui/dash.js:521
|
||||
msgid "No matching results."
|
||||
msgstr "Keine passenden Ergebnisse."
|
||||
|
||||
#. **** Places ****
|
||||
#. Translators: This is in the sense of locations for documents,
|
||||
#. network locations, etc.
|
||||
#: ../js/ui/dash.js:885 ../js/ui/placeDisplay.js:519
|
||||
#: ../js/ui/dash.js:871 ../js/ui/placeDisplay.js:579
|
||||
msgid "PLACES & DEVICES"
|
||||
msgstr "ORTE UND GERÄTE"
|
||||
|
||||
#. **** Documents ****
|
||||
#: ../js/ui/dash.js:892
|
||||
#| msgid "RECENT DOCUMENTS"
|
||||
#: ../js/ui/dash.js:878 ../js/ui/docDisplay.js:488
|
||||
msgid "RECENT ITEMS"
|
||||
msgstr "ZULETZT GEÖFFNETE DOKUMENTE"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:363
|
||||
msgid "No extensions installed"
|
||||
msgstr "Keine Erweiterungen installiert"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:400
|
||||
msgid "Enabled"
|
||||
msgstr "Aktiviert"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:402
|
||||
msgid "Disabled"
|
||||
msgstr "Deaktiviert"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:404
|
||||
msgid "Error"
|
||||
msgstr "Fehler"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:406
|
||||
msgid "Out of date"
|
||||
msgstr "Veraltet"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:431
|
||||
msgid "View Source"
|
||||
msgstr "Quelle zeigen"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:437
|
||||
msgid "Web Page"
|
||||
msgstr "Webseite"
|
||||
|
||||
#: ../js/ui/overview.js:182
|
||||
msgid "Undo"
|
||||
msgstr "Rückgängig"
|
||||
|
||||
#. Button on the left side of the panel.
|
||||
#. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview".
|
||||
#: ../js/ui/panel.js:336
|
||||
#: ../js/ui/panel.js:385
|
||||
msgid "Activities"
|
||||
msgstr "Aktivitäten"
|
||||
|
||||
#. Translators: This is a time format.
|
||||
#: ../js/ui/panel.js:549
|
||||
#. Translators: This is the time format used in 24-hour mode.
|
||||
#: ../js/ui/panel.js:616
|
||||
msgid "%a %R"
|
||||
msgstr "%a %R"
|
||||
|
||||
#. Translators: This is a time format used for AM/PM.
|
||||
#: ../js/ui/panel.js:619
|
||||
msgid "%a %l:%M %p"
|
||||
msgstr "%a %H:%M"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:144
|
||||
#: ../js/ui/placeDisplay.js:103
|
||||
#, c-format
|
||||
msgid "Failed to unmount '%s'"
|
||||
msgstr "»%s« konnte nicht ausgehängt werden"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:106
|
||||
msgid "Retry"
|
||||
msgstr "Erneut versuchen"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:151
|
||||
msgid "Connect to..."
|
||||
msgstr "Verbinden mit …"
|
||||
|
||||
#: ../js/ui/runDialog.js:235
|
||||
#: ../js/ui/runDialog.js:232
|
||||
msgid "Please enter a command:"
|
||||
msgstr "Bitte geben Sie einen Befehl ein:"
|
||||
|
||||
#: ../js/ui/runDialog.js:351
|
||||
#: ../js/ui/runDialog.js:374
|
||||
#, c-format
|
||||
msgid "Execution of '%s' failed:"
|
||||
msgstr "Ausführung von »%s« ist gescheitert:"
|
||||
|
||||
#: ../js/ui/statusMenu.js:107
|
||||
msgid "Available"
|
||||
msgstr "Verfügbar"
|
||||
|
||||
#: ../js/ui/statusMenu.js:112
|
||||
msgid "Busy"
|
||||
msgstr "Beschäftigt"
|
||||
|
||||
#: ../js/ui/statusMenu.js:117
|
||||
msgid "Invisible"
|
||||
msgstr "Unsichtbar"
|
||||
|
||||
#: ../js/ui/statusMenu.js:126
|
||||
msgid "Account Information..."
|
||||
msgstr "Benutzerinformationen …"
|
||||
|
||||
#: ../js/ui/statusMenu.js:132
|
||||
msgid "Sidebar"
|
||||
msgstr "Seitenleiste"
|
||||
|
||||
#: ../js/ui/statusMenu.js:142
|
||||
msgid "System Preferences..."
|
||||
msgstr "Systemeinstellungen …"
|
||||
|
||||
#: ../js/ui/statusMenu.js:151
|
||||
msgid "Lock Screen"
|
||||
msgstr "Bildschirm sperren"
|
||||
|
||||
#: ../js/ui/statusMenu.js:156
|
||||
msgid "Switch User"
|
||||
msgstr "Benutzer wechseln"
|
||||
|
||||
#: ../js/ui/statusMenu.js:162
|
||||
msgid "Log Out..."
|
||||
msgstr "Abmelden …"
|
||||
|
||||
#: ../js/ui/statusMenu.js:167
|
||||
msgid "Shut Down..."
|
||||
msgstr "Ausschalten …"
|
||||
|
||||
#. Translators: This is a time format.
|
||||
#: ../js/ui/widget.js:163
|
||||
msgid "%H:%M"
|
||||
@ -117,32 +213,42 @@ msgstr "Anwendungen"
|
||||
msgid "Recent Documents"
|
||||
msgstr "Zuletzt geöffnete Dokumente"
|
||||
|
||||
#: ../src/shell-global.c:890
|
||||
#: ../js/ui/windowAttentionHandler.js:47
|
||||
#, c-format
|
||||
msgid "%s has finished starting"
|
||||
msgstr "Start von %s ist abgeschlossen"
|
||||
|
||||
#: ../js/ui/windowAttentionHandler.js:49
|
||||
#, c-format
|
||||
msgid "'%s' is ready"
|
||||
msgstr "»%s« ist bereit"
|
||||
|
||||
#: ../src/shell-global.c:967
|
||||
msgid "Less than a minute ago"
|
||||
msgstr "Vor weniger als einer Minute"
|
||||
|
||||
#: ../src/shell-global.c:893
|
||||
#: ../src/shell-global.c:971
|
||||
#, c-format
|
||||
msgid "%d minute ago"
|
||||
msgid_plural "%d minutes ago"
|
||||
msgstr[0] "Vor %d Minute"
|
||||
msgstr[1] "Vor %d Minuten"
|
||||
|
||||
#: ../src/shell-global.c:896
|
||||
#: ../src/shell-global.c:976
|
||||
#, c-format
|
||||
msgid "%d hour ago"
|
||||
msgid_plural "%d hours ago"
|
||||
msgstr[0] "Vor %d Stunde"
|
||||
msgstr[1] "Vor %d Stunden"
|
||||
|
||||
#: ../src/shell-global.c:899
|
||||
#: ../src/shell-global.c:981
|
||||
#, c-format
|
||||
msgid "%d day ago"
|
||||
msgid_plural "%d days ago"
|
||||
msgstr[0] "Vor %d Tag"
|
||||
msgstr[1] "Vor %d Tagen"
|
||||
|
||||
#: ../src/shell-global.c:902
|
||||
#: ../src/shell-global.c:986
|
||||
#, c-format
|
||||
msgid "%d week ago"
|
||||
msgid_plural "%d weeks ago"
|
||||
@ -202,27 +308,6 @@ msgstr "%1$s: %2$s"
|
||||
#~ msgid "Can't logout: %s"
|
||||
#~ msgstr "Abmelden ist nicht möglich: %s"
|
||||
|
||||
#~ msgid "Account Information..."
|
||||
#~ msgstr "Benutzerinformationen …"
|
||||
|
||||
#~ msgid "Sidebar"
|
||||
#~ msgstr "Seitenleiste"
|
||||
|
||||
#~ msgid "System Preferences..."
|
||||
#~ msgstr "Systemeinstellungen …"
|
||||
|
||||
#~ msgid "Lock Screen"
|
||||
#~ msgstr "Bildschirm sperren"
|
||||
|
||||
#~ msgid "Switch User"
|
||||
#~ msgstr "Benutzer wechseln"
|
||||
|
||||
#~ msgid "Log Out..."
|
||||
#~ msgstr "Abmelden …"
|
||||
|
||||
#~ msgid "Shut Down..."
|
||||
#~ msgstr "Ausschalten …"
|
||||
|
||||
#~ msgid "Find apps or documents"
|
||||
#~ msgstr "Anwendungen oder Dokumente suchen"
|
||||
|
||||
|
308
po/en_GB.po
308
po/en_GB.po
@ -2,20 +2,22 @@
|
||||
# Copyright (C) 2009 gnome-shell's COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the gnome-shell package.
|
||||
# Philip Withnall <philip@tecnocode.co.uk>, 2009.
|
||||
#
|
||||
# Bruce Cowan <bcowan@fastmail.co.uk>, 2010.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gnome-shell master\n"
|
||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-"
|
||||
"shell&component=general\n"
|
||||
"POT-Creation-Date: 2009-09-12 12:41+0000\n"
|
||||
"PO-Revision-Date: 2009-09-12 12:41+0000\n"
|
||||
"Last-Translator: Philip Withnall <philip@tecnocode.co.uk>\n"
|
||||
"Language-Team: British English <en_GB@li.org>\n"
|
||||
"POT-Creation-Date: 2010-03-20 22:31+0000\n"
|
||||
"PO-Revision-Date: 2010-03-20 22:32+0100\n"
|
||||
"Last-Translator: Bruce Cowan <bcowan@fastmail.co.uk>\n"
|
||||
"Language-Team: British English <en@li.org>\n"
|
||||
"Language: en_GB\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Virtaal 0.5.2\n"
|
||||
|
||||
#: ../data/gnome-shell.desktop.in.in.h:1
|
||||
msgid "GNOME Shell"
|
||||
@ -25,151 +27,231 @@ msgstr "GNOME Shell"
|
||||
msgid "Window management and application launching"
|
||||
msgstr "Window management and application launching"
|
||||
|
||||
#. left side
|
||||
#: ../js/ui/panel.js:269
|
||||
msgid "Activities"
|
||||
msgstr "Activities"
|
||||
|
||||
#. Translators: This is a time format.
|
||||
#: ../js/ui/panel.js:452
|
||||
msgid "%a %l:%M %p"
|
||||
msgstr "%a %l:%M %p"
|
||||
|
||||
#: ../js/ui/dash.js:283
|
||||
msgid "Find..."
|
||||
msgstr "Find…"
|
||||
|
||||
#: ../js/ui/dash.js:400
|
||||
msgid "Browse"
|
||||
msgstr "Browse"
|
||||
|
||||
#: ../js/ui/dash.js:536
|
||||
msgid "(see all)"
|
||||
msgstr "(see all)"
|
||||
|
||||
#. **** Applications ****
|
||||
#: ../js/ui/dash.js:753 ../js/ui/dash.js:809
|
||||
#: ../js/ui/appDisplay.js:311 ../js/ui/dash.js:852
|
||||
msgid "APPLICATIONS"
|
||||
msgstr "APPLICATIONS"
|
||||
|
||||
#: ../js/ui/appDisplay.js:343
|
||||
msgid "PREFERENCES"
|
||||
msgstr "PREFERENCES"
|
||||
|
||||
#: ../js/ui/appDisplay.js:728
|
||||
msgid "New Window"
|
||||
msgstr "New Window"
|
||||
|
||||
#: ../js/ui/appDisplay.js:732
|
||||
msgid "Remove from Favorites"
|
||||
msgstr "Remove from Favourites"
|
||||
|
||||
#: ../js/ui/appDisplay.js:733
|
||||
msgid "Add to Favorites"
|
||||
msgstr "Add to Favourites"
|
||||
|
||||
#: ../js/ui/appDisplay.js:1085
|
||||
msgid "Drag here to add favorites"
|
||||
msgstr "Drag here to add favourites"
|
||||
|
||||
#: ../js/ui/appFavorites.js:89
|
||||
#, c-format
|
||||
msgid "%s has been added to your favorites."
|
||||
msgstr "%s has been added to your favourites."
|
||||
|
||||
#: ../js/ui/appFavorites.js:107
|
||||
#, c-format
|
||||
msgid "%s has been removed from your favorites."
|
||||
msgstr "%s has been removed from your favourites."
|
||||
|
||||
#: ../js/ui/dash.js:194
|
||||
msgid "Find"
|
||||
msgstr "Find"
|
||||
|
||||
#: ../js/ui/dash.js:507
|
||||
msgid "Searching..."
|
||||
msgstr "Searching…"
|
||||
|
||||
#: ../js/ui/dash.js:521
|
||||
msgid "No matching results."
|
||||
msgstr "No matching results."
|
||||
|
||||
#. **** Places ****
|
||||
#. Translators: This is in the sense of locations for documents,
|
||||
#. network locations, etc.
|
||||
#: ../js/ui/dash.js:773
|
||||
msgid "PLACES"
|
||||
msgstr "PLACES"
|
||||
#: ../js/ui/dash.js:871 ../js/ui/placeDisplay.js:579
|
||||
msgid "PLACES & DEVICES"
|
||||
msgstr "PLACES & DEVICES"
|
||||
|
||||
#. **** Documents ****
|
||||
#: ../js/ui/dash.js:780 ../js/ui/dash.js:819
|
||||
msgid "RECENT DOCUMENTS"
|
||||
msgstr "RECENT DOCUMENTS"
|
||||
#: ../js/ui/dash.js:878 ../js/ui/docDisplay.js:488
|
||||
msgid "RECENT ITEMS"
|
||||
msgstr "RECENT ITEMS"
|
||||
|
||||
#. **** Search Results ****
|
||||
#: ../js/ui/dash.js:799 ../js/ui/dash.js:931
|
||||
msgid "SEARCH RESULTS"
|
||||
msgstr "SEARCH RESULTS"
|
||||
#: ../js/ui/lookingGlass.js:363
|
||||
msgid "No extensions installed"
|
||||
msgstr "No extensions installed"
|
||||
|
||||
#: ../js/ui/dash.js:814
|
||||
msgid "PREFERENCES"
|
||||
msgstr "PREFERENCES"
|
||||
#: ../js/ui/lookingGlass.js:400
|
||||
msgid "Enabled"
|
||||
msgstr "Enabled"
|
||||
|
||||
#: ../js/ui/runDialog.js:90
|
||||
#: ../js/ui/lookingGlass.js:402
|
||||
msgid "Disabled"
|
||||
msgstr "Disabled"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:404
|
||||
msgid "Error"
|
||||
msgstr "Error"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:406
|
||||
msgid "Out of date"
|
||||
msgstr "Out of date"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:431
|
||||
msgid "View Source"
|
||||
msgstr "View Source"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:437
|
||||
msgid "Web Page"
|
||||
msgstr "Web Page"
|
||||
|
||||
#: ../js/ui/overview.js:182
|
||||
msgid "Undo"
|
||||
msgstr "Undo"
|
||||
|
||||
#. Button on the left side of the panel.
|
||||
#. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview".
|
||||
#: ../js/ui/panel.js:385
|
||||
msgid "Activities"
|
||||
msgstr "Activities"
|
||||
|
||||
#. Translators: This is the time format used in 24-hour mode.
|
||||
#: ../js/ui/panel.js:616
|
||||
msgid "%a %R"
|
||||
msgstr "%a %R"
|
||||
|
||||
#. Translators: This is a time format used for AM/PM.
|
||||
#: ../js/ui/panel.js:619
|
||||
msgid "%a %l:%M %p"
|
||||
msgstr "%a %l:%M %p"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:103
|
||||
#, c-format
|
||||
msgid "Failed to unmount '%s'"
|
||||
msgstr "Failed to unmount '%s'"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:106
|
||||
msgid "Retry"
|
||||
msgstr "Retry"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:151
|
||||
msgid "Connect to..."
|
||||
msgstr "Connect to…"
|
||||
|
||||
#: ../js/ui/runDialog.js:232
|
||||
msgid "Please enter a command:"
|
||||
msgstr "Please enter a command:"
|
||||
|
||||
#: ../src/shell-global.c:799
|
||||
#: ../js/ui/runDialog.js:374
|
||||
#, c-format
|
||||
msgid "Execution of '%s' failed:"
|
||||
msgstr "Execution of '%s' failed:"
|
||||
|
||||
#: ../js/ui/statusMenu.js:107
|
||||
msgid "Available"
|
||||
msgstr "Available"
|
||||
|
||||
#: ../js/ui/statusMenu.js:112
|
||||
msgid "Busy"
|
||||
msgstr "Busy"
|
||||
|
||||
#: ../js/ui/statusMenu.js:117
|
||||
msgid "Invisible"
|
||||
msgstr "Invisible"
|
||||
|
||||
#: ../js/ui/statusMenu.js:126
|
||||
msgid "Account Information..."
|
||||
msgstr "Account Information…"
|
||||
|
||||
#: ../js/ui/statusMenu.js:132
|
||||
msgid "Sidebar"
|
||||
msgstr "Sidebar"
|
||||
|
||||
#: ../js/ui/statusMenu.js:142
|
||||
msgid "System Preferences..."
|
||||
msgstr "System Preferences…"
|
||||
|
||||
#: ../js/ui/statusMenu.js:151
|
||||
msgid "Lock Screen"
|
||||
msgstr "Lock Screen"
|
||||
|
||||
#: ../js/ui/statusMenu.js:156
|
||||
msgid "Switch User"
|
||||
msgstr "Switch User"
|
||||
|
||||
#: ../js/ui/statusMenu.js:162
|
||||
msgid "Log Out..."
|
||||
msgstr "Log Out…"
|
||||
|
||||
#: ../js/ui/statusMenu.js:167
|
||||
msgid "Shut Down..."
|
||||
msgstr "Shut Down…"
|
||||
|
||||
#. Translators: This is a time format.
|
||||
#: ../js/ui/widget.js:163
|
||||
msgid "%H:%M"
|
||||
msgstr "%H:%M"
|
||||
|
||||
#: ../js/ui/widget.js:317
|
||||
msgid "Applications"
|
||||
msgstr "Applications"
|
||||
|
||||
#: ../js/ui/widget.js:339
|
||||
msgid "Recent Documents"
|
||||
msgstr "Recent Documents"
|
||||
|
||||
#: ../src/shell-global.c:967
|
||||
msgid "Less than a minute ago"
|
||||
msgstr "Less than a minute ago"
|
||||
|
||||
#: ../src/shell-global.c:802
|
||||
#: ../src/shell-global.c:971
|
||||
#, c-format
|
||||
msgid "%d minute ago"
|
||||
msgid_plural "%d minutes ago"
|
||||
msgstr[0] "%d minute ago"
|
||||
msgstr[1] "%d minutes ago"
|
||||
|
||||
#: ../src/shell-global.c:805
|
||||
#: ../src/shell-global.c:976
|
||||
#, c-format
|
||||
msgid "%d hour ago"
|
||||
msgid_plural "%d hours ago"
|
||||
msgstr[0] "%d hour ago"
|
||||
msgstr[1] "%d hours ago"
|
||||
|
||||
#: ../src/shell-global.c:808
|
||||
#: ../src/shell-global.c:981
|
||||
#, c-format
|
||||
msgid "%d day ago"
|
||||
msgid_plural "%d days ago"
|
||||
msgstr[0] "%d day ago"
|
||||
msgstr[1] "%d days ago"
|
||||
|
||||
#: ../src/shell-global.c:811
|
||||
#: ../src/shell-global.c:986
|
||||
#, c-format
|
||||
msgid "%d week ago"
|
||||
msgid_plural "%d weeks ago"
|
||||
msgstr[0] "%d week ago"
|
||||
msgstr[1] "%d weeks ago"
|
||||
|
||||
#: ../src/shell-status-menu.c:156
|
||||
msgid "Unknown"
|
||||
msgstr "Unknown"
|
||||
|
||||
#: ../src/shell-status-menu.c:212
|
||||
#, c-format
|
||||
msgid "Can't lock screen: %s"
|
||||
msgstr "Can't lock screen: %s"
|
||||
|
||||
#: ../src/shell-status-menu.c:227
|
||||
#, c-format
|
||||
msgid "Can't temporarily set screensaver to blank screen: %s"
|
||||
msgstr "Can't temporarily set screensaver to blank screen: %s"
|
||||
|
||||
#: ../src/shell-status-menu.c:351
|
||||
#, c-format
|
||||
msgid "Can't logout: %s"
|
||||
msgstr "Can't logout: %s"
|
||||
|
||||
#: ../src/shell-status-menu.c:492
|
||||
msgid "Account Information..."
|
||||
msgstr "Account Information…"
|
||||
|
||||
#: ../src/shell-status-menu.c:502
|
||||
msgid "Sidebar"
|
||||
msgstr "Sidebar"
|
||||
|
||||
#: ../src/shell-status-menu.c:510
|
||||
msgid "System Preferences..."
|
||||
msgstr "System Preferences…"
|
||||
|
||||
#: ../src/shell-status-menu.c:525
|
||||
msgid "Lock Screen"
|
||||
msgstr "Lock Screen"
|
||||
|
||||
#: ../src/shell-status-menu.c:535
|
||||
msgid "Switch User"
|
||||
msgstr "Switch User"
|
||||
|
||||
#. Only show switch user if there are other users
|
||||
#. Log Out
|
||||
#: ../src/shell-status-menu.c:546
|
||||
msgid "Log Out..."
|
||||
msgstr "Log Out…"
|
||||
|
||||
#. Shut down
|
||||
#: ../src/shell-status-menu.c:557
|
||||
msgid "Shut Down..."
|
||||
msgstr "Shut Down…"
|
||||
|
||||
#: ../src/shell-uri-util.c:87
|
||||
#: ../src/shell-uri-util.c:89
|
||||
msgid "Home Folder"
|
||||
msgstr "Home Folder"
|
||||
|
||||
#. Translators: this is the same string as the one found in
|
||||
#. * nautilus
|
||||
#: ../src/shell-uri-util.c:102
|
||||
#: ../src/shell-uri-util.c:104
|
||||
msgid "File System"
|
||||
msgstr "File System"
|
||||
|
||||
#: ../src/shell-uri-util.c:248
|
||||
#: ../src/shell-uri-util.c:250
|
||||
msgid "Search"
|
||||
msgstr "Search"
|
||||
|
||||
@ -178,7 +260,31 @@ msgstr "Search"
|
||||
#. * example, "Trash: some-directory". It means that the
|
||||
#. * directory called "some-directory" is in the trash.
|
||||
#.
|
||||
#: ../src/shell-uri-util.c:298
|
||||
#: ../src/shell-uri-util.c:300
|
||||
#, c-format
|
||||
msgid "%1$s: %2$s"
|
||||
msgstr "%1$s: %2$s"
|
||||
|
||||
#~ msgid "Browse"
|
||||
#~ msgstr "Browse"
|
||||
|
||||
#~ msgid "(see all)"
|
||||
#~ msgstr "(see all)"
|
||||
|
||||
#~ msgid "PLACES"
|
||||
#~ msgstr "PLACES"
|
||||
|
||||
#~ msgid "SEARCH RESULTS"
|
||||
#~ msgstr "SEARCH RESULTS"
|
||||
|
||||
#~ msgid "Unknown"
|
||||
#~ msgstr "Unknown"
|
||||
|
||||
#~ msgid "Can't lock screen: %s"
|
||||
#~ msgstr "Can't lock screen: %s"
|
||||
|
||||
#~ msgid "Can't temporarily set screensaver to blank screen: %s"
|
||||
#~ msgstr "Can't temporarily set screensaver to blank screen: %s"
|
||||
|
||||
#~ msgid "Can't logout: %s"
|
||||
#~ msgstr "Can't logout: %s"
|
||||
|
88
po/es.po
88
po/es.po
@ -7,8 +7,8 @@ msgstr ""
|
||||
"Project-Id-Version: gnome-shell master\n"
|
||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-"
|
||||
"shell&component=general\n"
|
||||
"POT-Creation-Date: 2010-02-15 13:36+0000\n"
|
||||
"PO-Revision-Date: 2010-02-15 21:45+0100\n"
|
||||
"POT-Creation-Date: 2010-03-20 22:48+0000\n"
|
||||
"PO-Revision-Date: 2010-03-21 16:48+0100\n"
|
||||
"Last-Translator: Jorge González <jorgegonz@svn.gnome.org>\n"
|
||||
"Language-Team: Español <gnome-es-list@gnome.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -25,27 +25,27 @@ msgid "Window management and application launching"
|
||||
msgstr "Gestión de ventanas e inicio de aplicaciones"
|
||||
|
||||
#. **** Applications ****
|
||||
#: ../js/ui/appDisplay.js:252 ../js/ui/dash.js:880
|
||||
#: ../js/ui/appDisplay.js:311 ../js/ui/dash.js:852
|
||||
msgid "APPLICATIONS"
|
||||
msgstr "APLICACIONES"
|
||||
|
||||
#: ../js/ui/appDisplay.js:276
|
||||
#: ../js/ui/appDisplay.js:343
|
||||
msgid "PREFERENCES"
|
||||
msgstr "PREFERENCIAS"
|
||||
|
||||
#: ../js/ui/appDisplay.js:649
|
||||
#: ../js/ui/appDisplay.js:728
|
||||
msgid "New Window"
|
||||
msgstr "Ventana nueva"
|
||||
|
||||
#: ../js/ui/appDisplay.js:653
|
||||
#: ../js/ui/appDisplay.js:732
|
||||
msgid "Remove from Favorites"
|
||||
msgstr "Quitar de los favoritos"
|
||||
|
||||
#: ../js/ui/appDisplay.js:654
|
||||
#: ../js/ui/appDisplay.js:733
|
||||
msgid "Add to Favorites"
|
||||
msgstr "Añadir a los favoritos"
|
||||
|
||||
#: ../js/ui/appDisplay.js:1006
|
||||
#: ../js/ui/appDisplay.js:1085
|
||||
msgid "Drag here to add favorites"
|
||||
msgstr "Arrastrar aquí para añadir a los favoritos"
|
||||
|
||||
@ -56,91 +56,99 @@ msgstr "Se ha añadido %s a sus favoritos."
|
||||
|
||||
#: ../js/ui/appFavorites.js:107
|
||||
#, c-format
|
||||
#| msgid "Remove from Favorites"
|
||||
msgid "%s has been removed from your favorites."
|
||||
msgstr "Se ha quitado %s de sus favoritos."
|
||||
|
||||
#: ../js/ui/dash.js:241
|
||||
msgid "Find..."
|
||||
msgstr "Buscar…"
|
||||
#: ../js/ui/dash.js:194
|
||||
msgid "Find"
|
||||
msgstr "Buscar"
|
||||
|
||||
#: ../js/ui/dash.js:508
|
||||
#: ../js/ui/dash.js:507
|
||||
msgid "Searching..."
|
||||
msgstr "Buscando…"
|
||||
|
||||
#: ../js/ui/dash.js:522
|
||||
#: ../js/ui/dash.js:521
|
||||
msgid "No matching results."
|
||||
msgstr "No se encontró ningún resultado coincidente."
|
||||
|
||||
#. **** Places ****
|
||||
#. Translators: This is in the sense of locations for documents,
|
||||
#. network locations, etc.
|
||||
#: ../js/ui/dash.js:900 ../js/ui/placeDisplay.js:529
|
||||
#: ../js/ui/dash.js:871 ../js/ui/placeDisplay.js:579
|
||||
msgid "PLACES & DEVICES"
|
||||
msgstr "LUGARES Y DISPOSITIVOS"
|
||||
|
||||
#. **** Documents ****
|
||||
#: ../js/ui/dash.js:907 ../js/ui/docDisplay.js:488
|
||||
#: ../js/ui/dash.js:878 ../js/ui/docDisplay.js:488
|
||||
msgid "RECENT ITEMS"
|
||||
msgstr "ELEMENTOS RECIENTES"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:356
|
||||
#: ../js/ui/lookingGlass.js:363
|
||||
msgid "No extensions installed"
|
||||
msgstr "No hay extensiones instaladas"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:393
|
||||
#: ../js/ui/lookingGlass.js:400
|
||||
msgid "Enabled"
|
||||
msgstr "Activado"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:395
|
||||
#: ../js/ui/lookingGlass.js:402
|
||||
msgid "Disabled"
|
||||
msgstr "Desactivado"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:397
|
||||
#: ../js/ui/lookingGlass.js:404
|
||||
msgid "Error"
|
||||
msgstr "Error"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:399
|
||||
#: ../js/ui/lookingGlass.js:406
|
||||
msgid "Out of date"
|
||||
msgstr "Caducado"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:424
|
||||
#: ../js/ui/lookingGlass.js:431
|
||||
msgid "View Source"
|
||||
msgstr "Ver fuente"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:430
|
||||
#: ../js/ui/lookingGlass.js:437
|
||||
msgid "Web Page"
|
||||
msgstr "Página web"
|
||||
|
||||
#: ../js/ui/overview.js:95
|
||||
#: ../js/ui/overview.js:182
|
||||
msgid "Undo"
|
||||
msgstr "Deshacer"
|
||||
|
||||
#. Button on the left side of the panel.
|
||||
#. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview".
|
||||
#: ../js/ui/panel.js:336
|
||||
#: ../js/ui/panel.js:385
|
||||
msgid "Activities"
|
||||
msgstr "Actividades"
|
||||
|
||||
#. Translators: This is the time format used in 24-hour mode.
|
||||
#: ../js/ui/panel.js:560
|
||||
#: ../js/ui/panel.js:616
|
||||
msgid "%a %R"
|
||||
msgstr "%a %R"
|
||||
|
||||
#. Translators: This is a time format used for AM/PM.
|
||||
#: ../js/ui/panel.js:563
|
||||
#: ../js/ui/panel.js:619
|
||||
msgid "%a %l:%M %p"
|
||||
msgstr "%a %H:%M"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:144
|
||||
#: ../js/ui/placeDisplay.js:103
|
||||
#, c-format
|
||||
msgid "Failed to unmount '%s'"
|
||||
msgstr "Falló al desmontar «%s»"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:106
|
||||
msgid "Retry"
|
||||
msgstr "Reintentar"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:151
|
||||
msgid "Connect to..."
|
||||
msgstr "Conectar a…"
|
||||
|
||||
#: ../js/ui/runDialog.js:245
|
||||
#: ../js/ui/runDialog.js:232
|
||||
msgid "Please enter a command:"
|
||||
msgstr "Introduzca un comando:"
|
||||
|
||||
#: ../js/ui/runDialog.js:361
|
||||
#: ../js/ui/runDialog.js:374
|
||||
#, c-format
|
||||
msgid "Execution of '%s' failed:"
|
||||
msgstr "Falló la ejecución de «%s»:"
|
||||
@ -198,32 +206,42 @@ msgstr "Aplicaciones"
|
||||
msgid "Recent Documents"
|
||||
msgstr "Documentos recientes"
|
||||
|
||||
#: ../src/shell-global.c:976
|
||||
#: ../js/ui/windowAttentionHandler.js:47
|
||||
#, c-format
|
||||
msgid "%s has finished starting"
|
||||
msgstr "%s finalizó su lanzamiento"
|
||||
|
||||
#: ../js/ui/windowAttentionHandler.js:49
|
||||
#, c-format
|
||||
msgid "'%s' is ready"
|
||||
msgstr "«%s» está preparado"
|
||||
|
||||
#: ../src/shell-global.c:967
|
||||
msgid "Less than a minute ago"
|
||||
msgstr "Hace menos de un minuto"
|
||||
|
||||
#: ../src/shell-global.c:980
|
||||
#: ../src/shell-global.c:971
|
||||
#, c-format
|
||||
msgid "%d minute ago"
|
||||
msgid_plural "%d minutes ago"
|
||||
msgstr[0] "Hace %d minuto"
|
||||
msgstr[1] "Hace %d minutos"
|
||||
|
||||
#: ../src/shell-global.c:985
|
||||
#: ../src/shell-global.c:976
|
||||
#, c-format
|
||||
msgid "%d hour ago"
|
||||
msgid_plural "%d hours ago"
|
||||
msgstr[0] "Hace %d hora"
|
||||
msgstr[1] "Hace %d horas"
|
||||
|
||||
#: ../src/shell-global.c:990
|
||||
#: ../src/shell-global.c:981
|
||||
#, c-format
|
||||
msgid "%d day ago"
|
||||
msgid_plural "%d days ago"
|
||||
msgstr[0] "Hace %d día"
|
||||
msgstr[1] "Hace %d días"
|
||||
|
||||
#: ../src/shell-global.c:995
|
||||
#: ../src/shell-global.c:986
|
||||
#, c-format
|
||||
msgid "%d week ago"
|
||||
msgid_plural "%d weeks ago"
|
||||
|
257
po/fi.po
257
po/fi.po
@ -1,14 +1,14 @@
|
||||
# gnome-shell Finnish translation
|
||||
# Copyright (C) 2009 Timo Jyrinki
|
||||
# Copyright (C) 2009-2010 Timo Jyrinki
|
||||
# This file is distributed under the same license as the gnome-shell package.
|
||||
# Timo Jyrinki <timo.jyrinki@iki.fi>, 2009.
|
||||
# Timo Jyrinki <timo.jyrinki@iki.fi>, 2009-2010.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gnome-shell\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2009-11-04 11:16+0200\n"
|
||||
"PO-Revision-Date: 2009-11-04 11:16+0200\n"
|
||||
"POT-Creation-Date: 2010-03-01 20:24+0200\n"
|
||||
"PO-Revision-Date: 2010-03-01 20:27+0200\n"
|
||||
"Last-Translator: Timo Jyrinki <timo.jyrinki@iki.fi>\n"
|
||||
"Language-Team: Finnish <gnome-fi-laatu@lists.sourceforge.net>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -24,87 +24,165 @@ msgstr ""
|
||||
msgid "Window management and application launching"
|
||||
msgstr "Ikkunanhallinta ja sovelluksien käynnistäminen"
|
||||
|
||||
#: ../js/ui/appDisplay.js:332
|
||||
msgid "Frequent"
|
||||
msgstr "Usein käytetyt"
|
||||
#. **** Applications ****
|
||||
#: ../js/ui/appDisplay.js:180 ../js/ui/dash.js:881
|
||||
msgid "APPLICATIONS"
|
||||
msgstr "SOVELLUKSET"
|
||||
|
||||
#: ../js/ui/appDisplay.js:867
|
||||
msgid "Drag here to add favorites"
|
||||
msgstr "Raahaa tähän lisätäksesi suosikkeihin"
|
||||
#: ../js/ui/appDisplay.js:204
|
||||
msgid "PREFERENCES"
|
||||
msgstr "ASETUKSET"
|
||||
|
||||
#: ../js/ui/appIcon.js:426
|
||||
#: ../js/ui/appDisplay.js:582
|
||||
msgid "New Window"
|
||||
msgstr "Uusi ikkuna"
|
||||
|
||||
#: ../js/ui/appIcon.js:430
|
||||
#: ../js/ui/appDisplay.js:586
|
||||
msgid "Remove from Favorites"
|
||||
msgstr "Poista suosikeista"
|
||||
|
||||
#: ../js/ui/appIcon.js:431
|
||||
#: ../js/ui/appDisplay.js:587
|
||||
msgid "Add to Favorites"
|
||||
msgstr "Lisää suosikkeihin"
|
||||
|
||||
#: ../js/ui/dash.js:283
|
||||
#: ../js/ui/appDisplay.js:939
|
||||
msgid "Drag here to add favorites"
|
||||
msgstr "Raahaa tähän lisätäksesi suosikkeihin"
|
||||
|
||||
#: ../js/ui/appFavorites.js:89
|
||||
#, c-format
|
||||
msgid "%s has been added to your favorites."
|
||||
msgstr "%s on lisätty suosikkeihin."
|
||||
|
||||
#: ../js/ui/appFavorites.js:107
|
||||
#, c-format
|
||||
msgid "%s has been removed from your favorites."
|
||||
msgstr "%s on poistettu suosikeista."
|
||||
|
||||
#: ../js/ui/dash.js:235
|
||||
msgid "Find..."
|
||||
msgstr "Etsi..."
|
||||
|
||||
#: ../js/ui/dash.js:400
|
||||
msgid "More"
|
||||
msgstr "Lisää"
|
||||
#: ../js/ui/dash.js:505
|
||||
msgid "Searching..."
|
||||
msgstr "Haetaan..."
|
||||
|
||||
#: ../js/ui/dash.js:543
|
||||
msgid "(see all)"
|
||||
msgstr "(näytä kaikki)"
|
||||
|
||||
#. **** Applications ****
|
||||
#: ../js/ui/dash.js:725 ../js/ui/dash.js:787
|
||||
msgid "APPLICATIONS"
|
||||
msgstr "SOVELLUKSET"
|
||||
#: ../js/ui/dash.js:519
|
||||
msgid "No matching results."
|
||||
msgstr "Ei tuloksia."
|
||||
|
||||
#. **** Places ****
|
||||
#. Translators: This is in the sense of locations for documents,
|
||||
#. network locations, etc.
|
||||
#: ../js/ui/dash.js:745
|
||||
msgid "PLACES"
|
||||
msgstr "SIJAINNIT"
|
||||
#: ../js/ui/dash.js:900 ../js/ui/placeDisplay.js:529
|
||||
msgid "PLACES & DEVICES"
|
||||
msgstr "SIJAINNIT JA LAITTEET"
|
||||
|
||||
#. **** Documents ****
|
||||
#: ../js/ui/dash.js:752 ../js/ui/dash.js:797
|
||||
msgid "RECENT DOCUMENTS"
|
||||
msgstr "VIIMEISIMMÄT ASIAKIRJAT"
|
||||
#: ../js/ui/dash.js:907 ../js/ui/docDisplay.js:488
|
||||
msgid "RECENT ITEMS"
|
||||
msgstr "VIIMEISIMMÄT"
|
||||
|
||||
#. **** Search Results ****
|
||||
#: ../js/ui/dash.js:777 ../js/ui/dash.js:961
|
||||
msgid "SEARCH RESULTS"
|
||||
msgstr "HAKUTULOKSET"
|
||||
#: ../js/ui/lookingGlass.js:363
|
||||
msgid "No extensions installed"
|
||||
msgstr "Laajennuksia ei asennettu"
|
||||
|
||||
#: ../js/ui/dash.js:792
|
||||
msgid "PREFERENCES"
|
||||
msgstr "ASETUKSET"
|
||||
#: ../js/ui/lookingGlass.js:400
|
||||
msgid "Enabled"
|
||||
msgstr "Käytössä"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:402
|
||||
msgid "Disabled"
|
||||
msgstr "Ei käytössä"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:404
|
||||
msgid "Error"
|
||||
msgstr "Virhe"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:406
|
||||
msgid "Out of date"
|
||||
msgstr "Ei ajan tasalla"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:431
|
||||
msgid "View Source"
|
||||
msgstr "Näytä lähde"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:437
|
||||
msgid "Web Page"
|
||||
msgstr "WWW-sivu"
|
||||
|
||||
#: ../js/ui/overview.js:92
|
||||
msgid "Undo"
|
||||
msgstr "Kumoa"
|
||||
|
||||
#. Button on the left side of the panel.
|
||||
#. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview".
|
||||
#: ../js/ui/panel.js:274
|
||||
#: ../js/ui/panel.js:399
|
||||
msgid "Activities"
|
||||
msgstr "Toiminnot"
|
||||
|
||||
#. Translators: This is a time format.
|
||||
#: ../js/ui/panel.js:491
|
||||
#. Translators: This is the time format used in 24-hour mode.
|
||||
#: ../js/ui/panel.js:623
|
||||
msgid "%a %R"
|
||||
msgstr "%a %R"
|
||||
|
||||
#. Translators: This is a time format used for AM/PM.
|
||||
#: ../js/ui/panel.js:626
|
||||
msgid "%a %l:%M %p"
|
||||
msgstr "%a %I.%M"
|
||||
|
||||
#: ../js/ui/places.js:178
|
||||
#: ../js/ui/placeDisplay.js:144
|
||||
msgid "Connect to..."
|
||||
msgstr "Yhdistä..."
|
||||
|
||||
#: ../js/ui/runDialog.js:96
|
||||
#: ../js/ui/runDialog.js:220
|
||||
msgid "Please enter a command:"
|
||||
msgstr "Syötä komento:"
|
||||
|
||||
#: ../js/ui/runDialog.js:173
|
||||
#: ../js/ui/runDialog.js:328
|
||||
#, c-format
|
||||
msgid "Execution of '%s' failed:"
|
||||
msgstr ""
|
||||
msgstr "”%s” suorittaminen epäonnistui:"
|
||||
|
||||
#: ../js/ui/statusMenu.js:107
|
||||
msgid "Available"
|
||||
msgstr "Tavoitettavissa"
|
||||
|
||||
#: ../js/ui/statusMenu.js:112
|
||||
msgid "Busy"
|
||||
msgstr "Kiireinen"
|
||||
|
||||
#: ../js/ui/statusMenu.js:117
|
||||
msgid "Invisible"
|
||||
msgstr "Näkymätön"
|
||||
|
||||
#: ../js/ui/statusMenu.js:126
|
||||
msgid "Account Information..."
|
||||
msgstr "Käyttäjätilin tiedot..."
|
||||
|
||||
#: ../js/ui/statusMenu.js:132
|
||||
msgid "Sidebar"
|
||||
msgstr "Sivupalkki"
|
||||
|
||||
#: ../js/ui/statusMenu.js:142
|
||||
msgid "System Preferences..."
|
||||
msgstr "Järjestelmän asetukset"
|
||||
|
||||
#: ../js/ui/statusMenu.js:151
|
||||
msgid "Lock Screen"
|
||||
msgstr "Lukitse näyttö"
|
||||
|
||||
#: ../js/ui/statusMenu.js:156
|
||||
msgid "Switch User"
|
||||
msgstr "Vaihda käyttäjää"
|
||||
|
||||
#: ../js/ui/statusMenu.js:162
|
||||
msgid "Log Out..."
|
||||
msgstr "Kirjaudu ulos..."
|
||||
|
||||
#: ../js/ui/statusMenu.js:167
|
||||
msgid "Shut Down..."
|
||||
msgstr "Sammuta..."
|
||||
|
||||
#. Translators: This is a time format.
|
||||
#: ../js/ui/widget.js:163
|
||||
@ -119,99 +197,49 @@ msgstr "Sovellukset"
|
||||
msgid "Recent Documents"
|
||||
msgstr "Viimeisimmät asiakirjat"
|
||||
|
||||
#: ../src/shell-global.c:821
|
||||
#: ../src/shell-global.c:967
|
||||
msgid "Less than a minute ago"
|
||||
msgstr "Alle minuutti sitten"
|
||||
|
||||
#: ../src/shell-global.c:824
|
||||
#: ../src/shell-global.c:971
|
||||
#, c-format
|
||||
msgid "%d minute ago"
|
||||
msgid_plural "%d minutes ago"
|
||||
msgstr[0] "%d minuutti sitten"
|
||||
msgstr[1] "%d minuuttia sitten"
|
||||
|
||||
#: ../src/shell-global.c:827
|
||||
#: ../src/shell-global.c:976
|
||||
#, c-format
|
||||
msgid "%d hour ago"
|
||||
msgid_plural "%d hours ago"
|
||||
msgstr[0] "%d tunti sitten"
|
||||
msgstr[1] "%d tuntia sitten"
|
||||
|
||||
#: ../src/shell-global.c:830
|
||||
#: ../src/shell-global.c:981
|
||||
#, c-format
|
||||
msgid "%d day ago"
|
||||
msgid_plural "%d days ago"
|
||||
msgstr[0] "%d päivä sitten"
|
||||
msgstr[1] "%d päivää sitten"
|
||||
|
||||
#: ../src/shell-global.c:833
|
||||
#: ../src/shell-global.c:986
|
||||
#, c-format
|
||||
msgid "%d week ago"
|
||||
msgid_plural "%d weeks ago"
|
||||
msgstr[0] "%d viikko sitten"
|
||||
msgstr[1] "%d viikkoa sitten"
|
||||
|
||||
#: ../src/shell-status-menu.c:156
|
||||
msgid "Unknown"
|
||||
msgstr "Tuntematon"
|
||||
|
||||
#: ../src/shell-status-menu.c:212
|
||||
#, c-format
|
||||
msgid "Can't lock screen: %s"
|
||||
msgstr "Näyttöä ei voi lukita: %s"
|
||||
|
||||
#: ../src/shell-status-menu.c:227
|
||||
#, c-format
|
||||
msgid "Can't temporarily set screensaver to blank screen: %s"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/shell-status-menu.c:351
|
||||
#, c-format
|
||||
msgid "Can't logout: %s"
|
||||
msgstr ""
|
||||
|
||||
#: ../src/shell-status-menu.c:492
|
||||
msgid "Account Information..."
|
||||
msgstr "Käyttäjätilin tiedot..."
|
||||
|
||||
#: ../src/shell-status-menu.c:502
|
||||
msgid "Sidebar"
|
||||
msgstr "Sivupalkki"
|
||||
|
||||
#: ../src/shell-status-menu.c:510
|
||||
msgid "System Preferences..."
|
||||
msgstr "Järjestelmän asetukset"
|
||||
|
||||
#: ../src/shell-status-menu.c:525
|
||||
msgid "Lock Screen"
|
||||
msgstr "Lukitse näyttö"
|
||||
|
||||
#: ../src/shell-status-menu.c:535
|
||||
msgid "Switch User"
|
||||
msgstr "Vaihda käyttäjää"
|
||||
|
||||
#. Only show switch user if there are other users
|
||||
#. Log Out
|
||||
#: ../src/shell-status-menu.c:546
|
||||
msgid "Log Out..."
|
||||
msgstr "Kirjaudu ulos..."
|
||||
|
||||
#. Shut down
|
||||
#: ../src/shell-status-menu.c:557
|
||||
msgid "Shut Down..."
|
||||
msgstr "Sammuta..."
|
||||
|
||||
#: ../src/shell-uri-util.c:87
|
||||
#: ../src/shell-uri-util.c:89
|
||||
msgid "Home Folder"
|
||||
msgstr "Kotikansio"
|
||||
|
||||
#. Translators: this is the same string as the one found in
|
||||
#. * nautilus
|
||||
#: ../src/shell-uri-util.c:102
|
||||
#: ../src/shell-uri-util.c:104
|
||||
msgid "File System"
|
||||
msgstr "Tiedostojärjestelmä"
|
||||
|
||||
#: ../src/shell-uri-util.c:248
|
||||
#: ../src/shell-uri-util.c:250
|
||||
msgid "Search"
|
||||
msgstr "Haku"
|
||||
|
||||
@ -220,7 +248,28 @@ msgstr "Haku"
|
||||
#. * example, "Trash: some-directory". It means that the
|
||||
#. * directory called "some-directory" is in the trash.
|
||||
#.
|
||||
#: ../src/shell-uri-util.c:298
|
||||
#: ../src/shell-uri-util.c:300
|
||||
#, c-format
|
||||
msgid "%1$s: %2$s"
|
||||
msgstr "%1$s: %2$s"
|
||||
|
||||
#~ msgid "Frequent"
|
||||
#~ msgstr "Usein käytetyt"
|
||||
|
||||
#~ msgid "More"
|
||||
#~ msgstr "Lisää"
|
||||
|
||||
#~ msgid "(see all)"
|
||||
#~ msgstr "(näytä kaikki)"
|
||||
|
||||
#~ msgid "PLACES"
|
||||
#~ msgstr "SIJAINNIT"
|
||||
|
||||
#~ msgid "SEARCH RESULTS"
|
||||
#~ msgstr "HAKUTULOKSET"
|
||||
|
||||
#~ msgid "Unknown"
|
||||
#~ msgstr "Tuntematon"
|
||||
|
||||
#~ msgid "Can't lock screen: %s"
|
||||
#~ msgstr "Näyttöä ei voi lukita: %s"
|
||||
|
234
po/fr.po
234
po/fr.po
@ -1,17 +1,19 @@
|
||||
# French translations for gnome-shell package.
|
||||
# Copyright (C) 2009 THE gnome-shell'S COPYRIGHT HOLDER
|
||||
# Copyright (C) 2009-2010 Listed translators
|
||||
# This file is distributed under the same license as the gnome-shell package.
|
||||
#
|
||||
# Mathieu Bridon <bochecha@fedoraproject.org>, 2009.
|
||||
# Mathieu Bridon <bochecha@fedoraproject.org>, 2009
|
||||
# Pablo Martin-Gomez <pablo.martin-gomez@laposte.net>, 2010
|
||||
# Claude Paroz <claude@2xlibre.net>, 2010
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gnome-shell master fr\n"
|
||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-"
|
||||
"shell&component=general\n"
|
||||
"POT-Creation-Date: 2009-11-13 17:44+0000\n"
|
||||
"PO-Revision-Date: 2009-12-05 16:43+0100\n"
|
||||
"Last-Translator: Pablo Martin-Gomez <pablo.martin-gomez@laposte.net>\n"
|
||||
"POT-Creation-Date: 2010-03-08 23:07+0000\n"
|
||||
"PO-Revision-Date: 2010-03-09 22:55+0100\n"
|
||||
"Last-Translator: Claude Paroz <claude@2xlibre.net>\n"
|
||||
"Language-Team: GNOME French Team <gnomefr@traduc.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
@ -26,76 +28,166 @@ msgstr "GNOME Shell"
|
||||
msgid "Window management and application launching"
|
||||
msgstr "Gestion des fenêtres et lancement des applications"
|
||||
|
||||
#: ../js/ui/appDisplay.js:696
|
||||
msgid "Drag here to add favorites"
|
||||
msgstr "Glisser ici pour ajouter aux favoris"
|
||||
#. **** Applications ****
|
||||
#: ../js/ui/appDisplay.js:311 ../js/ui/dash.js:886
|
||||
msgid "APPLICATIONS"
|
||||
msgstr "APPLICATIONS"
|
||||
|
||||
#: ../js/ui/appIcon.js:425
|
||||
#: ../js/ui/appDisplay.js:343
|
||||
msgid "PREFERENCES"
|
||||
msgstr "PRÉFÉRENCES"
|
||||
|
||||
#: ../js/ui/appDisplay.js:728
|
||||
msgid "New Window"
|
||||
msgstr "Nouvelle fenêtre"
|
||||
|
||||
#: ../js/ui/appIcon.js:429
|
||||
#: ../js/ui/appDisplay.js:732
|
||||
msgid "Remove from Favorites"
|
||||
msgstr "Enlever des favoris"
|
||||
|
||||
#: ../js/ui/appIcon.js:430
|
||||
#: ../js/ui/appDisplay.js:733
|
||||
msgid "Add to Favorites"
|
||||
msgstr "Ajouter aux favoris"
|
||||
|
||||
#: ../js/ui/dash.js:237
|
||||
#: ../js/ui/appDisplay.js:1085
|
||||
msgid "Drag here to add favorites"
|
||||
msgstr "Glisser ici pour ajouter aux favoris"
|
||||
|
||||
#: ../js/ui/appFavorites.js:89
|
||||
#, c-format
|
||||
msgid "%s has been added to your favorites."
|
||||
msgstr "%s a été ajouté à vos favoris."
|
||||
|
||||
#: ../js/ui/appFavorites.js:107
|
||||
#, c-format
|
||||
msgid "%s has been removed from your favorites."
|
||||
msgstr "%s a été supprimé de vos favoris."
|
||||
|
||||
#: ../js/ui/dash.js:235
|
||||
msgid "Find..."
|
||||
msgstr "Rechercher..."
|
||||
|
||||
#. **** Applications ****
|
||||
#: ../js/ui/dash.js:656 ../js/ui/dash.js:718
|
||||
msgid "APPLICATIONS"
|
||||
msgstr "APPLICATIONS"
|
||||
#: ../js/ui/dash.js:511
|
||||
msgid "Searching..."
|
||||
msgstr "Recherche en cours..."
|
||||
|
||||
#: ../js/ui/dash.js:525
|
||||
msgid "No matching results."
|
||||
msgstr "Aucun résultat correspondant."
|
||||
|
||||
#. **** Places ****
|
||||
#. Translators: This is in the sense of locations for documents,
|
||||
#. network locations, etc.
|
||||
#: ../js/ui/dash.js:676 ../js/ui/dash.js:733
|
||||
msgid "PLACES"
|
||||
msgstr "RACCOURCIS"
|
||||
#: ../js/ui/dash.js:905 ../js/ui/placeDisplay.js:529
|
||||
msgid "PLACES & DEVICES"
|
||||
msgstr "RACCOURCIS et PÉRIPHÉRIQUES"
|
||||
|
||||
#. **** Documents ****
|
||||
#: ../js/ui/dash.js:683 ../js/ui/dash.js:728
|
||||
msgid "RECENT DOCUMENTS"
|
||||
msgstr "DOCUMENTS RÉCENTS"
|
||||
#: ../js/ui/dash.js:912 ../js/ui/docDisplay.js:488
|
||||
msgid "RECENT ITEMS"
|
||||
msgstr "ÉLÉMENTS RÉCENTS"
|
||||
|
||||
#. **** Search Results ****
|
||||
#: ../js/ui/dash.js:708 ../js/ui/dash.js:898
|
||||
msgid "SEARCH RESULTS"
|
||||
msgstr "RÉSULTATS DE LA RECHERCHE"
|
||||
#: ../js/ui/lookingGlass.js:363
|
||||
msgid "No extensions installed"
|
||||
msgstr "Aucune extension installée"
|
||||
|
||||
#: ../js/ui/dash.js:723
|
||||
msgid "PREFERENCES"
|
||||
msgstr "PRÉFÉRENCES"
|
||||
#: ../js/ui/lookingGlass.js:400
|
||||
msgid "Enabled"
|
||||
msgstr "Activé"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:402
|
||||
msgid "Disabled"
|
||||
msgstr "Désactivé"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:404
|
||||
msgid "Error"
|
||||
msgstr "Erreur"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:406
|
||||
msgid "Out of date"
|
||||
msgstr "Périmé"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:431
|
||||
msgid "View Source"
|
||||
msgstr "Afficher la source"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:437
|
||||
msgid "Web Page"
|
||||
msgstr "Page Web"
|
||||
|
||||
#: ../js/ui/overview.js:92
|
||||
msgid "Undo"
|
||||
msgstr "Annuler"
|
||||
|
||||
#. Button on the left side of the panel.
|
||||
#. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview".
|
||||
#: ../js/ui/panel.js:274
|
||||
#: ../js/ui/panel.js:399
|
||||
msgid "Activities"
|
||||
msgstr "Activités"
|
||||
|
||||
#. Translators: This is a time format.
|
||||
#: ../js/ui/panel.js:491
|
||||
#. Translators: This is the time format used in 24-hour mode.
|
||||
#: ../js/ui/panel.js:630
|
||||
msgid "%a %R"
|
||||
msgstr "%a %R"
|
||||
|
||||
#. Translators: This is a time format used for AM/PM.
|
||||
#: ../js/ui/panel.js:633
|
||||
msgid "%a %l:%M %p"
|
||||
msgstr "%a %H:%M"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:84
|
||||
#: ../js/ui/placeDisplay.js:144
|
||||
msgid "Connect to..."
|
||||
msgstr "Connexion à..."
|
||||
|
||||
#: ../js/ui/runDialog.js:96
|
||||
#: ../js/ui/runDialog.js:221
|
||||
msgid "Please enter a command:"
|
||||
msgstr "Veuillez saisir une commande :"
|
||||
|
||||
#: ../js/ui/runDialog.js:173
|
||||
#: ../js/ui/runDialog.js:344
|
||||
#, c-format
|
||||
msgid "Execution of '%s' failed:"
|
||||
msgstr "Exécution de « %s » impossible :"
|
||||
|
||||
#: ../js/ui/statusMenu.js:107
|
||||
msgid "Available"
|
||||
msgstr "Disponible"
|
||||
|
||||
#: ../js/ui/statusMenu.js:112
|
||||
msgid "Busy"
|
||||
msgstr "Occupé"
|
||||
|
||||
#: ../js/ui/statusMenu.js:117
|
||||
msgid "Invisible"
|
||||
msgstr "Invisible"
|
||||
|
||||
#: ../js/ui/statusMenu.js:126
|
||||
msgid "Account Information..."
|
||||
msgstr "Informations personnelles..."
|
||||
|
||||
#: ../js/ui/statusMenu.js:132
|
||||
msgid "Sidebar"
|
||||
msgstr "Barre latérale"
|
||||
|
||||
#: ../js/ui/statusMenu.js:142
|
||||
msgid "System Preferences..."
|
||||
msgstr "Préférences du système..."
|
||||
|
||||
#: ../js/ui/statusMenu.js:151
|
||||
msgid "Lock Screen"
|
||||
msgstr "Verrouiller l'écran"
|
||||
|
||||
#: ../js/ui/statusMenu.js:156
|
||||
msgid "Switch User"
|
||||
msgstr "Changer d'utilisateur"
|
||||
|
||||
#: ../js/ui/statusMenu.js:162
|
||||
msgid "Log Out..."
|
||||
msgstr "Fermer la session..."
|
||||
|
||||
#: ../js/ui/statusMenu.js:167
|
||||
msgid "Shut Down..."
|
||||
msgstr "Éteindre..."
|
||||
|
||||
#. Translators: This is a time format.
|
||||
#: ../js/ui/widget.js:163
|
||||
msgid "%H:%M"
|
||||
@ -109,100 +201,49 @@ msgstr "Applications"
|
||||
msgid "Recent Documents"
|
||||
msgstr "Documents récents"
|
||||
|
||||
#: ../src/shell-global.c:821
|
||||
#: ../src/shell-global.c:967
|
||||
msgid "Less than a minute ago"
|
||||
msgstr "Il y a moins d'une minute"
|
||||
|
||||
#: ../src/shell-global.c:824
|
||||
#: ../src/shell-global.c:971
|
||||
#, c-format
|
||||
msgid "%d minute ago"
|
||||
msgid_plural "%d minutes ago"
|
||||
msgstr[0] "Il y a %d minute"
|
||||
msgstr[1] "Il y a %d minutes"
|
||||
|
||||
#: ../src/shell-global.c:827
|
||||
#: ../src/shell-global.c:976
|
||||
#, c-format
|
||||
msgid "%d hour ago"
|
||||
msgid_plural "%d hours ago"
|
||||
msgstr[0] "Il y a %d heure"
|
||||
msgstr[1] "Il y a %d heures"
|
||||
|
||||
#: ../src/shell-global.c:830
|
||||
#: ../src/shell-global.c:981
|
||||
#, c-format
|
||||
msgid "%d day ago"
|
||||
msgid_plural "%d days ago"
|
||||
msgstr[0] "Il y a %d jour"
|
||||
msgstr[1] "Il y a %d jours"
|
||||
|
||||
#: ../src/shell-global.c:833
|
||||
#: ../src/shell-global.c:986
|
||||
#, c-format
|
||||
msgid "%d week ago"
|
||||
msgid_plural "%d weeks ago"
|
||||
msgstr[0] "Il y a %d semaine"
|
||||
msgstr[1] "Il y a %d semaines"
|
||||
|
||||
#: ../src/shell-status-menu.c:156
|
||||
msgid "Unknown"
|
||||
msgstr "Inconnu"
|
||||
|
||||
#: ../src/shell-status-menu.c:212
|
||||
#, c-format
|
||||
msgid "Can't lock screen: %s"
|
||||
msgstr "Impossible de verrouiller l'écran : %s"
|
||||
|
||||
#: ../src/shell-status-menu.c:227
|
||||
#, c-format
|
||||
msgid "Can't temporarily set screensaver to blank screen: %s"
|
||||
msgstr ""
|
||||
"Impossible de régler temporairement l'écran de veille sur un écran vide : %s"
|
||||
|
||||
#: ../src/shell-status-menu.c:351
|
||||
#, c-format
|
||||
msgid "Can't logout: %s"
|
||||
msgstr "Impossible de fermer la session : %s"
|
||||
|
||||
#: ../src/shell-status-menu.c:492
|
||||
msgid "Account Information..."
|
||||
msgstr "Informations personnelles..."
|
||||
|
||||
#: ../src/shell-status-menu.c:502
|
||||
msgid "Sidebar"
|
||||
msgstr "Barre latérale"
|
||||
|
||||
#: ../src/shell-status-menu.c:510
|
||||
msgid "System Preferences..."
|
||||
msgstr "Préférences du système..."
|
||||
|
||||
#: ../src/shell-status-menu.c:525
|
||||
msgid "Lock Screen"
|
||||
msgstr "Verrouiller l'écran"
|
||||
|
||||
#: ../src/shell-status-menu.c:535
|
||||
msgid "Switch User"
|
||||
msgstr "Changer d'utilisateur"
|
||||
|
||||
#. Only show switch user if there are other users
|
||||
#. Log Out
|
||||
#: ../src/shell-status-menu.c:546
|
||||
msgid "Log Out..."
|
||||
msgstr "Fermer la session..."
|
||||
|
||||
#. Shut down
|
||||
#: ../src/shell-status-menu.c:557
|
||||
msgid "Shut Down..."
|
||||
msgstr "Éteindre..."
|
||||
|
||||
#: ../src/shell-uri-util.c:87
|
||||
#: ../src/shell-uri-util.c:89
|
||||
msgid "Home Folder"
|
||||
msgstr "Dossier personnel"
|
||||
|
||||
#. Translators: this is the same string as the one found in
|
||||
#. * nautilus
|
||||
#: ../src/shell-uri-util.c:102
|
||||
#: ../src/shell-uri-util.c:104
|
||||
msgid "File System"
|
||||
msgstr "Système de fichiers"
|
||||
|
||||
#: ../src/shell-uri-util.c:248
|
||||
#: ../src/shell-uri-util.c:250
|
||||
msgid "Search"
|
||||
msgstr "Recherche"
|
||||
|
||||
@ -211,10 +252,7 @@ msgstr "Recherche"
|
||||
#. * example, "Trash: some-directory". It means that the
|
||||
#. * directory called "some-directory" is in the trash.
|
||||
#.
|
||||
#: ../src/shell-uri-util.c:298
|
||||
#: ../src/shell-uri-util.c:300
|
||||
#, c-format
|
||||
msgid "%1$s: %2$s"
|
||||
msgstr "%1$s : %2$s"
|
||||
|
||||
#~ msgid "Browse"
|
||||
#~ msgstr "Parcourir"
|
||||
|
128
po/nb.po
128
po/nb.po
@ -7,8 +7,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gnome-shell 2.28.x\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2010-02-14 13:45+0100\n"
|
||||
"PO-Revision-Date: 2010-02-14 13:46+0100\n"
|
||||
"POT-Creation-Date: 2010-03-09 17:45+0100\n"
|
||||
"PO-Revision-Date: 2010-03-09 17:47+0100\n"
|
||||
"Last-Translator: Kjartan Maraas <kmaraas@broadpark.no>\n"
|
||||
"Language-Team: Norwegian bokmål <i18n-nb@lister.ping.uio.no>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -25,67 +25,109 @@ msgid "Window management and application launching"
|
||||
msgstr "Vindushåndtering og oppstart av programmer"
|
||||
|
||||
#. **** Applications ****
|
||||
#: ../js/ui/appDisplay.js:252 ../js/ui/dash.js:880
|
||||
#: ../js/ui/appDisplay.js:311 ../js/ui/dash.js:886
|
||||
msgid "APPLICATIONS"
|
||||
msgstr "PROGRAMMER"
|
||||
|
||||
#: ../js/ui/appDisplay.js:276
|
||||
#: ../js/ui/appDisplay.js:343
|
||||
msgid "PREFERENCES"
|
||||
msgstr "BRUKERVALG"
|
||||
|
||||
#: ../js/ui/appDisplay.js:649
|
||||
#: ../js/ui/appDisplay.js:728
|
||||
msgid "New Window"
|
||||
msgstr "Nytt vindu"
|
||||
|
||||
#: ../js/ui/appDisplay.js:653
|
||||
#: ../js/ui/appDisplay.js:732
|
||||
msgid "Remove from Favorites"
|
||||
msgstr "Fjern fra favoritter"
|
||||
|
||||
#: ../js/ui/appDisplay.js:654
|
||||
#: ../js/ui/appDisplay.js:733
|
||||
msgid "Add to Favorites"
|
||||
msgstr "Legg til i favoritter"
|
||||
|
||||
#: ../js/ui/appDisplay.js:1006
|
||||
#: ../js/ui/appDisplay.js:1085
|
||||
msgid "Drag here to add favorites"
|
||||
msgstr "Dra hit for å legge til favoritter"
|
||||
|
||||
#: ../js/ui/dash.js:241
|
||||
#: ../js/ui/appFavorites.js:89
|
||||
#, c-format
|
||||
msgid "%s has been added to your favorites."
|
||||
msgstr "%s ble lagt til i dine favoritter."
|
||||
|
||||
#: ../js/ui/appFavorites.js:107
|
||||
#, c-format
|
||||
msgid "%s has been removed from your favorites."
|
||||
msgstr "%s ble fjernet fra dine favoritter."
|
||||
|
||||
#: ../js/ui/dash.js:235
|
||||
msgid "Find..."
|
||||
msgstr "Finn..."
|
||||
|
||||
#: ../js/ui/dash.js:508
|
||||
#: ../js/ui/dash.js:511
|
||||
msgid "Searching..."
|
||||
msgstr "Søker..."
|
||||
|
||||
#: ../js/ui/dash.js:522
|
||||
#: ../js/ui/dash.js:525
|
||||
msgid "No matching results."
|
||||
msgstr "Ingen treff."
|
||||
|
||||
#. **** Places ****
|
||||
#. Translators: This is in the sense of locations for documents,
|
||||
#. network locations, etc.
|
||||
#: ../js/ui/dash.js:900 ../js/ui/placeDisplay.js:529
|
||||
#: ../js/ui/dash.js:905 ../js/ui/placeDisplay.js:529
|
||||
msgid "PLACES & DEVICES"
|
||||
msgstr "STEDER & ENHETER"
|
||||
|
||||
#. **** Documents ****
|
||||
#: ../js/ui/dash.js:907
|
||||
#: ../js/ui/dash.js:912 ../js/ui/docDisplay.js:488
|
||||
msgid "RECENT ITEMS"
|
||||
msgstr "SISTE OPPFØRINGER"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:363
|
||||
msgid "No extensions installed"
|
||||
msgstr "Ingen utvidelser installert"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:400
|
||||
msgid "Enabled"
|
||||
msgstr "Aktivert"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:402
|
||||
msgid "Disabled"
|
||||
msgstr "Deaktivert"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:404
|
||||
msgid "Error"
|
||||
msgstr "Feil"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:406
|
||||
msgid "Out of date"
|
||||
msgstr "Utdatert"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:431
|
||||
msgid "View Source"
|
||||
msgstr "Vis kildekode"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:437
|
||||
msgid "Web Page"
|
||||
msgstr "Nettside"
|
||||
|
||||
#: ../js/ui/overview.js:92
|
||||
msgid "Undo"
|
||||
msgstr "Angre"
|
||||
|
||||
#. Button on the left side of the panel.
|
||||
#. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview".
|
||||
#: ../js/ui/panel.js:336
|
||||
#: ../js/ui/panel.js:399
|
||||
msgid "Activities"
|
||||
msgstr "Aktiviteter"
|
||||
|
||||
#. Translators: This is the time format used in 24-hour mode.
|
||||
#: ../js/ui/panel.js:560
|
||||
#: ../js/ui/panel.js:630
|
||||
msgid "%a %R"
|
||||
msgstr "%a %R"
|
||||
|
||||
#. Translators: This is a time format used for AM/PM.
|
||||
#: ../js/ui/panel.js:563
|
||||
#: ../js/ui/panel.js:633
|
||||
msgid "%a %l:%M %p"
|
||||
msgstr "%a %H:%M"
|
||||
|
||||
@ -93,15 +135,55 @@ msgstr "%a %H:%M"
|
||||
msgid "Connect to..."
|
||||
msgstr "Koble til..."
|
||||
|
||||
#: ../js/ui/runDialog.js:245
|
||||
#: ../js/ui/runDialog.js:221
|
||||
msgid "Please enter a command:"
|
||||
msgstr "Oppgi en kommando:"
|
||||
|
||||
#: ../js/ui/runDialog.js:361
|
||||
#: ../js/ui/runDialog.js:344
|
||||
#, c-format
|
||||
msgid "Execution of '%s' failed:"
|
||||
msgstr "Kjøring av «%s» feilet:"
|
||||
|
||||
#: ../js/ui/statusMenu.js:107
|
||||
msgid "Available"
|
||||
msgstr "Tilgjengelig"
|
||||
|
||||
#: ../js/ui/statusMenu.js:112
|
||||
msgid "Busy"
|
||||
msgstr "Opptatt"
|
||||
|
||||
#: ../js/ui/statusMenu.js:117
|
||||
msgid "Invisible"
|
||||
msgstr "Usynlig"
|
||||
|
||||
#: ../js/ui/statusMenu.js:126
|
||||
msgid "Account Information..."
|
||||
msgstr "Kontoinformasjon..."
|
||||
|
||||
#: ../js/ui/statusMenu.js:132
|
||||
msgid "Sidebar"
|
||||
msgstr "Sidelinje"
|
||||
|
||||
#: ../js/ui/statusMenu.js:142
|
||||
msgid "System Preferences..."
|
||||
msgstr "Brukervalg for systemet..."
|
||||
|
||||
#: ../js/ui/statusMenu.js:151
|
||||
msgid "Lock Screen"
|
||||
msgstr "Lås skjerm"
|
||||
|
||||
#: ../js/ui/statusMenu.js:156
|
||||
msgid "Switch User"
|
||||
msgstr "Bytt bruker"
|
||||
|
||||
#: ../js/ui/statusMenu.js:162
|
||||
msgid "Log Out..."
|
||||
msgstr "Logg ut..."
|
||||
|
||||
#: ../js/ui/statusMenu.js:167
|
||||
msgid "Shut Down..."
|
||||
msgstr "Avslutt..."
|
||||
|
||||
#. Translators: This is a time format.
|
||||
#: ../js/ui/widget.js:163
|
||||
msgid "%H:%M"
|
||||
@ -115,32 +197,32 @@ msgstr "Programmer"
|
||||
msgid "Recent Documents"
|
||||
msgstr "Siste dokumenter"
|
||||
|
||||
#: ../src/shell-global.c:976
|
||||
#: ../src/shell-global.c:967
|
||||
msgid "Less than a minute ago"
|
||||
msgstr "Mindre enn ett minutt siden"
|
||||
|
||||
#: ../src/shell-global.c:980
|
||||
#: ../src/shell-global.c:971
|
||||
#, c-format
|
||||
msgid "%d minute ago"
|
||||
msgid_plural "%d minutes ago"
|
||||
msgstr[0] "%d minutt siden"
|
||||
msgstr[1] "%d minutter siden"
|
||||
|
||||
#: ../src/shell-global.c:985
|
||||
#: ../src/shell-global.c:976
|
||||
#, c-format
|
||||
msgid "%d hour ago"
|
||||
msgid_plural "%d hours ago"
|
||||
msgstr[0] "%d time siden"
|
||||
msgstr[1] "%d timer siden"
|
||||
|
||||
#: ../src/shell-global.c:990
|
||||
#: ../src/shell-global.c:981
|
||||
#, c-format
|
||||
msgid "%d day ago"
|
||||
msgid_plural "%d days ago"
|
||||
msgstr[0] "%d dag siden"
|
||||
msgstr[1] "%d dager siden"
|
||||
|
||||
#: ../src/shell-global.c:995
|
||||
#: ../src/shell-global.c:986
|
||||
#, c-format
|
||||
msgid "%d week ago"
|
||||
msgid_plural "%d weeks ago"
|
||||
|
273
po/pl.po
273
po/pl.po
@ -8,8 +8,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gnome-shell\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2009-09-09 03:06+0200\n"
|
||||
"PO-Revision-Date: 2009-09-09 03:02+0100\n"
|
||||
"POT-Creation-Date: 2010-03-19 13:08+0100\n"
|
||||
"PO-Revision-Date: 2010-03-19 13:07+0100\n"
|
||||
"Last-Translator: Tomasz Dominikowski <dominikowski@gmail.com>\n"
|
||||
"Language-Team: Polish <gnomepl@aviary.pl>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -28,59 +28,193 @@ msgstr "Powłoka środowiska GNOME"
|
||||
msgid "Window management and application launching"
|
||||
msgstr "Zarządzanie oknami i uruchamianiem programów"
|
||||
|
||||
#. left side
|
||||
#: ../js/ui/panel.js:269
|
||||
msgid "Activities"
|
||||
msgstr "Czynności"
|
||||
|
||||
#. Translators: This is a time format.
|
||||
#: ../js/ui/panel.js:452
|
||||
msgid "%a %l:%M %p"
|
||||
msgstr "%a, %H:%M"
|
||||
|
||||
#: ../js/ui/dash.js:255
|
||||
msgid "Find..."
|
||||
msgstr "Znajdź..."
|
||||
|
||||
#: ../js/ui/dash.js:372
|
||||
msgid "Browse"
|
||||
msgstr "Przeglądaj"
|
||||
|
||||
#: ../js/ui/dash.js:508
|
||||
msgid "(see all)"
|
||||
msgstr "(wyświetl wszystko)"
|
||||
|
||||
#. **** Applications ****
|
||||
#: ../js/ui/dash.js:700 ../js/ui/dash.js:756 ../js/ui/dash.js:887
|
||||
#: ../js/ui/appDisplay.js:311 ../js/ui/dash.js:852
|
||||
msgid "APPLICATIONS"
|
||||
msgstr "Programy"
|
||||
|
||||
#: ../js/ui/appDisplay.js:343
|
||||
msgid "PREFERENCES"
|
||||
msgstr "Preferencje"
|
||||
|
||||
#: ../js/ui/appDisplay.js:728
|
||||
msgid "New Window"
|
||||
msgstr "Nowe okno"
|
||||
|
||||
#: ../js/ui/appDisplay.js:732
|
||||
msgid "Remove from Favorites"
|
||||
msgstr "Usuń z ulubionych"
|
||||
|
||||
#: ../js/ui/appDisplay.js:733
|
||||
msgid "Add to Favorites"
|
||||
msgstr "Dodaj do ulubionych"
|
||||
|
||||
#: ../js/ui/appDisplay.js:1085
|
||||
msgid "Drag here to add favorites"
|
||||
msgstr "Przeciągnięcie tutaj doda do ulubionych"
|
||||
|
||||
#: ../js/ui/appFavorites.js:89
|
||||
#, c-format
|
||||
msgid "%s has been added to your favorites."
|
||||
msgstr "%s zostało dodane do ulubionych."
|
||||
|
||||
#: ../js/ui/appFavorites.js:107
|
||||
#, c-format
|
||||
msgid "%s has been removed from your favorites."
|
||||
msgstr "%s zostało usunięte z ulubionych."
|
||||
|
||||
#: ../js/ui/dash.js:194
|
||||
msgid "Find"
|
||||
msgstr "Znajdź"
|
||||
|
||||
#: ../js/ui/dash.js:507
|
||||
msgid "Searching..."
|
||||
msgstr "Wyszukiwanie..."
|
||||
|
||||
#: ../js/ui/dash.js:521
|
||||
msgid "No matching results."
|
||||
msgstr "Brak wyników."
|
||||
|
||||
#. **** Places ****
|
||||
#. Translators: This is in the sense of locations for documents,
|
||||
#. network locations, etc.
|
||||
#: ../js/ui/dash.js:720
|
||||
msgid "PLACES"
|
||||
msgstr "Miejsca"
|
||||
#: ../js/ui/dash.js:871 ../js/ui/placeDisplay.js:579
|
||||
msgid "PLACES & DEVICES"
|
||||
msgstr "Miejsca i urządzenia"
|
||||
|
||||
#. **** Documents ****
|
||||
#: ../js/ui/dash.js:727 ../js/ui/dash.js:768 ../js/ui/dash.js:861
|
||||
msgid "RECENT DOCUMENTS"
|
||||
#: ../js/ui/dash.js:878 ../js/ui/docDisplay.js:488
|
||||
msgid "RECENT ITEMS"
|
||||
msgstr "Ostatnie dokumenty"
|
||||
|
||||
#. **** Search Results ****
|
||||
#: ../js/ui/dash.js:746 ../js/ui/dash.js:850 ../js/ui/dash.js:876
|
||||
msgid "SEARCH RESULTS"
|
||||
msgstr "Wyniki wyszukiwania"
|
||||
#: ../js/ui/lookingGlass.js:363
|
||||
msgid "No extensions installed"
|
||||
msgstr "Nie zainstalowano rozszerzeń"
|
||||
|
||||
#: ../js/ui/runDialog.js:90
|
||||
#: ../js/ui/lookingGlass.js:400
|
||||
msgid "Enabled"
|
||||
msgstr "Włączone"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:402
|
||||
msgid "Disabled"
|
||||
msgstr "Wyłączone"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:404
|
||||
msgid "Error"
|
||||
msgstr "Błąd"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:406
|
||||
msgid "Out of date"
|
||||
msgstr "Przestarzałe"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:431
|
||||
msgid "View Source"
|
||||
msgstr "Wyświetl źródło"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:437
|
||||
msgid "Web Page"
|
||||
msgstr "Strona WWW"
|
||||
|
||||
#: ../js/ui/overview.js:182
|
||||
msgid "Undo"
|
||||
msgstr "Cofnij"
|
||||
|
||||
#. Button on the left side of the panel.
|
||||
#. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview".
|
||||
#: ../js/ui/panel.js:385
|
||||
msgid "Activities"
|
||||
msgstr "Podgląd"
|
||||
|
||||
#. Translators: This is the time format used in 24-hour mode.
|
||||
#: ../js/ui/panel.js:616
|
||||
msgid "%a %R"
|
||||
msgstr "%a, %R"
|
||||
|
||||
#. Translators: This is a time format used for AM/PM.
|
||||
#: ../js/ui/panel.js:619
|
||||
msgid "%a %l:%M %p"
|
||||
msgstr "%a, %H:%M"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:103
|
||||
#, c-format
|
||||
msgid "Failed to unmount '%s'"
|
||||
msgstr "Odmontowanie \"%s\" się nie powiodło"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:106
|
||||
msgid "Retry"
|
||||
msgstr "Ponów"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:151
|
||||
msgid "Connect to..."
|
||||
msgstr "Połącz z..."
|
||||
|
||||
#: ../js/ui/runDialog.js:232
|
||||
msgid "Please enter a command:"
|
||||
msgstr "Proszę wprowadzić polecenie:"
|
||||
|
||||
#: ../src/shell-global.c:799
|
||||
#: ../js/ui/runDialog.js:374
|
||||
#, c-format
|
||||
msgid "Execution of '%s' failed:"
|
||||
msgstr "Wykonanie \"%s\" się nie powiodło:"
|
||||
|
||||
#: ../js/ui/statusMenu.js:107
|
||||
msgid "Available"
|
||||
msgstr "Dostępny"
|
||||
|
||||
#: ../js/ui/statusMenu.js:112
|
||||
msgid "Busy"
|
||||
msgstr "Zajęty"
|
||||
|
||||
#: ../js/ui/statusMenu.js:117
|
||||
msgid "Invisible"
|
||||
msgstr "Niewidoczny"
|
||||
|
||||
#: ../js/ui/statusMenu.js:126
|
||||
msgid "Account Information..."
|
||||
msgstr "Informacje o koncie..."
|
||||
|
||||
#: ../js/ui/statusMenu.js:132
|
||||
msgid "Sidebar"
|
||||
msgstr "Panel boczny"
|
||||
|
||||
#: ../js/ui/statusMenu.js:142
|
||||
msgid "System Preferences..."
|
||||
msgstr "Preferencje systemu..."
|
||||
|
||||
#: ../js/ui/statusMenu.js:151
|
||||
msgid "Lock Screen"
|
||||
msgstr "Zablokuj ekran"
|
||||
|
||||
#: ../js/ui/statusMenu.js:156
|
||||
msgid "Switch User"
|
||||
msgstr "Przełącz użytkownika"
|
||||
|
||||
#: ../js/ui/statusMenu.js:162
|
||||
msgid "Log Out..."
|
||||
msgstr "Wyloguj się..."
|
||||
|
||||
#: ../js/ui/statusMenu.js:167
|
||||
msgid "Shut Down..."
|
||||
msgstr "Wyłącz komputer..."
|
||||
|
||||
#. Translators: This is a time format.
|
||||
#: ../js/ui/widget.js:163
|
||||
msgid "%H:%M"
|
||||
msgstr "%H:%M"
|
||||
|
||||
#: ../js/ui/widget.js:317
|
||||
msgid "Applications"
|
||||
msgstr "Programy"
|
||||
|
||||
#: ../js/ui/widget.js:339
|
||||
msgid "Recent Documents"
|
||||
msgstr "Ostatnie dokumenty"
|
||||
|
||||
#: ../src/shell-global.c:967
|
||||
msgid "Less than a minute ago"
|
||||
msgstr "Mniej niż minutę temu"
|
||||
|
||||
#: ../src/shell-global.c:802
|
||||
#: ../src/shell-global.c:971
|
||||
#, c-format
|
||||
msgid "%d minute ago"
|
||||
msgid_plural "%d minutes ago"
|
||||
@ -88,7 +222,7 @@ msgstr[0] "%d minuta temu"
|
||||
msgstr[1] "%d minuty temu"
|
||||
msgstr[2] "%d minut temu"
|
||||
|
||||
#: ../src/shell-global.c:805
|
||||
#: ../src/shell-global.c:976
|
||||
#, c-format
|
||||
msgid "%d hour ago"
|
||||
msgid_plural "%d hours ago"
|
||||
@ -96,7 +230,7 @@ msgstr[0] "%d godzina temu"
|
||||
msgstr[1] "%d godziny temu"
|
||||
msgstr[2] "%d godzin temu"
|
||||
|
||||
#: ../src/shell-global.c:808
|
||||
#: ../src/shell-global.c:981
|
||||
#, c-format
|
||||
msgid "%d day ago"
|
||||
msgid_plural "%d days ago"
|
||||
@ -104,7 +238,7 @@ msgstr[0] "%d dzień temu"
|
||||
msgstr[1] "%d dni temu"
|
||||
msgstr[2] "%d dni temu"
|
||||
|
||||
#: ../src/shell-global.c:811
|
||||
#: ../src/shell-global.c:986
|
||||
#, c-format
|
||||
msgid "%d week ago"
|
||||
msgid_plural "%d weeks ago"
|
||||
@ -112,68 +246,17 @@ msgstr[0] "%d tydzień temu"
|
||||
msgstr[1] "%d tygodnie temu"
|
||||
msgstr[2] "%d tygodni temu"
|
||||
|
||||
#: ../src/shell-status-menu.c:156
|
||||
msgid "Unknown"
|
||||
msgstr "Nieznane"
|
||||
|
||||
#: ../src/shell-status-menu.c:212
|
||||
#, c-format
|
||||
msgid "Can't lock screen: %s"
|
||||
msgstr "Nie można zablokować ekranu: %s"
|
||||
|
||||
#: ../src/shell-status-menu.c:227
|
||||
#, c-format
|
||||
msgid "Can't temporarily set screensaver to blank screen: %s"
|
||||
msgstr ""
|
||||
"Nie można tymczasowo ustawić wygaszacza ekranu na wygaszenie ekranu: %s"
|
||||
|
||||
#: ../src/shell-status-menu.c:351
|
||||
#, c-format
|
||||
msgid "Can't logout: %s"
|
||||
msgstr "Nie można się wylogować: %s"
|
||||
|
||||
#: ../src/shell-status-menu.c:492
|
||||
msgid "Account Information..."
|
||||
msgstr "Informacje o koncie..."
|
||||
|
||||
#: ../src/shell-status-menu.c:502
|
||||
msgid "Sidebar"
|
||||
msgstr "Panel boczny"
|
||||
|
||||
#: ../src/shell-status-menu.c:510
|
||||
msgid "System Preferences..."
|
||||
msgstr "Preferencje systemu..."
|
||||
|
||||
#: ../src/shell-status-menu.c:525
|
||||
msgid "Lock Screen"
|
||||
msgstr "Zablokuj ekran"
|
||||
|
||||
#: ../src/shell-status-menu.c:535
|
||||
msgid "Switch User"
|
||||
msgstr "Przełącz użytkownika"
|
||||
|
||||
#. Only show switch user if there are other users
|
||||
#. Log Out
|
||||
#: ../src/shell-status-menu.c:546
|
||||
msgid "Log Out..."
|
||||
msgstr "Wyloguj się..."
|
||||
|
||||
#. Shut down
|
||||
#: ../src/shell-status-menu.c:557
|
||||
msgid "Shut Down..."
|
||||
msgstr "Wyłącz komputer..."
|
||||
|
||||
#: ../src/shell-uri-util.c:87
|
||||
#: ../src/shell-uri-util.c:89
|
||||
msgid "Home Folder"
|
||||
msgstr "Katalog domowy"
|
||||
|
||||
#. Translators: this is the same string as the one found in
|
||||
#. * nautilus
|
||||
#: ../src/shell-uri-util.c:102
|
||||
#: ../src/shell-uri-util.c:104
|
||||
msgid "File System"
|
||||
msgstr "System plików"
|
||||
|
||||
#: ../src/shell-uri-util.c:248
|
||||
#: ../src/shell-uri-util.c:250
|
||||
msgid "Search"
|
||||
msgstr "Wyszukaj"
|
||||
|
||||
@ -182,7 +265,7 @@ msgstr "Wyszukaj"
|
||||
#. * example, "Trash: some-directory". It means that the
|
||||
#. * directory called "some-directory" is in the trash.
|
||||
#.
|
||||
#: ../src/shell-uri-util.c:298
|
||||
#: ../src/shell-uri-util.c:300
|
||||
#, c-format
|
||||
msgid "%1$s: %2$s"
|
||||
msgstr "%1$s: %2$s"
|
||||
|
91
po/sl.po
91
po/sl.po
@ -8,8 +8,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gnome-shell master\n"
|
||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-shell&component=general\n"
|
||||
"POT-Creation-Date: 2010-02-15 17:28+0000\n"
|
||||
"PO-Revision-Date: 2010-02-15 19:03+0100\n"
|
||||
"POT-Creation-Date: 2010-03-21 15:49+0000\n"
|
||||
"PO-Revision-Date: 2010-03-21 21:59+0100\n"
|
||||
"Last-Translator: Matej Urbančič <mateju@svn.gnome.org>\n"
|
||||
"Language-Team: Slovenian GNOME Translation Team <gnome-si@googlegroups.com>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@ -30,28 +30,28 @@ msgid "Window management and application launching"
|
||||
msgstr "Upravljanje oken in zaganjanje programov"
|
||||
|
||||
#. **** Applications ****
|
||||
#: ../js/ui/appDisplay.js:252
|
||||
#: ../js/ui/dash.js:880
|
||||
#: ../js/ui/appDisplay.js:311
|
||||
#: ../js/ui/dash.js:852
|
||||
msgid "APPLICATIONS"
|
||||
msgstr "Programi"
|
||||
|
||||
#: ../js/ui/appDisplay.js:276
|
||||
#: ../js/ui/appDisplay.js:343
|
||||
msgid "PREFERENCES"
|
||||
msgstr "Možnosti"
|
||||
|
||||
#: ../js/ui/appDisplay.js:649
|
||||
#: ../js/ui/appDisplay.js:728
|
||||
msgid "New Window"
|
||||
msgstr "Novo okno"
|
||||
|
||||
#: ../js/ui/appDisplay.js:653
|
||||
#: ../js/ui/appDisplay.js:732
|
||||
msgid "Remove from Favorites"
|
||||
msgstr "Odstrani iz priljubljenih"
|
||||
|
||||
#: ../js/ui/appDisplay.js:654
|
||||
#: ../js/ui/appDisplay.js:733
|
||||
msgid "Add to Favorites"
|
||||
msgstr "Dodaj med priljubljene"
|
||||
|
||||
#: ../js/ui/appDisplay.js:1006
|
||||
#: ../js/ui/appDisplay.js:1085
|
||||
msgid "Drag here to add favorites"
|
||||
msgstr "S potegom na to mesto se izbor doda med priljubljene"
|
||||
|
||||
@ -65,89 +65,98 @@ msgstr "Program \"%s\" je dodan med priljubljeno."
|
||||
msgid "%s has been removed from your favorites."
|
||||
msgstr "Program \"%s\" je odstranjen iz priljubljenih."
|
||||
|
||||
#: ../js/ui/dash.js:241
|
||||
msgid "Find..."
|
||||
msgstr "Najdi ..."
|
||||
#: ../js/ui/dash.js:194
|
||||
msgid "Find"
|
||||
msgstr "Najdi"
|
||||
|
||||
#: ../js/ui/dash.js:508
|
||||
#: ../js/ui/dash.js:507
|
||||
msgid "Searching..."
|
||||
msgstr "Iskanje ..."
|
||||
|
||||
#: ../js/ui/dash.js:522
|
||||
#: ../js/ui/dash.js:521
|
||||
msgid "No matching results."
|
||||
msgstr "Ni zadetkov iskanja"
|
||||
|
||||
#. **** Places ****
|
||||
#. Translators: This is in the sense of locations for documents,
|
||||
#. network locations, etc.
|
||||
#: ../js/ui/dash.js:900
|
||||
#: ../js/ui/placeDisplay.js:529
|
||||
#: ../js/ui/dash.js:871
|
||||
#: ../js/ui/placeDisplay.js:579
|
||||
msgid "PLACES & DEVICES"
|
||||
msgstr "Mesta in naprave"
|
||||
|
||||
#. **** Documents ****
|
||||
#: ../js/ui/dash.js:907
|
||||
#: ../js/ui/dash.js:878
|
||||
#: ../js/ui/docDisplay.js:488
|
||||
msgid "RECENT ITEMS"
|
||||
msgstr "Nedavni predmeti"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:356
|
||||
#: ../js/ui/lookingGlass.js:363
|
||||
msgid "No extensions installed"
|
||||
msgstr "Ni nameščenih razširitev"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:393
|
||||
#: ../js/ui/lookingGlass.js:400
|
||||
msgid "Enabled"
|
||||
msgstr "Omogočeno"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:395
|
||||
#: ../js/ui/lookingGlass.js:402
|
||||
msgid "Disabled"
|
||||
msgstr "Onemogočeno"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:397
|
||||
#: ../js/ui/lookingGlass.js:404
|
||||
msgid "Error"
|
||||
msgstr "Napaka"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:399
|
||||
#: ../js/ui/lookingGlass.js:406
|
||||
msgid "Out of date"
|
||||
msgstr "Zastarelo"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:424
|
||||
#: ../js/ui/lookingGlass.js:431
|
||||
msgid "View Source"
|
||||
msgstr "Poglej vir"
|
||||
|
||||
#: ../js/ui/lookingGlass.js:430
|
||||
#: ../js/ui/lookingGlass.js:437
|
||||
msgid "Web Page"
|
||||
msgstr "Spletna stran"
|
||||
|
||||
#: ../js/ui/overview.js:95
|
||||
#: ../js/ui/overview.js:182
|
||||
msgid "Undo"
|
||||
msgstr "Razveljavi"
|
||||
|
||||
#. Button on the left side of the panel.
|
||||
#. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview".
|
||||
#: ../js/ui/panel.js:336
|
||||
#: ../js/ui/panel.js:385
|
||||
msgid "Activities"
|
||||
msgstr "Dejavnosti"
|
||||
|
||||
#. Translators: This is the time format used in 24-hour mode.
|
||||
#: ../js/ui/panel.js:560
|
||||
#: ../js/ui/panel.js:616
|
||||
msgid "%a %R"
|
||||
msgstr "%a. %R"
|
||||
|
||||
#. Translators: This is a time format used for AM/PM.
|
||||
#: ../js/ui/panel.js:563
|
||||
#: ../js/ui/panel.js:619
|
||||
msgid "%a %l:%M %p"
|
||||
msgstr "%a, %H:%M"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:144
|
||||
#: ../js/ui/placeDisplay.js:103
|
||||
#, c-format
|
||||
msgid "Failed to unmount '%s'"
|
||||
msgstr "Ni mogoče odklopiti '%s'"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:106
|
||||
msgid "Retry"
|
||||
msgstr "Poskusi znova"
|
||||
|
||||
#: ../js/ui/placeDisplay.js:151
|
||||
msgid "Connect to..."
|
||||
msgstr "Povezava z ..."
|
||||
|
||||
#: ../js/ui/runDialog.js:245
|
||||
#: ../js/ui/runDialog.js:232
|
||||
msgid "Please enter a command:"
|
||||
msgstr "Vnos ukaza:"
|
||||
|
||||
#: ../js/ui/runDialog.js:361
|
||||
#: ../js/ui/runDialog.js:374
|
||||
#, c-format
|
||||
msgid "Execution of '%s' failed:"
|
||||
msgstr "Izvajanje '%s' je spodletelo:"
|
||||
@ -205,11 +214,21 @@ msgstr "Programi"
|
||||
msgid "Recent Documents"
|
||||
msgstr "Nedavni dokumenti"
|
||||
|
||||
#: ../src/shell-global.c:976
|
||||
#: ../js/ui/windowAttentionHandler.js:47
|
||||
#, c-format
|
||||
msgid "%s has finished starting"
|
||||
msgstr "%s je končal začenjanje"
|
||||
|
||||
#: ../js/ui/windowAttentionHandler.js:49
|
||||
#, c-format
|
||||
msgid "'%s' is ready"
|
||||
msgstr "'%s' storitev je pripravljena"
|
||||
|
||||
#: ../src/shell-global.c:967
|
||||
msgid "Less than a minute ago"
|
||||
msgstr "Pred manj kot eno minuto"
|
||||
|
||||
#: ../src/shell-global.c:980
|
||||
#: ../src/shell-global.c:971
|
||||
#, c-format
|
||||
msgid "%d minute ago"
|
||||
msgid_plural "%d minutes ago"
|
||||
@ -218,7 +237,7 @@ msgstr[1] "Pred %d minuto"
|
||||
msgstr[2] "Pred %d minutama"
|
||||
msgstr[3] "Pred %d minutami"
|
||||
|
||||
#: ../src/shell-global.c:985
|
||||
#: ../src/shell-global.c:976
|
||||
#, c-format
|
||||
msgid "%d hour ago"
|
||||
msgid_plural "%d hours ago"
|
||||
@ -227,7 +246,7 @@ msgstr[1] "Pred %d uro"
|
||||
msgstr[2] "Pred %d urama"
|
||||
msgstr[3] "Pred %d urami"
|
||||
|
||||
#: ../src/shell-global.c:990
|
||||
#: ../src/shell-global.c:981
|
||||
#, c-format
|
||||
msgid "%d day ago"
|
||||
msgid_plural "%d days ago"
|
||||
@ -236,7 +255,7 @@ msgstr[1] "Pred %d dnevom"
|
||||
msgstr[2] "Pred %d dnevoma"
|
||||
msgstr[3] "Pred %d dnevi"
|
||||
|
||||
#: ../src/shell-global.c:995
|
||||
#: ../src/shell-global.c:986
|
||||
#, c-format
|
||||
msgid "%d week ago"
|
||||
msgid_plural "%d weeks ago"
|
||||
|
@ -18,6 +18,7 @@ gnome-shell: gnome-shell.in
|
||||
-e "s|@libdir[@]|$(libdir)|" \
|
||||
-e "s|@pkgdatadir[@]|$(pkgdatadir)|" \
|
||||
-e "s|@PYTHON[@]|$(PYTHON)|" \
|
||||
-e "s|@VERSION[@]|$(VERSION)|" \
|
||||
-e "s|@sysconfdir[@]|$(sysconfdir)|" \
|
||||
$< > $@ && chmod a+x $@
|
||||
CLEANFILES += gnome-shell
|
||||
@ -90,8 +91,6 @@ libgnome_shell_la_SOURCES = \
|
||||
shell-stack.h \
|
||||
shell-tray-manager.c \
|
||||
shell-tray-manager.h \
|
||||
shell-texture-cache.c \
|
||||
shell-texture-cache.h \
|
||||
shell-uri-util.c \
|
||||
shell-uri-util.h \
|
||||
shell-window-tracker.c \
|
||||
@ -193,15 +192,14 @@ Shell-0.1.typelib: libgnome-shell.la Shell-0.1.gir Big-1.0.gir
|
||||
Shell-0.1.gir -o $@
|
||||
CLEANFILES += Shell-0.1.typelib
|
||||
|
||||
Big-1.0.gir: $(mutter) $(G_IR_SCANNER) libgnome-shell.la libbig-1.0.la Makefile
|
||||
Big-1.0.gir: $(mutter) $(G_IR_SCANNER) libbig-1.0.la Makefile
|
||||
$(AM_V_GEN) $(G_IR_SCANNER) \
|
||||
--namespace=Big \
|
||||
--nsversion=1.0 \
|
||||
--include=Clutter-1.0 \
|
||||
--include=GdkPixbuf-2.0 \
|
||||
--libtool="$(LIBTOOL)" \
|
||||
--program=mutter \
|
||||
--program-arg=--mutter-plugins=$$(pwd)/libgnome-shell.la \
|
||||
--libtool="$(LIBTOOL)" \
|
||||
--library=libbig-1.0.la \
|
||||
$(addprefix $(srcdir)/,$(big_source_h)) \
|
||||
$(addprefix $(srcdir)/,$(big_source_c)) \
|
||||
$(srcdir)/big-enum-types.h \
|
||||
@ -213,7 +211,7 @@ Big-1.0.typelib: libbig-1.0.la Big-1.0.gir
|
||||
$(AM_V_GEN) $(G_IR_COMPILER) Big-1.0.gir -o $@
|
||||
CLEANFILES += Big-1.0.typelib
|
||||
|
||||
St-1.0.gir: $(mutter) $(G_IR_SCANNER) libgnome-shell.la libst-1.0.la Makefile
|
||||
St-1.0.gir: $(mutter) $(G_IR_SCANNER) libst-1.0.la Makefile
|
||||
$(AM_V_GEN) $(G_IR_SCANNER) \
|
||||
--namespace=St \
|
||||
--nsversion=1.0 \
|
||||
@ -221,8 +219,8 @@ St-1.0.gir: $(mutter) $(G_IR_SCANNER) libgnome-shell.la libst-1.0.la Makefile
|
||||
--include=Gtk-2.0 \
|
||||
--add-include-path=$(builddir) \
|
||||
--libtool="$(LIBTOOL)" \
|
||||
--program=mutter \
|
||||
--program-arg=--mutter-plugins=$$(pwd)/libgnome-shell.la \
|
||||
--library=libst-1.0.la \
|
||||
--library=libbig-1.0.la \
|
||||
-DST_COMPILATION \
|
||||
$(addprefix $(srcdir)/,$(st_source_h)) \
|
||||
$(addprefix $(srcdir)/,$(st_source_c)) \
|
||||
|
@ -233,7 +233,7 @@ corner_unref(Corner *corner)
|
||||
if (corner->ref_count == 0) {
|
||||
g_hash_table_remove(all_corners, corner);
|
||||
|
||||
cogl_texture_unref(corner->texture);
|
||||
cogl_handle_unref(corner->texture);
|
||||
g_free(corner->data);
|
||||
g_free(corner);
|
||||
}
|
||||
@ -608,17 +608,17 @@ big_rectangle_dispose(GObject *object)
|
||||
}
|
||||
|
||||
if (rectangle->corner_material) {
|
||||
cogl_material_unref (rectangle->corner_material);
|
||||
cogl_handle_unref (rectangle->corner_material);
|
||||
rectangle->corner_material = NULL;
|
||||
}
|
||||
|
||||
if (rectangle->background_material) {
|
||||
cogl_material_unref (rectangle->background_material);
|
||||
cogl_handle_unref (rectangle->background_material);
|
||||
rectangle->background_material = NULL;
|
||||
}
|
||||
|
||||
if (rectangle->border_material) {
|
||||
cogl_material_unref (rectangle->border_material);
|
||||
cogl_handle_unref (rectangle->border_material);
|
||||
rectangle->border_material = NULL;
|
||||
}
|
||||
|
||||
|
56
src/gnome-shell.in
Executable file → Normal file
56
src/gnome-shell.in
Executable file → Normal file
@ -14,6 +14,54 @@ import termios
|
||||
import time
|
||||
import errno
|
||||
|
||||
def show_version(option, opt_str, value, parser):
|
||||
print "GNOME Shell @VERSION@"
|
||||
sys.exit()
|
||||
|
||||
def get_running_session_environs():
|
||||
wanted_environment = ['DBUS_SESSION_BUS_ADDRESS', 'DISPLAY', 'XDG_DATA_DIRS',
|
||||
'XAUTHORITY', 'XDG_SESSION_COOKIE', 'ORBIT_SOCKETDIR',
|
||||
'SESSION_MANAGER']
|
||||
num_re = re.compile('^[0-9]+$')
|
||||
myuid = os.getuid()
|
||||
if not os.path.isdir('/proc'):
|
||||
return {}
|
||||
for filename in os.listdir('/proc'):
|
||||
if not num_re.match(filename):
|
||||
continue
|
||||
piddir = '/proc/' + filename
|
||||
try:
|
||||
stat = os.stat(piddir)
|
||||
except OSError, e:
|
||||
continue
|
||||
if not stat.st_uid == myuid:
|
||||
continue
|
||||
try:
|
||||
exe = os.readlink(piddir + '/exe')
|
||||
except OSError, e:
|
||||
continue
|
||||
if os.path.basename(exe) != 'gnome-session':
|
||||
continue
|
||||
try:
|
||||
f = open(os.path.join(piddir, 'environ'))
|
||||
except OSError, e:
|
||||
continue
|
||||
environ_data = f.read()
|
||||
f.close()
|
||||
# There's a trailing null at the last one, so remove the
|
||||
# empty string
|
||||
environs = environ_data.split('\0')[:-1]
|
||||
# Rumor has it the presence of just FOO (instead of FOO=bar)
|
||||
# represents a deleted environment variable
|
||||
environs = filter(lambda x: '=' in x, environs)
|
||||
# Turn it into a dictionary
|
||||
environs = dict(map(lambda x: x.split('=', 1), environs))
|
||||
result = {}
|
||||
for key in wanted_environment:
|
||||
if key in environs:
|
||||
result[key] = environs[key]
|
||||
return result
|
||||
|
||||
def start_xephyr():
|
||||
tmpdir = tempfile.mkdtemp("", "gnome-shell.")
|
||||
atexit.register(shutil.rmtree, tmpdir)
|
||||
@ -214,6 +262,8 @@ parser.add_option("", "--eval-file", metavar="EVAL_FILE",
|
||||
help="Evaluate the contents of the given JavaScript file")
|
||||
parser.add_option("", "--create-extension", action="store_true",
|
||||
help="Create a new GNOME Shell extension")
|
||||
parser.add_option("", "--version", action="callback", callback=show_version,
|
||||
help="Display version and exit")
|
||||
|
||||
options, args = parser.parse_args()
|
||||
|
||||
@ -343,6 +393,12 @@ else:
|
||||
if options.verbose:
|
||||
print "Starting shell"
|
||||
|
||||
|
||||
# Handle ssh logins
|
||||
if 'DISPLAY' not in os.environ:
|
||||
running_env = get_running_session_environs()
|
||||
os.environ.update(running_env)
|
||||
|
||||
if options.debug:
|
||||
# Record initial terminal state so we can reset it to that
|
||||
# later, in case we kill gdb at a bad time
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
#include "shell-app-private.h"
|
||||
#include "shell-global.h"
|
||||
#include "shell-texture-cache.h"
|
||||
#include "st/st-texture-cache.h"
|
||||
#include "display.h"
|
||||
|
||||
#define GMENU_I_KNOW_THIS_IS_UNSTABLE
|
||||
@ -1021,7 +1021,16 @@ themed_icon_from_name (const char *iconname)
|
||||
return icon;
|
||||
}
|
||||
|
||||
static GIcon *
|
||||
/**
|
||||
* shell_app_info_get_icon:
|
||||
* @info: A #ShellAppInfo
|
||||
*
|
||||
* Get the #GIcon associated with this app; for apps "faked" from a #MetaWindow,
|
||||
* return %NULL.
|
||||
*
|
||||
* Returns: (transfer full): The icon for @info, or %NULL
|
||||
*/
|
||||
GIcon *
|
||||
shell_app_info_get_icon (ShellAppInfo *info)
|
||||
{
|
||||
char *iconname = NULL;
|
||||
@ -1100,9 +1109,9 @@ shell_app_info_create_icon_texture (ShellAppInfo *info, float size)
|
||||
|
||||
if (info->type == SHELL_APP_INFO_TYPE_WINDOW)
|
||||
{
|
||||
return shell_texture_cache_bind_pixbuf_property (shell_texture_cache_get_default (),
|
||||
G_OBJECT (info->window),
|
||||
"icon");
|
||||
return st_texture_cache_bind_pixbuf_property (st_texture_cache_get_default (),
|
||||
G_OBJECT (info->window),
|
||||
"icon");
|
||||
}
|
||||
|
||||
icon = shell_app_info_get_icon (info);
|
||||
@ -1113,13 +1122,28 @@ shell_app_info_create_icon_texture (ShellAppInfo *info, float size)
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = shell_texture_cache_load_gicon (shell_texture_cache_get_default (), icon, (int)size);
|
||||
ret = st_texture_cache_load_gicon (st_texture_cache_get_default (), icon, (int)size);
|
||||
g_object_unref (icon);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* shell_app_info_get_source_window:
|
||||
* @info: A #ShellAppInfo
|
||||
*
|
||||
* If @info is tracking a #MetaWindow, return that window.
|
||||
* Otherwise, return %NULL.
|
||||
*/
|
||||
MetaWindow *
|
||||
shell_app_info_get_source_window (ShellAppInfo *info)
|
||||
{
|
||||
if (info->type == SHELL_APP_INFO_TYPE_WINDOW)
|
||||
return info->window;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* shell_app_info_launch_full:
|
||||
* @timestamp: Event timestamp, or 0 for current event timestamp
|
||||
|
@ -50,10 +50,14 @@ char *shell_app_info_get_name (ShellAppInfo *info);
|
||||
char *shell_app_info_get_description (ShellAppInfo *info);
|
||||
char *shell_app_info_get_executable (ShellAppInfo *info);
|
||||
char *shell_app_info_get_desktop_file_path (ShellAppInfo *info);
|
||||
GIcon *shell_app_info_get_icon (ShellAppInfo *info);
|
||||
ClutterActor *shell_app_info_create_icon_texture (ShellAppInfo *info, float size);
|
||||
GSList *shell_app_info_get_categories (ShellAppInfo *info);
|
||||
gboolean shell_app_info_get_is_nodisplay (ShellAppInfo *info);
|
||||
gboolean shell_app_info_is_transient (ShellAppInfo *info);
|
||||
|
||||
MetaWindow *shell_app_info_get_source_window (ShellAppInfo *info);
|
||||
|
||||
gboolean shell_app_info_launch_full (ShellAppInfo *info,
|
||||
guint timestamp,
|
||||
GList *uris,
|
||||
|
149
src/shell-app.c
149
src/shell-app.c
@ -4,6 +4,9 @@
|
||||
|
||||
#include "shell-app-private.h"
|
||||
#include "shell-global.h"
|
||||
#include "st.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/**
|
||||
* SECTION:shell-app
|
||||
@ -22,6 +25,7 @@ struct _ShellApp
|
||||
|
||||
gboolean window_sort_stale;
|
||||
GSList *windows;
|
||||
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (ShellApp, shell_app, G_TYPE_OBJECT);
|
||||
@ -53,6 +57,149 @@ shell_app_create_icon_texture (ShellApp *app,
|
||||
{
|
||||
return shell_app_info_create_icon_texture (app->info, size);
|
||||
}
|
||||
typedef struct {
|
||||
ShellApp *app;
|
||||
int size;
|
||||
} CreateFadedIconData;
|
||||
|
||||
static CoglHandle
|
||||
shell_app_create_faded_icon_cpu (StTextureCache *cache,
|
||||
const char *key,
|
||||
void *datap,
|
||||
GError **error)
|
||||
{
|
||||
CreateFadedIconData *data = datap;
|
||||
ShellApp *app;
|
||||
GdkPixbuf *pixbuf;
|
||||
int size;
|
||||
CoglHandle texture;
|
||||
gint width, height, rowstride;
|
||||
guint8 n_channels;
|
||||
gboolean have_alpha;
|
||||
gint fade_start;
|
||||
gint fade_range;
|
||||
guint i, j;
|
||||
guint pixbuf_byte_size;
|
||||
guint8 *orig_pixels;
|
||||
guint8 *pixels;
|
||||
GIcon *icon;
|
||||
GtkIconInfo *info;
|
||||
|
||||
app = data->app;
|
||||
size = data->size;
|
||||
|
||||
icon = shell_app_info_get_icon (app->info);
|
||||
if (icon == NULL)
|
||||
return COGL_INVALID_HANDLE;
|
||||
|
||||
info = gtk_icon_theme_lookup_by_gicon (gtk_icon_theme_get_default (),
|
||||
icon, (int) (size + 0.5),
|
||||
GTK_ICON_LOOKUP_FORCE_SIZE);
|
||||
g_object_unref (icon);
|
||||
if (info == NULL)
|
||||
return COGL_INVALID_HANDLE;
|
||||
|
||||
pixbuf = gtk_icon_info_load_icon (info, NULL);
|
||||
gtk_icon_info_free (info);
|
||||
|
||||
if (pixbuf == NULL)
|
||||
return COGL_INVALID_HANDLE;
|
||||
|
||||
width = gdk_pixbuf_get_width (pixbuf);
|
||||
height = gdk_pixbuf_get_height (pixbuf);
|
||||
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
|
||||
n_channels = gdk_pixbuf_get_n_channels (pixbuf);
|
||||
orig_pixels = gdk_pixbuf_get_pixels (pixbuf);
|
||||
have_alpha = gdk_pixbuf_get_has_alpha (pixbuf);
|
||||
|
||||
pixbuf_byte_size = (height - 1) * rowstride +
|
||||
+ width * ((n_channels * gdk_pixbuf_get_bits_per_sample (pixbuf) + 7) / 8);
|
||||
|
||||
pixels = g_malloc0 (rowstride * height);
|
||||
memcpy (pixels, orig_pixels, pixbuf_byte_size);
|
||||
|
||||
fade_start = width / 2;
|
||||
fade_range = width - fade_start;
|
||||
for (i = fade_start; i < width; i++)
|
||||
{
|
||||
for (j = 0; j < height; j++)
|
||||
{
|
||||
guchar *pixel = &pixels[j * rowstride + i * n_channels];
|
||||
float fade = 1.0 - ((float) i - fade_start) / fade_range;
|
||||
pixel[0] = 0.5 + pixel[0] * fade;
|
||||
pixel[1] = 0.5 + pixel[1] * fade;
|
||||
pixel[2] = 0.5 + pixel[2] * fade;
|
||||
if (have_alpha)
|
||||
pixel[3] = 0.5 + pixel[3] * fade;
|
||||
}
|
||||
}
|
||||
|
||||
texture = cogl_texture_new_from_data (width,
|
||||
height,
|
||||
COGL_TEXTURE_NONE,
|
||||
have_alpha ? COGL_PIXEL_FORMAT_RGBA_8888 : COGL_PIXEL_FORMAT_RGB_888,
|
||||
COGL_PIXEL_FORMAT_ANY,
|
||||
rowstride,
|
||||
pixels);
|
||||
g_free (pixels);
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
return texture;
|
||||
}
|
||||
|
||||
/**
|
||||
* shell_app_get_faded_icon:
|
||||
* @app: A #ShellApp
|
||||
* @size: Size in pixels
|
||||
*
|
||||
* Return an actor with a horizontally faded look.
|
||||
*
|
||||
* Return value: (transfer none): A floating #ClutterActor, or %NULL if no icon
|
||||
*/
|
||||
ClutterActor *
|
||||
shell_app_get_faded_icon (ShellApp *app, float size)
|
||||
{
|
||||
MetaWindow *window;
|
||||
CoglHandle texture;
|
||||
ClutterActor *result;
|
||||
char *cache_key;
|
||||
CreateFadedIconData data;
|
||||
|
||||
/* Punt for WINDOW types for now...easier to reuse the property tracking bits,
|
||||
* and this helps us visually distinguish app-tracked from not.
|
||||
*/
|
||||
window = shell_app_info_get_source_window (app->info);
|
||||
if (window)
|
||||
{
|
||||
return st_texture_cache_bind_pixbuf_property (st_texture_cache_get_default (),
|
||||
G_OBJECT (window),
|
||||
"icon");
|
||||
}
|
||||
|
||||
cache_key = g_strdup_printf ("faded-icon:%s,size=%f", shell_app_get_id (app), size);
|
||||
data.app = app;
|
||||
data.size = (int) (0.5 + size);
|
||||
texture = st_texture_cache_load (st_texture_cache_get_default (),
|
||||
cache_key,
|
||||
ST_TEXTURE_CACHE_POLICY_FOREVER,
|
||||
shell_app_create_faded_icon_cpu,
|
||||
&data,
|
||||
NULL);
|
||||
g_free (cache_key);
|
||||
|
||||
if (texture != COGL_INVALID_HANDLE)
|
||||
{
|
||||
result = clutter_texture_new ();
|
||||
clutter_texture_set_cogl_texture (CLUTTER_TEXTURE (result), texture);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = clutter_texture_new ();
|
||||
g_object_set (result, "opacity", 0, "width", size, "height", size, NULL);
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
char *
|
||||
shell_app_get_name (ShellApp *app)
|
||||
@ -360,6 +507,8 @@ shell_app_dispose (GObject *object)
|
||||
_shell_app_remove_window (app, app->windows->data);
|
||||
|
||||
disconnect_workspace_switch (app);
|
||||
|
||||
G_OBJECT_CLASS(shell_app_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -30,6 +30,7 @@ GType shell_app_get_type (void) G_GNUC_CONST;
|
||||
const char *shell_app_get_id (ShellApp *app);
|
||||
|
||||
ClutterActor *shell_app_create_icon_texture (ShellApp *app, float size);
|
||||
ClutterActor *shell_app_get_faded_icon (ShellApp *app, float size);
|
||||
char *shell_app_get_name (ShellApp *app);
|
||||
char *shell_app_get_description (ShellApp *app);
|
||||
gboolean shell_app_is_transient (ShellApp *app);
|
||||
|
@ -5,7 +5,6 @@
|
||||
#include "shell-doc-system.h"
|
||||
|
||||
#include "shell-global.h"
|
||||
#include "shell-texture-cache.h"
|
||||
|
||||
|
||||
/**
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <math.h>
|
||||
|
||||
void
|
||||
shell_draw_clock (ClutterCairoTexture *texture,
|
||||
shell_draw_clock (StDrawingArea *area,
|
||||
int hour,
|
||||
int minute)
|
||||
{
|
||||
@ -15,15 +15,14 @@ shell_draw_clock (ClutterCairoTexture *texture,
|
||||
double xc, yc, radius, hour_radius, minute_radius;
|
||||
double angle;
|
||||
|
||||
clutter_cairo_texture_get_surface_size (texture, &width, &height);
|
||||
st_drawing_area_get_surface_size (area, &width, &height);
|
||||
xc = (double)width / 2;
|
||||
yc = (double)height / 2;
|
||||
radius = (double)(MIN(width, height)) / 2 - 2;
|
||||
minute_radius = radius - 3;
|
||||
hour_radius = radius / 2;
|
||||
|
||||
clutter_cairo_texture_clear (texture);
|
||||
cr = clutter_cairo_texture_create (texture);
|
||||
cr = st_drawing_area_get_context (area);
|
||||
cairo_set_line_width (cr, 1.0);
|
||||
|
||||
/* Outline */
|
||||
@ -48,76 +47,10 @@ shell_draw_clock (ClutterCairoTexture *texture,
|
||||
xc + minute_radius * cos (angle),
|
||||
yc + minute_radius * sin (angle));
|
||||
cairo_stroke (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
}
|
||||
|
||||
/**
|
||||
* shell_fade_app_icon:
|
||||
* @source: Source #ClutterTexture
|
||||
*
|
||||
* Create a new texture by modifying the alpha channel of the
|
||||
* source texture, adding a horizontal gradient fade.
|
||||
*
|
||||
* Returns: (transfer none): A new #ClutterTexture
|
||||
*/
|
||||
ClutterTexture *
|
||||
shell_fade_app_icon (ClutterTexture *source)
|
||||
{
|
||||
CoglHandle texture;
|
||||
guchar *pixels;
|
||||
gint width, height, rowstride;
|
||||
gint fade_start;
|
||||
gint fade_range;
|
||||
guint i, j;
|
||||
ClutterTexture *result;
|
||||
|
||||
texture = clutter_texture_get_cogl_texture (source);
|
||||
if (texture == COGL_INVALID_HANDLE)
|
||||
return NULL;
|
||||
|
||||
width = cogl_texture_get_width (texture);
|
||||
height = cogl_texture_get_height (texture);
|
||||
rowstride = (width * 4 + 3) & ~3;
|
||||
|
||||
pixels = g_malloc0 (rowstride * height);
|
||||
|
||||
cogl_texture_get_data (texture, COGL_PIXEL_FORMAT_RGBA_8888_PRE,
|
||||
rowstride, pixels);
|
||||
|
||||
fade_start = width / 2;
|
||||
fade_range = width - fade_start;
|
||||
for (i = fade_start; i < width; i++)
|
||||
{
|
||||
for (j = 0; j < height; j++)
|
||||
{
|
||||
guchar *pixel = &pixels[j * rowstride + i * 4];
|
||||
float fade = 1.0 - ((float) i - fade_start) / fade_range;
|
||||
pixel[0] = 0.5 + pixel[0] * fade;
|
||||
pixel[1] = 0.5 + pixel[1] * fade;
|
||||
pixel[2] = 0.5 + pixel[2] * fade;
|
||||
pixel[3] = 0.5 + pixel[3] * fade;
|
||||
}
|
||||
}
|
||||
|
||||
texture = cogl_texture_new_from_data (width,
|
||||
height,
|
||||
COGL_TEXTURE_NONE,
|
||||
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
|
||||
COGL_PIXEL_FORMAT_ANY,
|
||||
rowstride,
|
||||
pixels);
|
||||
g_free (pixels);
|
||||
|
||||
result = (ClutterTexture*)clutter_texture_new ();
|
||||
clutter_texture_set_cogl_texture (result, texture);
|
||||
cogl_texture_unref (texture);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
shell_draw_box_pointer (ClutterCairoTexture *texture,
|
||||
shell_draw_box_pointer (StDrawingArea *area,
|
||||
ShellPointerDirection direction,
|
||||
ClutterColor *border_color,
|
||||
ClutterColor *background_color)
|
||||
@ -125,10 +58,9 @@ shell_draw_box_pointer (ClutterCairoTexture *texture,
|
||||
guint width, height;
|
||||
cairo_t *cr;
|
||||
|
||||
clutter_cairo_texture_get_surface_size (texture, &width, &height);
|
||||
st_drawing_area_get_surface_size (area, &width, &height);
|
||||
|
||||
clutter_cairo_texture_clear (texture);
|
||||
cr = clutter_cairo_texture_create (texture);
|
||||
cr = st_drawing_area_get_context (area);
|
||||
|
||||
cairo_set_line_width (cr, 1.0);
|
||||
|
||||
@ -169,8 +101,6 @@ shell_draw_box_pointer (ClutterCairoTexture *texture,
|
||||
clutter_cairo_set_source_color (cr, background_color);
|
||||
|
||||
cairo_fill (cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -4,6 +4,7 @@
|
||||
#define __SHELL_DRAWING_H__
|
||||
|
||||
#include <clutter/clutter.h>
|
||||
#include "st.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@ -14,17 +15,15 @@ typedef enum {
|
||||
SHELL_POINTER_RIGHT
|
||||
} ShellPointerDirection;
|
||||
|
||||
void shell_draw_box_pointer (ClutterCairoTexture *texture,
|
||||
void shell_draw_box_pointer (StDrawingArea *area,
|
||||
ShellPointerDirection direction,
|
||||
ClutterColor *border_color,
|
||||
ClutterColor *background_color);
|
||||
|
||||
void shell_draw_clock (ClutterCairoTexture *texture,
|
||||
void shell_draw_clock (StDrawingArea *area,
|
||||
int hour,
|
||||
int minute);
|
||||
|
||||
ClutterTexture * shell_fade_app_icon (ClutterTexture *source);
|
||||
|
||||
guint shell_add_hook_paint_red_border (ClutterActor *actor);
|
||||
|
||||
G_END_DECLS
|
||||
|
@ -46,9 +46,21 @@ static void gconf_value_changed (GConfClient *client, const char *key,
|
||||
static void
|
||||
shell_gconf_init (ShellGConf *gconf)
|
||||
{
|
||||
GConfValue *val;
|
||||
|
||||
gconf->client = gconf_client_get_default ();
|
||||
gconf_client_add_dir (gconf->client, SHELL_GCONF_DIR,
|
||||
GCONF_CLIENT_PRELOAD_RECURSIVE, NULL);
|
||||
|
||||
val = gconf_client_get (gconf->client,
|
||||
SHELL_GCONF_DIR "/development_tools", NULL);
|
||||
if (!val)
|
||||
{
|
||||
g_error ("GNOME Shell GConf schemas not found.\n"
|
||||
"This generally indicates a building or packaging problem.");
|
||||
}
|
||||
gconf_value_free (val);
|
||||
|
||||
g_signal_connect (gconf->client, "value_changed",
|
||||
G_CALLBACK (gconf_value_changed), gconf);
|
||||
}
|
||||
|
@ -8,92 +8,11 @@
|
||||
* lack of GObject subclassing + vfunc overrides in gjs. We
|
||||
* implement the container interface, but proxy the virtual functions
|
||||
* into signals, which gjs can catch.
|
||||
*
|
||||
* #ShellGenericContainer is an #StWidget, and automatically takes its
|
||||
* borders and padding into account during size request and allocation.
|
||||
*/
|
||||
|
||||
/* Example implementation of a horzontal box with PACK_EXPAND for all,
|
||||
vertically and horizontally centering.
|
||||
|
||||
function TestFixedBox() {
|
||||
this._init();
|
||||
}
|
||||
|
||||
TestFixedBox.prototype = {
|
||||
_init : function () {
|
||||
this.actor = new Shell.GenericContainer();
|
||||
this.spacing = 4;
|
||||
this.actor.connect('get-preferred-width', Lang.bind(this, function (actor, for_height, alloc) {
|
||||
let children = this.actor.get_children();
|
||||
let max_child_min = 0;
|
||||
let max_child_nat = 0;
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
let spacing = i > 0 && i < children.length-1 ? this.spacing : 0;
|
||||
let [child_min, child_nat] = children[i].get_preferred_width(for_height);
|
||||
if (child_min > max_child_min)
|
||||
max_child_min = child_min;
|
||||
if (child_nat > max_child_nat)
|
||||
max_child_nat = child_nat;
|
||||
}
|
||||
let totalSpacing = this.spacing * Math.abs(children.length - 1);
|
||||
alloc.min_size = children.length * max_child_min + totalSpacing;
|
||||
alloc.nat_size = children.length * max_child_nat + totalSpacing;
|
||||
}));
|
||||
this.actor.connect('get-preferred-height', Lang.bind(this, function (actor, for_width, alloc) {
|
||||
let children = this.actor.get_children();
|
||||
let max_child_min = 0;
|
||||
let max_child_nat = 0;
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
let [child_min, child_nat] = children[i].get_preferred_height(for_width);
|
||||
if (child_min > max_child_min)
|
||||
max_child_min = child_min;
|
||||
if (child_nat > max_child_nat)
|
||||
max_child_nat = child_nat;
|
||||
}
|
||||
alloc.min_size = max_child_min;
|
||||
alloc.nat_size = max_child_nat;
|
||||
}));
|
||||
this.actor.connect('allocate', Lang.bind(this, function (actor, box, flags) {
|
||||
let children = this.actor.get_children();
|
||||
let totalSpacing = (this.spacing * Math.abs(children.length - 1));
|
||||
let child_width = (box.x2 - box.x1 - totalSpacing) / (children.length);
|
||||
let child_height = box.y2 - box.y1;
|
||||
|
||||
let x = box.x1;
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
let [child_min, child_nat] = children[i].get_preferred_height(child_width);
|
||||
let vSpacing = Math.abs(child_height - child_nat) / 2;
|
||||
let childBox = new Clutter.ActorBox();
|
||||
childBox.x1 = x;
|
||||
childBox.y1 = vSpacing;
|
||||
childBox.x2 = x+child_width;
|
||||
childBox.y2 = child_height - vSpacing;
|
||||
children[i].allocate(childBox, flags);
|
||||
x += this.spacing + child_width;
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
function runTestFixedBox() {
|
||||
let testBox = new TestFixedBox();
|
||||
let c = new Clutter.Color();
|
||||
c.from_pixel(0xff0000a0);
|
||||
let r = new Clutter.Rectangle({ width: 50, height: 100, color: c });
|
||||
testBox.actor.add_actor(r);
|
||||
r = new Clutter.Rectangle({ width: 90, height: 70, color: c });
|
||||
testBox.actor.add_actor(r);
|
||||
r = new Clutter.Rectangle({ width: 90, height: 70, color: c });
|
||||
testBox.actor.add_actor(r);
|
||||
r = new Clutter.Rectangle({ width: 30, height: 10, color: c });
|
||||
testBox.actor.add_actor(r);
|
||||
|
||||
c.from_pixel(0x00ff00a0);
|
||||
let borderBox = new Big.Box({ border: 1, border_color: c });
|
||||
borderBox.set_position(100, 100);
|
||||
borderBox.append(testBox.actor, Big.BoxPackFlags.NONE);
|
||||
Shell.Global.get().stage.add_actor(borderBox);
|
||||
}
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "shell-generic-container.h"
|
||||
@ -106,11 +25,12 @@ static void shell_generic_container_iface_init (ClutterContainerIface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE(ShellGenericContainer,
|
||||
shell_generic_container,
|
||||
CLUTTER_TYPE_GROUP,
|
||||
ST_TYPE_WIDGET,
|
||||
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_CONTAINER,
|
||||
shell_generic_container_iface_init));
|
||||
|
||||
struct _ShellGenericContainerPrivate {
|
||||
GList *children;
|
||||
GHashTable *skip_paint;
|
||||
};
|
||||
|
||||
@ -125,8 +45,6 @@ enum
|
||||
|
||||
static guint shell_generic_container_signals [LAST_SIGNAL] = { 0 };
|
||||
|
||||
static ClutterContainerIface *parent_container_iface;
|
||||
|
||||
static gpointer
|
||||
shell_generic_container_allocation_ref (ShellGenericContainerAllocation *alloc)
|
||||
{
|
||||
@ -138,30 +56,37 @@ static void
|
||||
shell_generic_container_allocation_unref (ShellGenericContainerAllocation *alloc)
|
||||
{
|
||||
if (--alloc->_refcount == 0)
|
||||
{
|
||||
g_slice_free1 (sizeof (ShellGenericContainerAllocation), alloc);
|
||||
}
|
||||
g_slice_free (ShellGenericContainerAllocation, alloc);
|
||||
}
|
||||
|
||||
static void
|
||||
shell_generic_container_allocate (ClutterActor *self,
|
||||
const ClutterActorBox *box,
|
||||
ClutterAllocationFlags flags)
|
||||
shell_generic_container_allocate (ClutterActor *self,
|
||||
const ClutterActorBox *box,
|
||||
ClutterAllocationFlags flags)
|
||||
{
|
||||
/* chain up to set actor->allocation */
|
||||
(CLUTTER_ACTOR_CLASS (g_type_class_peek (clutter_actor_get_type ())))->allocate (self, box, flags);
|
||||
StThemeNode *theme_node;
|
||||
ClutterActorBox content_box;
|
||||
|
||||
CLUTTER_ACTOR_CLASS (shell_generic_container_parent_class)->allocate (self, box, flags);
|
||||
|
||||
theme_node = st_widget_get_theme_node (ST_WIDGET (self));
|
||||
st_theme_node_get_content_box (theme_node, box, &content_box);
|
||||
|
||||
g_signal_emit (G_OBJECT (self), shell_generic_container_signals[ALLOCATE], 0,
|
||||
box, flags);
|
||||
&content_box, flags);
|
||||
}
|
||||
|
||||
static void
|
||||
shell_generic_container_get_preferred_width (ClutterActor *actor,
|
||||
gfloat for_height,
|
||||
gfloat *min_width_p,
|
||||
gfloat *natural_width_p)
|
||||
gfloat for_height,
|
||||
gfloat *min_width_p,
|
||||
gfloat *natural_width_p)
|
||||
{
|
||||
ShellGenericContainerAllocation *alloc = g_slice_alloc0 (sizeof (ShellGenericContainerAllocation));
|
||||
ShellGenericContainerAllocation *alloc = g_slice_new0 (ShellGenericContainerAllocation);
|
||||
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor));
|
||||
|
||||
st_theme_node_adjust_for_height (theme_node, &for_height);
|
||||
|
||||
alloc->_refcount = 1;
|
||||
g_signal_emit (G_OBJECT (actor), shell_generic_container_signals[GET_PREFERRED_WIDTH], 0,
|
||||
for_height, alloc);
|
||||
@ -174,11 +99,15 @@ shell_generic_container_get_preferred_width (ClutterActor *actor,
|
||||
|
||||
static void
|
||||
shell_generic_container_get_preferred_height (ClutterActor *actor,
|
||||
gfloat for_width,
|
||||
gfloat *min_height_p,
|
||||
gfloat *natural_height_p)
|
||||
gfloat for_width,
|
||||
gfloat *min_height_p,
|
||||
gfloat *natural_height_p)
|
||||
{
|
||||
ShellGenericContainerAllocation *alloc = g_slice_alloc0 (sizeof (ShellGenericContainerAllocation));
|
||||
ShellGenericContainerAllocation *alloc = g_slice_new0 (ShellGenericContainerAllocation);
|
||||
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor));
|
||||
|
||||
st_theme_node_adjust_for_width (theme_node, &for_width);
|
||||
|
||||
alloc->_refcount = 1;
|
||||
g_signal_emit (G_OBJECT (actor), shell_generic_container_signals[GET_PREFERRED_HEIGHT], 0,
|
||||
for_width, alloc);
|
||||
@ -193,11 +122,11 @@ static void
|
||||
shell_generic_container_paint (ClutterActor *actor)
|
||||
{
|
||||
ShellGenericContainer *self = (ShellGenericContainer*) actor;
|
||||
GList *iter, *children;
|
||||
GList *iter;
|
||||
|
||||
children = clutter_container_get_children ((ClutterContainer*) actor);
|
||||
CLUTTER_ACTOR_CLASS (shell_generic_container_parent_class)->paint (actor);
|
||||
|
||||
for (iter = children; iter; iter = iter->next)
|
||||
for (iter = self->priv->children; iter; iter = iter->next)
|
||||
{
|
||||
ClutterActor *child = iter->data;
|
||||
|
||||
@ -206,8 +135,6 @@ shell_generic_container_paint (ClutterActor *actor)
|
||||
|
||||
clutter_actor_paint (child);
|
||||
}
|
||||
|
||||
g_list_free (children);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -215,13 +142,11 @@ shell_generic_container_pick (ClutterActor *actor,
|
||||
const ClutterColor *color)
|
||||
{
|
||||
ShellGenericContainer *self = (ShellGenericContainer*) actor;
|
||||
GList *iter, *children;
|
||||
GList *iter;
|
||||
|
||||
(CLUTTER_ACTOR_CLASS (g_type_class_peek (clutter_actor_get_type ())))->pick (actor, color);
|
||||
CLUTTER_ACTOR_CLASS (shell_generic_container_parent_class)->pick (actor, color);
|
||||
|
||||
children = clutter_container_get_children ((ClutterContainer*) actor);
|
||||
|
||||
for (iter = children; iter; iter = iter->next)
|
||||
for (iter = self->priv->children; iter; iter = iter->next)
|
||||
{
|
||||
ClutterActor *child = iter->data;
|
||||
|
||||
@ -230,8 +155,18 @@ shell_generic_container_pick (ClutterActor *actor,
|
||||
|
||||
clutter_actor_paint (child);
|
||||
}
|
||||
}
|
||||
|
||||
g_list_free (children);
|
||||
/**
|
||||
* shell_generic_container_get_n_skip_paint:
|
||||
* @container: A #ShellGenericContainer
|
||||
*
|
||||
* Returns: Number of children which will not be painted.
|
||||
*/
|
||||
guint
|
||||
shell_generic_container_get_n_skip_paint (ShellGenericContainer *self)
|
||||
{
|
||||
return g_hash_table_size (self->priv->skip_paint);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -260,6 +195,29 @@ shell_generic_container_set_skip_paint (ShellGenericContainer *self,
|
||||
g_hash_table_insert (self->priv->skip_paint, child, child);
|
||||
}
|
||||
|
||||
/**
|
||||
* shell_generic_container_remove_all:
|
||||
* @self: A #ShellGenericContainer
|
||||
*
|
||||
* Removes all child actors from @self.
|
||||
*/
|
||||
void
|
||||
shell_generic_container_remove_all (ShellGenericContainer *self)
|
||||
{
|
||||
/* copied from clutter_group_remove_all() */
|
||||
|
||||
GList *children;
|
||||
|
||||
children = self->priv->children;
|
||||
while (children)
|
||||
{
|
||||
ClutterActor *child = children->data;
|
||||
children = children->next;
|
||||
|
||||
clutter_container_remove_actor (CLUTTER_CONTAINER (self), child);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
shell_generic_container_finalize (GObject *object)
|
||||
{
|
||||
@ -270,6 +228,17 @@ shell_generic_container_finalize (GObject *object)
|
||||
G_OBJECT_CLASS (shell_generic_container_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
shell_generic_container_dispose (GObject *object)
|
||||
{
|
||||
ShellGenericContainerPrivate *priv = SHELL_GENERIC_CONTAINER (object)->priv;
|
||||
|
||||
while (priv->children)
|
||||
clutter_actor_destroy (priv->children->data);
|
||||
|
||||
G_OBJECT_CLASS (shell_generic_container_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
shell_generic_container_class_init (ShellGenericContainerClass *klass)
|
||||
{
|
||||
@ -277,6 +246,7 @@ shell_generic_container_class_init (ShellGenericContainerClass *klass)
|
||||
ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
|
||||
|
||||
gobject_class->finalize = shell_generic_container_finalize;
|
||||
gobject_class->dispose = shell_generic_container_dispose;
|
||||
|
||||
actor_class->get_preferred_width = shell_generic_container_get_preferred_width;
|
||||
actor_class->get_preferred_height = shell_generic_container_get_preferred_height;
|
||||
@ -315,22 +285,73 @@ shell_generic_container_class_init (ShellGenericContainerClass *klass)
|
||||
}
|
||||
|
||||
static void
|
||||
shell_generic_container_remove (ClutterContainer *container,
|
||||
ClutterActor *actor)
|
||||
shell_generic_container_add_actor (ClutterContainer *container,
|
||||
ClutterActor *actor)
|
||||
{
|
||||
ShellGenericContainer *self = SHELL_GENERIC_CONTAINER (container);
|
||||
ShellGenericContainerPrivate *priv = SHELL_GENERIC_CONTAINER (container)->priv;
|
||||
|
||||
g_hash_table_remove (self->priv->skip_paint, actor);
|
||||
_st_container_add_actor (container, actor, &priv->children);
|
||||
}
|
||||
|
||||
parent_container_iface->remove (container, actor);
|
||||
static void
|
||||
shell_generic_container_remove_actor (ClutterContainer *container,
|
||||
ClutterActor *actor)
|
||||
{
|
||||
ShellGenericContainerPrivate *priv = SHELL_GENERIC_CONTAINER (container)->priv;
|
||||
|
||||
g_hash_table_remove (priv->skip_paint, actor);
|
||||
|
||||
_st_container_remove_actor (container, actor, &priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
shell_generic_container_foreach (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
ShellGenericContainerPrivate *priv = SHELL_GENERIC_CONTAINER (container)->priv;
|
||||
|
||||
_st_container_foreach (container, callback, callback_data,
|
||||
&priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
shell_generic_container_lower (ClutterContainer *container,
|
||||
ClutterActor *actor,
|
||||
ClutterActor *sibling)
|
||||
{
|
||||
ShellGenericContainerPrivate *priv = SHELL_GENERIC_CONTAINER (container)->priv;
|
||||
|
||||
_st_container_lower (container, actor, sibling, &priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
shell_generic_container_raise (ClutterContainer *container,
|
||||
ClutterActor *actor,
|
||||
ClutterActor *sibling)
|
||||
{
|
||||
ShellGenericContainerPrivate *priv = SHELL_GENERIC_CONTAINER (container)->priv;
|
||||
|
||||
_st_container_raise (container, actor, sibling, &priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
shell_generic_container_sort_depth_order (ClutterContainer *container)
|
||||
{
|
||||
ShellGenericContainerPrivate *priv = SHELL_GENERIC_CONTAINER (container)->priv;
|
||||
|
||||
_st_container_sort_depth_order (container, &priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
shell_generic_container_iface_init (ClutterContainerIface *iface)
|
||||
{
|
||||
parent_container_iface = g_type_interface_peek_parent (iface);
|
||||
|
||||
iface->remove = shell_generic_container_remove;
|
||||
iface->add = shell_generic_container_add_actor;
|
||||
iface->remove = shell_generic_container_remove_actor;
|
||||
iface->foreach = shell_generic_container_foreach;
|
||||
iface->lower = shell_generic_container_lower;
|
||||
iface->raise = shell_generic_container_raise;
|
||||
iface->sort_depth_order = shell_generic_container_sort_depth_order;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -341,7 +362,8 @@ shell_generic_container_init (ShellGenericContainer *area)
|
||||
area->priv->skip_paint = g_hash_table_new (NULL, NULL);
|
||||
}
|
||||
|
||||
GType shell_generic_container_allocation_get_type (void)
|
||||
GType
|
||||
shell_generic_container_allocation_get_type (void)
|
||||
{
|
||||
static GType gtype = G_TYPE_INVALID;
|
||||
if (gtype == G_TYPE_INVALID)
|
||||
|
@ -2,8 +2,7 @@
|
||||
#ifndef __SHELL_GENERIC_CONTAINER_H__
|
||||
#define __SHELL_GENERIC_CONTAINER_H__
|
||||
|
||||
#include <clutter/clutter.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include "st.h"
|
||||
|
||||
#define SHELL_TYPE_GENERIC_CONTAINER (shell_generic_container_get_type ())
|
||||
#define SHELL_GENERIC_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHELL_TYPE_GENERIC_CONTAINER, ShellGenericContainer))
|
||||
@ -30,20 +29,23 @@ typedef struct _ShellGenericContainerPrivate ShellGenericContainerPrivate;
|
||||
|
||||
struct _ShellGenericContainer
|
||||
{
|
||||
ClutterGroup parent;
|
||||
StWidget parent;
|
||||
|
||||
ShellGenericContainerPrivate *priv;
|
||||
};
|
||||
|
||||
struct _ShellGenericContainerClass
|
||||
{
|
||||
ClutterGroupClass parent_class;
|
||||
StWidgetClass parent_class;
|
||||
};
|
||||
|
||||
GType shell_generic_container_get_type (void) G_GNUC_CONST;
|
||||
|
||||
void shell_generic_container_set_skip_paint (ShellGenericContainer *container,
|
||||
ClutterActor *actor,
|
||||
gboolean skip);
|
||||
guint shell_generic_container_get_n_skip_paint (ShellGenericContainer *self);
|
||||
|
||||
void shell_generic_container_set_skip_paint (ShellGenericContainer *self,
|
||||
ClutterActor *actor,
|
||||
gboolean skip);
|
||||
void shell_generic_container_remove_all (ShellGenericContainer *self);
|
||||
|
||||
#endif /* __SHELL_GENERIC_CONTAINER_H__ */
|
||||
|
@ -593,12 +593,6 @@ shell_global_display_is_grabbed (ShellGlobal *global)
|
||||
return meta_display_get_grab_op (display) != META_GRAB_OP_NONE;
|
||||
}
|
||||
|
||||
/* Defining this here for now, see
|
||||
* https://bugzilla.gnome.org/show_bug.cgi?id=604075
|
||||
* for upstreaming status.
|
||||
*/
|
||||
JSContext * gjs_context_get_context (GjsContext *context);
|
||||
|
||||
/**
|
||||
* shell_global_add_extension_importer:
|
||||
* @target_object_script: JavaScript code evaluating to a target object
|
||||
@ -621,7 +615,7 @@ shell_global_add_extension_importer (ShellGlobal *global,
|
||||
{
|
||||
jsval target_object;
|
||||
JSObject *importer;
|
||||
JSContext *context = gjs_context_get_context (global->js_context);
|
||||
JSContext *context = gjs_context_get_native_context (global->js_context);
|
||||
char *search_path[2] = { 0, 0 };
|
||||
|
||||
// This is a bit of a hack; ideally we'd be able to pass our target
|
||||
@ -789,6 +783,19 @@ shell_global_reexec_self (ShellGlobal *global)
|
||||
g_ptr_array_free (arr, TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* shell_global_breakpoint:
|
||||
* @global: A #ShellGlobal
|
||||
*
|
||||
* Using G_BREAKPOINT(), interrupt the current process. This is useful
|
||||
* in conjunction with a debugger such as gdb.
|
||||
*/
|
||||
void
|
||||
shell_global_breakpoint (ShellGlobal *global)
|
||||
{
|
||||
G_BREAKPOINT ();
|
||||
}
|
||||
|
||||
/**
|
||||
* shell_global_gc:
|
||||
* @global: A #ShellGlobal
|
||||
@ -799,7 +806,7 @@ shell_global_reexec_self (ShellGlobal *global)
|
||||
void
|
||||
shell_global_gc (ShellGlobal *global)
|
||||
{
|
||||
JSContext *context = gjs_context_get_context (global->js_context);
|
||||
JSContext *context = gjs_context_get_native_context (global->js_context);
|
||||
|
||||
JS_GC (context);
|
||||
}
|
||||
|
@ -70,6 +70,8 @@ gboolean shell_global_display_is_grabbed (ShellGlobal *global);
|
||||
|
||||
void shell_global_reexec_self (ShellGlobal *global);
|
||||
|
||||
void shell_global_breakpoint (ShellGlobal *global);
|
||||
|
||||
void shell_global_gc (ShellGlobal *global);
|
||||
|
||||
void shell_global_format_time_relative_pretty (ShellGlobal *global, guint delta, char **text, guint *update_time);
|
||||
|
@ -280,7 +280,7 @@ shell_recorder_finalize (GObject *object)
|
||||
recorder_set_pipeline (recorder, NULL);
|
||||
recorder_set_filename (recorder, NULL);
|
||||
|
||||
cogl_texture_unref (recorder->recording_icon);
|
||||
cogl_handle_unref (recorder->recording_icon);
|
||||
|
||||
G_OBJECT_CLASS (shell_recorder_parent_class)->finalize (object);
|
||||
}
|
||||
@ -872,7 +872,7 @@ recorder_set_stage (ShellRecorder *recorder,
|
||||
|
||||
clutter_stage_ensure_current (stage);
|
||||
gl_extensions = (const char *)glGetString (GL_EXTENSIONS);
|
||||
recorder->have_pack_invert = cogl_check_extension ("GL_MESA_pack_invert", gl_extensions);
|
||||
recorder->have_pack_invert = strstr (gl_extensions, "GL_MESA_pack_invert") != NULL;
|
||||
|
||||
recorder_get_initial_cursor_position (recorder);
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ shell_slicer_paint_child (ShellSlicer *self)
|
||||
|
||||
cogl_push_matrix ();
|
||||
|
||||
cogl_clip_push (0, 0, width, height);
|
||||
cogl_clip_push_rectangle (0, 0, width, height);
|
||||
cogl_translate ((int)(0.5 + x_align_factor * (width - child_width)),
|
||||
(int)(0.5 + y_align_factor * (height - child_height)),
|
||||
0);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,100 +0,0 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
#ifndef __SHELL_TEXTURE_CACHE_H__
|
||||
#define __SHELL_TEXTURE_CACHE_H__
|
||||
|
||||
#include <gio/gio.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
#define SHELL_TYPE_TEXTURE_CACHE (shell_texture_cache_get_type ())
|
||||
#define SHELL_TEXTURE_CACHE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SHELL_TYPE_TEXTURE_CACHE, ShellTextureCache))
|
||||
#define SHELL_TEXTURE_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SHELL_TYPE_TEXTURE_CACHE, ShellTextureCacheClass))
|
||||
#define SHELL_IS_TEXTURE_CACHE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SHELL_TYPE_TEXTURE_CACHE))
|
||||
#define SHELL_IS_TEXTURE_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SHELL_TYPE_TEXTURE_CACHE))
|
||||
#define SHELL_TEXTURE_CACHE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SHELL_TYPE_TEXTURE_CACHE, ShellTextureCacheClass))
|
||||
|
||||
typedef struct _ShellTextureCache ShellTextureCache;
|
||||
typedef struct _ShellTextureCacheClass ShellTextureCacheClass;
|
||||
|
||||
typedef struct _ShellTextureCachePrivate ShellTextureCachePrivate;
|
||||
|
||||
struct _ShellTextureCache
|
||||
{
|
||||
GObject parent;
|
||||
|
||||
ShellTextureCachePrivate *priv;
|
||||
};
|
||||
|
||||
struct _ShellTextureCacheClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
SHELL_TEXTURE_CACHE_POLICY_NONE,
|
||||
SHELL_TEXTURE_CACHE_POLICY_FOREVER
|
||||
} ShellTextureCachePolicy;
|
||||
|
||||
GType shell_texture_cache_get_type (void) G_GNUC_CONST;
|
||||
|
||||
ShellTextureCache* shell_texture_cache_get_default (void);
|
||||
|
||||
ClutterActor *shell_texture_cache_bind_pixbuf_property (ShellTextureCache *cache,
|
||||
GObject *object,
|
||||
const char *property_name);
|
||||
|
||||
ClutterActor *shell_texture_cache_load_icon_name (ShellTextureCache *cache,
|
||||
const char *name,
|
||||
gint size);
|
||||
|
||||
ClutterActor *shell_texture_cache_load_gicon (ShellTextureCache *cache,
|
||||
GIcon *icon,
|
||||
gint size);
|
||||
|
||||
ClutterActor *shell_texture_cache_load_thumbnail (ShellTextureCache *cache,
|
||||
int size,
|
||||
const char *uri,
|
||||
const char *mimetype);
|
||||
|
||||
ClutterActor *shell_texture_cache_load_recent_thumbnail (ShellTextureCache *cache,
|
||||
int size,
|
||||
GtkRecentInfo *info);
|
||||
|
||||
void shell_texture_cache_evict_thumbnail (ShellTextureCache *cache,
|
||||
const char *uri);
|
||||
|
||||
void shell_texture_cache_evict_recent_thumbnail (ShellTextureCache *cache,
|
||||
GtkRecentInfo *info);
|
||||
|
||||
ClutterActor *shell_texture_cache_load_uri_async (ShellTextureCache *cache,
|
||||
const gchar *filename,
|
||||
int available_width,
|
||||
int available_height);
|
||||
|
||||
ClutterActor *shell_texture_cache_load_uri_sync (ShellTextureCache *cache,
|
||||
ShellTextureCachePolicy policy,
|
||||
const gchar *filename,
|
||||
int available_width,
|
||||
int available_height,
|
||||
GError **error);
|
||||
|
||||
ClutterActor *shell_texture_cache_load_from_data (ShellTextureCache *cache,
|
||||
const guchar *data,
|
||||
gsize len,
|
||||
int size,
|
||||
GError **error);
|
||||
ClutterActor *shell_texture_cache_load_from_raw (ShellTextureCache *cache,
|
||||
const guchar *data,
|
||||
gsize len,
|
||||
gboolean has_alpha,
|
||||
int width,
|
||||
int height,
|
||||
int rowstride,
|
||||
int size,
|
||||
GError **error);
|
||||
|
||||
gboolean shell_texture_cache_pixbuf_equal (ShellTextureCache *cache, GdkPixbuf *a, GdkPixbuf *b);
|
||||
|
||||
#endif /* __SHELL_TEXTURE_CACHE_H__ */
|
@ -16,7 +16,7 @@
|
||||
#include "shell-window-tracker.h"
|
||||
#include "shell-app-system.h"
|
||||
#include "shell-app-private.h"
|
||||
#include "shell-texture-cache.h"
|
||||
#include "st/st-texture-cache.h"
|
||||
#include "shell-global.h"
|
||||
#include "shell-marshal.h"
|
||||
|
||||
@ -345,6 +345,19 @@ get_app_for_window (ShellWindowTracker *monitor,
|
||||
MetaGroup *group;
|
||||
GSList *iter;
|
||||
|
||||
result = NULL;
|
||||
if (meta_window_get_window_type (window) == META_WINDOW_NORMAL)
|
||||
{
|
||||
result = g_hash_table_lookup (monitor->window_to_app, window);
|
||||
if (result != NULL)
|
||||
{
|
||||
g_object_ref (result);
|
||||
return result;
|
||||
}
|
||||
else
|
||||
return get_app_for_window_direct (window);
|
||||
}
|
||||
|
||||
group = meta_window_get_group (window);
|
||||
if (group == NULL)
|
||||
group_windows = g_slist_prepend (NULL, window);
|
||||
@ -834,8 +847,8 @@ shell_startup_sequence_create_icon (ShellStartupSequence *sequence, guint size)
|
||||
}
|
||||
|
||||
themed = g_themed_icon_new (icon_name);
|
||||
texture = shell_texture_cache_load_gicon (shell_texture_cache_get_default (),
|
||||
themed, size);
|
||||
texture = st_texture_cache_load_gicon (st_texture_cache_get_default (),
|
||||
themed, size);
|
||||
g_object_unref (G_OBJECT (themed));
|
||||
return texture;
|
||||
}
|
||||
|
@ -111,6 +111,8 @@ scrollable_set_adjustments (StScrollable *scrollable,
|
||||
{
|
||||
StBoxLayoutPrivate *priv = ST_BOX_LAYOUT (scrollable)->priv;
|
||||
|
||||
g_object_freeze_notify (G_OBJECT (scrollable));
|
||||
|
||||
if (hadjustment != priv->hadjustment)
|
||||
{
|
||||
if (priv->hadjustment)
|
||||
@ -130,6 +132,7 @@ scrollable_set_adjustments (StScrollable *scrollable,
|
||||
}
|
||||
|
||||
priv->hadjustment = hadjustment;
|
||||
g_object_notify (G_OBJECT (scrollable), "hadjustment");
|
||||
}
|
||||
|
||||
if (vadjustment != priv->vadjustment)
|
||||
@ -151,7 +154,10 @@ scrollable_set_adjustments (StScrollable *scrollable,
|
||||
}
|
||||
|
||||
priv->vadjustment = vadjustment;
|
||||
g_object_notify (G_OBJECT (scrollable), "vadjustment");
|
||||
}
|
||||
|
||||
g_object_thaw_notify (G_OBJECT (scrollable));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -160,82 +166,14 @@ scrollable_get_adjustments (StScrollable *scrollable,
|
||||
StAdjustment **vadjustment)
|
||||
{
|
||||
StBoxLayoutPrivate *priv;
|
||||
ClutterActor *actor, *stage;
|
||||
|
||||
priv = (ST_BOX_LAYOUT (scrollable))->priv;
|
||||
|
||||
actor = CLUTTER_ACTOR (scrollable);
|
||||
stage = clutter_actor_get_stage (actor);
|
||||
|
||||
if (hadjustment)
|
||||
{
|
||||
if (priv->hadjustment)
|
||||
*hadjustment = priv->hadjustment;
|
||||
else
|
||||
{
|
||||
StAdjustment *adjustment;
|
||||
gdouble width, stage_width, increment;
|
||||
|
||||
if (stage)
|
||||
{
|
||||
width = clutter_actor_get_width (actor);
|
||||
stage_width = clutter_actor_get_width (stage);
|
||||
increment = MAX (1.0, MIN (stage_width, width));
|
||||
}
|
||||
else
|
||||
{
|
||||
width = increment = 1.0;
|
||||
}
|
||||
|
||||
adjustment = st_adjustment_new (0,
|
||||
0,
|
||||
width,
|
||||
1.0,
|
||||
increment,
|
||||
increment);
|
||||
|
||||
scrollable_set_adjustments (scrollable,
|
||||
adjustment,
|
||||
priv->vadjustment);
|
||||
|
||||
*hadjustment = adjustment;
|
||||
}
|
||||
}
|
||||
if (priv->hadjustment)
|
||||
*hadjustment = priv->hadjustment;
|
||||
|
||||
if (vadjustment)
|
||||
{
|
||||
if (priv->vadjustment)
|
||||
*vadjustment = priv->vadjustment;
|
||||
else
|
||||
{
|
||||
StAdjustment *adjustment;
|
||||
gdouble height, stage_height, increment;
|
||||
|
||||
if (stage)
|
||||
{
|
||||
height = clutter_actor_get_height (actor);
|
||||
stage_height = clutter_actor_get_height (stage);
|
||||
increment = MAX (1.0, MIN (stage_height, height));
|
||||
}
|
||||
else
|
||||
{
|
||||
height = increment = 1.0;
|
||||
}
|
||||
|
||||
adjustment = st_adjustment_new (0,
|
||||
0,
|
||||
height,
|
||||
1.0,
|
||||
increment,
|
||||
increment);
|
||||
|
||||
scrollable_set_adjustments (scrollable,
|
||||
priv->hadjustment,
|
||||
adjustment);
|
||||
|
||||
*vadjustment = adjustment;
|
||||
}
|
||||
}
|
||||
*vadjustment = priv->vadjustment;
|
||||
}
|
||||
|
||||
|
||||
@ -256,13 +194,7 @@ st_box_container_add_actor (ClutterContainer *container,
|
||||
{
|
||||
StBoxLayoutPrivate *priv = ST_BOX_LAYOUT (container)->priv;
|
||||
|
||||
clutter_actor_set_parent (actor, CLUTTER_ACTOR (container));
|
||||
|
||||
priv->children = g_list_append (priv->children, actor);
|
||||
|
||||
clutter_actor_queue_relayout (CLUTTER_ACTOR (container));
|
||||
|
||||
g_signal_emit_by_name (container, "actor-added", actor);
|
||||
_st_container_add_actor (container, actor, &priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -271,28 +203,7 @@ st_box_container_remove_actor (ClutterContainer *container,
|
||||
{
|
||||
StBoxLayoutPrivate *priv = ST_BOX_LAYOUT (container)->priv;
|
||||
|
||||
GList *item = NULL;
|
||||
|
||||
item = g_list_find (priv->children, actor);
|
||||
|
||||
if (item == NULL)
|
||||
{
|
||||
g_warning ("Actor of type '%s' is not a child of container of type '%s'",
|
||||
g_type_name (G_OBJECT_TYPE (actor)),
|
||||
g_type_name (G_OBJECT_TYPE (container)));
|
||||
return;
|
||||
}
|
||||
|
||||
g_object_ref (actor);
|
||||
|
||||
priv->children = g_list_delete_link (priv->children, item);
|
||||
clutter_actor_unparent (actor);
|
||||
|
||||
g_signal_emit_by_name (container, "actor-removed", actor);
|
||||
|
||||
g_object_unref (actor);
|
||||
|
||||
clutter_actor_queue_relayout ((ClutterActor*) container);
|
||||
_st_container_remove_actor (container, actor, &priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -302,7 +213,8 @@ st_box_container_foreach (ClutterContainer *container,
|
||||
{
|
||||
StBoxLayoutPrivate *priv = ST_BOX_LAYOUT (container)->priv;
|
||||
|
||||
g_list_foreach (priv->children, (GFunc) callback, callback_data);
|
||||
_st_container_foreach (container, callback, callback_data,
|
||||
&priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -312,40 +224,7 @@ st_box_container_lower (ClutterContainer *container,
|
||||
{
|
||||
StBoxLayoutPrivate *priv = ST_BOX_LAYOUT (container)->priv;
|
||||
|
||||
/* copied from clutter/clutter/clutter-group.c */
|
||||
|
||||
priv->children = g_list_remove (priv->children, actor);
|
||||
|
||||
/* Push to bottom */
|
||||
if (!sibling)
|
||||
{
|
||||
GList *last_item;
|
||||
|
||||
last_item = g_list_first (priv->children);
|
||||
|
||||
if (last_item)
|
||||
sibling = last_item->data;
|
||||
|
||||
priv->children = g_list_prepend (priv->children, actor);
|
||||
}
|
||||
else
|
||||
{
|
||||
gint pos;
|
||||
|
||||
pos = g_list_index (priv->children, sibling);
|
||||
|
||||
priv->children = g_list_insert (priv->children, actor, pos);
|
||||
}
|
||||
|
||||
/* See comment in group_raise for this */
|
||||
if (sibling &&
|
||||
clutter_actor_get_depth (sibling) != clutter_actor_get_depth (actor))
|
||||
{
|
||||
clutter_actor_set_depth (actor, clutter_actor_get_depth (sibling));
|
||||
}
|
||||
|
||||
if (CLUTTER_ACTOR_IS_VISIBLE (container))
|
||||
clutter_actor_queue_redraw (CLUTTER_ACTOR (container));
|
||||
_st_container_lower (container, actor, sibling, &priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -355,52 +234,15 @@ st_box_container_raise (ClutterContainer *container,
|
||||
{
|
||||
StBoxLayoutPrivate *priv = ST_BOX_LAYOUT (container)->priv;
|
||||
|
||||
priv->children = g_list_remove (priv->children, actor);
|
||||
|
||||
/* copied from clutter/clutter/clutter-group.c */
|
||||
|
||||
/* Raise at the top */
|
||||
if (!sibling)
|
||||
{
|
||||
GList *last_item;
|
||||
|
||||
last_item = g_list_last (priv->children);
|
||||
|
||||
if (last_item)
|
||||
sibling = last_item->data;
|
||||
|
||||
priv->children = g_list_append (priv->children, actor);
|
||||
}
|
||||
else
|
||||
{
|
||||
gint pos;
|
||||
|
||||
pos = g_list_index (priv->children, sibling) + 1;
|
||||
|
||||
priv->children = g_list_insert (priv->children, actor, pos);
|
||||
}
|
||||
|
||||
/* set Z ordering a value below, this will then call sort
|
||||
* as values are equal ordering shouldn't change but Z
|
||||
* values will be correct.
|
||||
*
|
||||
* FIXME: optimise
|
||||
*/
|
||||
if (sibling &&
|
||||
clutter_actor_get_depth (sibling) != clutter_actor_get_depth (actor))
|
||||
{
|
||||
clutter_actor_set_depth (actor, clutter_actor_get_depth (sibling));
|
||||
}
|
||||
|
||||
if (CLUTTER_ACTOR_IS_VISIBLE (container))
|
||||
clutter_actor_queue_redraw (CLUTTER_ACTOR (container));
|
||||
_st_container_raise (container, actor, sibling, &priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
st_box_container_sort_depth_order (ClutterContainer *container)
|
||||
{
|
||||
/* XXX: not yet implemented */
|
||||
g_warning ("%s() not yet implemented", __FUNCTION__);
|
||||
StBoxLayoutPrivate *priv = ST_BOX_LAYOUT (container)->priv;
|
||||
|
||||
_st_container_sort_depth_order (container, &priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -665,11 +507,25 @@ st_box_layout_get_preferred_height (ClutterActor *actor,
|
||||
gfloat *min_height_p,
|
||||
gfloat *natural_height_p)
|
||||
{
|
||||
StBoxLayout *self = ST_BOX_LAYOUT (actor);
|
||||
StBoxLayoutPrivate *priv = self->priv;
|
||||
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor));
|
||||
|
||||
st_theme_node_adjust_for_width (theme_node, &for_width);
|
||||
|
||||
get_content_preferred_height (ST_BOX_LAYOUT (actor), for_width,
|
||||
if (priv->hadjustment)
|
||||
{
|
||||
/* If we're scrolled, the parent calls us with the width that
|
||||
* we'll actually get, which can be smaller than the minimum
|
||||
* width that we give our contents.
|
||||
*/
|
||||
gfloat min_width;
|
||||
|
||||
get_content_preferred_width (self, -1, &min_width, NULL);
|
||||
for_width = MAX (for_width, min_width);
|
||||
}
|
||||
|
||||
get_content_preferred_height (self, for_width,
|
||||
min_height_p, natural_height_p);
|
||||
|
||||
st_theme_node_adjust_preferred_height (theme_node,
|
||||
@ -839,10 +695,11 @@ st_box_layout_allocate (ClutterActor *actor,
|
||||
avail_width = content_box.x2 - content_box.x1;
|
||||
avail_height = content_box.y2 - content_box.y1;
|
||||
|
||||
get_content_preferred_height (ST_BOX_LAYOUT (actor), avail_width,
|
||||
&min_height, &natural_height);
|
||||
get_content_preferred_width (ST_BOX_LAYOUT (actor), avail_height,
|
||||
&min_width, &natural_width);
|
||||
get_content_preferred_height (ST_BOX_LAYOUT (actor), MAX (avail_width, min_width),
|
||||
&min_height, &natural_height);
|
||||
|
||||
|
||||
/* update adjustments for scrolling */
|
||||
if (priv->vadjustment)
|
||||
@ -851,10 +708,10 @@ st_box_layout_allocate (ClutterActor *actor,
|
||||
|
||||
g_object_set (G_OBJECT (priv->vadjustment),
|
||||
"lower", 0.0,
|
||||
"upper", natural_height,
|
||||
"upper", MAX (min_height, avail_height),
|
||||
"page-size", avail_height,
|
||||
"step-increment", avail_height / 6,
|
||||
"page-increment", avail_height,
|
||||
"page-increment", avail_height - avail_height / 6,
|
||||
NULL);
|
||||
|
||||
prev_value = st_adjustment_get_value (priv->vadjustment);
|
||||
@ -867,25 +724,37 @@ st_box_layout_allocate (ClutterActor *actor,
|
||||
|
||||
g_object_set (G_OBJECT (priv->hadjustment),
|
||||
"lower", 0.0,
|
||||
"upper", natural_width,
|
||||
"upper", MAX (min_width, avail_width),
|
||||
"page-size", avail_width,
|
||||
"step-increment", avail_width / 6,
|
||||
"page-increment", avail_width,
|
||||
"page-increment", avail_width - avail_width / 6,
|
||||
NULL);
|
||||
|
||||
prev_value = st_adjustment_get_value (priv->hadjustment);
|
||||
st_adjustment_set_value (priv->hadjustment, prev_value);
|
||||
}
|
||||
|
||||
if (avail_height < min_height)
|
||||
{
|
||||
avail_height = min_height;
|
||||
content_box.y2 = content_box.y1 + avail_height;
|
||||
}
|
||||
|
||||
if (avail_width < min_width)
|
||||
{
|
||||
avail_width = min_width;
|
||||
content_box.x2 = content_box.x1 + avail_width;
|
||||
}
|
||||
|
||||
if (priv->is_vertical)
|
||||
{
|
||||
expand_amount = MAX (0, avail_height - natural_height);
|
||||
shrink_amount = MAX (0, natural_height - MAX (avail_height, min_height));
|
||||
shrink_amount = MAX (0, natural_height - avail_height);
|
||||
}
|
||||
else
|
||||
{
|
||||
expand_amount = MAX (0, avail_width - natural_width);
|
||||
shrink_amount = MAX (0, natural_width - MAX (avail_width, min_width));
|
||||
shrink_amount = MAX (0, natural_width - avail_width);
|
||||
}
|
||||
|
||||
if (expand_amount > 0)
|
||||
@ -990,10 +859,7 @@ st_box_layout_allocate (ClutterActor *actor,
|
||||
child_box.y1 = (int)(0.5 + position);
|
||||
child_box.y2 = (int)(0.5 + next_position);
|
||||
child_box.x1 = content_box.x1;
|
||||
if (priv->hadjustment)
|
||||
child_box.x2 = content_box.x1 + MAX (avail_width, natural_width);
|
||||
else
|
||||
child_box.x2 = content_box.x2;
|
||||
child_box.x2 = content_box.x2;
|
||||
|
||||
_st_allocate_fill (ST_WIDGET (actor), child, &child_box,
|
||||
xalign, yalign, xfill, yfill);
|
||||
@ -1014,10 +880,7 @@ st_box_layout_allocate (ClutterActor *actor,
|
||||
}
|
||||
|
||||
child_box.y1 = content_box.y1;
|
||||
if (priv->vadjustment)
|
||||
child_box.y2 = content_box.y1 + MAX (avail_height, natural_height);
|
||||
else
|
||||
child_box.y2 = content_box.y2;
|
||||
child_box.y2 = content_box.y2;
|
||||
|
||||
_st_allocate_fill (ST_WIDGET (actor), child, &child_box,
|
||||
xalign, yalign, xfill, yfill);
|
||||
@ -1120,10 +983,10 @@ st_box_layout_paint (ClutterActor *actor)
|
||||
* the borders and background stay in place; after drawing the borders and
|
||||
* background, we clip to the content area */
|
||||
if (priv->hadjustment || priv->vadjustment)
|
||||
cogl_clip_push ((int)content_box.x1,
|
||||
(int)content_box.y1,
|
||||
(int)content_box.x2 - (int)content_box.x1,
|
||||
(int)content_box.y2 - (int)content_box.y1);
|
||||
cogl_clip_push_rectangle ((int)content_box.x1,
|
||||
(int)content_box.y1,
|
||||
(int)content_box.x2,
|
||||
(int)content_box.y2);
|
||||
|
||||
for (l = priv->children; l; l = g_list_next (l))
|
||||
{
|
||||
@ -1194,10 +1057,10 @@ st_box_layout_pick (ClutterActor *actor,
|
||||
content_box.y2 += y;
|
||||
|
||||
if (priv->hadjustment || priv->vadjustment)
|
||||
cogl_clip_push ((int)content_box.x1,
|
||||
(int)content_box.y1,
|
||||
(int)content_box.x2 - (int)content_box.x1,
|
||||
(int)content_box.y2 - (int)content_box.y1);
|
||||
cogl_clip_push_rectangle ((int)content_box.x1,
|
||||
(int)content_box.y1,
|
||||
(int)content_box.x2,
|
||||
(int)content_box.y2);
|
||||
|
||||
for (l = priv->children; l; l = g_list_next (l))
|
||||
{
|
||||
|
@ -73,10 +73,6 @@ struct _StButtonPrivate
|
||||
{
|
||||
gchar *text;
|
||||
|
||||
ClutterActor *old_bg;
|
||||
gboolean old_bg_parented; /* TRUE if we have adopted old_bg */
|
||||
gboolean old_bg_animating; /* TRUE if the opacity animation is running and we hold a self-ref */
|
||||
|
||||
guint8 old_opacity;
|
||||
|
||||
guint is_pressed : 1;
|
||||
@ -109,35 +105,6 @@ st_button_update_label_style (StButton *button)
|
||||
_st_set_text_from_style ((ClutterText*) label, st_widget_get_theme_node (ST_WIDGET (button)));
|
||||
}
|
||||
|
||||
static void
|
||||
st_button_dispose_old_bg (StButton *button)
|
||||
{
|
||||
StButtonPrivate *priv = button->priv;
|
||||
|
||||
if (priv->old_bg)
|
||||
{
|
||||
if (priv->old_bg_parented)
|
||||
{
|
||||
clutter_actor_unparent (priv->old_bg);
|
||||
priv->old_bg_parented = FALSE;
|
||||
}
|
||||
g_object_unref (priv->old_bg);
|
||||
priv->old_bg = NULL;
|
||||
if (priv->old_bg_animating)
|
||||
{
|
||||
g_object_unref (button);
|
||||
priv->old_bg_animating = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
st_animation_completed (ClutterAnimation *animation,
|
||||
StButton *button)
|
||||
{
|
||||
st_button_dispose_old_bg (button);
|
||||
}
|
||||
|
||||
static void
|
||||
st_button_style_changed (StWidget *widget)
|
||||
{
|
||||
@ -145,15 +112,8 @@ st_button_style_changed (StWidget *widget)
|
||||
StButtonPrivate *priv = button->priv;
|
||||
StButtonClass *button_class = ST_BUTTON_GET_CLASS (button);
|
||||
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (button));
|
||||
ClutterActor *bg_image;
|
||||
double spacing;
|
||||
|
||||
st_button_dispose_old_bg (button);
|
||||
|
||||
bg_image = st_widget_get_border_image ((StWidget*) button);
|
||||
if (bg_image)
|
||||
button->priv->old_bg = g_object_ref (bg_image);
|
||||
|
||||
ST_WIDGET_CLASS (st_button_parent_class)->style_changed (widget);
|
||||
|
||||
spacing = 6;
|
||||
@ -166,42 +126,7 @@ st_button_style_changed (StWidget *widget)
|
||||
/* run a transition if applicable */
|
||||
if (button_class->transition)
|
||||
{
|
||||
button_class->transition (button, priv->old_bg);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (priv->old_bg &&
|
||||
(!st_widget_get_style_pseudo_class (widget)))
|
||||
{
|
||||
ClutterAnimation *animation;
|
||||
if (!clutter_actor_get_parent (priv->old_bg))
|
||||
{
|
||||
clutter_actor_set_parent (priv->old_bg, (ClutterActor*) widget);
|
||||
priv->old_bg_parented = TRUE;
|
||||
}
|
||||
if (priv->transition_duration > 0)
|
||||
{
|
||||
animation = clutter_actor_animate (priv->old_bg,
|
||||
CLUTTER_LINEAR,
|
||||
priv->transition_duration,
|
||||
"opacity", 0,
|
||||
NULL);
|
||||
/* The reference counting here is looped; through the button, old_bg,
|
||||
* and the animation. However, that's not a problem because we will
|
||||
* break the cycle when either the animation completes, or when
|
||||
* we dispose.
|
||||
*/
|
||||
priv->old_bg_animating = TRUE;
|
||||
g_object_ref (button);
|
||||
g_signal_connect (animation, "completed",
|
||||
G_CALLBACK (st_animation_completed), button);
|
||||
}
|
||||
else
|
||||
{
|
||||
st_button_dispose_old_bg (button);
|
||||
}
|
||||
|
||||
}
|
||||
button_class->transition (button);
|
||||
}
|
||||
}
|
||||
|
||||
@ -394,49 +319,6 @@ st_button_finalize (GObject *gobject)
|
||||
G_OBJECT_CLASS (st_button_parent_class)->finalize (gobject);
|
||||
}
|
||||
|
||||
static void
|
||||
st_button_dispose (GObject *gobject)
|
||||
{
|
||||
st_button_dispose_old_bg (ST_BUTTON (gobject));
|
||||
|
||||
G_OBJECT_CLASS (st_button_parent_class)->dispose (gobject);
|
||||
}
|
||||
|
||||
static void
|
||||
st_button_map (ClutterActor *self)
|
||||
{
|
||||
StButtonPrivate *priv = ST_BUTTON (self)->priv;
|
||||
|
||||
CLUTTER_ACTOR_CLASS (st_button_parent_class)->map (self);
|
||||
|
||||
if (priv->old_bg && priv->old_bg_parented)
|
||||
clutter_actor_map (priv->old_bg);
|
||||
}
|
||||
|
||||
static void
|
||||
st_button_unmap (ClutterActor *self)
|
||||
{
|
||||
StButtonPrivate *priv = ST_BUTTON (self)->priv;
|
||||
|
||||
CLUTTER_ACTOR_CLASS (st_button_parent_class)->unmap (self);
|
||||
|
||||
if (priv->old_bg && priv->old_bg_parented)
|
||||
clutter_actor_unmap (priv->old_bg);
|
||||
}
|
||||
|
||||
static void
|
||||
st_button_draw_background (StWidget *widget)
|
||||
{
|
||||
StButtonPrivate *priv;
|
||||
|
||||
ST_WIDGET_CLASS (st_button_parent_class)->draw_background (widget);
|
||||
|
||||
priv = ST_BUTTON (widget)->priv;
|
||||
|
||||
if (priv->old_bg && priv->old_bg_parented)
|
||||
clutter_actor_paint (priv->old_bg);
|
||||
}
|
||||
|
||||
static void
|
||||
st_button_class_init (StButtonClass *klass)
|
||||
{
|
||||
@ -452,7 +334,6 @@ st_button_class_init (StButtonClass *klass)
|
||||
|
||||
gobject_class->set_property = st_button_set_property;
|
||||
gobject_class->get_property = st_button_get_property;
|
||||
gobject_class->dispose = st_button_dispose;
|
||||
gobject_class->finalize = st_button_finalize;
|
||||
|
||||
actor_class->button_press_event = st_button_button_press;
|
||||
@ -460,10 +341,6 @@ st_button_class_init (StButtonClass *klass)
|
||||
actor_class->enter_event = st_button_enter;
|
||||
actor_class->leave_event = st_button_leave;
|
||||
|
||||
actor_class->map = st_button_map;
|
||||
actor_class->unmap = st_button_unmap;
|
||||
|
||||
widget_class->draw_background = st_button_draw_background;
|
||||
widget_class->style_changed = st_button_style_changed;
|
||||
|
||||
pspec = g_param_spec_string ("label",
|
||||
|
@ -68,8 +68,7 @@ struct _StButtonClass
|
||||
/* vfuncs, not signals */
|
||||
void (* pressed) (StButton *button);
|
||||
void (* released) (StButton *button);
|
||||
void (* transition) (StButton *button,
|
||||
ClutterActor *old_bg);
|
||||
void (* transition) (StButton *button);
|
||||
|
||||
/* signals */
|
||||
void (* clicked) (StButton *button);
|
||||
|
@ -6,66 +6,156 @@
|
||||
*
|
||||
* #StDrawingArea is similar to #ClutterCairoTexture in that
|
||||
* it allows drawing via Cairo; the primary difference is that
|
||||
* it is dynamically sized. To use, connect to the #StDrawingArea::redraw
|
||||
* it is dynamically sized. To use, connect to the #StDrawingArea::repaint
|
||||
* signal, and inside the signal handler, call
|
||||
* clutter_cairo_texture_create() to begin drawing. The
|
||||
* #StDrawingArea::redraw signal will be emitted by default when the area is
|
||||
* st_drawing_area_get_context() to get the Cairo context to draw to. The
|
||||
* #StDrawingArea::repaint signal will be emitted by default when the area is
|
||||
* resized or the CSS style changes; you can use the
|
||||
* st_drawing_area_emit_redraw() as well.
|
||||
* st_drawing_area_queue_repaint() as well.
|
||||
*/
|
||||
|
||||
#include "st-drawing-area.h"
|
||||
|
||||
#include <cairo.h>
|
||||
|
||||
G_DEFINE_TYPE(StDrawingArea, st_drawing_area, ST_TYPE_BIN);
|
||||
/* Cairo stores the data in native byte order as ARGB but Cogl's pixel
|
||||
formats specify the actual byte order. Therefore we need to use a
|
||||
different format depending on the architecture */
|
||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||
#define PIXEL_FORMAT COGL_PIXEL_FORMAT_BGRA_8888_PRE
|
||||
#else
|
||||
#define PIXEL_FORMAT COGL_PIXEL_FORMAT_ARGB_8888_PRE
|
||||
#endif
|
||||
|
||||
G_DEFINE_TYPE(StDrawingArea, st_drawing_area, ST_TYPE_WIDGET);
|
||||
|
||||
struct _StDrawingAreaPrivate {
|
||||
ClutterCairoTexture *texture;
|
||||
CoglHandle *texture;
|
||||
CoglHandle *material;
|
||||
cairo_t *context;
|
||||
guint needs_repaint : 1;
|
||||
guint in_repaint : 1;
|
||||
};
|
||||
|
||||
/* Signals */
|
||||
enum
|
||||
{
|
||||
REDRAW,
|
||||
REPAINT,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
static guint st_drawing_area_signals [LAST_SIGNAL] = { 0 };
|
||||
|
||||
static void
|
||||
st_drawing_area_allocate (ClutterActor *self,
|
||||
const ClutterActorBox *box,
|
||||
ClutterAllocationFlags flags)
|
||||
st_drawing_area_dispose (GObject *object)
|
||||
{
|
||||
StDrawingArea *area = ST_DRAWING_AREA (object);
|
||||
StDrawingAreaPrivate *priv = area->priv;
|
||||
|
||||
if (priv->material != COGL_INVALID_HANDLE)
|
||||
{
|
||||
cogl_handle_unref (priv->material);
|
||||
priv->material = COGL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
if (priv->texture != COGL_INVALID_HANDLE)
|
||||
{
|
||||
cogl_handle_unref (priv->texture);
|
||||
priv->texture = COGL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (st_drawing_area_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
st_drawing_area_paint (ClutterActor *self)
|
||||
{
|
||||
StThemeNode *theme_node;
|
||||
ClutterActorBox content_box;
|
||||
StDrawingArea *area = ST_DRAWING_AREA (self);
|
||||
int width = box->x2 - box->x1;
|
||||
int height = box->y2 - box->y1;
|
||||
StDrawingAreaPrivate *priv = area->priv;
|
||||
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (self));
|
||||
ClutterActorBox allocation_box;
|
||||
ClutterActorBox content_box;
|
||||
int width, height;
|
||||
CoglColor color;
|
||||
guint8 paint_opacity;
|
||||
|
||||
(CLUTTER_ACTOR_CLASS (st_drawing_area_parent_class))->allocate (self, box, flags);
|
||||
(CLUTTER_ACTOR_CLASS (st_drawing_area_parent_class))->paint (self);
|
||||
|
||||
theme_node = st_widget_get_theme_node (ST_WIDGET (self));
|
||||
clutter_actor_get_allocation_box (self, &allocation_box);
|
||||
st_theme_node_get_content_box (theme_node, &allocation_box, &content_box);
|
||||
|
||||
st_theme_node_get_content_box (theme_node, box, &content_box);
|
||||
width = (int)(0.5 + content_box.x2 - content_box.x1);
|
||||
height = (int)(0.5 + content_box.y2 - content_box.y1);
|
||||
|
||||
if (priv->material == COGL_INVALID_HANDLE)
|
||||
priv->material = cogl_material_new ();
|
||||
|
||||
if (priv->texture != COGL_INVALID_HANDLE &&
|
||||
(width != cogl_texture_get_width (priv->texture) ||
|
||||
height != cogl_texture_get_height (priv->texture)))
|
||||
{
|
||||
cogl_handle_unref (priv->texture);
|
||||
priv->texture = COGL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
if (width > 0 && height > 0)
|
||||
{
|
||||
clutter_cairo_texture_set_surface_size (area->priv->texture,
|
||||
content_box.x2 - content_box.x1,
|
||||
content_box.y2 - content_box.y1);
|
||||
g_signal_emit (G_OBJECT (self), st_drawing_area_signals[REDRAW], 0,
|
||||
area->priv->texture);
|
||||
if (priv->texture == COGL_INVALID_HANDLE)
|
||||
{
|
||||
priv->texture = cogl_texture_new_with_size (width, height,
|
||||
COGL_TEXTURE_NONE,
|
||||
PIXEL_FORMAT);
|
||||
priv->needs_repaint = TRUE;
|
||||
}
|
||||
|
||||
if (priv->needs_repaint)
|
||||
{
|
||||
cairo_surface_t *surface;
|
||||
|
||||
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
|
||||
priv->context = cairo_create (surface);
|
||||
priv->in_repaint = TRUE;
|
||||
|
||||
g_signal_emit ((GObject*)area, st_drawing_area_signals[REPAINT], 0);
|
||||
|
||||
priv->in_repaint = FALSE;
|
||||
cairo_destroy (priv->context);
|
||||
priv->context = NULL;
|
||||
|
||||
cogl_texture_set_region (priv->texture, 0, 0, 0, 0, width, height, width, height,
|
||||
PIXEL_FORMAT,
|
||||
cairo_image_surface_get_stride (surface),
|
||||
cairo_image_surface_get_data (surface));
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
}
|
||||
}
|
||||
|
||||
cogl_material_set_layer (priv->material, 0, priv->texture);
|
||||
|
||||
if (priv->texture)
|
||||
{
|
||||
paint_opacity = clutter_actor_get_paint_opacity (self);
|
||||
cogl_color_set_from_4ub (&color,
|
||||
paint_opacity, paint_opacity, paint_opacity, paint_opacity);
|
||||
cogl_material_set_color (priv->material, &color);
|
||||
|
||||
cogl_set_source (priv->material);
|
||||
cogl_rectangle_with_texture_coords (content_box.x1, content_box.y1,
|
||||
width, height,
|
||||
0.0f, 0.0f, 1.0f, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
st_drawing_area_style_changed (StWidget *self)
|
||||
{
|
||||
StDrawingArea *area = ST_DRAWING_AREA (self);
|
||||
StDrawingAreaPrivate *priv = area->priv;
|
||||
|
||||
(ST_WIDGET_CLASS (st_drawing_area_parent_class))->style_changed (self);
|
||||
|
||||
st_drawing_area_emit_redraw (ST_DRAWING_AREA (self));
|
||||
priv->needs_repaint = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -75,17 +165,18 @@ st_drawing_area_class_init (StDrawingAreaClass *klass)
|
||||
ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
|
||||
StWidgetClass *widget_class = ST_WIDGET_CLASS (klass);
|
||||
|
||||
actor_class->allocate = st_drawing_area_allocate;
|
||||
gobject_class->dispose = st_drawing_area_dispose;
|
||||
actor_class->paint = st_drawing_area_paint;
|
||||
widget_class->style_changed = st_drawing_area_style_changed;
|
||||
|
||||
st_drawing_area_signals[REDRAW] =
|
||||
g_signal_new ("redraw",
|
||||
st_drawing_area_signals[REPAINT] =
|
||||
g_signal_new ("repaint",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (StDrawingAreaClass, redraw),
|
||||
G_STRUCT_OFFSET (StDrawingAreaClass, repaint),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1, CLUTTER_TYPE_CAIRO_TEXTURE);
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
g_type_class_add_private (gobject_class, sizeof (StDrawingAreaPrivate));
|
||||
}
|
||||
@ -95,31 +186,74 @@ st_drawing_area_init (StDrawingArea *area)
|
||||
{
|
||||
area->priv = G_TYPE_INSTANCE_GET_PRIVATE (area, ST_TYPE_DRAWING_AREA,
|
||||
StDrawingAreaPrivate);
|
||||
area->priv->texture = CLUTTER_CAIRO_TEXTURE (clutter_cairo_texture_new (1, 1));
|
||||
clutter_container_add_actor (CLUTTER_CONTAINER (area), CLUTTER_ACTOR (area->priv->texture));
|
||||
area->priv->texture = COGL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
/**
|
||||
* st_drawing_area_get_texture:
|
||||
* st_drawing_area_queue_repaint:
|
||||
* @area: the #StDrawingArea
|
||||
*
|
||||
* Return Value: (transfer none):
|
||||
*/
|
||||
ClutterCairoTexture *
|
||||
st_drawing_area_get_texture (StDrawingArea *area)
|
||||
{
|
||||
return area->priv->texture;
|
||||
}
|
||||
|
||||
/**
|
||||
* st_drawing_area_emit_redraw:
|
||||
* @area: A #StDrawingArea
|
||||
*
|
||||
* Immediately emit a redraw signal. Useful if
|
||||
* some parameters for the area being drawn other
|
||||
* than the size or style have changed.
|
||||
* Will cause the actor to emit a ::repaint signal before it is next
|
||||
* drawn to the scene. Useful if some parameters for the area being
|
||||
* drawn other than the size or style have changed. Note that
|
||||
* clutter_actor_queue_redraw() will simply result in the same
|
||||
* contents being drawn to the scene again.
|
||||
*/
|
||||
void
|
||||
st_drawing_area_emit_redraw (StDrawingArea *area)
|
||||
st_drawing_area_queue_repaint (StDrawingArea *area)
|
||||
{
|
||||
g_signal_emit ((GObject*)area, st_drawing_area_signals[REDRAW], 0, area->priv->texture);
|
||||
StDrawingAreaPrivate *priv;
|
||||
|
||||
g_return_if_fail (ST_IS_DRAWING_AREA (area));
|
||||
|
||||
priv = area->priv;
|
||||
|
||||
priv->needs_repaint = TRUE;
|
||||
clutter_actor_queue_redraw (CLUTTER_ACTOR (area));
|
||||
}
|
||||
|
||||
/**
|
||||
* st_drawing_area_get_context:
|
||||
* @area: the #StDrawingArea
|
||||
*
|
||||
* Gets the Cairo context to paint to. This function must only be called
|
||||
* from a signal hander for the ::repaint signal.
|
||||
*
|
||||
* Return Value: (transfer none): the Cairo context for the paint operation
|
||||
*/
|
||||
cairo_t *
|
||||
st_drawing_area_get_context (StDrawingArea *area)
|
||||
{
|
||||
g_return_val_if_fail (ST_IS_DRAWING_AREA (area), NULL);
|
||||
g_return_val_if_fail (area->priv->in_repaint, NULL);
|
||||
|
||||
return area->priv->context;
|
||||
}
|
||||
|
||||
/**
|
||||
* st_drawing_area_get_surface_size:
|
||||
* @area: the #StDrawingArea
|
||||
* @width: (out): location to store the width of the painted area
|
||||
* @height: (out): location to store the height of the painted area
|
||||
*
|
||||
* Gets the size of the cairo surface being painted to, which is equal
|
||||
* to the size of the content area of the widget. This function must
|
||||
* only be called from a signal hander for the ::repaint signal.
|
||||
*/
|
||||
void
|
||||
st_drawing_area_get_surface_size (StDrawingArea *area,
|
||||
guint *width,
|
||||
guint *height)
|
||||
{
|
||||
StDrawingAreaPrivate *priv;
|
||||
|
||||
g_return_if_fail (ST_IS_DRAWING_AREA (area));
|
||||
g_return_if_fail (area->priv->in_repaint);
|
||||
|
||||
priv = area->priv;
|
||||
|
||||
if (width)
|
||||
*width = cogl_texture_get_width (priv->texture);
|
||||
if (height)
|
||||
*height = cogl_texture_get_height (priv->texture);
|
||||
}
|
||||
|
@ -2,7 +2,8 @@
|
||||
#ifndef __ST_DRAWING_AREA_H__
|
||||
#define __ST_DRAWING_AREA_H__
|
||||
|
||||
#include "st-bin.h"
|
||||
#include "st-widget.h"
|
||||
#include <cairo.h>
|
||||
|
||||
#define ST_TYPE_DRAWING_AREA (st_drawing_area_get_type ())
|
||||
#define ST_DRAWING_AREA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ST_TYPE_DRAWING_AREA, StDrawingArea))
|
||||
@ -18,22 +19,24 @@ typedef struct _StDrawingAreaPrivate StDrawingAreaPrivate;
|
||||
|
||||
struct _StDrawingArea
|
||||
{
|
||||
StBin parent;
|
||||
StWidget parent;
|
||||
|
||||
StDrawingAreaPrivate *priv;
|
||||
};
|
||||
|
||||
struct _StDrawingAreaClass
|
||||
{
|
||||
StBinClass parent_class;
|
||||
StWidgetClass parent_class;
|
||||
|
||||
void (*redraw) (StDrawingArea *area, ClutterCairoTexture *texture);
|
||||
void (*repaint) (StDrawingArea *area);
|
||||
};
|
||||
|
||||
GType st_drawing_area_get_type (void) G_GNUC_CONST;
|
||||
|
||||
ClutterCairoTexture *st_drawing_area_get_texture (StDrawingArea *area);
|
||||
|
||||
void st_drawing_area_emit_redraw (StDrawingArea *area);
|
||||
void st_drawing_area_queue_repaint (StDrawingArea *area);
|
||||
cairo_t *st_drawing_area_get_context (StDrawingArea *area);
|
||||
void st_drawing_area_get_surface_size (StDrawingArea *area,
|
||||
guint *width,
|
||||
guint *height);
|
||||
|
||||
#endif /* __ST_DRAWING_AREA_H__ */
|
||||
|
@ -38,6 +38,10 @@
|
||||
* <listitem>
|
||||
* <para>indeterminate: the widget is showing the hint text</para>
|
||||
* </listitem>
|
||||
* <listitem>
|
||||
* <para>hover: the widget is showing the hint text and is underneath the
|
||||
* pointer</para>
|
||||
* </listitem>
|
||||
* </itemizedlist>
|
||||
*/
|
||||
|
||||
@ -97,6 +101,8 @@ struct _StEntryPrivate
|
||||
ClutterActor *secondary_icon;
|
||||
|
||||
gfloat spacing;
|
||||
|
||||
gboolean hint_visible;
|
||||
};
|
||||
|
||||
static guint entry_signals[LAST_SIGNAL] = { 0, };
|
||||
@ -165,6 +171,8 @@ st_entry_dispose (GObject *object)
|
||||
clutter_actor_destroy (priv->entry);
|
||||
priv->entry = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (st_entry_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -174,6 +182,8 @@ st_entry_finalize (GObject *object)
|
||||
|
||||
g_free (priv->hint);
|
||||
priv->hint = NULL;
|
||||
|
||||
G_OBJECT_CLASS (st_entry_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -184,12 +194,16 @@ st_entry_style_changed (StWidget *self)
|
||||
ClutterColor color;
|
||||
const PangoFontDescription *font;
|
||||
gchar *font_string;
|
||||
gdouble size;
|
||||
|
||||
theme_node = st_widget_get_theme_node (self);
|
||||
|
||||
st_theme_node_get_foreground_color (theme_node, &color);
|
||||
clutter_text_set_color (CLUTTER_TEXT (priv->entry), &color);
|
||||
|
||||
if (st_theme_node_get_length (theme_node, "caret-size", FALSE, &size))
|
||||
clutter_text_set_cursor_size (CLUTTER_TEXT (priv->entry), (int)(.5 + size));
|
||||
|
||||
if (st_theme_node_get_color (theme_node, "caret-color", FALSE, &color))
|
||||
clutter_text_set_cursor_color (CLUTTER_TEXT (priv->entry), &color);
|
||||
|
||||
@ -371,9 +385,10 @@ clutter_text_focus_in_cb (ClutterText *text,
|
||||
StEntryPrivate *priv = ST_ENTRY_PRIV (actor);
|
||||
|
||||
/* remove the hint if visible */
|
||||
if (priv->hint
|
||||
&& !strcmp (clutter_text_get_text (text), priv->hint))
|
||||
if (priv->hint && priv->hint_visible)
|
||||
{
|
||||
priv->hint_visible = FALSE;
|
||||
|
||||
clutter_text_set_text (text, "");
|
||||
}
|
||||
st_widget_set_style_pseudo_class (ST_WIDGET (actor), "focus");
|
||||
@ -389,6 +404,8 @@ clutter_text_focus_out_cb (ClutterText *text,
|
||||
/* add a hint if the entry is empty */
|
||||
if (priv->hint && !strcmp (clutter_text_get_text (text), ""))
|
||||
{
|
||||
priv->hint_visible = TRUE;
|
||||
|
||||
clutter_text_set_text (text, priv->hint);
|
||||
st_widget_set_style_pseudo_class (ST_WIDGET (actor), "indeterminate");
|
||||
}
|
||||
@ -561,6 +578,38 @@ st_entry_key_focus_in (ClutterActor *actor)
|
||||
clutter_actor_grab_key_focus (priv->entry);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
st_entry_enter_event (ClutterActor *actor,
|
||||
ClutterCrossingEvent *event)
|
||||
{
|
||||
StEntryPrivate *priv = ST_ENTRY_PRIV (actor);
|
||||
|
||||
if (priv->hint && priv->hint_visible)
|
||||
{
|
||||
st_widget_set_style_pseudo_class (ST_WIDGET (actor), "hover");
|
||||
}
|
||||
|
||||
return CLUTTER_ACTOR_CLASS (st_entry_parent_class)->enter_event (actor, event);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
st_entry_leave_event (ClutterActor *actor,
|
||||
ClutterCrossingEvent *event)
|
||||
{
|
||||
StEntryPrivate *priv = ST_ENTRY_PRIV (actor);
|
||||
|
||||
if (priv->hint && priv->hint_visible)
|
||||
{
|
||||
st_widget_set_style_pseudo_class (ST_WIDGET (actor), "indeterminate");
|
||||
}
|
||||
else
|
||||
{
|
||||
st_widget_set_style_pseudo_class (ST_WIDGET (actor), "focus");
|
||||
}
|
||||
|
||||
return CLUTTER_ACTOR_CLASS (st_entry_parent_class)->leave_event (actor, event);
|
||||
}
|
||||
|
||||
static void
|
||||
st_entry_class_init (StEntryClass *klass)
|
||||
{
|
||||
@ -586,6 +635,8 @@ st_entry_class_init (StEntryClass *klass)
|
||||
|
||||
actor_class->key_press_event = st_entry_key_press_event;
|
||||
actor_class->key_focus_in = st_entry_key_focus_in;
|
||||
actor_class->enter_event = st_entry_enter_event;
|
||||
actor_class->leave_event = st_entry_leave_event;
|
||||
|
||||
widget_class->style_changed = st_entry_style_changed;
|
||||
|
||||
@ -701,13 +752,16 @@ st_entry_get_text (StEntry *entry)
|
||||
{
|
||||
g_return_val_if_fail (ST_IS_ENTRY (entry), NULL);
|
||||
|
||||
return clutter_text_get_text (CLUTTER_TEXT (entry->priv->entry));
|
||||
if (entry->priv->hint_visible)
|
||||
return "";
|
||||
else
|
||||
return clutter_text_get_text (CLUTTER_TEXT (entry->priv->entry));
|
||||
}
|
||||
|
||||
/**
|
||||
* st_entry_set_text:
|
||||
* @entry: a #StEntry
|
||||
* @text: text to set the entry to
|
||||
* @text: (allow-none): text to set the entry to
|
||||
*
|
||||
* Sets the text displayed on the entry
|
||||
*/
|
||||
@ -727,6 +781,7 @@ st_entry_set_text (StEntry *entry,
|
||||
&& !HAS_FOCUS (priv->entry))
|
||||
{
|
||||
text = priv->hint;
|
||||
priv->hint_visible = TRUE;
|
||||
st_widget_set_style_pseudo_class (ST_WIDGET (entry), "indeterminate");
|
||||
}
|
||||
else
|
||||
@ -735,6 +790,8 @@ st_entry_set_text (StEntry *entry,
|
||||
st_widget_set_style_pseudo_class (ST_WIDGET (entry), "focus");
|
||||
else
|
||||
st_widget_set_style_pseudo_class (ST_WIDGET (entry), NULL);
|
||||
|
||||
priv->hint_visible = FALSE;
|
||||
}
|
||||
|
||||
clutter_text_set_text (CLUTTER_TEXT (priv->entry), text);
|
||||
@ -762,7 +819,7 @@ st_entry_get_clutter_text (StEntry *entry)
|
||||
/**
|
||||
* st_entry_set_hint_text:
|
||||
* @entry: a #StEntry
|
||||
* @text: text to set as the entry hint
|
||||
* @text: (allow-none): text to set as the entry hint
|
||||
*
|
||||
* Sets the text to display when the entry is empty and unfocused. When the
|
||||
* entry is displaying the hint, it has a pseudo class of "indeterminate".
|
||||
@ -782,8 +839,11 @@ st_entry_set_hint_text (StEntry *entry,
|
||||
|
||||
priv->hint = g_strdup (text);
|
||||
|
||||
if (!strcmp (clutter_text_get_text (CLUTTER_TEXT (priv->entry)), ""))
|
||||
if (!strcmp (clutter_text_get_text (CLUTTER_TEXT (priv->entry)), "")
|
||||
&& !HAS_FOCUS (priv->entry))
|
||||
{
|
||||
priv->hint_visible = TRUE;
|
||||
|
||||
clutter_text_set_text (CLUTTER_TEXT (priv->entry), priv->hint);
|
||||
st_widget_set_style_pseudo_class (ST_WIDGET (entry), "indeterminate");
|
||||
}
|
||||
@ -842,9 +902,7 @@ _st_entry_set_icon_from_file (StEntry *entry,
|
||||
|
||||
cache = st_texture_cache_get_default ();
|
||||
|
||||
|
||||
|
||||
*icon = (ClutterActor*) st_texture_cache_get_texture (cache, filename);
|
||||
*icon = (ClutterActor*) st_texture_cache_load_file_simple (cache, filename);
|
||||
|
||||
clutter_actor_set_reactive (*icon, TRUE);
|
||||
clutter_actor_set_parent (*icon, CLUTTER_ACTOR (entry));
|
||||
@ -858,7 +916,7 @@ _st_entry_set_icon_from_file (StEntry *entry,
|
||||
/**
|
||||
* st_entry_set_primary_icon_from_file:
|
||||
* @entry: a #StEntry
|
||||
* @filename: filename of an icon
|
||||
* @filename: (allow-none): filename of an icon
|
||||
*
|
||||
* Set the primary icon of the entry to the given filename
|
||||
*/
|
||||
@ -879,7 +937,7 @@ st_entry_set_primary_icon_from_file (StEntry *entry,
|
||||
/**
|
||||
* st_entry_set_secondary_icon_from_file:
|
||||
* @entry: a #StEntry
|
||||
* @filename: filename of an icon
|
||||
* @filename: (allow-none): filename of an icon
|
||||
*
|
||||
* Set the primary icon of the entry to the given filename
|
||||
*/
|
||||
|
@ -93,6 +93,8 @@ st_im_text_dispose (GObject *object)
|
||||
|
||||
g_object_unref (priv->im_context);
|
||||
priv->im_context = NULL;
|
||||
|
||||
G_OBJECT_CLASS (st_im_text_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -172,9 +172,9 @@ st_label_allocate (ClutterActor *actor,
|
||||
}
|
||||
|
||||
static void
|
||||
st_label_dispose (GObject *actor)
|
||||
st_label_dispose (GObject *object)
|
||||
{
|
||||
StLabelPrivate *priv = ST_LABEL (actor)->priv;
|
||||
StLabelPrivate *priv = ST_LABEL (object)->priv;
|
||||
|
||||
if (priv->label)
|
||||
{
|
||||
@ -182,7 +182,7 @@ st_label_dispose (GObject *actor)
|
||||
priv->label = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (st_label_parent_class)->dispose (G_OBJECT (actor));
|
||||
G_OBJECT_CLASS (st_label_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -74,13 +74,7 @@ st_overflow_box_add_actor (ClutterContainer *container,
|
||||
{
|
||||
StOverflowBoxPrivate *priv = ST_OVERFLOW_BOX (container)->priv;
|
||||
|
||||
clutter_actor_set_parent (actor, CLUTTER_ACTOR (container));
|
||||
|
||||
priv->children = g_list_append (priv->children, actor);
|
||||
|
||||
clutter_actor_queue_relayout (CLUTTER_ACTOR (container));
|
||||
|
||||
g_signal_emit_by_name (container, "actor-added", actor);
|
||||
_st_container_add_actor (container, actor, &priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -89,28 +83,7 @@ st_overflow_box_remove_actor (ClutterContainer *container,
|
||||
{
|
||||
StOverflowBoxPrivate *priv = ST_OVERFLOW_BOX (container)->priv;
|
||||
|
||||
GList *item = NULL;
|
||||
|
||||
item = g_list_find (priv->children, actor);
|
||||
|
||||
if (item == NULL)
|
||||
{
|
||||
g_warning ("Actor of type '%s' is not a child of container of type '%s'",
|
||||
g_type_name (G_OBJECT_TYPE (actor)),
|
||||
g_type_name (G_OBJECT_TYPE (container)));
|
||||
return;
|
||||
}
|
||||
|
||||
g_object_ref (actor);
|
||||
|
||||
priv->children = g_list_delete_link (priv->children, item);
|
||||
clutter_actor_unparent (actor);
|
||||
|
||||
g_signal_emit_by_name (container, "actor-removed", actor);
|
||||
|
||||
g_object_unref (actor);
|
||||
|
||||
clutter_actor_queue_relayout ((ClutterActor*) container);
|
||||
_st_container_remove_actor (container, actor, &priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -120,7 +93,8 @@ st_overflow_box_foreach (ClutterContainer *container,
|
||||
{
|
||||
StOverflowBoxPrivate *priv = ST_OVERFLOW_BOX (container)->priv;
|
||||
|
||||
g_list_foreach (priv->children, (GFunc) callback, callback_data);
|
||||
_st_container_foreach (container, callback, callback_data,
|
||||
&priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -130,40 +104,7 @@ st_overflow_box_lower (ClutterContainer *container,
|
||||
{
|
||||
StOverflowBoxPrivate *priv = ST_OVERFLOW_BOX (container)->priv;
|
||||
|
||||
/* copied from clutter/clutter/clutter-group.c */
|
||||
|
||||
priv->children = g_list_remove (priv->children, actor);
|
||||
|
||||
/* Push to bottom */
|
||||
if (!sibling)
|
||||
{
|
||||
GList *last_item;
|
||||
|
||||
last_item = g_list_first (priv->children);
|
||||
|
||||
if (last_item)
|
||||
sibling = last_item->data;
|
||||
|
||||
priv->children = g_list_prepend (priv->children, actor);
|
||||
}
|
||||
else
|
||||
{
|
||||
gint pos;
|
||||
|
||||
pos = g_list_index (priv->children, sibling);
|
||||
|
||||
priv->children = g_list_insert (priv->children, actor, pos);
|
||||
}
|
||||
|
||||
/* See comment in group_raise for this */
|
||||
if (sibling &&
|
||||
clutter_actor_get_depth (sibling) != clutter_actor_get_depth (actor))
|
||||
{
|
||||
clutter_actor_set_depth (actor, clutter_actor_get_depth (sibling));
|
||||
}
|
||||
|
||||
if (CLUTTER_ACTOR_IS_VISIBLE (container))
|
||||
clutter_actor_queue_redraw (CLUTTER_ACTOR (container));
|
||||
_st_container_lower (container, actor, sibling, &priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -173,52 +114,15 @@ st_overflow_box_raise (ClutterContainer *container,
|
||||
{
|
||||
StOverflowBoxPrivate *priv = ST_OVERFLOW_BOX (container)->priv;
|
||||
|
||||
priv->children = g_list_remove (priv->children, actor);
|
||||
|
||||
/* copied from clutter/clutter/clutter-group.c */
|
||||
|
||||
/* Raise at the top */
|
||||
if (!sibling)
|
||||
{
|
||||
GList *last_item;
|
||||
|
||||
last_item = g_list_last (priv->children);
|
||||
|
||||
if (last_item)
|
||||
sibling = last_item->data;
|
||||
|
||||
priv->children = g_list_append (priv->children, actor);
|
||||
}
|
||||
else
|
||||
{
|
||||
gint pos;
|
||||
|
||||
pos = g_list_index (priv->children, sibling) + 1;
|
||||
|
||||
priv->children = g_list_insert (priv->children, actor, pos);
|
||||
}
|
||||
|
||||
/* set Z ordering a value below, this will then call sort
|
||||
* as values are equal ordering shouldn't change but Z
|
||||
* values will be correct.
|
||||
*
|
||||
* FIXME: optimise
|
||||
*/
|
||||
if (sibling &&
|
||||
clutter_actor_get_depth (sibling) != clutter_actor_get_depth (actor))
|
||||
{
|
||||
clutter_actor_set_depth (actor, clutter_actor_get_depth (sibling));
|
||||
}
|
||||
|
||||
if (CLUTTER_ACTOR_IS_VISIBLE (container))
|
||||
clutter_actor_queue_redraw (CLUTTER_ACTOR (container));
|
||||
_st_container_raise (container, actor, sibling, &priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
st_overflow_box_sort_depth_order (ClutterContainer *container)
|
||||
{
|
||||
/* XXX: not yet implemented */
|
||||
g_warning ("%s() not yet implemented", __FUNCTION__);
|
||||
StOverflowBoxPrivate *priv = ST_OVERFLOW_BOX (container)->priv;
|
||||
|
||||
_st_container_sort_depth_order (container, &priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -310,3 +310,231 @@ _st_set_text_from_style (ClutterText *text,
|
||||
|
||||
pango_attr_list_unref (attribs);
|
||||
}
|
||||
|
||||
/**
|
||||
* _st_container_add_actor:
|
||||
* @container: a #ClutterContainer
|
||||
* @actor: a #ClutterActor
|
||||
* @children: pointer to @container's list of children
|
||||
*
|
||||
* A basic implementation for clutter_container_add_actor().
|
||||
* Mostly copied from clutter_group_real_add().
|
||||
*/
|
||||
void
|
||||
_st_container_add_actor (ClutterContainer *container,
|
||||
ClutterActor *actor,
|
||||
GList **children)
|
||||
{
|
||||
g_object_ref (actor);
|
||||
|
||||
*children = g_list_append (*children, actor);
|
||||
clutter_actor_set_parent (actor, CLUTTER_ACTOR (container));
|
||||
|
||||
/* queue a relayout, to get the correct positioning inside
|
||||
* the ::actor-added signal handlers
|
||||
*/
|
||||
clutter_actor_queue_relayout (CLUTTER_ACTOR (container));
|
||||
|
||||
g_signal_emit_by_name (container, "actor-added", actor);
|
||||
|
||||
clutter_container_sort_depth_order (container);
|
||||
|
||||
g_object_unref (actor);
|
||||
}
|
||||
|
||||
/**
|
||||
* _st_container_remove_actor:
|
||||
* @container: a #ClutterContainer
|
||||
* @actor: a #ClutterActor
|
||||
* @children: pointer to @container's list of children
|
||||
*
|
||||
* A basic implementation for clutter_container_remove_actor().
|
||||
* Mostly copied from clutter_group_real_remove().
|
||||
*/
|
||||
void
|
||||
_st_container_remove_actor (ClutterContainer *container,
|
||||
ClutterActor *actor,
|
||||
GList **children)
|
||||
{
|
||||
g_object_ref (actor);
|
||||
|
||||
*children = g_list_remove (*children, actor);
|
||||
clutter_actor_unparent (actor);
|
||||
|
||||
/* queue a relayout, to get the correct positioning inside
|
||||
* the ::actor-removed signal handlers
|
||||
*/
|
||||
clutter_actor_queue_relayout (CLUTTER_ACTOR (container));
|
||||
|
||||
/* at this point, the actor passed to the "actor-removed" signal
|
||||
* handlers is not parented anymore to the container but since we
|
||||
* are holding a reference on it, it's still valid
|
||||
*/
|
||||
g_signal_emit_by_name (container, "actor-removed", actor);
|
||||
|
||||
if (CLUTTER_ACTOR_IS_VISIBLE (container))
|
||||
clutter_actor_queue_redraw (CLUTTER_ACTOR (container));
|
||||
|
||||
g_object_unref (actor);
|
||||
}
|
||||
|
||||
/**
|
||||
* _st_container_raise:
|
||||
* @container: a #ClutterContainer
|
||||
* @callback: callback
|
||||
* @user_data: data for @callback
|
||||
* @children: pointer to @container's list of children
|
||||
*
|
||||
* A basic implementation for clutter_container_foreach().
|
||||
* Mostly copied from clutter_group_real_foreach().
|
||||
*/
|
||||
void
|
||||
_st_container_foreach (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer user_data,
|
||||
GList **children)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
for (l = *children; l; l = l->next)
|
||||
(* callback) (CLUTTER_ACTOR (l->data), user_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* _st_container_raise:
|
||||
* @container: a #ClutterContainer
|
||||
* @actor: a #ClutterActor to raise
|
||||
* @sibling: the sibling to raise to, or %NULL to put on top
|
||||
* @children: pointer to @container's list of children
|
||||
*
|
||||
* A basic implementation for clutter_container_raise().
|
||||
* Mostly copied from clutter_group_real_raise().
|
||||
*/
|
||||
void
|
||||
_st_container_raise (ClutterContainer *container,
|
||||
ClutterActor *actor,
|
||||
ClutterActor *sibling,
|
||||
GList **children)
|
||||
{
|
||||
*children = g_list_remove (*children, actor);
|
||||
|
||||
/* Raise at the top */
|
||||
if (!sibling)
|
||||
{
|
||||
GList *last_item;
|
||||
|
||||
last_item = g_list_last (*children);
|
||||
|
||||
if (last_item)
|
||||
sibling = last_item->data;
|
||||
|
||||
*children = g_list_append (*children, actor);
|
||||
}
|
||||
else
|
||||
{
|
||||
gint pos;
|
||||
|
||||
pos = g_list_index (*children, sibling) + 1;
|
||||
|
||||
*children = g_list_insert (*children, actor, pos);
|
||||
}
|
||||
|
||||
/* set Z ordering a value below, this will then call sort
|
||||
* as values are equal ordering shouldn't change but Z
|
||||
* values will be correct.
|
||||
*
|
||||
* FIXME: optimise
|
||||
*/
|
||||
if (sibling &&
|
||||
clutter_actor_get_depth (sibling) != clutter_actor_get_depth (actor))
|
||||
{
|
||||
clutter_actor_set_depth (actor, clutter_actor_get_depth (sibling));
|
||||
}
|
||||
|
||||
if (CLUTTER_ACTOR_IS_VISIBLE (container))
|
||||
clutter_actor_queue_redraw (CLUTTER_ACTOR (container));
|
||||
}
|
||||
|
||||
/**
|
||||
* _st_container_lower:
|
||||
* @container: a #ClutterContainer
|
||||
* @actor: a #ClutterActor to lower
|
||||
* @sibling: the sibling to lower to, or %NULL to put on bottom
|
||||
* @children: pointer to @container's list of children
|
||||
*
|
||||
* A basic implementation for clutter_container_lower().
|
||||
* Mostly copied from clutter_group_real_lower().
|
||||
*/
|
||||
void
|
||||
_st_container_lower (ClutterContainer *container,
|
||||
ClutterActor *actor,
|
||||
ClutterActor *sibling,
|
||||
GList **children)
|
||||
{
|
||||
*children = g_list_remove (*children, actor);
|
||||
|
||||
/* Push to bottom */
|
||||
if (!sibling)
|
||||
{
|
||||
GList *last_item;
|
||||
|
||||
last_item = g_list_first (*children);
|
||||
|
||||
if (last_item)
|
||||
sibling = last_item->data;
|
||||
|
||||
*children = g_list_prepend (*children, actor);
|
||||
}
|
||||
else
|
||||
{
|
||||
gint pos;
|
||||
|
||||
pos = g_list_index (*children, sibling);
|
||||
|
||||
*children = g_list_insert (*children, actor, pos);
|
||||
}
|
||||
|
||||
/* See comment in _st_container_raise() for this */
|
||||
if (sibling &&
|
||||
clutter_actor_get_depth (sibling) != clutter_actor_get_depth (actor))
|
||||
{
|
||||
clutter_actor_set_depth (actor, clutter_actor_get_depth (sibling));
|
||||
}
|
||||
|
||||
if (CLUTTER_ACTOR_IS_VISIBLE (container))
|
||||
clutter_actor_queue_redraw (CLUTTER_ACTOR (container));
|
||||
}
|
||||
|
||||
static gint
|
||||
sort_z_order (gconstpointer a,
|
||||
gconstpointer b)
|
||||
{
|
||||
float depth_a, depth_b;
|
||||
|
||||
depth_a = clutter_actor_get_depth (CLUTTER_ACTOR (a));
|
||||
depth_b = clutter_actor_get_depth (CLUTTER_ACTOR (b));
|
||||
|
||||
if (depth_a < depth_b)
|
||||
return -1;
|
||||
if (depth_a > depth_b)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* _st_container_sort_depth_order:
|
||||
* @container: a #ClutterContainer
|
||||
* @children: pointer to @container's list of children
|
||||
*
|
||||
* A basic implementation for clutter_container_sort_depth_order().
|
||||
* Mostly copied from clutter_group_real_sort_depth_order().
|
||||
*/
|
||||
void
|
||||
_st_container_sort_depth_order (ClutterContainer *container,
|
||||
GList **children)
|
||||
{
|
||||
*children = g_list_sort (*children, sort_z_order);
|
||||
|
||||
if (CLUTTER_ACTOR_IS_VISIBLE (container))
|
||||
clutter_actor_queue_redraw (CLUTTER_ACTOR (container));
|
||||
}
|
||||
|
@ -72,4 +72,25 @@ void _st_allocate_fill (StWidget *parent,
|
||||
void _st_set_text_from_style (ClutterText *text,
|
||||
StThemeNode *theme_node);
|
||||
|
||||
void _st_container_add_actor (ClutterContainer *container,
|
||||
ClutterActor *actor,
|
||||
GList **children);
|
||||
void _st_container_remove_actor (ClutterContainer *container,
|
||||
ClutterActor *actor,
|
||||
GList **children);
|
||||
void _st_container_foreach (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer user_data,
|
||||
GList **children);
|
||||
void _st_container_raise (ClutterContainer *container,
|
||||
ClutterActor *actor,
|
||||
ClutterActor *sibling,
|
||||
GList **children);
|
||||
void _st_container_lower (ClutterContainer *container,
|
||||
ClutterActor *actor,
|
||||
ClutterActor *sibling,
|
||||
GList **children);
|
||||
void _st_container_sort_depth_order (ClutterContainer *container,
|
||||
GList **children);
|
||||
|
||||
#endif /* __ST_PRIVATE_H__ */
|
||||
|
@ -77,7 +77,15 @@ struct _StScrollBarPrivate
|
||||
|
||||
ClutterAnimation *paging_animation;
|
||||
|
||||
gboolean vertical;
|
||||
guint vertical : 1;
|
||||
|
||||
/* We want to keep track of whether we have a currently valid
|
||||
* allocation or not. This isn't exported from ClutterActor
|
||||
* so we need to shadow the computations and track it ourselves.
|
||||
*
|
||||
* http://bugzilla.openedhand.com/show_bug.cgi?id=2024
|
||||
*/
|
||||
guint needs_allocation : 1;
|
||||
};
|
||||
|
||||
enum
|
||||
@ -188,14 +196,23 @@ st_scroll_bar_dispose (GObject *gobject)
|
||||
priv->handle = NULL;
|
||||
}
|
||||
|
||||
clutter_actor_unparent (priv->bw_stepper);
|
||||
priv->bw_stepper = NULL;
|
||||
if (priv->bw_stepper)
|
||||
{
|
||||
clutter_actor_unparent (priv->bw_stepper);
|
||||
priv->bw_stepper = NULL;
|
||||
}
|
||||
|
||||
clutter_actor_unparent (priv->fw_stepper);
|
||||
priv->fw_stepper = NULL;
|
||||
if (priv->fw_stepper)
|
||||
{
|
||||
clutter_actor_unparent (priv->fw_stepper);
|
||||
priv->fw_stepper = NULL;
|
||||
}
|
||||
|
||||
clutter_actor_unparent (priv->trough);
|
||||
priv->trough = NULL;
|
||||
if (priv->trough)
|
||||
{
|
||||
clutter_actor_unparent (priv->trough);
|
||||
priv->trough = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (st_scroll_bar_parent_class)->dispose (gobject);
|
||||
}
|
||||
@ -264,19 +281,37 @@ st_scroll_bar_unmap (ClutterActor *actor)
|
||||
}
|
||||
|
||||
static void
|
||||
st_scroll_bar_allocate (ClutterActor *actor,
|
||||
const ClutterActorBox *box,
|
||||
ClutterAllocationFlags flags)
|
||||
st_scroll_bar_parent_set (ClutterActor *actor,
|
||||
ClutterActor *old_parent)
|
||||
{
|
||||
StScrollBarPrivate *priv = ST_SCROLL_BAR (actor)->priv;
|
||||
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor));
|
||||
|
||||
priv->needs_allocation = TRUE;
|
||||
|
||||
if (CLUTTER_ACTOR_CLASS (st_scroll_bar_parent_class)->parent_set)
|
||||
CLUTTER_ACTOR_CLASS (st_scroll_bar_parent_class)->parent_set (actor, old_parent);
|
||||
}
|
||||
|
||||
static void
|
||||
st_scroll_bar_queue_relayout (ClutterActor *actor)
|
||||
{
|
||||
StScrollBarPrivate *priv = ST_SCROLL_BAR (actor)->priv;
|
||||
|
||||
priv->needs_allocation = TRUE;
|
||||
|
||||
CLUTTER_ACTOR_CLASS (st_scroll_bar_parent_class)->queue_relayout (actor);
|
||||
}
|
||||
|
||||
static void
|
||||
scroll_bar_allocate_children (StScrollBar *bar,
|
||||
const ClutterActorBox *box,
|
||||
ClutterAllocationFlags flags)
|
||||
{
|
||||
StScrollBarPrivate *priv = bar->priv;
|
||||
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (bar));
|
||||
ClutterActorBox content_box, bw_box, fw_box, trough_box;
|
||||
gfloat bw_stepper_size, fw_stepper_size, min_size, natural_size;
|
||||
|
||||
/* Chain up */
|
||||
CLUTTER_ACTOR_CLASS (st_scroll_bar_parent_class)->
|
||||
allocate (actor, box, flags);
|
||||
|
||||
st_theme_node_get_content_box (theme_node, box, &content_box);
|
||||
|
||||
if (priv->vertical)
|
||||
@ -352,7 +387,6 @@ st_scroll_bar_allocate (ClutterActor *actor,
|
||||
|
||||
if (priv->adjustment)
|
||||
{
|
||||
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (actor));
|
||||
float handle_size, position, avail_size, stepper_size;
|
||||
gdouble value, lower, upper, page_size, increment, min_size, max_size;
|
||||
ClutterActorBox handle_box = { 0, };
|
||||
@ -420,6 +454,45 @@ st_scroll_bar_allocate (ClutterActor *actor,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
st_scroll_bar_allocate (ClutterActor *actor,
|
||||
const ClutterActorBox *box,
|
||||
ClutterAllocationFlags flags)
|
||||
{
|
||||
StScrollBar *bar = ST_SCROLL_BAR (actor);
|
||||
StScrollBarPrivate *priv = bar->priv;
|
||||
priv->needs_allocation = FALSE;
|
||||
|
||||
/* Chain up */
|
||||
CLUTTER_ACTOR_CLASS (st_scroll_bar_parent_class)->allocate (actor, box, flags);
|
||||
|
||||
scroll_bar_allocate_children (bar, box, flags);
|
||||
}
|
||||
|
||||
static void
|
||||
scroll_bar_update_positions (StScrollBar *bar)
|
||||
{
|
||||
StScrollBarPrivate *priv = bar->priv;
|
||||
ClutterActorBox box;
|
||||
|
||||
/* Due to a change in the adjustments, we need to reposition our
|
||||
* children; since adjustments changes can come from allocation
|
||||
* changes in the scrolled area, we can't just queue a new relayout -
|
||||
* we may already be in a relayout cycle. On the other hand, if
|
||||
* a relayout is already queued, we can't just go ahead and allocate
|
||||
* our children, since we don't have a valid allocation, and calling
|
||||
* clutter_actor_get_allocation_box() will trigger an immediate
|
||||
* stage relayout. So what we do is go ahead and immediately
|
||||
* allocate our children if we already have a valid allocation, and
|
||||
* otherwise just wait for the queued relayout.
|
||||
*/
|
||||
if (priv->needs_allocation)
|
||||
return;
|
||||
|
||||
clutter_actor_get_allocation_box (CLUTTER_ACTOR (bar), &box);
|
||||
scroll_bar_allocate_children (bar, &box, CLUTTER_ALLOCATION_NONE);
|
||||
}
|
||||
|
||||
static void
|
||||
st_scroll_bar_style_changed (StWidget *widget)
|
||||
{
|
||||
@ -523,6 +596,8 @@ st_scroll_bar_class_init (StScrollBarClass *klass)
|
||||
object_class->dispose = st_scroll_bar_dispose;
|
||||
object_class->constructor = st_scroll_bar_constructor;
|
||||
|
||||
actor_class->parent_set = st_scroll_bar_parent_set;
|
||||
actor_class->queue_relayout = st_scroll_bar_queue_relayout;
|
||||
actor_class->allocate = st_scroll_bar_allocate;
|
||||
actor_class->paint = st_scroll_bar_paint;
|
||||
actor_class->pick = st_scroll_bar_pick;
|
||||
@ -1032,6 +1107,8 @@ st_scroll_bar_init (StScrollBar *self)
|
||||
|
||||
g_signal_connect (self, "notify::reactive",
|
||||
G_CALLBACK (st_scroll_bar_notify_reactive), NULL);
|
||||
|
||||
self->priv->needs_allocation = TRUE;
|
||||
}
|
||||
|
||||
StWidget *
|
||||
@ -1042,6 +1119,21 @@ st_scroll_bar_new (StAdjustment *adjustment)
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
on_notify_value (GObject *object,
|
||||
GParamSpec *pspec,
|
||||
StScrollBar *bar)
|
||||
{
|
||||
scroll_bar_update_positions (bar);
|
||||
}
|
||||
|
||||
static void
|
||||
on_changed (StAdjustment *adjustment,
|
||||
StScrollBar *bar)
|
||||
{
|
||||
scroll_bar_update_positions (bar);
|
||||
}
|
||||
|
||||
void
|
||||
st_scroll_bar_set_adjustment (StScrollBar *bar,
|
||||
StAdjustment *adjustment)
|
||||
@ -1051,13 +1143,17 @@ st_scroll_bar_set_adjustment (StScrollBar *bar,
|
||||
g_return_if_fail (ST_IS_SCROLL_BAR (bar));
|
||||
|
||||
priv = bar->priv;
|
||||
|
||||
if (adjustment == priv->adjustment)
|
||||
return;
|
||||
|
||||
if (priv->adjustment)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (priv->adjustment,
|
||||
clutter_actor_queue_relayout,
|
||||
on_notify_value,
|
||||
bar);
|
||||
g_signal_handlers_disconnect_by_func (priv->adjustment,
|
||||
clutter_actor_queue_relayout,
|
||||
on_changed,
|
||||
bar);
|
||||
g_object_unref (priv->adjustment);
|
||||
priv->adjustment = NULL;
|
||||
@ -1067,15 +1163,17 @@ st_scroll_bar_set_adjustment (StScrollBar *bar,
|
||||
{
|
||||
priv->adjustment = g_object_ref (adjustment);
|
||||
|
||||
g_signal_connect_swapped (priv->adjustment, "notify::value",
|
||||
G_CALLBACK (clutter_actor_queue_relayout),
|
||||
bar);
|
||||
g_signal_connect_swapped (priv->adjustment, "changed",
|
||||
G_CALLBACK (clutter_actor_queue_relayout),
|
||||
bar);
|
||||
g_signal_connect (priv->adjustment, "notify::value",
|
||||
G_CALLBACK (on_notify_value),
|
||||
bar);
|
||||
g_signal_connect (priv->adjustment, "changed",
|
||||
G_CALLBACK (on_changed),
|
||||
bar);
|
||||
|
||||
clutter_actor_queue_relayout (CLUTTER_ACTOR (bar));
|
||||
}
|
||||
|
||||
g_object_notify (G_OBJECT (bar), "adjustment");
|
||||
}
|
||||
|
||||
/**
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -25,6 +25,61 @@
|
||||
|
||||
#include "st-scrollable.h"
|
||||
|
||||
/**
|
||||
* SECTION:st-scrollable
|
||||
* @short_description: A #ClutterActor that can be scrolled
|
||||
*
|
||||
* The #StScrollable interface is exposed by actors that support scrolling.
|
||||
*
|
||||
* The interface contains methods for getting and setting the adjustments
|
||||
* for scrolling; these adjustments will be used to hook the scrolled
|
||||
* position up to scrollbars or other external controls. When a #StScrollable
|
||||
* is added to a parent container, the parent container is responsible
|
||||
* for setting the adjustments. The parent container then sets the adjustments
|
||||
* back to %NULL when the scrollable is removed.
|
||||
*
|
||||
* For #StScrollable supporting height-for-width size negotation, size
|
||||
* negotation works as follows:
|
||||
*
|
||||
* In response to get_preferred_width(), the scrollable should report
|
||||
* the minimum width at which horizontal scrolling is needed for the
|
||||
* preferred width, and natural width of the actor when not
|
||||
* horizontally scrolled as the natural width.
|
||||
*
|
||||
* The for_width passed into get_preferred_height() is the width at which
|
||||
* the scrollable will be allocated; this will be smaller than the minimum
|
||||
* width when scrolling horizontally, so the scrollable may want to adjust
|
||||
* it up to the minimum width before computing a preferred height. (Other
|
||||
* scrollables may want to fit as much content into the allocated area
|
||||
* as possible and only scroll what absolutely needs to scroll - consider,
|
||||
* for example, the line-wrapping behavior of a text editor where there
|
||||
* is a long line without any spaces.) As for width, get_preferred_height()
|
||||
* should return the minimum size at which no scrolling is needed for the
|
||||
* minimum height, and the natural size of the actor when not vertically scrolled
|
||||
* as the natural height.
|
||||
*
|
||||
* In allocate() the allocation box passed in will be actual allocated
|
||||
* size of the actor so will be smaller than the reported minimum
|
||||
* width and/or height when scrolling is present. Any scrollable actor
|
||||
* must support being allocated at any size down to 0x0 without
|
||||
* crashing, however if the actor has content around the scrolled area
|
||||
* and has an absolute minimum size that's bigger than 0x0 its
|
||||
* acceptable for it to misdraw between 0x0 and the absolute minimum
|
||||
* size. It's up to the application author to avoid letting the user
|
||||
* resize the scroll view small enough so that the scrolled area
|
||||
* vanishes.
|
||||
*
|
||||
* In response to allocate, in addition to normal handling, the
|
||||
* scrollable should also set the limits of the the horizontal and
|
||||
* vertical adjustments that were set on it earlier. The standard
|
||||
* settings are:
|
||||
*
|
||||
* lower: 0
|
||||
* page_size: allocated size (width or height)
|
||||
* upper: MAX (total size of the scrolled area,allocated_size)
|
||||
* step_increment: natural row/column height or a fixed fraction of the page size
|
||||
* page_increment: page_size - step_increment
|
||||
*/
|
||||
static void
|
||||
st_scrollable_base_init (gpointer g_iface)
|
||||
{
|
||||
|
@ -191,8 +191,8 @@ st_shadow_texture_create_shadow (StShadowTexture *st,
|
||||
|
||||
clutter_texture_set_cogl_material (CLUTTER_TEXTURE (st), material);
|
||||
|
||||
cogl_texture_unref (texture);
|
||||
cogl_material_unref (material);
|
||||
cogl_handle_unref (texture);
|
||||
cogl_handle_unref (material);
|
||||
|
||||
g_free (pixels_in);
|
||||
g_free (pixels_out);
|
||||
|
@ -131,7 +131,7 @@ st_subtexture_unrealize (ClutterActor *self)
|
||||
if (priv->material == COGL_INVALID_HANDLE)
|
||||
return;
|
||||
|
||||
cogl_material_unref (priv->material);
|
||||
cogl_handle_unref (priv->material);
|
||||
priv->material = COGL_INVALID_HANDLE;
|
||||
|
||||
CLUTTER_ACTOR_UNSET_FLAGS (self, CLUTTER_ACTOR_REALIZED);
|
||||
@ -338,7 +338,7 @@ st_subtexture_dispose (GObject *gobject)
|
||||
|
||||
if (priv->material)
|
||||
{
|
||||
cogl_material_unref (priv->material);
|
||||
cogl_handle_unref (priv->material);
|
||||
priv->material = COGL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ enum
|
||||
|
||||
struct _StTablePrivate
|
||||
{
|
||||
GSList *children;
|
||||
GList *children;
|
||||
|
||||
gint col_spacing;
|
||||
gint row_spacing;
|
||||
@ -89,11 +89,11 @@ struct _StTablePrivate
|
||||
guint homogeneous : 1;
|
||||
};
|
||||
|
||||
static void st_container_iface_init (ClutterContainerIface *iface);
|
||||
static void st_table_container_iface_init (ClutterContainerIface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (StTable, st_table, ST_TYPE_WIDGET,
|
||||
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_CONTAINER,
|
||||
st_container_iface_init));
|
||||
st_table_container_iface_init));
|
||||
|
||||
|
||||
|
||||
@ -101,95 +101,72 @@ G_DEFINE_TYPE_WITH_CODE (StTable, st_table, ST_TYPE_WIDGET,
|
||||
* ClutterContainer Implementation
|
||||
*/
|
||||
static void
|
||||
st_container_add_actor (ClutterContainer *container,
|
||||
ClutterActor *actor)
|
||||
st_table_add_actor (ClutterContainer *container,
|
||||
ClutterActor *actor)
|
||||
{
|
||||
StTablePrivate *priv = ST_TABLE (container)->priv;
|
||||
|
||||
clutter_actor_set_parent (actor, CLUTTER_ACTOR (container));
|
||||
|
||||
|
||||
priv->children = g_slist_append (priv->children, actor);
|
||||
|
||||
clutter_actor_queue_relayout (CLUTTER_ACTOR (container));
|
||||
|
||||
g_signal_emit_by_name (container, "actor-added", actor);
|
||||
_st_container_add_actor (container, actor, &priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
st_container_remove_actor (ClutterContainer *container,
|
||||
ClutterActor *actor)
|
||||
st_table_remove_actor (ClutterContainer *container,
|
||||
ClutterActor *actor)
|
||||
{
|
||||
StTablePrivate *priv = ST_TABLE (container)->priv;
|
||||
|
||||
GSList *item = NULL;
|
||||
|
||||
item = g_slist_find (priv->children, actor);
|
||||
|
||||
if (item == NULL)
|
||||
{
|
||||
g_warning ("Widget of type '%s' is not a child of container of type '%s'",
|
||||
g_type_name (G_OBJECT_TYPE (actor)),
|
||||
g_type_name (G_OBJECT_TYPE (container)));
|
||||
return;
|
||||
}
|
||||
|
||||
g_object_ref (actor);
|
||||
|
||||
priv->children = g_slist_delete_link (priv->children, item);
|
||||
clutter_actor_unparent (actor);
|
||||
|
||||
clutter_actor_queue_relayout (CLUTTER_ACTOR (container));
|
||||
|
||||
g_signal_emit_by_name (container, "actor-removed", actor);
|
||||
|
||||
g_object_unref (actor);
|
||||
_st_container_remove_actor (container, actor, &priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
st_container_foreach (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer callback_data)
|
||||
st_table_foreach (ClutterContainer *container,
|
||||
ClutterCallback callback,
|
||||
gpointer callback_data)
|
||||
{
|
||||
StTablePrivate *priv = ST_TABLE (container)->priv;
|
||||
|
||||
g_slist_foreach (priv->children, (GFunc) callback, callback_data);
|
||||
_st_container_foreach (container, callback, callback_data,
|
||||
&priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
st_container_lower (ClutterContainer *container,
|
||||
ClutterActor *actor,
|
||||
ClutterActor *sibling)
|
||||
st_table_lower (ClutterContainer *container,
|
||||
ClutterActor *actor,
|
||||
ClutterActor *sibling)
|
||||
{
|
||||
/* XXX: not yet implemented */
|
||||
g_warning ("%s() not yet implemented", __FUNCTION__);
|
||||
StTablePrivate *priv = ST_TABLE (container)->priv;
|
||||
|
||||
_st_container_lower (container, actor, sibling, &priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
st_container_raise (ClutterContainer *container,
|
||||
ClutterActor *actor,
|
||||
ClutterActor *sibling)
|
||||
st_table_raise (ClutterContainer *container,
|
||||
ClutterActor *actor,
|
||||
ClutterActor *sibling)
|
||||
{
|
||||
/* XXX: not yet implemented */
|
||||
g_warning ("%s() not yet implemented", __FUNCTION__);
|
||||
StTablePrivate *priv = ST_TABLE (container)->priv;
|
||||
|
||||
_st_container_raise (container, actor, sibling, &priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
st_container_sort_depth_order (ClutterContainer *container)
|
||||
st_table_sort_depth_order (ClutterContainer *container)
|
||||
{
|
||||
/* XXX: not yet implemented */
|
||||
g_warning ("%s() not yet implemented", __FUNCTION__);
|
||||
StTablePrivate *priv = ST_TABLE (container)->priv;
|
||||
|
||||
_st_container_sort_depth_order (container, &priv->children);
|
||||
}
|
||||
|
||||
static void
|
||||
st_container_iface_init (ClutterContainerIface *iface)
|
||||
st_table_container_iface_init (ClutterContainerIface *iface)
|
||||
{
|
||||
iface->add = st_container_add_actor;
|
||||
iface->remove = st_container_remove_actor;
|
||||
iface->foreach = st_container_foreach;
|
||||
iface->lower = st_container_lower;
|
||||
iface->raise = st_container_raise;
|
||||
iface->sort_depth_order = st_container_sort_depth_order;
|
||||
iface->add = st_table_add_actor;
|
||||
iface->remove = st_table_remove_actor;
|
||||
iface->foreach = st_table_foreach;
|
||||
iface->lower = st_table_lower;
|
||||
iface->raise = st_table_raise;
|
||||
iface->sort_depth_order = st_table_sort_depth_order;
|
||||
|
||||
iface->child_meta_type = ST_TYPE_TABLE_CHILD;
|
||||
}
|
||||
|
||||
@ -283,7 +260,7 @@ st_table_homogeneous_allocate (ClutterActor *self,
|
||||
const ClutterActorBox *content_box,
|
||||
gboolean flags)
|
||||
{
|
||||
GSList *list;
|
||||
GList *list;
|
||||
gfloat col_width, row_height;
|
||||
gint row_spacing, col_spacing;
|
||||
StTablePrivate *priv = ST_TABLE (self)->priv;
|
||||
@ -299,7 +276,7 @@ st_table_homogeneous_allocate (ClutterActor *self,
|
||||
- (row_spacing * (priv->n_rows - 1)))
|
||||
/ priv->n_rows;
|
||||
|
||||
for (list = priv->children; list; list = g_slist_next (list))
|
||||
for (list = priv->children; list; list = list->next)
|
||||
{
|
||||
gint row, col, row_span, col_span;
|
||||
StTableChild *meta;
|
||||
@ -357,7 +334,7 @@ st_table_calculate_col_widths (StTable *table,
|
||||
gboolean *is_expand_col;
|
||||
gint extra_col_width, n_expanded_cols = 0, expanded_cols = 0;
|
||||
gint *pref_widths, *min_widths;
|
||||
GSList *list;
|
||||
GList *list;
|
||||
|
||||
g_array_set_size (priv->is_expand_col, 0);
|
||||
g_array_set_size (priv->is_expand_col, priv->n_cols);
|
||||
@ -371,7 +348,7 @@ st_table_calculate_col_widths (StTable *table,
|
||||
g_array_set_size (priv->min_widths, priv->n_cols);
|
||||
min_widths = (gint *) priv->min_widths->data;
|
||||
|
||||
for (list = priv->children; list; list = g_slist_next (list))
|
||||
for (list = priv->children; list; list = list->next)
|
||||
{
|
||||
gint row, col;
|
||||
gfloat w_min, w_pref;
|
||||
@ -459,7 +436,7 @@ st_table_calculate_row_heights (StTable *table,
|
||||
gint * col_widths)
|
||||
{
|
||||
StTablePrivate *priv = ST_TABLE (table)->priv;
|
||||
GSList *list;
|
||||
GList *list;
|
||||
gint *is_expand_row, *min_heights, *pref_heights, *row_heights, extra_row_height;
|
||||
gint i, total_min_height;
|
||||
gint expanded_rows = 0;
|
||||
@ -482,7 +459,7 @@ st_table_calculate_row_heights (StTable *table,
|
||||
pref_heights = (gboolean *) priv->pref_heights->data;
|
||||
|
||||
/* calculate minimum row widths and column heights */
|
||||
for (list = priv->children; list; list = g_slist_next (list))
|
||||
for (list = priv->children; list; list = list->next)
|
||||
{
|
||||
gint row, col, cell_width;
|
||||
gfloat h_min, h_pref;
|
||||
@ -633,7 +610,7 @@ st_table_preferred_allocate (ClutterActor *self,
|
||||
const ClutterActorBox *content_box,
|
||||
gboolean flags)
|
||||
{
|
||||
GSList *list;
|
||||
GList *list;
|
||||
gint row_spacing, col_spacing;
|
||||
gint i;
|
||||
gint *col_widths, *row_heights;
|
||||
@ -659,7 +636,7 @@ st_table_preferred_allocate (ClutterActor *self,
|
||||
ltr = (st_widget_get_direction (ST_WIDGET (self)) == ST_TEXT_DIRECTION_LTR);
|
||||
|
||||
|
||||
for (list = priv->children; list; list = g_slist_next (list))
|
||||
for (list = priv->children; list; list = list->next)
|
||||
{
|
||||
gint row, col, row_span, col_span;
|
||||
gint col_width, row_height;
|
||||
@ -803,7 +780,7 @@ st_table_get_preferred_width (ClutterActor *self,
|
||||
gfloat total_min_width, total_pref_width;
|
||||
StTablePrivate *priv = ST_TABLE (self)->priv;
|
||||
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (self));
|
||||
GSList *list;
|
||||
GList *list;
|
||||
gint i;
|
||||
|
||||
if (priv->n_cols < 1)
|
||||
@ -825,7 +802,7 @@ st_table_get_preferred_width (ClutterActor *self,
|
||||
pref_widths = (gint *) priv->pref_widths->data;
|
||||
|
||||
/* calculate minimum row widths */
|
||||
for (list = priv->children; list; list = g_slist_next (list))
|
||||
for (list = priv->children; list; list = list->next)
|
||||
{
|
||||
gint col, col_span;
|
||||
gfloat w_min, w_pref;
|
||||
@ -878,7 +855,7 @@ st_table_get_preferred_height (ClutterActor *self,
|
||||
gfloat total_min_height, total_pref_height;
|
||||
StTablePrivate *priv = ST_TABLE (self)->priv;
|
||||
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (self));
|
||||
GSList *list;
|
||||
GList *list;
|
||||
gint i;
|
||||
gint *min_widths;
|
||||
|
||||
@ -906,7 +883,7 @@ st_table_get_preferred_height (ClutterActor *self,
|
||||
pref_heights = (gint *) priv->pref_heights->data;
|
||||
|
||||
/* calculate minimum row heights */
|
||||
for (list = priv->children; list; list = g_slist_next (list))
|
||||
for (list = priv->children; list; list = list->next)
|
||||
{
|
||||
gint row, col, col_span, cell_width, row_span;
|
||||
gfloat min, pref;
|
||||
@ -961,12 +938,12 @@ static void
|
||||
st_table_paint (ClutterActor *self)
|
||||
{
|
||||
StTablePrivate *priv = ST_TABLE (self)->priv;
|
||||
GSList *list;
|
||||
GList *list;
|
||||
|
||||
/* make sure the background gets painted first */
|
||||
CLUTTER_ACTOR_CLASS (st_table_parent_class)->paint (self);
|
||||
|
||||
for (list = priv->children; list; list = g_slist_next (list))
|
||||
for (list = priv->children; list; list = list->next)
|
||||
{
|
||||
ClutterActor *child = CLUTTER_ACTOR (list->data);
|
||||
if (CLUTTER_ACTOR_IS_VISIBLE (child))
|
||||
@ -979,12 +956,12 @@ st_table_pick (ClutterActor *self,
|
||||
const ClutterColor *color)
|
||||
{
|
||||
StTablePrivate *priv = ST_TABLE (self)->priv;
|
||||
GSList *list;
|
||||
GList *list;
|
||||
|
||||
/* Chain up so we get a bounding box painted (if we are reactive) */
|
||||
CLUTTER_ACTOR_CLASS (st_table_parent_class)->pick (self, color);
|
||||
|
||||
for (list = priv->children; list; list = g_slist_next (list))
|
||||
for (list = priv->children; list; list = list->next)
|
||||
{
|
||||
if (CLUTTER_ACTOR_IS_VISIBLE (list->data))
|
||||
clutter_actor_paint (CLUTTER_ACTOR (list->data));
|
||||
@ -995,7 +972,7 @@ static void
|
||||
st_table_show_all (ClutterActor *table)
|
||||
{
|
||||
StTablePrivate *priv = ST_TABLE (table)->priv;
|
||||
GSList *l;
|
||||
GList *l;
|
||||
|
||||
for (l = priv->children; l; l = l->next)
|
||||
clutter_actor_show_all (CLUTTER_ACTOR (l->data));
|
||||
@ -1007,7 +984,7 @@ static void
|
||||
st_table_hide_all (ClutterActor *table)
|
||||
{
|
||||
StTablePrivate *priv = ST_TABLE (table)->priv;
|
||||
GSList *l;
|
||||
GList *l;
|
||||
|
||||
clutter_actor_hide (table);
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,96 +1,115 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
/*
|
||||
* st-texture-cache.h: Cached textures object
|
||||
*
|
||||
* Copyright 2007 OpenedHand
|
||||
* Copyright 2009 Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU Lesser General Public License,
|
||||
* version 2.1, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
#ifndef __ST_TEXTURE_CACHE_H__
|
||||
#define __ST_TEXTURE_CACHE_H__
|
||||
|
||||
#if !defined(ST_H_INSIDE) && !defined(ST_COMPILATION)
|
||||
#error "Only <st/st.h> can be included directly.h"
|
||||
#endif
|
||||
|
||||
#ifndef _ST_TEXTURE_CACHE
|
||||
#define _ST_TEXTURE_CACHE
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gio/gio.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
#define ST_TYPE_TEXTURE_CACHE (st_texture_cache_get_type ())
|
||||
#define ST_TEXTURE_CACHE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ST_TYPE_TEXTURE_CACHE, StTextureCache))
|
||||
#define ST_TEXTURE_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ST_TYPE_TEXTURE_CACHE, StTextureCacheClass))
|
||||
#define ST_IS_TEXTURE_CACHE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ST_TYPE_TEXTURE_CACHE))
|
||||
#define ST_IS_TEXTURE_CACHE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ST_TYPE_TEXTURE_CACHE))
|
||||
#define ST_TEXTURE_CACHE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ST_TYPE_TEXTURE_CACHE, StTextureCacheClass))
|
||||
|
||||
#define ST_TYPE_TEXTURE_CACHE st_texture_cache_get_type()
|
||||
typedef struct _StTextureCache StTextureCache;
|
||||
typedef struct _StTextureCacheClass StTextureCacheClass;
|
||||
|
||||
#define ST_TEXTURE_CACHE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
|
||||
ST_TYPE_TEXTURE_CACHE, StTextureCache))
|
||||
typedef struct _StTextureCachePrivate StTextureCachePrivate;
|
||||
|
||||
#define ST_TEXTURE_CACHE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST ((klass), \
|
||||
ST_TYPE_TEXTURE_CACHE, StTextureCacheClass))
|
||||
struct _StTextureCache
|
||||
{
|
||||
GObject parent;
|
||||
|
||||
#define ST_IS_TEXTURE_CACHE(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
|
||||
ST_TYPE_TEXTURE_CACHE))
|
||||
StTextureCachePrivate *priv;
|
||||
};
|
||||
|
||||
#define ST_IS_TEXTURE_CACHE_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE ((klass), \
|
||||
ST_TYPE_TEXTURE_CACHE))
|
||||
|
||||
#define ST_TEXTURE_CACHE_GET_CLASS(obj) \
|
||||
(G_TYPE_INSTANCE_GET_CLASS ((obj), \
|
||||
ST_TYPE_TEXTURE_CACHE, StTextureCacheClass))
|
||||
|
||||
/**
|
||||
* StTextureCache:
|
||||
*
|
||||
* The contents of this structure are private and should only be accessed
|
||||
* through the public API.
|
||||
*/
|
||||
typedef struct {
|
||||
/*< private >*/
|
||||
GObject parent;
|
||||
} StTextureCache;
|
||||
|
||||
typedef struct {
|
||||
struct _StTextureCacheClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
void (* loaded) (StTextureCache *self,
|
||||
const gchar *path,
|
||||
ClutterTexture *texture);
|
||||
};
|
||||
|
||||
void (* error_loading) (StTextureCache *self,
|
||||
GError *error);
|
||||
} StTextureCacheClass;
|
||||
typedef enum {
|
||||
ST_TEXTURE_CACHE_POLICY_NONE,
|
||||
ST_TEXTURE_CACHE_POLICY_FOREVER
|
||||
} StTextureCachePolicy;
|
||||
|
||||
GType st_texture_cache_get_type (void);
|
||||
GType st_texture_cache_get_type (void) G_GNUC_CONST;
|
||||
|
||||
StTextureCache* st_texture_cache_get_default (void);
|
||||
|
||||
ClutterTexture* st_texture_cache_get_texture (StTextureCache *self,
|
||||
const gchar *path);
|
||||
ClutterActor* st_texture_cache_get_actor (StTextureCache *self,
|
||||
const gchar *path);
|
||||
ClutterActor *st_texture_cache_bind_pixbuf_property (StTextureCache *cache,
|
||||
GObject *object,
|
||||
const char *property_name);
|
||||
|
||||
gint st_texture_cache_get_size (StTextureCache *self);
|
||||
ClutterActor *st_texture_cache_load_icon_name (StTextureCache *cache,
|
||||
const char *name,
|
||||
gint size);
|
||||
|
||||
void st_texture_cache_load_cache (StTextureCache *self,
|
||||
const char *filename);
|
||||
ClutterActor *st_texture_cache_load_gicon (StTextureCache *cache,
|
||||
GIcon *icon,
|
||||
gint size);
|
||||
|
||||
G_END_DECLS
|
||||
ClutterActor *st_texture_cache_load_thumbnail (StTextureCache *cache,
|
||||
int size,
|
||||
const char *uri,
|
||||
const char *mimetype);
|
||||
|
||||
#endif /* _ST_TEXTURE_CACHE */
|
||||
ClutterActor *st_texture_cache_load_recent_thumbnail (StTextureCache *cache,
|
||||
int size,
|
||||
GtkRecentInfo *info);
|
||||
|
||||
void st_texture_cache_evict_thumbnail (StTextureCache *cache,
|
||||
const char *uri);
|
||||
|
||||
void st_texture_cache_evict_recent_thumbnail (StTextureCache *cache,
|
||||
GtkRecentInfo *info);
|
||||
|
||||
ClutterActor *st_texture_cache_load_uri_async (StTextureCache *cache,
|
||||
const gchar *filename,
|
||||
int available_width,
|
||||
int available_height);
|
||||
|
||||
ClutterActor *st_texture_cache_load_uri_sync (StTextureCache *cache,
|
||||
StTextureCachePolicy policy,
|
||||
const gchar *filename,
|
||||
int available_width,
|
||||
int available_height,
|
||||
GError **error);
|
||||
|
||||
CoglHandle st_texture_cache_load_file_to_cogl_texture (StTextureCache *cache,
|
||||
const gchar *file_path);
|
||||
|
||||
ClutterActor *st_texture_cache_load_file_simple (StTextureCache *cache,
|
||||
const gchar *file_path);
|
||||
|
||||
ClutterActor *st_texture_cache_load_from_data (StTextureCache *cache,
|
||||
const guchar *data,
|
||||
gsize len,
|
||||
int size,
|
||||
GError **error);
|
||||
ClutterActor *st_texture_cache_load_from_raw (StTextureCache *cache,
|
||||
const guchar *data,
|
||||
gsize len,
|
||||
gboolean has_alpha,
|
||||
int width,
|
||||
int height,
|
||||
int rowstride,
|
||||
int size,
|
||||
GError **error);
|
||||
|
||||
typedef CoglHandle (*StTextureCacheLoader) (StTextureCache *cache, const char *key, void *data, GError **error);
|
||||
|
||||
CoglHandle st_texture_cache_load (StTextureCache *cache,
|
||||
const char *key,
|
||||
StTextureCachePolicy policy,
|
||||
StTextureCacheLoader load,
|
||||
void *data,
|
||||
GError **error);
|
||||
|
||||
gboolean st_texture_cache_pixbuf_equal (StTextureCache *cache, GdkPixbuf *a, GdkPixbuf *b);
|
||||
|
||||
#endif /* __ST_TEXTURE_CACHE_H__ */
|
||||
|
@ -28,8 +28,8 @@ struct _StThemeNode {
|
||||
ClutterColor foreground_color;
|
||||
ClutterColor border_color[4];
|
||||
|
||||
double border_width[4];
|
||||
double border_radius[4];
|
||||
int border_width[4];
|
||||
int border_radius[4];
|
||||
guint padding[4];
|
||||
|
||||
int width;
|
||||
@ -720,6 +720,21 @@ get_length_from_term (StThemeNode *node,
|
||||
return VALUE_FOUND;
|
||||
}
|
||||
|
||||
static GetFromTermResult
|
||||
get_length_from_term_int (StThemeNode *node,
|
||||
CRTerm *term,
|
||||
gboolean use_parent_font,
|
||||
gint *length)
|
||||
{
|
||||
double value;
|
||||
GetFromTermResult result;
|
||||
|
||||
result = get_length_from_term (node, term, use_parent_font, &value);
|
||||
if (result != VALUE_NOT_FOUND)
|
||||
*length = (int) (0.5 + value);
|
||||
return result;
|
||||
}
|
||||
|
||||
static GetFromTermResult
|
||||
get_length_internal (StThemeNode *node,
|
||||
const char *property_name,
|
||||
@ -795,9 +810,9 @@ do_border_radius_term (StThemeNode *node,
|
||||
gboolean bottomright,
|
||||
gboolean bottomleft)
|
||||
{
|
||||
gdouble value;
|
||||
int value;
|
||||
|
||||
if (get_length_from_term (node, term, FALSE, &value) != VALUE_FOUND)
|
||||
if (get_length_from_term_int (node, term, FALSE, &value) != VALUE_FOUND)
|
||||
return;
|
||||
|
||||
if (topleft)
|
||||
@ -877,7 +892,7 @@ do_border_property (StThemeNode *node,
|
||||
StSide side = (StSide)-1;
|
||||
ClutterColor color;
|
||||
gboolean color_set = FALSE;
|
||||
double width;
|
||||
int width;
|
||||
gboolean width_set = FALSE;
|
||||
int j;
|
||||
|
||||
@ -948,7 +963,7 @@ do_border_property (StThemeNode *node,
|
||||
|
||||
if (term->type == TERM_NUMBER)
|
||||
{
|
||||
result = get_length_from_term (node, term, FALSE, &width);
|
||||
result = get_length_from_term_int (node, term, FALSE, &width);
|
||||
if (result != VALUE_NOT_FOUND)
|
||||
{
|
||||
width_set = result == VALUE_FOUND;
|
||||
@ -979,7 +994,7 @@ do_border_property (StThemeNode *node,
|
||||
if (decl->value == NULL || decl->value->next != NULL)
|
||||
return;
|
||||
|
||||
if (get_length_from_term (node, decl->value, FALSE, &width) == VALUE_FOUND)
|
||||
if (get_length_from_term_int (node, decl->value, FALSE, &width) == VALUE_FOUND)
|
||||
/* Ignore inherit */
|
||||
width_set = TRUE;
|
||||
}
|
||||
@ -1011,23 +1026,19 @@ do_padding_property_term (StThemeNode *node,
|
||||
gboolean top,
|
||||
gboolean bottom)
|
||||
{
|
||||
gdouble value;
|
||||
int int_value;
|
||||
int value;
|
||||
|
||||
if (get_length_from_term (node, term, FALSE, &value) != VALUE_FOUND)
|
||||
if (get_length_from_term_int (node, term, FALSE, &value) != VALUE_FOUND)
|
||||
return;
|
||||
|
||||
/* Round the value */
|
||||
int_value = (int) (0.5 + value);
|
||||
|
||||
if (left)
|
||||
node->padding[ST_SIDE_LEFT] = int_value;
|
||||
node->padding[ST_SIDE_LEFT] = value;
|
||||
if (right)
|
||||
node->padding[ST_SIDE_RIGHT] = int_value;
|
||||
node->padding[ST_SIDE_RIGHT] = value;
|
||||
if (top)
|
||||
node->padding[ST_SIDE_TOP] = int_value;
|
||||
node->padding[ST_SIDE_TOP] = value;
|
||||
if (bottom)
|
||||
node->padding[ST_SIDE_BOTTOM] = int_value;
|
||||
node->padding[ST_SIDE_BOTTOM] = value;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1092,12 +1103,9 @@ do_padding_property (StThemeNode *node,
|
||||
static void
|
||||
do_size_property (StThemeNode *node,
|
||||
CRDeclaration *decl,
|
||||
int *node_value)
|
||||
int *node_value)
|
||||
{
|
||||
gdouble value;
|
||||
|
||||
if (get_length_from_term (node, decl->value, FALSE, &value) == VALUE_FOUND)
|
||||
*node_value = (int) (0.5 + value);
|
||||
get_length_from_term_int (node, decl->value, FALSE, node_value);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1177,7 +1185,7 @@ ensure_geometry (StThemeNode *node)
|
||||
node->height = node->min_height;
|
||||
}
|
||||
|
||||
double
|
||||
int
|
||||
st_theme_node_get_border_width (StThemeNode *node,
|
||||
StSide side)
|
||||
{
|
||||
@ -1189,7 +1197,7 @@ st_theme_node_get_border_width (StThemeNode *node,
|
||||
return node->border_width[side];
|
||||
}
|
||||
|
||||
double
|
||||
int
|
||||
st_theme_node_get_border_radius (StThemeNode *node,
|
||||
StCorner corner)
|
||||
{
|
||||
@ -1394,6 +1402,10 @@ ensure_background (StThemeNode *node)
|
||||
{
|
||||
node->background_gradient_type = ST_GRADIENT_RADIAL;
|
||||
}
|
||||
else if (strcmp (term->content.str->stryng->str, "none") == 0)
|
||||
{
|
||||
node->background_gradient_type = ST_GRADIENT_NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning ("Unrecognized background-gradient-direction \"%s\"",
|
||||
@ -2162,6 +2174,44 @@ st_theme_node_get_border_image (StThemeNode *node)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* st_theme_node_get_horizontal_padding:
|
||||
* @node: a #StThemeNode
|
||||
*
|
||||
* Gets the total horizonal padding (left + right padding)
|
||||
*
|
||||
* Return value: the total horizonal padding
|
||||
* in pixels
|
||||
*/
|
||||
double
|
||||
st_theme_node_get_horizontal_padding (StThemeNode *node)
|
||||
{
|
||||
double padding = 0.0;
|
||||
padding += st_theme_node_get_padding (node, ST_SIDE_LEFT);
|
||||
padding += st_theme_node_get_padding (node, ST_SIDE_RIGHT);
|
||||
|
||||
return padding;
|
||||
}
|
||||
|
||||
/**
|
||||
* st_theme_node_get_vertical_padding:
|
||||
* @node: a #StThemeNode
|
||||
*
|
||||
* Gets the total vertical padding (top + bottom padding)
|
||||
*
|
||||
* Return value: the total vertical padding
|
||||
* in pixels
|
||||
*/
|
||||
double
|
||||
st_theme_node_get_vertical_padding (StThemeNode *node)
|
||||
{
|
||||
double padding = 0.0;
|
||||
padding += st_theme_node_get_padding (node, ST_SIDE_TOP);
|
||||
padding += st_theme_node_get_padding (node, ST_SIDE_BOTTOM);
|
||||
|
||||
return padding;
|
||||
}
|
||||
|
||||
/**
|
||||
* st_theme_node_get_shadow:
|
||||
* @node: a #StThemeNode
|
||||
@ -2439,7 +2489,7 @@ st_theme_node_get_content_box (StThemeNode *node,
|
||||
/**
|
||||
* st_theme_node_geometry_equal:
|
||||
* @node: a #StThemeNode
|
||||
* @node: a different #StThemeNode
|
||||
* @other: a different #StThemeNode
|
||||
*
|
||||
* Tests if two theme nodes have the same borders and padding; this can be
|
||||
* used to optimize having to relayout when the style applied to a Clutter
|
||||
|
@ -118,9 +118,9 @@ void st_theme_node_get_background_gradient (StThemeNode *node,
|
||||
|
||||
const char *st_theme_node_get_background_image (StThemeNode *node);
|
||||
|
||||
double st_theme_node_get_border_width (StThemeNode *node,
|
||||
int st_theme_node_get_border_width (StThemeNode *node,
|
||||
StSide side);
|
||||
double st_theme_node_get_border_radius (StThemeNode *node,
|
||||
int st_theme_node_get_border_radius (StThemeNode *node,
|
||||
StCorner corner);
|
||||
void st_theme_node_get_border_color (StThemeNode *node,
|
||||
StSide side,
|
||||
@ -129,6 +129,9 @@ void st_theme_node_get_border_color (StThemeNode *node,
|
||||
double st_theme_node_get_padding (StThemeNode *node,
|
||||
StSide side);
|
||||
|
||||
double st_theme_node_get_horizontal_padding (StThemeNode *node);
|
||||
double st_theme_node_get_vertical_padding (StThemeNode *node);
|
||||
|
||||
int st_theme_node_get_width (StThemeNode *node);
|
||||
int st_theme_node_get_height (StThemeNode *node);
|
||||
int st_theme_node_get_min_width (StThemeNode *node);
|
||||
|
@ -148,27 +148,13 @@ st_tooltip_get_preferred_width (ClutterActor *self,
|
||||
{
|
||||
StTooltipPrivate *priv = ST_TOOLTIP (self)->priv;
|
||||
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (self));
|
||||
gfloat label_height, arrow_height;
|
||||
ClutterActor *arrow_image;
|
||||
gfloat label_height;
|
||||
|
||||
st_theme_node_adjust_for_height (theme_node, &for_height);
|
||||
|
||||
arrow_image = st_widget_get_background_image (ST_WIDGET (self));
|
||||
if (arrow_image)
|
||||
{
|
||||
clutter_actor_get_preferred_height (arrow_image,
|
||||
-1,
|
||||
NULL,
|
||||
&arrow_height);
|
||||
}
|
||||
else
|
||||
{
|
||||
arrow_height = 0;
|
||||
}
|
||||
|
||||
if (for_height > -1)
|
||||
{
|
||||
label_height = for_height - arrow_height;
|
||||
label_height = for_height;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -194,26 +180,10 @@ st_tooltip_get_preferred_height (ClutterActor *self,
|
||||
{
|
||||
StTooltipPrivate *priv = ST_TOOLTIP (self)->priv;
|
||||
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (self));
|
||||
gfloat arrow_height;
|
||||
gfloat min_label_h, natural_label_h;
|
||||
ClutterActor *arrow_image;
|
||||
|
||||
st_theme_node_adjust_for_width (theme_node, &for_width);
|
||||
|
||||
arrow_image = st_widget_get_background_image (ST_WIDGET (self));
|
||||
|
||||
if (arrow_image && !priv->actor_below)
|
||||
{
|
||||
clutter_actor_get_preferred_height (arrow_image,
|
||||
-1,
|
||||
NULL,
|
||||
&arrow_height);
|
||||
}
|
||||
else
|
||||
{
|
||||
arrow_height = 0;
|
||||
}
|
||||
|
||||
if (priv->label)
|
||||
{
|
||||
clutter_actor_get_preferred_height (priv->label,
|
||||
@ -228,10 +198,10 @@ st_tooltip_get_preferred_height (ClutterActor *self,
|
||||
}
|
||||
|
||||
if (min_height_p)
|
||||
*min_height_p = arrow_height + min_label_h;
|
||||
*min_height_p = min_label_h;
|
||||
|
||||
if (natural_height_p)
|
||||
*natural_height_p = arrow_height + natural_label_h;
|
||||
*natural_height_p = natural_label_h;
|
||||
|
||||
st_theme_node_adjust_preferred_height (theme_node, min_height_p, natural_height_p);
|
||||
}
|
||||
@ -243,9 +213,7 @@ st_tooltip_allocate (ClutterActor *self,
|
||||
{
|
||||
StTooltipPrivate *priv = ST_TOOLTIP (self)->priv;
|
||||
StThemeNode *theme_node = st_widget_get_theme_node (ST_WIDGET (self));
|
||||
ClutterActorBox content_box, child_box, arrow_box;
|
||||
gfloat arrow_height, arrow_width;
|
||||
ClutterActor *border_image, *arrow_image;
|
||||
ClutterActorBox content_box, child_box;
|
||||
|
||||
CLUTTER_ACTOR_CLASS (st_tooltip_parent_class)->allocate (self,
|
||||
box,
|
||||
@ -253,61 +221,23 @@ st_tooltip_allocate (ClutterActor *self,
|
||||
|
||||
st_theme_node_get_content_box (theme_node, box, &content_box);
|
||||
|
||||
arrow_image = st_widget_get_background_image (ST_WIDGET (self));
|
||||
|
||||
if (arrow_image && !priv->actor_below)
|
||||
{
|
||||
clutter_actor_get_preferred_height (arrow_image, -1, NULL, &arrow_height);
|
||||
clutter_actor_get_preferred_width (arrow_image, -1, NULL, &arrow_width);
|
||||
|
||||
arrow_box.x1 = (float)(priv->arrow_offset) - (int)(arrow_width / 2);
|
||||
arrow_box.y1 = 0;
|
||||
arrow_box.x2 = arrow_box.x1 + arrow_width;
|
||||
arrow_box.y2 = arrow_box.y1 + arrow_height;
|
||||
|
||||
clutter_actor_allocate (arrow_image, &arrow_box, flags);
|
||||
}
|
||||
else
|
||||
{
|
||||
arrow_height = 0;
|
||||
arrow_width = 0;
|
||||
}
|
||||
|
||||
child_box.x1 = child_box.y1 = 0;
|
||||
child_box.x2 = (box->x2 - box->x1);
|
||||
child_box.y2 = (box->y2 - box->y1);
|
||||
|
||||
/* remove the space that is used by the arrow */
|
||||
child_box.y1 += arrow_height;
|
||||
|
||||
border_image = st_widget_get_border_image (ST_WIDGET (self));
|
||||
if (border_image)
|
||||
clutter_actor_allocate (border_image, &child_box, flags);
|
||||
|
||||
if (priv->label)
|
||||
{
|
||||
child_box = content_box;
|
||||
child_box.y1 += arrow_height;
|
||||
|
||||
clutter_actor_allocate (priv->label, &child_box, flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
st_tooltip_paint (ClutterActor *self)
|
||||
{
|
||||
ClutterActor *border_image, *arrow_image;
|
||||
StTooltipPrivate *priv = ST_TOOLTIP (self)->priv;
|
||||
|
||||
border_image = st_widget_get_border_image (ST_WIDGET (self));
|
||||
if (border_image)
|
||||
clutter_actor_paint (border_image);
|
||||
|
||||
arrow_image = st_widget_get_background_image (ST_WIDGET (self));
|
||||
if (arrow_image && !priv->actor_below)
|
||||
clutter_actor_paint (arrow_image);
|
||||
|
||||
clutter_actor_paint (priv->label);
|
||||
}
|
||||
|
||||
@ -315,18 +245,9 @@ static void
|
||||
st_tooltip_map (ClutterActor *self)
|
||||
{
|
||||
StTooltipPrivate *priv = ST_TOOLTIP (self)->priv;
|
||||
ClutterActor *border_image, *arrow_image;
|
||||
|
||||
CLUTTER_ACTOR_CLASS (st_tooltip_parent_class)->map (self);
|
||||
|
||||
border_image = st_widget_get_border_image (ST_WIDGET (self));
|
||||
if (border_image)
|
||||
clutter_actor_map (border_image);
|
||||
|
||||
arrow_image = st_widget_get_background_image (ST_WIDGET (self));
|
||||
if (arrow_image)
|
||||
clutter_actor_map (arrow_image);
|
||||
|
||||
clutter_actor_map (priv->label);
|
||||
}
|
||||
|
||||
@ -334,18 +255,9 @@ static void
|
||||
st_tooltip_unmap (ClutterActor *self)
|
||||
{
|
||||
StTooltipPrivate *priv = ST_TOOLTIP (self)->priv;
|
||||
ClutterActor *border_image, *arrow_image;
|
||||
|
||||
CLUTTER_ACTOR_CLASS (st_tooltip_parent_class)->unmap (self);
|
||||
|
||||
border_image = st_widget_get_border_image (ST_WIDGET (self));
|
||||
if (border_image)
|
||||
clutter_actor_unmap (border_image);
|
||||
|
||||
arrow_image = st_widget_get_background_image (ST_WIDGET (self));
|
||||
if (arrow_image)
|
||||
clutter_actor_unmap (arrow_image);
|
||||
|
||||
clutter_actor_unmap (priv->label);
|
||||
}
|
||||
|
||||
|
@ -242,6 +242,12 @@ st_widget_dispose (GObject *gobject)
|
||||
priv->background_image_shadow = NULL;
|
||||
}
|
||||
|
||||
if (priv->theme_node)
|
||||
{
|
||||
g_object_unref (priv->theme_node);
|
||||
priv->theme_node = NULL;
|
||||
}
|
||||
|
||||
if (priv->tooltip)
|
||||
{
|
||||
ClutterContainer *parent;
|
||||
@ -537,9 +543,8 @@ static void
|
||||
st_widget_paint (ClutterActor *self)
|
||||
{
|
||||
StWidgetPrivate *priv = ST_WIDGET (self)->priv;
|
||||
StWidgetClass *klass = ST_WIDGET_GET_CLASS (self);
|
||||
|
||||
klass->draw_background (ST_WIDGET (self));
|
||||
st_widget_real_draw_background (ST_WIDGET (self));
|
||||
|
||||
if (priv->background_image != NULL)
|
||||
{
|
||||
@ -905,8 +910,8 @@ st_widget_real_style_changed (StWidget *self)
|
||||
/* `border-image' takes precedence over `background-image'.
|
||||
* Firefox lets the background-image shine thru when border-image has
|
||||
* alpha an channel, maybe that would be an option for the future. */
|
||||
texture = st_texture_cache_get_texture (texture_cache,
|
||||
filename);
|
||||
texture = (ClutterTexture*) st_texture_cache_load_file_simple (texture_cache,
|
||||
filename);
|
||||
|
||||
clutter_texture_get_base_size (CLUTTER_TEXTURE (texture),
|
||||
&width, &height);
|
||||
@ -968,16 +973,8 @@ st_widget_real_style_changed (StWidget *self)
|
||||
bg_file = st_theme_node_get_background_image (theme_node);
|
||||
if (bg_file != NULL)
|
||||
{
|
||||
texture = st_texture_cache_get_texture (texture_cache, bg_file);
|
||||
priv->background_image = (ClutterActor*) texture;
|
||||
|
||||
if (priv->background_image != NULL)
|
||||
{
|
||||
clutter_actor_set_parent (priv->background_image,
|
||||
CLUTTER_ACTOR (self));
|
||||
}
|
||||
else
|
||||
g_warning ("Could not load %s", bg_file);
|
||||
priv->background_image = st_texture_cache_load_file_simple (texture_cache, bg_file);
|
||||
clutter_actor_set_parent (priv->background_image, CLUTTER_ACTOR (self));
|
||||
|
||||
has_changed = TRUE;
|
||||
relayout_needed = TRUE;
|
||||
@ -1110,8 +1107,7 @@ st_widget_get_theme_node (StWidget *widget)
|
||||
|
||||
if (stage == NULL)
|
||||
{
|
||||
g_warning ("st_widget_get_theme_node called on a widget not in a stage");
|
||||
stage = CLUTTER_STAGE (clutter_stage_get_default ());
|
||||
g_error ("st_widget_get_theme_node called on a widget not in a stage");
|
||||
}
|
||||
|
||||
if (parent_node == NULL)
|
||||
@ -1198,7 +1194,6 @@ st_widget_class_init (StWidgetClass *klass)
|
||||
actor_class->leave_event = st_widget_leave;
|
||||
actor_class->hide = st_widget_hide;
|
||||
|
||||
klass->draw_background = st_widget_real_draw_background;
|
||||
klass->style_changed = st_widget_real_style_changed;
|
||||
|
||||
/**
|
||||
@ -1581,40 +1576,6 @@ st_widget_set_direction (StWidget *self, StTextDirection dir)
|
||||
self->priv->direction = dir;
|
||||
}
|
||||
|
||||
/**
|
||||
* st_widget_get_border_image:
|
||||
* @actor: A #StWidget
|
||||
*
|
||||
* Get the texture used as the border image. This is set using the
|
||||
* "border-image" CSS property. This function should normally only be used
|
||||
* by subclasses.
|
||||
*
|
||||
* Returns: (transfer none): #ClutterActor
|
||||
*/
|
||||
ClutterActor *
|
||||
st_widget_get_border_image (StWidget *actor)
|
||||
{
|
||||
StWidgetPrivate *priv = ST_WIDGET (actor)->priv;
|
||||
return priv->border_image;
|
||||
}
|
||||
|
||||
/**
|
||||
* st_widget_get_background_image:
|
||||
* @actor: A #StWidget
|
||||
*
|
||||
* Get the texture used as the background image. This is set using the
|
||||
* "background-image" CSS property. This function should normally only be used
|
||||
* by subclasses.
|
||||
*
|
||||
* Returns: (transfer none): a #ClutterActor
|
||||
*/
|
||||
ClutterActor *
|
||||
st_widget_get_background_image (StWidget *actor)
|
||||
{
|
||||
StWidgetPrivate *priv = ST_WIDGET (actor)->priv;
|
||||
return priv->background_image;
|
||||
}
|
||||
|
||||
/**
|
||||
* st_widget_set_has_tooltip:
|
||||
* @widget: A #StWidget
|
||||
@ -1776,27 +1737,3 @@ st_widget_hide_tooltip (StWidget *widget)
|
||||
if (widget->priv->tooltip)
|
||||
st_tooltip_hide (widget->priv->tooltip);
|
||||
}
|
||||
|
||||
/**
|
||||
* st_widget_draw_background:
|
||||
* @widget: a #StWidget
|
||||
*
|
||||
* Invokes #StWidget::draw_background() using the default background
|
||||
* image and/or color from the @widget style
|
||||
*
|
||||
* This function should be used by subclasses of #StWidget that override
|
||||
* the paint() virtual function and cannot chain up
|
||||
*/
|
||||
void
|
||||
st_widget_draw_background (StWidget *self)
|
||||
{
|
||||
StWidgetPrivate *priv;
|
||||
StWidgetClass *klass;
|
||||
|
||||
g_return_if_fail (ST_IS_WIDGET (self));
|
||||
|
||||
priv = self->priv;
|
||||
|
||||
klass = ST_WIDGET_GET_CLASS (self);
|
||||
klass->draw_background (ST_WIDGET (self));
|
||||
}
|
||||
|
@ -78,7 +78,6 @@ struct _StWidgetClass
|
||||
ClutterActorClass parent_class;
|
||||
|
||||
/* vfuncs */
|
||||
void (* draw_background) (StWidget *self);
|
||||
void (* style_changed) (StWidget *self);
|
||||
};
|
||||
|
||||
@ -119,9 +118,6 @@ void st_widget_set_direction (StWidget *self, StTextDirection dir);
|
||||
void st_widget_style_changed (StWidget *widget);
|
||||
StThemeNode *st_widget_get_theme_node (StWidget *widget);
|
||||
|
||||
ClutterActor *st_widget_get_background_image (StWidget *actor);
|
||||
ClutterActor *st_widget_get_border_image (StWidget *actor);
|
||||
void st_widget_draw_background (StWidget *widget);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -9,6 +9,7 @@ TEST_JS = \
|
||||
interactive/entry.js \
|
||||
interactive/inline-style.js \
|
||||
interactive/scrolling.js \
|
||||
interactive/scroll-view-sizing.js \
|
||||
interactive/table.js \
|
||||
testcommon/border-image.png \
|
||||
testcommon/ui.js \
|
||||
|
348
tests/interactive/scroll-view-sizing.js
Normal file
348
tests/interactive/scroll-view-sizing.js
Normal file
@ -0,0 +1,348 @@
|
||||
/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
|
||||
const Clutter = imports.gi.Clutter;
|
||||
const Gtk = imports.gi.Gtk;
|
||||
const Lang = imports.lang;
|
||||
const Shell = imports.gi.Shell;
|
||||
const St = imports.gi.St;
|
||||
|
||||
const UI = imports.testcommon.ui;
|
||||
|
||||
// This is an interactive test of the sizing behavior of StScrollView. It
|
||||
// may be interesting in the future to split out the two classes at the
|
||||
// top into utility classes for testing the sizing behavior of other
|
||||
// containers and actors.
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
// FlowedBoxes: This is a simple actor that demonstrates an interesting
|
||||
// height-for-width behavior. A set of boxes of different sizes are line-wrapped
|
||||
// horizontally with the minimum horizontal size being determined by the
|
||||
// largest box. It would be easy to extend this to allow doing vertical
|
||||
// wrapping instead, if you wanted to see just how badly our width-for-height
|
||||
// implementation is or work on fixing it.
|
||||
|
||||
const BOX_HEIGHT = 20;
|
||||
const BOX_WIDTHS = [
|
||||
10, 40, 100, 20, 60, 30, 70, 10, 20, 200, 50, 70, 90, 20, 40
|
||||
];
|
||||
|
||||
const SPACING = 10;
|
||||
|
||||
function FlowedBoxes() {
|
||||
this._init();
|
||||
}
|
||||
|
||||
FlowedBoxes.prototype = {
|
||||
_init: function() {
|
||||
this.actor = new Shell.GenericContainer();
|
||||
this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
|
||||
this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
|
||||
this.actor.connect('allocate', Lang.bind(this, this._allocate));
|
||||
|
||||
for (let i = 0; i < BOX_WIDTHS.length; i++) {
|
||||
let child = new St.Bin({ width: BOX_WIDTHS[i], height: BOX_HEIGHT,
|
||||
style: 'border: 1px solid #444444; background: #00aa44' })
|
||||
this.actor.add_actor(child);
|
||||
}
|
||||
},
|
||||
|
||||
_getPreferredWidth: function (actor, forHeight, alloc) {
|
||||
let children = this.actor.get_children();
|
||||
|
||||
let maxMinWidth = 0;
|
||||
let totalNaturalWidth = 0;
|
||||
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
let child = children[i];
|
||||
let [minWidth, naturalWidth] = child.get_preferred_width(-1);
|
||||
maxMinWidth = Math.max(maxMinWidth, minWidth);
|
||||
if (i != 0)
|
||||
totalNaturalWidth += SPACING;
|
||||
totalNaturalWidth += naturalWidth;
|
||||
}
|
||||
|
||||
alloc.min_size = maxMinWidth;
|
||||
alloc.natural_size = totalNaturalWidth;
|
||||
},
|
||||
|
||||
_layoutChildren: function(forWidth, callback) {
|
||||
let children = this.actor.get_children();
|
||||
|
||||
let x = 0;
|
||||
let y = 0;
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
let child = children[i];
|
||||
let [minWidth, naturalWidth] = child.get_preferred_width(-1);
|
||||
let [minHeight, naturalHeight] = child.get_preferred_height(naturalWidth);
|
||||
|
||||
let x1 = x;
|
||||
if (x != 0)
|
||||
x1 += SPACING;
|
||||
let x2 = x1 + naturalWidth;
|
||||
|
||||
if (x2 > forWidth) {
|
||||
if (x > 0) {
|
||||
x1 = 0;
|
||||
y += BOX_HEIGHT + SPACING;
|
||||
}
|
||||
|
||||
x2 = naturalWidth;
|
||||
}
|
||||
|
||||
callback(child, x1, y, x2, y + naturalHeight);
|
||||
x = x2;
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
_getPreferredHeight: function (actor, forWidth, alloc) {
|
||||
let height = 0;
|
||||
this._layoutChildren(forWidth,
|
||||
function(child, x1, y1, x2, y2) {
|
||||
height = Math.max(height, y2);
|
||||
});
|
||||
|
||||
alloc.min_size = alloc.natural_size = height;
|
||||
},
|
||||
|
||||
_allocate: function (actor, box, flags) {
|
||||
this._layoutChildren(box.x2 - box.x1,
|
||||
function(child, x1, y1, x2, y2) {
|
||||
child.allocate(new Clutter.ActorBox({ x1: x1, y1: y1, x2: x2, y2: y2 }),
|
||||
flags);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
// SizingIllustrator: this is a container that allows interactively exploring
|
||||
// the sizing behavior of the child. Lines are drawn to indicate the minimum
|
||||
// and natural size of the child, and a drag handle allows the user to resize
|
||||
// the child interactively and see how that affects it.
|
||||
//
|
||||
// This is currently only written for the case where the child is height-for-width
|
||||
|
||||
function SizingIllustrator() {
|
||||
this._init();
|
||||
}
|
||||
|
||||
SizingIllustrator.prototype = {
|
||||
_init: function() {
|
||||
this.actor = new Shell.GenericContainer();
|
||||
|
||||
this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth));
|
||||
this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
|
||||
this.actor.connect('allocate', Lang.bind(this, this._allocate));
|
||||
|
||||
this.minWidthLine = new St.Bin({ style: 'background: red' });
|
||||
this.actor.add_actor(this.minWidthLine);
|
||||
this.minHeightLine = new St.Bin({ style: 'background: red' });
|
||||
this.actor.add_actor(this.minHeightLine);
|
||||
|
||||
this.naturalWidthLine = new St.Bin({ style: 'background: #4444ff' });
|
||||
this.actor.add_actor(this.naturalWidthLine);
|
||||
this.naturalHeightLine = new St.Bin({ style: 'background: #4444ff' });
|
||||
this.actor.add_actor(this.naturalHeightLine);
|
||||
|
||||
this.currentWidthLine = new St.Bin({ style: 'background: #aaaaaa' });
|
||||
this.actor.add_actor(this.currentWidthLine);
|
||||
this.currentHeightLine = new St.Bin({ style: 'background: #aaaaaa' });
|
||||
this.actor.add_actor(this.currentHeightLine);
|
||||
|
||||
this.handle = new St.Bin({ style: 'background: yellow; border: 1px solid black;',
|
||||
reactive: true });
|
||||
this.handle.connect('button-press-event', Lang.bind(this, this._handlePressed));
|
||||
this.handle.connect('button-release-event', Lang.bind(this, this._handleReleased));
|
||||
this.handle.connect('motion-event', Lang.bind(this, this._handleMotion));
|
||||
this.actor.add_actor(this.handle);
|
||||
|
||||
this._inDrag = false;
|
||||
|
||||
this.width = 300;
|
||||
this.height = 300;
|
||||
},
|
||||
|
||||
add: function(child) {
|
||||
this.child = child;
|
||||
this.actor.add_actor(this.child);
|
||||
this.child.lower_bottom();
|
||||
},
|
||||
|
||||
_getPreferredWidth: function (actor, forHeight, alloc) {
|
||||
let children = this.actor.get_children();
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
let child = children[i];
|
||||
let [minWidth, naturalWidth] = child.get_preferred_width(-1);
|
||||
if (child == this.child) {
|
||||
this.minWidth = minWidth;
|
||||
this.naturalWidth = naturalWidth;
|
||||
}
|
||||
}
|
||||
|
||||
alloc.min_size = 0;
|
||||
alloc.natural_size = 400;
|
||||
},
|
||||
|
||||
_getPreferredHeight: function (actor, forWidth, alloc) {
|
||||
let children = this.actor.get_children();
|
||||
for (let i = 0; i < children.length; i++) {
|
||||
let child = children[i];
|
||||
if (child == this.child) {
|
||||
[this.minHeight, this.naturalHeight] = child.get_preferred_height(this.width);
|
||||
} else {
|
||||
let [minWidth, naturalWidth] = child.get_preferred_width(-1);
|
||||
child.get_preferred_height(naturalWidth);
|
||||
}
|
||||
}
|
||||
|
||||
alloc.min_size = 0;
|
||||
alloc.natural_size = 400;
|
||||
},
|
||||
|
||||
_allocate: function (actor, box, flags) {
|
||||
let allocWidth = box.x2 - box.x1;
|
||||
let allocHeight = box.y2 - box.y1;
|
||||
|
||||
function alloc(child, x1, y1, x2, y2) {
|
||||
child.allocate(new Clutter.ActorBox({ x1: x1, y1: y1, x2: x2, y2: y2 }),
|
||||
flags);
|
||||
}
|
||||
|
||||
alloc(this.child, 0, 0, this.width, this.height);
|
||||
alloc(this.minWidthLine, this.minWidth, 0, this.minWidth + 1, allocHeight);
|
||||
alloc(this.naturalWidthLine, this.naturalWidth, 0, this.naturalWidth + 1, allocHeight);
|
||||
alloc(this.currentWidthLine, this.width, 0, this.width + 1, allocHeight);
|
||||
alloc(this.minHeightLine, 0, this.minHeight, allocWidth, this.minHeight + 1);
|
||||
alloc(this.naturalHeightLine, 0, this.naturalHeight, allocWidth, this.naturalHeight + 1);
|
||||
alloc(this.currentHeightLine, 0, this.height, allocWidth, this.height + 1);
|
||||
alloc(this.handle, this.width, this.height, this.width + 10, this.height + 10);
|
||||
},
|
||||
|
||||
_handlePressed: function(handle, event) {
|
||||
if (event.get_button() == 1) {
|
||||
this._inDrag = true;
|
||||
let [handleX, handleY] = handle.get_transformed_position();
|
||||
let [x, y] = event.get_coords();
|
||||
this._dragX = x - handleX;
|
||||
this._dragY = y - handleY;
|
||||
Clutter.grab_pointer(handle);
|
||||
}
|
||||
},
|
||||
|
||||
_handleReleased: function(handle, event) {
|
||||
if (event.get_button() == 1) {
|
||||
this._inDrag = false;
|
||||
Clutter.ungrab_pointer(handle);
|
||||
}
|
||||
},
|
||||
|
||||
_handleMotion: function(handle, event) {
|
||||
if (this._inDrag) {
|
||||
let [x, y] = event.get_coords();
|
||||
let [actorX, actorY] = this.actor.get_transformed_position();
|
||||
this.width = x - this._dragX - actorX;
|
||||
this.height = y - this._dragY - actorY;
|
||||
this.actor.queue_relayout();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
UI.init();
|
||||
let stage = Clutter.Stage.get_default();
|
||||
stage.width = 600;
|
||||
stage.height = 600;
|
||||
|
||||
let mainBox = new St.BoxLayout({ width: stage.width,
|
||||
height: stage.height,
|
||||
vertical: true,
|
||||
style: 'padding: 10px;'
|
||||
+ 'spacing: 5px;'
|
||||
+ 'font: 16px sans-serif;'
|
||||
+ 'background: black;'
|
||||
+ 'color: white;' });
|
||||
stage.add_actor(mainBox);
|
||||
|
||||
const DOCS = 'Red lines represent minimum size, blue lines natural size. Drag yellow handle to resize ScrollView. Click on options to change.';
|
||||
|
||||
let docsLabel = new St.Label({ text: DOCS });
|
||||
docsLabel.clutter_text.line_wrap = true;
|
||||
mainBox.add(docsLabel);
|
||||
|
||||
let bin = new St.Bin({ x_fill: true, y_fill: true, style: 'border: 2px solid #666666;' });
|
||||
mainBox.add(bin, { x_fill: true, y_fill: true, expand: true });
|
||||
|
||||
let illustrator = new SizingIllustrator();
|
||||
bin.add_actor(illustrator.actor);
|
||||
|
||||
let scrollView = new St.ScrollView();
|
||||
illustrator.add(scrollView);
|
||||
|
||||
let box = new St.BoxLayout({ vertical: true });
|
||||
scrollView.add_actor(box);
|
||||
|
||||
let flowedBoxes = new FlowedBoxes();
|
||||
box.add(flowedBoxes.actor, { expand: false, x_fill: true, y_fill: true });
|
||||
|
||||
let policyBox = new St.BoxLayout({ vertical: false });
|
||||
mainBox.add(policyBox);
|
||||
|
||||
policyBox.add(new St.Label({ text: 'Horizontal Policy: ' }));
|
||||
let hpolicy = new St.Button({ label: 'AUTOMATIC', style: 'text-decoration: underline; color: #4444ff;' });
|
||||
policyBox.add(hpolicy);
|
||||
|
||||
let spacer = new St.Bin();
|
||||
policyBox.add(spacer, { expand: true });
|
||||
|
||||
policyBox.add(new St.Label({ text: 'Vertical Policy: '}));
|
||||
let vpolicy = new St.Button({ label: 'AUTOMATIC', style: 'text-decoration: underline; color: #4444ff;' });
|
||||
policyBox.add(vpolicy);
|
||||
|
||||
function togglePolicy(button) {
|
||||
switch(button.label) {
|
||||
case 'AUTOMATIC':
|
||||
button.label = 'ALWAYS';
|
||||
break;
|
||||
case 'ALWAYS':
|
||||
button.label = 'NEVER';
|
||||
break;
|
||||
case 'NEVER':
|
||||
button.label = 'AUTOMATIC';
|
||||
break;
|
||||
}
|
||||
scrollView.set_policy(Gtk.PolicyType[hpolicy.label], Gtk.PolicyType[vpolicy.label]);
|
||||
}
|
||||
|
||||
hpolicy.connect('clicked', function() { togglePolicy(hpolicy); });
|
||||
vpolicy.connect('clicked', function() { togglePolicy(vpolicy); });
|
||||
|
||||
let shadowsBox = new St.BoxLayout({ vertical: false });
|
||||
mainBox.add(shadowsBox);
|
||||
|
||||
spacer = new St.Bin();
|
||||
shadowsBox.add(spacer, { expand: true });
|
||||
|
||||
shadowsBox.add(new St.Label({ text: 'Vertical Shadows: '}));
|
||||
let vshadows = new St.Button({ label: 'No', style: 'text-decoration: underline; color: #4444ff;' });
|
||||
shadowsBox.add(vshadows);
|
||||
|
||||
function toggleShadows(button) {
|
||||
switch(button.label) {
|
||||
case 'No':
|
||||
button.label = 'Yes';
|
||||
break;
|
||||
case 'Yes':
|
||||
button.label = 'No';
|
||||
break;
|
||||
}
|
||||
scrollView.set_vshadows(vshadows.label == 'Yes');
|
||||
}
|
||||
|
||||
vshadows.connect('clicked', function() { toggleShadows(vshadows); });
|
||||
|
||||
stage.show();
|
||||
Clutter.main();
|
||||
stage.destroy();
|
@ -14,7 +14,36 @@
|
||||
<branch repo="git.gnome.org" module="gobject-introspection"/>
|
||||
</autotools>
|
||||
|
||||
<autotools id="gir-repository">
|
||||
<autotools id="glib">
|
||||
<branch repo="git.gnome.org" module="glib"/>
|
||||
</autotools>
|
||||
|
||||
<autotools id="atk">
|
||||
<branch repo="git.gnome.org" module="atk"/>
|
||||
<dependencies>
|
||||
<dep package="glib"/>
|
||||
<dep package="gobject-introspection"/>
|
||||
</dependencies>
|
||||
</autotools>
|
||||
|
||||
<autotools id="pango">
|
||||
<branch repo="git.gnome.org" module="pango"/>
|
||||
<dependencies>
|
||||
<dep package="glib"/>
|
||||
<dep package="gobject-introspection"/>
|
||||
</dependencies>
|
||||
</autotools>
|
||||
|
||||
<autotools id="gtk+">
|
||||
<branch repo="git.gnome.org" module="gtk+"/>
|
||||
<dependencies>
|
||||
<dep package="glib"/>
|
||||
<dep package="pango"/>
|
||||
<dep package="atk"/>
|
||||
</dependencies>
|
||||
</autotools>
|
||||
|
||||
<autotools id="gir-repository" autogenargs="--with-skipped-gir-modules=Gst,Poppler,WebKit,GSSDP,Unique,GMenu,Wnck,GooCanvas,Notify,GnomeKeyring">
|
||||
<branch repo="git.gnome.org" module="gir-repository"/>
|
||||
<dependencies>
|
||||
<dep package="gobject-introspection"/>
|
||||
@ -32,11 +61,13 @@
|
||||
</autotools>
|
||||
|
||||
<autotools id="clutter">
|
||||
<branch repo="git.clutter-project.org" module="clutter" revision="clutter-1.0"/>
|
||||
<branch repo="git.clutter-project.org" module="clutter" revision="clutter-1.2"/>
|
||||
<dependencies>
|
||||
<dep package="gobject-introspection"/>
|
||||
<dep package="gir-repository"/>
|
||||
</dependencies>
|
||||
<after>
|
||||
<dep package="gir-repository"/>
|
||||
</after>
|
||||
</autotools>
|
||||
|
||||
<autotools id="gconf" autogenargs="--disable-defaults-service">
|
||||
@ -46,21 +77,36 @@
|
||||
<autotools id="mutter" autogenargs="--with-clutter">
|
||||
<branch repo="git.gnome.org" module="mutter"/>
|
||||
<dependencies>
|
||||
<dep package="gir-repository"/>
|
||||
<dep package="clutter"/>
|
||||
<dep package="gconf"/>
|
||||
</dependencies>
|
||||
<after>
|
||||
<dep package="gtk+"/>
|
||||
</after>
|
||||
</autotools>
|
||||
|
||||
<autotools id="gnome-shell">
|
||||
<branch repo="git.gnome.org" module="gnome-shell"/>
|
||||
<dependencies>
|
||||
<dep package="gobject-introspection"/>
|
||||
<dep package="gir-repository"/>
|
||||
<dep package="mutter"/>
|
||||
<dep package="gjs"/>
|
||||
<dep package="gconf"/>
|
||||
</dependencies>
|
||||
</autotools>
|
||||
|
||||
<metamodule id="gnome-shell-using-gir-repository">
|
||||
<dependencies>
|
||||
<dep package="gir-repository"/>
|
||||
<dep package="gnome-shell"/>
|
||||
</dependencies>
|
||||
</metamodule>
|
||||
|
||||
<metamodule id="gnome-shell-full">
|
||||
<dependencies>
|
||||
<dep package="gtk+"/>
|
||||
<dep package="gnome-shell"/>
|
||||
</dependencies>
|
||||
</metamodule>
|
||||
|
||||
</moduleset>
|
||||
|
@ -20,7 +20,9 @@ build_policy = 'updated'
|
||||
|
||||
moduleset = 'http://git.gnome.org/browse/gnome-shell/plain/tools/build/gnome-shell.modules'
|
||||
|
||||
modules = [ 'gnome-shell' ]
|
||||
modules = [ 'gnome-shell-using-gir-repository' ]
|
||||
# Enable this one to use introspection built from the stack itself
|
||||
# modules = [ 'gnome-shell-full' ]
|
||||
|
||||
# what directory should the source be checked out to?
|
||||
checkoutroot = os.path.expanduser('~/gnome-shell/source')
|
||||
|
Reference in New Issue
Block a user