Compare commits

...

10 Commits

Author SHA1 Message Date
Jakub Steiner
2eb5df9320 workspace: update window close
- match the updated visuals

https://bugzilla.gnome.org/show_bug.cgi?id=783953
2017-08-10 11:27:39 +02:00
Florian Müllner
6ecfedaa08 workspace: Show window chrome on long-press
Pointer hover and keyboard focus aren't available on touch devices,
so add long-press as alternative to reveal preview title and close
button.

https://bugzilla.gnome.org/show_bug.cgi?id=783953
2017-08-10 11:27:39 +02:00
Florian Müllner
1e6fec0d1e workspace: Move decision to show/hide chrome to clone
Currently the chrome layer decides itself which events on the window
clone should show or hide the chrome, which makes it harder to extent.
Instead, move the decision to the window clone by letting it emit
show/hide-chrome events when appropriate.

https://bugzilla.gnome.org/show_bug.cgi?id=783953
2017-08-10 11:27:39 +02:00
Florian Müllner
ed537da0e0 workspace: Allow full-sized window previews
Previews are currently limited to at most 70% of the actual window
size. This was done to indicate more clearly that the overview is
active and the window cannot be interacted with. However since then
other indications like the vignette effect have been added, so
artificially limiting the preview size doesn't look necessary anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=783953
2017-08-10 11:27:39 +02:00
Florian Müllner
e1ea2a6881 workspace: Don't restrict title width to window preview
Now that only one window title is visible at any time, it no longer
matters if a title extends into other window previews, so we can
always show the full title.

https://bugzilla.gnome.org/show_bug.cgi?id=783953
2017-08-10 11:27:39 +02:00
Florian Müllner
152fc448b7 workspace: Only reveal title captions on hover
While the new title position gives the previews more space, they now
overlay the content which may hide valuable information. Address this
by only revealing the title as additional information on hover, like
we do for other auxiliary elements.

https://bugzilla.gnome.org/show_bug.cgi?id=783953
2017-08-10 11:27:39 +02:00
Florian Müllner
3b59ade4c0 workspace: Reduce spacing between window previews
With the window titles no longer being shown as part of the previews
grid, we can reduce the spacing to have more space available to the
window previews themselves.

https://bugzilla.gnome.org/show_bug.cgi?id=783953
2017-08-10 11:27:39 +02:00
Florian Müllner
90b173a581 workspace: Move window captions
We consider the window previews the primary way to identify a window,
so it makes sense to give them as much space as possible. So in order
to not have title captions take up too much vertical space, overlay
them on top of the preview borders.

https://bugzilla.gnome.org/show_bug.cgi?id=783953
2017-08-10 11:27:39 +02:00
Florian Müllner
6ac53bf5ec overview: Don't expand workspace thumbnails by default
We currently expand the workspace switcher when workspaces are being
used, that is when there are any windows on a non-active workspace.
While this helps with the switcher's discoverability, it does eat into
the space available for window previews. By now the component should
be well established, so we can afford opting for space efficiency and
only expand the switcher while the user actually interacts with it.

https://bugzilla.gnome.org/show_bug.cgi?id=783953
2017-08-10 11:27:39 +02:00
Florian Müllner
7baaf4341a workspaceThumbnails: Reduce maximum thumbnail size
The overview's window picker is primarily about windows, and as the
previews that represent them are more effective the bigger they are,
it makes sense to scale down competing elements; start by reducing
the size of workspace thumbnails on the right ...

https://bugzilla.gnome.org/show_bug.cgi?id=783953
2017-08-10 11:27:39 +02:00
6 changed files with 127 additions and 241 deletions

View File

