[gnome-shell] New workspace switcher popup
- From: Adel Gadllah <agadllah src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-shell] New workspace switcher popup
- Date: Fri, 12 Feb 2010 22:53:27 +0000 (UTC)
commit abc7b1ff02ee19abee3f0ca3e632f099a3f60ba3
Author: Adel Gadllah <adel gadllah gmail com>
Date: Fri Feb 12 23:52:15 2010 +0100
New workspace switcher popup
Replace the current workspace switcher popup (which is still the old metacity popup), with a clutter based one, which fits better into the overall shell design.
https://bugzilla.gnome.org/show_bug.cgi?id=609187
data/theme/gnome-shell.css | 49 +++++
data/theme/ws-switch-arrow-left.svg | 96 ++++++++++
data/theme/ws-switch-arrow-right.svg | 331 ++++++++++++++++++++++++++++++++++
js/ui/windowManager.js | 48 +++++
js/ui/workspaceSwitcherPopup.js | 100 ++++++++++
5 files changed, 624 insertions(+), 0 deletions(-)
---
diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css
index e79a8cb..73ab69e 100644
--- a/data/theme/gnome-shell.css
+++ b/data/theme/gnome-shell.css
@@ -668,3 +668,52 @@ StTooltip {
height: 52px;
background-image: url("corner-ripple.png");
}
+
+/* Workspace Switcher */
+.workspace-switcher-container {
+ background: rgba(0,0,0,0.8);
+ border: 1px solid rgba(128,128,128,0.40);
+ border-radius: 8px;
+ padding: 12px;
+}
+
+.workspace-switcher {
+ background: transparent;
+ border: 0px;
+ border-radius: 0px;
+ padding: 4px;
+}
+
+.ws-switcher-active-left {
+ width: 98px;
+ height: 98px;
+ border: 0px;
+ background: rgba(255,255,255,0.5);
+ background-image: url("ws-switch-arrow-left.svg");
+ border-radius: 4px;
+}
+
+.ws-switcher-active-right {
+ width: 98px;
+ height: 98px;
+ border: 0px;
+ background: rgba(255,255,255,0.5);
+ background-image: url("ws-switch-arrow-right.svg");
+ border-radius: 4px;
+}
+
+.ws-switcher-spacer {
+ width: 0.5px;
+ height: 96px;
+ border: 0px;
+ background: transparent;
+ padding: 4px;
+}
+
+.ws-switcher-box {
+ width: 96px;
+ height: 96px;
+ border: 2px solid rgba(85,85,85,0.5);
+ background: transparent;
+ border-radius: 4px;
+}
diff --git a/data/theme/ws-switch-arrow-left.svg b/data/theme/ws-switch-arrow-left.svg
new file mode 100644
index 0000000..a1e1b9c
--- /dev/null
+++ b/data/theme/ws-switch-arrow-left.svg
@@ -0,0 +1,96 @@
+<?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="96" height="96" id="svg25070" version="1.1" inkscape:version="0.47 r22583" sodipodi:docname="dark-arrow-larger.svg">
+ <defs id="defs25072">
+ <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="perspective25078"/>
+ <inkscape:perspective id="perspective24985" 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"/>
+ <linearGradient inkscape:collect="always" xlink:href="#linearGradient4034-0-4" id="linearGradient24957" gradientUnits="userSpaceOnUse" gradientTransform="translate(6)" x1="-86.552246" y1="185.439" x2="-83.37072" y2="197.31261"/>
+ <linearGradient inkscape:collect="always" id="linearGradient4034-0-4">
+ <stop style="stop-color: rgb(238, 238, 236); stop-opacity: 1;" offset="0" id="stop4036-5-7"/>
+ <stop style="stop-color: rgb(186, 189, 182); stop-opacity: 1;" offset="1" id="stop4038-9-6"/>
+ </linearGradient>
+ <filter id="filter24765" inkscape:label="Invert" x="0" y="0" width="1" height="1" inkscape:menu="Color" inkscape:menu-tooltip="Invert colors" color-interpolation-filters="sRGB">
+ <feColorMatrix id="feColorMatrix24767" type="saturate" values="1" result="fbSourceGraphic"/>
+ <feColorMatrix id="feColorMatrix24769" in="fbSourceGraphic" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"/>
+ </filter>
+ <linearGradient inkscape:collect="always" xlink:href="#linearGradient4632-1-3-9-3-2" id="linearGradient24955" gradientUnits="userSpaceOnUse" gradientTransform="translate(-5)" x1="-74.520325" y1="169.06032" x2="-74.520325" y2="205.94189"/>
+ <linearGradient id="linearGradient4632-1-3-9-3-2">
+ <stop style="stop-color: rgb(238, 238, 236); stop-opacity: 1;" offset="0" id="stop4634-1-8-3-9-0"/>
+ <stop id="stop4636-1-9-9-8-8" offset="0.0274937" style="stop-color: rgb(255, 255, 255); stop-opacity: 1;"/>
+ <stop id="stop4638-8-3-9-6-6" offset="0.274937" style="stop-color: rgb(242, 242, 242); stop-opacity: 1;"/>
+ <stop id="stop4640-8-5-7-8-9" offset="0.38707438" style="stop-color: rgb(238, 238, 236); stop-opacity: 1;"/>
+ <stop id="stop4642-5-41-9-6-9" offset="0.66528589" style="stop-color: rgb(217, 218, 216); stop-opacity: 1;"/>
+ <stop id="stop4644-5-2-7-9-2" offset="0.76745707" style="stop-color: rgb(223, 224, 221); stop-opacity: 1;"/>
+ <stop style="stop-color: rgb(240, 240, 240); stop-opacity: 1;" offset="1" id="stop4646-3-2-3-7-3"/>
+ </linearGradient>
+ <radialGradient inkscape:collect="always" xlink:href="#linearGradient4869-4-1" id="radialGradient24959" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.0075, 0, 0, 1.0075, -5.4544, -1.25141)" cx="-33.412369" cy="185.74171" fx="-33.412369" fy="185.74171" r="2.3554697"/>
+ <linearGradient id="linearGradient4869-4-1">
+ <stop style="stop-color: rgb(255, 255, 255); stop-opacity: 1;" offset="0" id="stop4871-6-2"/>
+ <stop id="stop4879-7-4" offset="0.31807542" style="stop-color: rgb(238, 238, 236); stop-opacity: 1;"/>
+ <stop id="stop4877-6-1" offset="0.74691135" style="stop-color: rgb(200, 201, 198); stop-opacity: 1;"/>
+ <stop style="stop-color: rgb(211, 215, 207); stop-opacity: 1;" offset="1" id="stop4873-1-0"/>
+ </linearGradient>
+ <filter id="filter25011" inkscape:label="Invert" x="0" y="0" width="1" height="1" inkscape:menu="Color" inkscape:menu-tooltip="Invert colors" color-interpolation-filters="sRGB">
+ <feColorMatrix id="feColorMatrix25013" type="saturate" values="1" result="fbSourceGraphic"/>
+ <feColorMatrix id="feColorMatrix25015" in="fbSourceGraphic" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"/>
+ </filter>
+ <radialGradient inkscape:collect="always" xlink:href="#linearGradient4869-4-0" id="radialGradient24961" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.0075, 0, 0, 1.0075, -5.4544, -1.25141)" cx="-33.412369" cy="185.74171" fx="-33.412369" fy="185.74171" r="2.3554697"/>
+ <linearGradient id="linearGradient4869-4-0">
+ <stop style="stop-color: rgb(255, 255, 255); stop-opacity: 1;" offset="0" id="stop4871-6-8"/>
+ <stop id="stop4879-7-5" offset="0.31807542" style="stop-color: rgb(238, 238, 236); stop-opacity: 1;"/>
+ <stop id="stop4877-6-5" offset="0.74691135" style="stop-color: rgb(200, 201, 198); stop-opacity: 1;"/>
+ <stop style="stop-color: rgb(211, 215, 207); stop-opacity: 1;" offset="1" id="stop4873-1-4"/>
+ </linearGradient>
+ <filter id="filter25023" inkscape:label="Invert" x="0" y="0" width="1" height="1" inkscape:menu="Color" inkscape:menu-tooltip="Invert colors" color-interpolation-filters="sRGB">
+ <feColorMatrix id="feColorMatrix25025" type="saturate" values="1" result="fbSourceGraphic"/>
+ <feColorMatrix id="feColorMatrix25027" in="fbSourceGraphic" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"/>
+ </filter>
+ <linearGradient inkscape:collect="always" xlink:href="#linearGradient4941" id="linearGradient24963" gradientUnits="userSpaceOnUse" x1="-39.858727" y1="184.61784" x2="-38.244785" y2="188.84898"/>
+ <linearGradient inkscape:collect="always" id="linearGradient4941">
+ <stop style="stop-color: rgb(255, 255, 255); stop-opacity: 1;" offset="0" id="stop4943"/>
+ <stop style="stop-color: rgb(255, 255, 255); stop-opacity: 0;" offset="1" id="stop4945"/>
+ </linearGradient>
+ <filter id="filter25033" inkscape:label="Invert" x="0" y="0" width="1" height="1" inkscape:menu="Color" inkscape:menu-tooltip="Invert colors" color-interpolation-filters="sRGB">
+ <feColorMatrix id="feColorMatrix25035" type="saturate" values="1" result="fbSourceGraphic"/>
+ <feColorMatrix id="feColorMatrix25037" in="fbSourceGraphic" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"/>
+ </filter>
+ <linearGradient inkscape:collect="always" xlink:href="#linearGradient4941-7" id="linearGradient24965" gradientUnits="userSpaceOnUse" x1="-39.858727" y1="184.61784" x2="-38.244785" y2="188.84898"/>
+ <linearGradient inkscape:collect="always" id="linearGradient4941-7">
+ <stop style="stop-color: rgb(255, 255, 255); stop-opacity: 1;" offset="0" id="stop4943-2"/>
+ <stop style="stop-color: rgb(255, 255, 255); stop-opacity: 0;" offset="1" id="stop4945-5"/>
+ </linearGradient>
+ <filter id="filter25043" inkscape:label="Invert" x="0" y="0" width="1" height="1" inkscape:menu="Color" inkscape:menu-tooltip="Invert colors" color-interpolation-filters="sRGB">
+ <feColorMatrix id="feColorMatrix25045" type="saturate" values="1" result="fbSourceGraphic"/>
+ <feColorMatrix id="feColorMatrix25047" in="fbSourceGraphic" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"/>
+ </filter>
+ <filter id="filter25049" inkscape:label="Invert" x="0" y="0" width="1" height="1" inkscape:menu="Color" inkscape:menu-tooltip="Invert colors" color-interpolation-filters="sRGB">
+ <feColorMatrix id="feColorMatrix25051" type="saturate" values="1" result="fbSourceGraphic"/>
+ <feColorMatrix id="feColorMatrix25053" in="fbSourceGraphic" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"/>
+ </filter>
+ <filter id="filter25055" inkscape:label="Invert" x="0" y="0" width="1" height="1" inkscape:menu="Color" inkscape:menu-tooltip="Invert colors" color-interpolation-filters="sRGB">
+ <feColorMatrix id="feColorMatrix25057" type="saturate" values="1" result="fbSourceGraphic"/>
+ <feColorMatrix id="feColorMatrix25059" in="fbSourceGraphic" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"/>
+ </filter>
+ </defs>
+ <sodipodi:namedview id="base" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="2.8284271" inkscape:cx="48.631638" inkscape:cy="57.536221" inkscape:current-layer="layer1" showgrid="true" inkscape:grid-bbox="true" inkscape:document-units="px" inkscape:window-width="1200" inkscape:window-height="851" inkscape:window-x="0" inkscape:window-y="52" inkscape:window-maximized="0"/>
+ <metadata id="metadata25075">
+ <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/>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g id="layer1" inkscape:label="Layer 1" inkscape:groupmode="layer" transform="translate(0, 48)">
+ <g id="g4030-1-8" transform="matrix(2, 0, 0, 2, 193.25, -374.967)" style="stroke: rgb(0, 0, 0); display: inline; stroke-opacity: 1;">
+ <path sodipodi:nodetypes="ccc" id="path3165-7-3" d="m -72.5,173.5 -14,14 14,14" style="overflow: visible; marker: none; color: rgb(0, 0, 0); fill: none; stroke: rgb(0, 0, 0); stroke-width: 7; stroke-linecap: round; stroke-linejoin: miter; stroke-miterlimit: 4; stroke-opacity: 1; stroke-dasharray: none; stroke-dashoffset: 0pt; visibility: visible; display: inline;"/>
+ </g>
+ <path sodipodi:type="arc" style="overflow: visible; marker: none; color: rgb(0, 0, 0); fill: rgb(0, 0, 0); fill-opacity: 1; fill-rule: nonzero; stroke: none; stroke-width: 0.523439; visibility: visible; display: inline;" id="path4050-2-7-9-4" sodipodi:cx="-38.59375" sodipodi:cy="186.40625" sodipodi:rx="2.09375" sodipodi:ry="2.09375" d="m -36.5,186.40625 a 2.09375,2.09375 0 1 1 -4.1875,0 2.09375,2.09375 0 1 1 4.1875,0 z" transform="matrix(3.34328, 0, 0, 3.34328, 185.28, -623.176)"/>
+ <path sodipodi:type="arc" style="overflow: visible; marker: none; color: rgb(0, 0, 0); fill: rgb(0, 0, 0); fill-opacity: 1; fill-rule: nonzero; stroke: none; stroke-width: 0.523439; visibility: visible; display: inline;" id="path4050-2-7-9-4-8" sodipodi:cx="-38.59375" sodipodi:cy="186.40625" sodipodi:rx="2.09375" sodipodi:ry="2.09375" d="m -36.5,186.40625 a 2.09375,2.09375 0 1 1 -4.1875,0 2.09375,2.09375 0 1 1 4.1875,0 z" transform="matrix(3.34328, 0, 0, 3.34328, 207.28, -623.176)"/>
+ <path sodipodi:type="arc" style="overflow: visible; marker: none; color: rgb(0, 0, 0); fill: none; stroke: rgb(0, 0, 0); stroke-width: 0.697921; stroke-linecap: round; stroke-linejoin: miter; stroke-miterlimit: 4; stroke-opacity: 1; stroke-dasharray: none; stroke-dashoffset: 0pt; visibility: visible; display: inline;" id="path4050-2-7-9-4-0" sodipodi:cx="-38.59375" sodipodi:cy="186.40625" sodipodi:rx="2.09375" sodipodi:ry="2.09375" d="m -36.5,186.40625 a 2.09375,2.09375 0 1 1 -4.1875,0 2.09375,2.09375 0 1 1 4.1875,0 z" transform="matrix(2.86565, 0, 0, 2.86565, 166.846, -534.143)"/>
+ <path sodipodi:type="arc" style="overflow: visible; marker: none; color: rgb(0, 0, 0); fill: none; stroke: rgb(0, 0, 0); stroke-width: 0.697921; stroke-linecap: round; stroke-linejoin: miter; stroke-miterlimit: 4; stroke-opacity: 1; stroke-dasharray: none; stroke-dashoffset: 0pt; visibility: visible; display: inline;" id="path4050-2-7-9-4-0-9" sodipodi:cx="-38.59375" sodipodi:cy="186.40625" sodipodi:rx="2.09375" sodipodi:ry="2.09375" d="m -36.5,186.40625 a 2.09375,2.09375 0 1 1 -4.1875,0 2.09375,2.09375 0 1 1 4.1875,0 z" transform="matrix(2.86565, 0, 0, 2.86565, 188.846, -534.143)"/>
+ <path style="overflow: visible; marker: none; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; text-indent: 0pt; text-align: start; text-decoration: none; line-height: normal; letter-spacing: normal; word-spacing: normal; text-transform: none; direction: ltr; text-anchor: start; opacity: 0.35; color: rgb(0, 0, 0); fill: none; stroke: rgb(0, 0, 0); stroke-width: 1; stroke-miterlimit: 4; stroke-dasharray: none; visibility: visible; display: inline; font-family: Bitstream Vera Sans; stroke-opacity: 1;" d="m 317.06251,365.96875 c -0.76948,0.0224 -1.52555,0.35464 -2.0625,0.90625 l -16.125,16.125 16.125,16.125 c 1.11265,1.11265 3.13735,1.11265 4.25,0 1.11265,-1.11264 1.11265,-3.13735 0,-4.25 l -11.875,-11.875 11.875,-11.875 c 0.86584,-0.83655 1.1475,-2.22114 0.6773,-3.32947 -0.47021,-1.10834 -1.66156,-1.86802 -2.8648,-1.82678 z" id="path3165-7-3-1" sodipodi:nodetypes="ccccscccsc" transform="matrix(2, 0, 0, 2, -586, -765.96
7)"/>
+ <path style="overflow: visible; marker: none; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; text-indent: 0pt; text-align: start; text-decoration: none; line-height: normal; letter-spacing: normal; word-spacing: normal; text-transform: none; direction: ltr; text-anchor: start; color: rgb(0, 0, 0); fill: none; stroke: rgb(0, 0, 0); stroke-width: 1; stroke-linecap: round; stroke-miterlimit: 4; stroke-dasharray: none; visibility: visible; display: inline; font-family: Bitstream Vera Sans; stroke-opacity: 1;" d="m 320.08435,397.03059 c 0.007,-0.79449 -0.27079,-1.59203 -0.83434,-2.15559 L 307.37501,383 m 12.5523,-15.20447 c -0.47021,-1.10834 -1.66156,-1.86802 -2.8648,-1.82678 -0.76948,0.0224 -1.52555,0.35464 -2.0625,0.90625 L 298.87501,383" id="path3165-7-3-1-9" sodipodi:nodetypes="ccccccc" transform="matrix(2, 0, 0, 2, -586, -765.967)"/>
+ </g>
+</svg>
\ No newline at end of file
diff --git a/data/theme/ws-switch-arrow-right.svg b/data/theme/ws-switch-arrow-right.svg
new file mode 100644
index 0000000..03d7f83
--- /dev/null
+++ b/data/theme/ws-switch-arrow-right.svg
@@ -0,0 +1,331 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ version="1.1"
+ width="96"
+ height="96"
+ id="svg25070">
+ <defs
+ id="defs25072">
+ <linearGradient
+ x1="-86.552246"
+ y1="185.439"
+ x2="-83.37072"
+ y2="197.31261"
+ id="linearGradient24957"
+ xlink:href="#linearGradient4034-0-4"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(6,0)" />
+ <linearGradient
+ id="linearGradient4034-0-4">
+ <stop
+ id="stop4036-5-7"
+ style="stop-color:#eeeeec;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop4038-9-6"
+ style="stop-color:#babdb6;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <filter
+ x="0"
+ y="0"
+ width="1"
+ height="1"
+ color-interpolation-filters="sRGB"
+ id="filter24765">
+ <feColorMatrix
+ result="fbSourceGraphic"
+ values="1"
+ type="saturate"
+ id="feColorMatrix24767" />
+ <feColorMatrix
+ values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
+ in="fbSourceGraphic"
+ id="feColorMatrix24769" />
+ </filter>
+ <linearGradient
+ x1="-74.520325"
+ y1="169.06032"
+ x2="-74.520325"
+ y2="205.94189"
+ id="linearGradient24955"
+ xlink:href="#linearGradient4632-1-3-9-3-2"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="translate(-5,0)" />
+ <linearGradient
+ id="linearGradient4632-1-3-9-3-2">
+ <stop
+ id="stop4634-1-8-3-9-0"
+ style="stop-color:#eeeeec;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop4636-1-9-9-8-8"
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="0.0274937" />
+ <stop
+ id="stop4638-8-3-9-6-6"
+ style="stop-color:#f2f2f2;stop-opacity:1"
+ offset="0.274937" />
+ <stop
+ id="stop4640-8-5-7-8-9"
+ style="stop-color:#eeeeec;stop-opacity:1"
+ offset="0.38707438" />
+ <stop
+ id="stop4642-5-41-9-6-9"
+ style="stop-color:#d9dad8;stop-opacity:1"
+ offset="0.66528589" />
+ <stop
+ id="stop4644-5-2-7-9-2"
+ style="stop-color:#dfe0dd;stop-opacity:1"
+ offset="0.76745707" />
+ <stop
+ id="stop4646-3-2-3-7-3"
+ style="stop-color:#f0f0f0;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <radialGradient
+ cx="-33.412369"
+ cy="185.74171"
+ r="2.3554697"
+ fx="-33.412369"
+ fy="185.74171"
+ id="radialGradient24959"
+ xlink:href="#linearGradient4869-4-1"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.0075,0,0,1.0075,-5.4544,-1.25141)" />
+ <linearGradient
+ id="linearGradient4869-4-1">
+ <stop
+ id="stop4871-6-2"
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop4879-7-4"
+ style="stop-color:#eeeeec;stop-opacity:1"
+ offset="0.31807542" />
+ <stop
+ id="stop4877-6-1"
+ style="stop-color:#c8c9c6;stop-opacity:1"
+ offset="0.74691135" />
+ <stop
+ id="stop4873-1-0"
+ style="stop-color:#d3d7cf;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <filter
+ x="0"
+ y="0"
+ width="1"
+ height="1"
+ color-interpolation-filters="sRGB"
+ id="filter25011">
+ <feColorMatrix
+ result="fbSourceGraphic"
+ values="1"
+ type="saturate"
+ id="feColorMatrix25013" />
+ <feColorMatrix
+ values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
+ in="fbSourceGraphic"
+ id="feColorMatrix25015" />
+ </filter>
+ <radialGradient
+ cx="-33.412369"
+ cy="185.74171"
+ r="2.3554697"
+ fx="-33.412369"
+ fy="185.74171"
+ id="radialGradient24961"
+ xlink:href="#linearGradient4869-4-0"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(1.0075,0,0,1.0075,-5.4544,-1.25141)" />
+ <linearGradient
+ id="linearGradient4869-4-0">
+ <stop
+ id="stop4871-6-8"
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop4879-7-5"
+ style="stop-color:#eeeeec;stop-opacity:1"
+ offset="0.31807542" />
+ <stop
+ id="stop4877-6-5"
+ style="stop-color:#c8c9c6;stop-opacity:1"
+ offset="0.74691135" />
+ <stop
+ id="stop4873-1-4"
+ style="stop-color:#d3d7cf;stop-opacity:1"
+ offset="1" />
+ </linearGradient>
+ <filter
+ x="0"
+ y="0"
+ width="1"
+ height="1"
+ color-interpolation-filters="sRGB"
+ id="filter25023">
+ <feColorMatrix
+ result="fbSourceGraphic"
+ values="1"
+ type="saturate"
+ id="feColorMatrix25025" />
+ <feColorMatrix
+ values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
+ in="fbSourceGraphic"
+ id="feColorMatrix25027" />
+ </filter>
+ <linearGradient
+ x1="-39.858727"
+ y1="184.61784"
+ x2="-38.244785"
+ y2="188.84898"
+ id="linearGradient24963"
+ xlink:href="#linearGradient4941"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ id="linearGradient4941">
+ <stop
+ id="stop4943"
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop4945"
+ style="stop-color:#ffffff;stop-opacity:0"
+ offset="1" />
+ </linearGradient>
+ <filter
+ x="0"
+ y="0"
+ width="1"
+ height="1"
+ color-interpolation-filters="sRGB"
+ id="filter25033">
+ <feColorMatrix
+ result="fbSourceGraphic"
+ values="1"
+ type="saturate"
+ id="feColorMatrix25035" />
+ <feColorMatrix
+ values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
+ in="fbSourceGraphic"
+ id="feColorMatrix25037" />
+ </filter>
+ <linearGradient
+ x1="-39.858727"
+ y1="184.61784"
+ x2="-38.244785"
+ y2="188.84898"
+ id="linearGradient24965"
+ xlink:href="#linearGradient4941-7"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ id="linearGradient4941-7">
+ <stop
+ id="stop4943-2"
+ style="stop-color:#ffffff;stop-opacity:1"
+ offset="0" />
+ <stop
+ id="stop4945-5"
+ style="stop-color:#ffffff;stop-opacity:0"
+ offset="1" />
+ </linearGradient>
+ <filter
+ x="0"
+ y="0"
+ width="1"
+ height="1"
+ color-interpolation-filters="sRGB"
+ id="filter25043">
+ <feColorMatrix
+ result="fbSourceGraphic"
+ values="1"
+ type="saturate"
+ id="feColorMatrix25045" />
+ <feColorMatrix
+ values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
+ in="fbSourceGraphic"
+ id="feColorMatrix25047" />
+ </filter>
+ <filter
+ x="0"
+ y="0"
+ width="1"
+ height="1"
+ color-interpolation-filters="sRGB"
+ id="filter25049">
+ <feColorMatrix
+ result="fbSourceGraphic"
+ values="1"
+ type="saturate"
+ id="feColorMatrix25051" />
+ <feColorMatrix
+ values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
+ in="fbSourceGraphic"
+ id="feColorMatrix25053" />
+ </filter>
+ <filter
+ x="0"
+ y="0"
+ width="1"
+ height="1"
+ color-interpolation-filters="sRGB"
+ id="filter25055">
+ <feColorMatrix
+ result="fbSourceGraphic"
+ values="1"
+ type="saturate"
+ id="feColorMatrix25057" />
+ <feColorMatrix
+ values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"
+ in="fbSourceGraphic"
+ id="feColorMatrix25059" />
+ </filter>
+ </defs>
+ <g
+ transform="translate(0,48)"
+ id="layer1">
+ <g
+ transform="matrix(-2,0,0,2,-97.2497,-374.967)"
+ id="g4030-1-8"
+ style="stroke:#000000;stroke-opacity:1;display:inline">
+ <path
+ d="m -72.5,173.5 -14,14 14,14"
+ id="path3165-7-3"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:7;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" />
+ </g>
+ <path
+ d="m -36.5,186.40625 a 2.09375,2.09375 0 1 1 -4.1875,0 2.09375,2.09375 0 1 1 4.1875,0 z"
+ transform="matrix(-3.34328,0,0,3.34328,-89.2797,-623.176)"
+ id="path4050-2-7-9-4"
+ style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.52343899;marker:none;visibility:visible;display:inline;overflow:visible" />
+ <path
+ d="m -36.5,186.40625 a 2.09375,2.09375 0 1 1 -4.1875,0 2.09375,2.09375 0 1 1 4.1875,0 z"
+ transform="matrix(-3.34328,0,0,3.34328,-111.2797,-623.176)"
+ id="path4050-2-7-9-4-8"
+ style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.52343899;marker:none;visibility:visible;display:inline;overflow:visible" />
+ <path
+ d="m -36.5,186.40625 a 2.09375,2.09375 0 1 1 -4.1875,0 2.09375,2.09375 0 1 1 4.1875,0 z"
+ transform="matrix(-2.86565,0,0,2.86565,-70.8457,-534.143)"
+ id="path4050-2-7-9-4-0"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.69792098;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" />
+ <path
+ d="m -36.5,186.40625 a 2.09375,2.09375 0 1 1 -4.1875,0 2.09375,2.09375 0 1 1 4.1875,0 z"
+ transform="matrix(-2.86565,0,0,2.86565,-92.8457,-534.143)"
+ id="path4050-2-7-9-4-0-9"
+ style="color:#000000;fill:none;stroke:#000000;stroke-width:0.69792098;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" />
+ <path
+ d="m 47.87528,-34.0295 c 1.53896,0.0448 3.0511,0.70928 4.125,1.8125 l 32.25,32.25 -32.25,32.25 c -2.2253,2.2253 -6.2747,2.2253 -8.5,0 -2.2253,-2.22528 -2.2253,-6.2747 0,-8.5 l 23.75,-23.75 -23.75,-23.75 c -1.73168,-1.6731 -2.295,-4.44228 -1.3546,-6.65894 0.94042,-2.21668 3.32312,-3.73604 5.7296,-3.65356 z"
+ id="path3165-7-3-1"
+ style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0pt;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;text-anchor:start;opacity:0.35;color:#000000;fill:none;stroke:#000000;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;font-family:Bitstream Vera Sans" />
+ <path
+ d="m 41.8316,28.09418 c -0.014,-1.58898 0.54158,-3.18406 1.66868,-4.31118 l 23.75,-23.75 m -25.1046,-30.40894 c 0.94042,-2.21668 3.32312,-3.73604 5.7296,-3.65356 1.53896,0.0448 3.0511,0.70928 4.125,1.8125 l 32.25,32.25"
+ id="path3165-7-3-1-9"
+ style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0pt;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;text-anchor:start;color:#000000;fill:none;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;font-family:Bitstream Vera Sans" />
+ </g>
+</svg>
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index 136cd09..6877986 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -7,6 +7,7 @@ const Meta = imports.gi.Meta;
const Shell = imports.gi.Shell;
const AltTab = imports.ui.altTab;
+const WorkspaceSwitcherPopup = imports.ui.workspaceSwitcherPopup;
const Main = imports.ui.main;
const Tweener = imports.ui.tweener;
@@ -42,6 +43,17 @@ WindowManager.prototype = {
shellwm.takeover_keybinding('switch_windows');
shellwm.connect('keybinding::switch_windows', Lang.bind(this, this._startAppSwitcher));
+
+ 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));
+
},
_shouldAnimate : function(actor) {
@@ -277,9 +289,45 @@ WindowManager.prototype = {
},
_startAppSwitcher : function(shellwm, binding, window, backwards) {
+ /* prevent a corner case where both popups show up at once */
+ if (this._workspaceSwitcherPopup != null)
+ this._workspaceSwitcherPopup.actor.hide();
+
let tabPopup = new AltTab.AltTabPopup();
if (!tabPopup.show(backwards))
tabPopup.destroy();
+ },
+
+ _showWorkspaceSwitcher : function(shellwm, binding, window, backwards) {
+ /* We don't support this kind of layout */
+ if (binding == "switch_to_workspace_up" || binding == "switch_to_workspace_down")
+ return;
+
+ if (global.screen.n_workspaces == 1)
+ return;
+
+ 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);
+ }
+
+ 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._workspaceSwitcherPopup.display(WorkspaceSwitcherPopup.RIGHT, activeWorkspaceIndex + 1);
+ }
+ else
+ this._workspaceSwitcherPopup.display(WorkspaceSwitcherPopup.RIGHT, activeWorkspaceIndex);
+ }
}
};
diff --git a/js/ui/workspaceSwitcherPopup.js b/js/ui/workspaceSwitcherPopup.js
new file mode 100644
index 0000000..655779c
--- /dev/null
+++ b/js/ui/workspaceSwitcherPopup.js
@@ -0,0 +1,100 @@
+/* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */
+
+const Clutter = imports.gi.Clutter;
+const Lang = imports.lang;
+const Mainloop = imports.mainloop;
+const Shell = imports.gi.Shell;
+const St = imports.gi.St;
+
+const Tweener = imports.ui.tweener;
+
+const ANIMATION_TIME = 0.075;
+const DISPLAY_TIMEOUT = 600;
+
+const LEFT = -1;
+const RIGHT = 1;
+
+function WorkspaceSwitcherPopup() {
+ this._init();
+}
+
+WorkspaceSwitcherPopup.prototype = {
+ _init : function() {
+ this.actor = new Clutter.Group({ reactive: true,
+ x: 0,
+ y: 0,
+ width: global.screen_width,
+ height: global.screen_height });
+ global.stage.add_actor(this.actor);
+
+ this._container = new St.BoxLayout({ style_class: "workspace-switcher-container" });
+ this._list = new St.BoxLayout({ style_class: "workspace-switcher" });
+
+ this._redraw();
+
+ this._container.add(this._list);
+ this.actor.add_actor(this._container);
+
+ this._position();
+
+ this.actor.show();
+ this._timeoutId = Mainloop.timeout_add(DISPLAY_TIMEOUT, Lang.bind(this, this._onTimeout));
+ },
+
+ _redraw : function(direction, activeWorkspaceIndex) {
+ this._list.destroy_children();
+
+ for (let i = 0; i < global.screen.n_workspaces; i++) {
+ let indicator = null;
+
+ if (i == activeWorkspaceIndex && direction == LEFT)
+ indicator = new St.Bin({ style_class: 'ws-switcher-active-left' });
+ else if(i == activeWorkspaceIndex && direction == RIGHT)
+ indicator = new St.Bin({ style_class: 'ws-switcher-active-right' });
+ else
+ indicator = new St.Bin({ style_class: 'ws-switcher-box' });
+
+ this._list.add(indicator);
+
+ if (i < global.screen.n_workspaces - 1) {
+ let spacer = new St.Bin({ style_class: 'ws-switcher-spacer' });
+ this._list.add(spacer);
+ }
+
+ }
+ },
+
+ _position: function() {
+ let focus = global.get_focus_monitor();
+ this._container.x = focus.x + Math.floor((focus.width - this._container.width) / 2);
+ this._container.y = focus.y + Math.floor((focus.height - this._container.height) / 2);
+ },
+
+ _show : function() {
+ Tweener.addTween(this._container, { opacity: 255,
+ time: ANIMATION_TIME,
+ transition: "easeOutQuad"
+ });
+ this._position();
+ this.actor.show();
+ },
+
+ display : function(direction, activeWorkspaceIndex) {
+ this._redraw(direction, activeWorkspaceIndex);
+ if (this._timeoutId != 0)
+ Mainloop.source_remove(this._timeoutId);
+ this._timeoutId = Mainloop.timeout_add(DISPLAY_TIMEOUT, Lang.bind(this, this._onTimeout));
+ this._show();
+ },
+
+ _onTimeout : function() {
+ Mainloop.source_remove(this._timeoutId);
+ this._timeoutId = 0;
+ Tweener.addTween(this._container, { opacity: 0.0,
+ time: ANIMATION_TIME,
+ transition: "easeOutQuad",
+ onComplete: function() { this.actor.hide() },
+ onCompleteScope: this
+ });
+ }
+};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]