@ -7,7 +7,6 @@
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"
version="1.0"
@ -16,137 +15,72 @@
y="0px"
width="32"
height="32"
viewBox="0 0 23.272727 23.272727"
viewBox="0 0 32 32"
enable-background="new 0 0 16 16"
xml:space="preserve"
sodipodi:version="0.32"
inkscape:version="0.48+devel r10081 custom"
inkscape:version="0.92+devel unknown"
sodipodi:docname="close-window.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"><metadata
id="metadata2399"><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><defs
id="defs2397"><linearGradient
id="linearGradient3173"><stop
style="stop-color:#c4c4c4;stop-opacity:1;"
offset="0"
id="stop3175" /><stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="1"
id="stop3177" /></linearGradient><inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 8 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="16 : 8 : 1"
inkscape:persp3d-origin="8 : 5.3333333 : 1"
id="perspective2401" /><filter
color-interpolation-filters="sRGB"
inkscape:collect="always"
id="filter16494-4"
x="-0.20989846"
width="1.4197969"
y="-0.20903821"
height="1.4180764"><feGaussianBlur
inkscape:collect="always"
stdDeviation="1.3282637"
id="feGaussianBlur16496-8" /></filter><radialGradient
inkscape:collect="always"
xlink:href="#linearGradient16498-6"
id="radialGradient16504-1"
cx="7.6582627"
cy="5.8191104"
fx="7.6582627"
fy="5.8191104"
r="8.6928644"
gradientTransform="matrix(1.0474339,0,0,1.0517402,-0.3632615,-0.42032492)"
gradientUnits="userSpaceOnUse" /><linearGradient
inkscape:collect="always"
id="linearGradient16498-6"><stop
style="stop-color:#7b7b7b;stop-opacity:1"
offset="0"
id="stop16500-8" /><stop
style="stop-color:#101010;stop-opacity:1"
offset="1"
id="stop16502-0" /></linearGradient><filter
color-interpolation-filters="sRGB"
inkscape:collect="always"
id="filter16524-9"
x="-0.212979"
width="1.425958"
y="-0.21305652"
height="1.426113"><feGaussianBlur
inkscape:collect="always"
stdDeviation="0.71020915"
id="feGaussianBlur16526-0" /></filter></defs><sodipodi:namedview
inkscape:window-height="1114"
inkscape:window-width="1463"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
guidetolerance="10.0"
gridtolerance="10.0"
objecttolerance="10.0"
borderopacity="1.0"
bordercolor="#666666"
pagecolor="#000000"
id="base"
showgrid="false"
inkscape:zoom="1"
inkscape:cx="10.720189"
inkscape:cy="13.739577"
inkscape:window-x="0"
inkscape:window-y="26"
inkscape:current-layer="Foreground"
showguides="true"
inkscape:guide-bbox="true"
borderlayer="true"
inkscape:showpageshadow="false"
inkscape:window-maximized="0"><inkscape:grid
type="xygrid"
id="grid11246"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" /></sodipodi:namedview>
<g
style="display:inline"
id="g16402-8"
transform="translate(4.7533483,2.8238929)"><g
id="g3175-4"><path
sodipodi:type="inkscape:offset"
inkscape:radius="0"
inkscape:original="M 7.65625 0.125 C 3.2589349 0.125 -0.3125 3.7070002 -0.3125 8.125 C -0.3125 12.543001 3.2589349 16.125 7.65625 16.125 C 12.053566 16.125 15.625 12.543001 15.625 8.125 C 15.625 3.7070002 12.053566 0.125 7.65625 0.125 z "
xlink:href="#path2394-32"
style="opacity:0.52994014;color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:2.18181825;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;filter:url(#filter16494-4);enable-background:accumulate"
id="path16480-5"
inkscape:href="#path2394-32"
d="m 7.65625,0.125 c -4.3973151,0 -7.96875,3.5820002 -7.96875,8 0,4.418001 3.5714349,8 7.96875,8 4.397316,0 7.96875,-3.581999 7.96875,-8 0,-4.4179998 -3.571434,-8 -7.96875,-8 z"
transform="translate(0,1.028519)" /><path
clip-rule="evenodd"
d="m -0.30428257,8.1237596 c 0,-4.4179998 3.56522987,-7.9999996 7.96254497,-7.9999996 4.3973156,0 7.9625456,3.5819998 7.9625456,7.9999996 0,4.4180014 -3.56523,8.0000004 -7.9625456,8.0000004 -4.3973151,0 -7.96254497,-3.581999 -7.96254497,-8.0000004 z"
id="path2394-32"
style="color:#000000;fill:url(#radialGradient16504-1);fill-opacity:1;fill-rule:nonzero;stroke:#eeeeec;stroke-width:1.4545455;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;enable-background:accumulate"
sodipodi:nodetypes="csssc"
inkscape:connector-curvature="0" /><g
id="g3172-6" /></g><g
transform="matrix(0.72727273,0,0,0.72727273,2.368236,2.1803254)"
style="fill:#ffffff;fill-opacity:1;display:inline"
id="g27275-6-6"
inkscape:label="window-close"><g
style="fill:#ffffff;fill-opacity:1;display:inline"
id="g27277-1-1"
transform="translate(-41,-760)"><path
sodipodi:type="inkscape:offset"
inkscape:radius="0"
inkscape:original="M 44.21875 764.1875 L 44.21875 765.1875 C 44.19684 765.46825 44.289258 765.74287 44.5 765.9375 L 46.78125 768.21875 L 44.5 770.46875 C 44.31181 770.65692 44.218747 770.92221 44.21875 771.1875 L 44.21875 772.1875 L 45.21875 772.1875 C 45.48404 772.1875 45.749336 772.09444 45.9375 771.90625 L 48.21875 769.625 L 50.5 771.90625 C 50.688164 772.0944 50.953449 772.18749 51.21875 772.1875 L 52.21875 772.1875 L 52.21875 771.1875 C 52.218742 770.9222 52.125688 770.65692 51.9375 770.46875 L 49.6875 768.21875 L 51.96875 765.9375 C 52.18441 765.73815 52.21875 765.47397 52.21875 765.1875 L 52.21875 764.1875 L 51.21875 764.1875 C 50.977922 764.1945 50.796875 764.2695 50.53125 764.5 L 48.21875 766.78125 L 45.9375 764.5 C 45.75987 764.31608 45.504951 764.1987 45.25 764.1875 C 45.23954 764.18704 45.22912 764.18738 45.21875 764.1875 L 44.21875 764.1875 z "
xlink:href="#path27279-0-5"
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#bebebe;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78124988;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter16524-9);enable-background:new;font-family:Andale Mono;-inkscape-font-specification:Andale Mono"
id="path16506-5"
inkscape:href="#path27279-0-5"
d="m 44.21875,764.1875 0,1 c -0.02191,0.28075 0.07051,0.55537 0.28125,0.75 l 2.28125,2.28125 -2.28125,2.25 c -0.18819,0.18817 -0.281253,0.45346 -0.28125,0.71875 l 0,1 1,0 c 0.26529,0 0.530586,-0.0931 0.71875,-0.28125 L 48.21875,769.625 50.5,771.90625 c 0.188164,0.18815 0.453449,0.28124 0.71875,0.28125 l 1,0 0,-1 c -8e-6,-0.2653 -0.09306,-0.53058 -0.28125,-0.71875 l -2.25,-2.25 2.28125,-2.28125 c 0.21566,-0.19935 0.25,-0.46353 0.25,-0.75 l 0,-1 -1,0 c -0.240828,0.007 -0.421875,0.082 -0.6875,0.3125 l -2.3125,2.28125 L 45.9375,764.5 c -0.17763,-0.18392 -0.432549,-0.3013 -0.6875,-0.3125 -0.01046,-4.6e-4 -0.02088,-1.2e-4 -0.03125,0 l -1,0 z"
transform="translate(0,1.3535534)" /><path
sodipodi:nodetypes="ccsccccccccccccccccccccccc"
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#bebebe;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78124988;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new;font-family:Andale Mono;-inkscape-font-specification:Andale Mono"
id="path27279-0-5"
inkscape:connector-curvature="0"
d="m 44.226475,764.17222 1,0 c 0.01037,-1.2e-4 0.02079,-4.6e-4 0.03125,0 0.254951,0.0112 0.50987,0.12858 0.6875,0.3125 l 2.28125,2.28125 2.3125,-2.28125 c 0.265625,-0.2305 0.446672,-0.3055 0.6875,-0.3125 l 1,0 0,1 c 0,0.28647 -0.03434,0.55065 -0.25,0.75 l -2.28125,2.28125 2.25,2.25 c 0.188188,0.18817 0.281242,0.45345 0.28125,0.71875 l 0,1 -1,0 c -0.265301,-1e-5 -0.530586,-0.0931 -0.71875,-0.28125 l -2.28125,-2.28125 -2.28125,2.28125 c -0.188164,0.18819 -0.45346,0.28125 -0.71875,0.28125 l -1,0 0,-1 c -3e-6,-0.26529 0.09306,-0.53058 0.28125,-0.71875 l 2.28125,-2.25 -2.28125,-2.28125 c -0.210742,-0.19463 -0.30316,-0.46925 -0.28125,-0.75 l 0,-1 z" /></g></g></g></svg>
id="metadata2399"><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><defs
id="defs2397"><linearGradient
id="linearGradient3173"><stop
style="stop-color:#c4c4c4;stop-opacity:1;"
offset="0"
id="stop3175" /><stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="1"
id="stop3177" /></linearGradient><inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 11 : 1"
inkscape:vp_y="0 : 1375 : 0"
inkscape:vp_z="22 : 11 : 1"
inkscape:persp3d-origin="11 : 7.3333334 : 1"
id="perspective2401" /></defs><sodipodi:namedview
inkscape:window-height="1376"
inkscape:window-width="3440"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
guidetolerance="10.0"
gridtolerance="10.0"
objecttolerance="10.0"
borderopacity="1.0"
bordercolor="#666666"
pagecolor="#797979"
id="base"
showgrid="false"
inkscape:zoom="8"
inkscape:cx="-17.664395"
inkscape:cy="7.2420799"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:current-layer="Foreground"
showguides="true"
inkscape:guide-bbox="true"
borderlayer="true"
inkscape:showpageshadow="false"
inkscape:window-maximized="1"
inkscape:document-rotation="0"><inkscape:grid
type="xygrid"
id="grid11246"
empspacing="5"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" /></sodipodi:namedview><path
clip-rule="evenodd"
d="m 4.4362021,15.860384 c 0,-6.410121 5.1728276,-11.6072804 11.5529359,-11.6072804 6.380109,0 11.552937,5.1971594 11.552937,11.6072804 0,6.410122 -5.172828,11.607281 -11.552937,11.607281 -6.3801083,0 -11.5529359,-5.197159 -11.5529359,-11.607281 z"
id="path2394-32"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#2975c4;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
sodipodi:nodetypes="csssc"
inkscape:connector-curvature="0" /><path
style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.49900004;fill:#4a90d9;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.74932218;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
d="m 6.4654832,15.001321 c -0.025906,0.288419 -0.044417,0.579469 -0.044417,0.874662 0,5.313347 4.2883848,9.621271 9.5768588,9.621271 5.288466,0 9.575143,-4.307924 9.575143,-9.621271 0,-0.295193 -0.01852,-0.586243 -0.04441,-0.874662 -0.440376,4.903023 -4.536071,8.746611 -9.53073,8.746611 -4.994659,0 -9.0920617,-3.843588 -9.5324391,-8.746611 z"
id="path2561"
inkscape:connector-curvature="0" /><path
d="m 11.718386,11.639547 h 1.055207 c 0.01091,-1.26e-4 0.02193,-4.86e-4 0.03298,0 0.269026,0.01183 0.538019,0.135679 0.725455,0.329752 l 2.407192,2.407192 2.440166,-2.407192 c 0.28029,-0.243226 0.471333,-0.322366 0.725455,-0.329752 h 1.055207 v 1.055208 c 0,0.302285 -0.03623,0.581049 -0.263801,0.791405 l -2.407191,2.407191 2.374217,2.374216 c 0.198577,0.198559 0.296768,0.478484 0.296775,0.758432 v 1.055206 h -1.055211 c -0.279947,-10e-6 -0.559877,-0.09824 -0.75843,-0.296777 l -2.407192,-2.407192 -2.407192,2.407192 c -0.198551,0.198579 -0.478493,0.296777 -0.758429,0.296777 H 11.71839 v -1.055206 c -3e-6,-0.279936 0.0982,-0.559873 0.296777,-0.758432 L 14.422359,15.893351 12.015167,13.48616 C 11.79279,13.280784 11.69527,12.991003 11.71839,12.694755 Z"
inkscape:connector-curvature="0"
id="path27279-0-5"
style="color:#bebebe;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:'Andale Mono';-inkscape-font-specification:'Andale Mono';text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-anchor:start;display:inline;overflow:visible;visibility:visible;fill:#4a90d9;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.87958801;marker:none;enable-background:new"
sodipodi:nodetypes="ccsccccccccccccccccccccccc" /></svg>

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@ -1094,13 +1094,11 @@ StScrollBar {
padding-bottom: 32px; }
.window-picker {
-horizontal-spacing: 32px;
-vertical-spacing: 32px;
padding-left: 32px;
padding-right: 32px;
padding-bottom: 48px; }
-horizontal-spacing: 16px;
-vertical-spacing: 16px;
padding: 0 16px 16px; }
.window-picker.external-monitor {
padding: 32px; }
padding: 16px; }
.window-clone-border {
border: 4px solid #215d9c;
@ -1109,14 +1107,10 @@ StScrollBar {
.window-caption {
spacing: 25px;
color: #eeeeec;
background-color: rgba(46, 52, 54, 0.7);
color: #ffffff;
background-color: #215d9c;
border-radius: 8px;
padding: 4px 12px;
-shell-caption-spacing: 12px; }
.window-caption:hover {
background-color: #215d9c;
color: #ffffff; }
padding: 4px 12px; }
.search-entry {
width: 320px;

View File

@ -1094,13 +1094,11 @@ StScrollBar {
padding-bottom: 32px; }
.window-picker {
-horizontal-spacing: 32px;
-vertical-spacing: 32px;
padding-left: 32px;
padding-right: 32px;
padding-bottom: 48px; }
-horizontal-spacing: 16px;
-vertical-spacing: 16px;
padding: 0 16px 16px; }
.window-picker.external-monitor {
padding: 32px; }
padding: 16px; }
.window-clone-border {
border: 4px solid #215d9c;
@ -1109,14 +1107,10 @@ StScrollBar {
.window-caption {
spacing: 25px;
color: #eeeeec;
background-color: rgba(46, 52, 54, 0.7);
color: #ffffff;
background-color: #215d9c;
border-radius: 8px;
padding: 4px 12px;
-shell-caption-spacing: 12px; }
.window-caption:hover {
background-color: #215d9c;
color: #ffffff; }
padding: 4px 12px; }
.search-entry {
width: 320px;

View File

@ -254,18 +254,12 @@ var ThumbnailsSlider = new Lang.Class({
Main.layoutManager.connect('monitors-changed', Lang.bind(this, this._updateSlide));
this.actor.connect('notify::hover', Lang.bind(this, this._updateSlide));
global.window_manager.connect('switch-workspace', Lang.bind(this, this._updateSlide));
this._thumbnailsBox.actor.bind_property('visible', this.actor, 'visible', GObject.BindingFlags.SYNC_CREATE);
},
_getAlwaysZoomOut: function() {
// Always show the pager when hover, during a drag, or if workspaces are
// actually used, e.g. there are windows on any non-active workspace
let alwaysZoomOut = this.actor.hover ||
this._inDrag ||
!Meta.prefs_get_dynamic_workspaces() ||
global.screen.n_workspaces > 2 ||
global.screen.get_active_workspace_index() != 0;
// Always show the pager on hover or during a drag
let alwaysZoomOut = this.actor.hover || this._inDrag;
if (!alwaysZoomOut) {
let monitors = Main.layoutManager.monitors;

View File

@ -20,7 +20,7 @@ const WindowManager = imports.ui.windowManager;
var WINDOW_DND_SIZE = 256;
var WINDOW_CLONE_MAXIMUM_SCALE = 0.7;
var WINDOW_CLONE_MAXIMUM_SCALE = 1.0;
var CLOSE_BUTTON_FADE_TIME = 0.1;
@ -157,6 +157,12 @@ var WindowClone = new Lang.Class({
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPress));
this.actor.connect('enter-event', () => { this.emit('show-chrome'); });
this.actor.connect('key-focus-in', () => { this.emit('show-chrome'); });
this.actor.connect('leave-event', () => { this.emit('hide-chrome'); });
this.actor.connect('key-focus-out', () => { this.emit('hide-chrome'); });
this._draggable = DND.makeDraggable(this.actor,
{ restoreOnSuccess: true,
manualMode: true,
@ -374,6 +380,8 @@ var WindowClone = new Lang.Class({
action.release();
this._draggable.startDrag(x, y, global.get_current_time(), this._dragTouchSequence);
}));
} else {
this.emit('show-chrome');
}
return true;
},
@ -439,7 +447,6 @@ var WindowOverlay = new Lang.Class({
let title = new St.Label({ style_class: 'window-caption',
text: metaWindow.title });
title.clutter_text.ellipsize = Pango.EllipsizeMode.END;
title._spacing = 0;
windowClone.actor.label_actor = title;
this._updateCaptionId = metaWindow.connect('notify::title',
@ -455,18 +462,13 @@ var WindowOverlay = new Lang.Class({
button.connect('clicked', Lang.bind(this, this._closeWindow));
windowClone.actor.connect('destroy', Lang.bind(this, this._onDestroy));
windowClone.actor.connect('enter-event',
Lang.bind(this, this._onEnter));
windowClone.actor.connect('leave-event',
Lang.bind(this, this._onLeave));
windowClone.actor.connect('key-focus-in',
Lang.bind(this, this._onEnter));
windowClone.actor.connect('key-focus-out',
Lang.bind(this, this._onLeave));
windowClone.connect('show-chrome', Lang.bind(this, this._onShowChrome));
windowClone.connect('hide-chrome', Lang.bind(this, this._onHideChrome));
this._windowAddedId = 0;
button.hide();
title.hide();
this.title = title;
this.closeButton = button;
@ -475,8 +477,8 @@ var WindowOverlay = new Lang.Class({
Shell.util_set_hidden_from_pick(this.title, true);
Shell.util_set_hidden_from_pick(this.border, true);
parentActor.add_actor(this.title);
parentActor.add_actor(this.border);
parentActor.add_actor(this.title);
parentActor.add_actor(this.closeButton);
title.connect('style-changed',
Lang.bind(this, this._onStyleChanged));
@ -491,7 +493,6 @@ var WindowOverlay = new Lang.Class({
hide: function() {
this._hidden = true;
this.title.hide();
this.hideCloseButton();
},
@ -499,14 +500,13 @@ var WindowOverlay = new Lang.Class({
show: function() {
this._hidden = false;
this.title.show();
if (this._windowClone.actor['has-pointer'])
this._animateVisible();
},
chromeHeights: function () {
return [Math.max(this.borderSize, this.closeButton.height - this.closeButton._overlap),
this.title.height + this.title._spacing];
(this.title.height - this.borderSize) / 2];
},
chromeWidths: function () {
@ -540,24 +540,13 @@ var WindowOverlay = new Lang.Class({
else
button.set_position(Math.floor(buttonX), Math.floor(buttonY));
// Clutter.Actor.get_preferred_width() will return the fixed width if one
// is set, so we need to reset the width by calling set_width(-1), to forward
// the call down to StLabel.
// We also need to save and restore the current width, otherwise the animation
// starts from the wrong point.
let prevTitleWidth = title.width;
title.set_width(-1);
let [titleMinWidth, titleNatWidth] = title.get_preferred_width(-1);
let titleWidth = Math.max(titleMinWidth, Math.min(titleNatWidth, cloneWidth));
title.width = prevTitleWidth;
let titleX = cloneX + (cloneWidth - title.width) / 2;
let titleY = cloneY + cloneHeight - (title.height - this.borderSize) / 2;
let titleX = cloneX + (cloneWidth - titleWidth) / 2;
let titleY = cloneY + cloneHeight + title._spacing;
if (animate)
this._animateOverlayActor(title, Math.floor(titleX), Math.floor(titleY), titleWidth);
else {
title.width = titleWidth;
if (animate) {
this._animateOverlayActor(title, Math.floor(titleX), Math.floor(titleY), title.width);
} else {
title.width = title.width;
title.set_position(Math.floor(titleX), Math.floor(titleY));
}
@ -640,60 +629,47 @@ var WindowOverlay = new Lang.Class({
_animateVisible: function() {
this._parentActor.raise_top();
if (this._windowCanClose()) {
this.closeButton.show();
this.closeButton.opacity = 0;
Tweener.addTween(this.closeButton,
let toAnimate = [this.border, this.title];
if (this._windowCanClose())
toAnimate.push(this.closeButton);
toAnimate.forEach(a => {
a.show();
a.opacity = 0;
Tweener.addTween(a,
{ opacity: 255,
time: CLOSE_BUTTON_FADE_TIME,
transition: 'easeOutQuad' });
}
this.border.show();
this.border.opacity = 0;
Tweener.addTween(this.border,
{ opacity: 255,
time: CLOSE_BUTTON_FADE_TIME,
transition: 'easeOutQuad' });
this.title.add_style_pseudo_class('hover');
});
},
_animateInvisible: function() {
this.closeButton.opacity = 255;
Tweener.addTween(this.closeButton,
{ opacity: 0,
time: CLOSE_BUTTON_FADE_TIME,
transition: 'easeInQuad' });
this.border.opacity = 255;
Tweener.addTween(this.border,
{ opacity: 0,
time: CLOSE_BUTTON_FADE_TIME,
transition: 'easeInQuad' });
this.title.remove_style_pseudo_class('hover');
[this.closeButton, this.border, this.title].forEach(a => {
a.opacity = 255;
Tweener.addTween(a,
{ opacity: 0,
time: CLOSE_BUTTON_FADE_TIME,
transition: 'easeInQuad' });
});
},
_onEnter: function() {
_onShowChrome: function() {
// We might get enter events on the clone while the overlay is
// hidden, e.g. during animations, we ignore these events,
// as the close button will be shown as needed when the overlays
// are shown again
if (this._hidden)
return Clutter.EVENT_PROPAGATE;
return;
this._animateVisible();
this.emit('show-close-button');
return Clutter.EVENT_PROPAGATE;
},
_onLeave: function() {
_onHideChrome: function() {
if (this._idleToggleCloseId == 0) {
this._idleToggleCloseId = Mainloop.timeout_add(750, Lang.bind(this, this._idleToggleCloseButton));
GLib.Source.set_name_by_id(this._idleToggleCloseId, '[gnome-shell] this._idleToggleCloseButton');
}
return Clutter.EVENT_PROPAGATE;
},
_idleToggleCloseButton: function() {
@ -713,13 +689,10 @@ var WindowOverlay = new Lang.Class({
}
this.closeButton.hide();
this.border.hide();
this.title.remove_style_pseudo_class('hover');
this.title.hide();
},
_onStyleChanged: function() {
let titleNode = this.title.get_theme_node();
this.title._spacing = titleNode.get_length('-shell-caption-spacing');
let closeNode = this.closeButton.get_theme_node();
this.closeButton._overlap = closeNode.get_length('-shell-close-overlap');
@ -1951,19 +1924,16 @@ var Workspace = new Lang.Class({
right: node.get_padding(St.Side.RIGHT),
};
let closeButtonHeight, captionHeight;
let leftBorder, rightBorder;
// All of the overlays have the same chrome sizes,
// so just pick the first one.
let overlay = this._windowOverlays[0];
[closeButtonHeight, captionHeight] = overlay.chromeHeights();
[leftBorder, rightBorder] = overlay.chromeWidths();
let [topBorder, bottomBorder] = overlay.chromeHeights();
let [leftBorder, rightBorder] = overlay.chromeWidths();
rowSpacing += captionHeight;
rowSpacing += (topBorder + bottomBorder) / 2;
columnSpacing += (rightBorder + leftBorder) / 2;
padding.top += closeButtonHeight;
padding.bottom += captionHeight;
padding.top += topBorder;
padding.bottom += bottomBorder;
padding.left += leftBorder;
padding.right += rightBorder;

View File

@ -18,8 +18,8 @@ const WindowManager = imports.ui.windowManager;
const Workspace = imports.ui.workspace;
const WorkspacesView = imports.ui.workspacesView;
// The maximum size of a thumbnail is 1/8 the width and height of the screen
let MAX_THUMBNAIL_SCALE = 1/8.;
// The maximum size of a thumbnail is 1/10 the width and height of the screen
let MAX_THUMBNAIL_SCALE = 1/10.;
var RESCALE_ANIMATION_TIME = 0.2;
var SLIDE_ANIMATION_TIME = 0.2;