Compare commits
22 Commits
1151-movin
...
wip/jimmac
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6393e90a5a | ||
![]() |
4e5ca6d376 | ||
![]() |
2fab75f448 | ||
![]() |
22883f2fa2 | ||
![]() |
5d9f80bc73 | ||
![]() |
f7d117488b | ||
![]() |
244a329ee7 | ||
![]() |
044572cb60 | ||
![]() |
746875258d | ||
![]() |
4892a87dfe | ||
![]() |
8b9c8ddb1e | ||
![]() |
eb9000576c | ||
![]() |
862aaf341e | ||
![]() |
a5c75ff58b | ||
![]() |
4541fb9819 | ||
![]() |
9f8edd980c | ||
![]() |
e5b9043435 | ||
![]() |
c0012c2ea4 | ||
![]() |
b77e4975f0 | ||
![]() |
e83f2344f6 | ||
![]() |
de6512be1a | ||
![]() |
0b72ff1896 |
@@ -9,9 +9,6 @@
|
|||||||
<method name="ShowOSD">
|
<method name="ShowOSD">
|
||||||
<arg type="a{sv}" direction="in" name="params"/>
|
<arg type="a{sv}" direction="in" name="params"/>
|
||||||
</method>
|
</method>
|
||||||
<method name="ShowMonitorLabels">
|
|
||||||
<arg type="a{uv}" direction="in" name="params"/>
|
|
||||||
</method>
|
|
||||||
<method name="ShowMonitorLabels2">
|
<method name="ShowMonitorLabels2">
|
||||||
<arg type="a{sv}" direction="in" name="params"/>
|
<arg type="a{sv}" direction="in" name="params"/>
|
||||||
</method>
|
</method>
|
||||||
|
@@ -21,7 +21,7 @@ $success_color: if($variant == 'light', #33d17a, darken(#33d17a, 10%));
|
|||||||
$destructive_color: if($variant == 'light', #e01b24, darken(#e01b24, 10%));
|
$destructive_color: if($variant == 'light', #e01b24, darken(#e01b24, 10%));
|
||||||
|
|
||||||
$osd_fg_color: #eeeeec;
|
$osd_fg_color: #eeeeec;
|
||||||
$osd_bg_color: #2e3436;
|
$osd_bg_color: transparentize(darken(desaturate(#3d3846, 100%), 15%),0.3);
|
||||||
$osd_borders_color: transparentize(black, 0.3);
|
$osd_borders_color: transparentize(black, 0.3);
|
||||||
$osd_outer_borders_color: transparentize(white, 0.9);
|
$osd_outer_borders_color: transparentize(white, 0.9);
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@ $panel-corner-radius: 6px;
|
|||||||
/* GLOBALS */
|
/* GLOBALS */
|
||||||
$font-size: 11;
|
$font-size: 11;
|
||||||
$font-family: Cantarell, Sans-Serif;
|
$font-family: Cantarell, Sans-Serif;
|
||||||
$_bubble_bg_color: opacify($osd_bg_color,0.25);
|
$_bubble_bg_color: $osd_bg_color;
|
||||||
$_bubble_fg_color: $osd_fg_color;
|
$_bubble_fg_color: $osd_fg_color;
|
||||||
$_bubble_borders_color: transparentize($osd_fg_color,0.8);
|
$_bubble_borders_color: transparentize($osd_fg_color,0.8);
|
||||||
|
|
||||||
@@ -184,7 +184,7 @@ StScrollBar {
|
|||||||
.modal-dialog {
|
.modal-dialog {
|
||||||
border-radius: 9px;
|
border-radius: 9px;
|
||||||
color: $osd_fg_color;
|
color: $osd_fg_color;
|
||||||
background-color: transparentize(darken($osd_bg_color,10%),0.05);
|
background-color: $osd_bg_color;
|
||||||
border: 1px solid $_bubble_borders_color;
|
border: 1px solid $_bubble_borders_color;
|
||||||
.modal-dialog-content-box {
|
.modal-dialog-content-box {
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
@@ -1142,6 +1142,12 @@ StScrollBar {
|
|||||||
|
|
||||||
.ripple-box:rtl { border-radius: 0 0 0 52px; } // just a simple change to the border radius position
|
.ripple-box:rtl { border-radius: 0 0 0 52px; } // just a simple change to the border radius position
|
||||||
|
|
||||||
|
// Rubberband for select-area screenshots
|
||||||
|
.select-area-rubberband {
|
||||||
|
background-color: transparentize($selected_bg_color,0.7);
|
||||||
|
border: 1px solid $selected_bg_color;
|
||||||
|
}
|
||||||
|
|
||||||
// not really top bar only
|
// not really top bar only
|
||||||
.popup-menu-arrow { icon-size: 1.09em; }
|
.popup-menu-arrow { icon-size: 1.09em; }
|
||||||
.popup-menu-icon { icon-size: 1.09em; }
|
.popup-menu-icon { icon-size: 1.09em; }
|
||||||
|
@@ -111,7 +111,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@mixin button($t, $c:$osd_bg_color, $tc:$fg_color, $edge: $borders_edge) {
|
@mixin button($t, $c:opacify(lighten($osd_bg_color, 5%),1.0), $tc:$fg_color, $edge: $borders_edge) {
|
||||||
//
|
//
|
||||||
// Button drawing function
|
// Button drawing function
|
||||||
//
|
//
|
||||||
@@ -136,8 +136,7 @@
|
|||||||
//
|
//
|
||||||
// normal button
|
// normal button
|
||||||
//
|
//
|
||||||
$_bg: if($c!=$osd_bg_color, transparentize($c, 0.5),
|
$_bg: $c;
|
||||||
$osd_bg_color);
|
|
||||||
|
|
||||||
color: $osd_fg_color;
|
color: $osd_fg_color;
|
||||||
background-color: $_bg;
|
background-color: $_bg;
|
||||||
@@ -150,8 +149,7 @@
|
|||||||
//
|
//
|
||||||
// focused button
|
// focused button
|
||||||
//
|
//
|
||||||
$_bg: if($c!=$osd_bg_color, transparentize($c, 0.3),
|
$_bg: lighten($c,3%);
|
||||||
lighten($osd_bg_color,3%));
|
|
||||||
|
|
||||||
color: $osd_fg_color;
|
color: $osd_fg_color;
|
||||||
text-shadow: 0 1px black;
|
text-shadow: 0 1px black;
|
||||||
@@ -163,8 +161,7 @@
|
|||||||
//
|
//
|
||||||
// active osd button
|
// active osd button
|
||||||
//
|
//
|
||||||
$_bg: if($c!=$osd_bg_color, transparentize($c, 0.3),
|
$_bg: lighten($c,3%);
|
||||||
lighten($osd_bg_color,3%));
|
|
||||||
|
|
||||||
color: white;
|
color: white;
|
||||||
border-color: $osd_borders_color;
|
border-color: $osd_borders_color;
|
||||||
|
@@ -551,9 +551,9 @@ class ExtensionRow extends Gtk.ListBoxRow {
|
|||||||
|
|
||||||
let button = new Gtk.Button({ valign: Gtk.Align.CENTER,
|
let button = new Gtk.Button({ valign: Gtk.Align.CENTER,
|
||||||
no_show_all: true });
|
no_show_all: true });
|
||||||
button.add(new Gtk.Image({ icon_name: 'emblem-system-symbolic',
|
button.set_image(new Gtk.Image({ icon_name: 'emblem-system-symbolic',
|
||||||
icon_size: Gtk.IconSize.BUTTON,
|
icon_size: Gtk.IconSize.BUTTON,
|
||||||
visible: true }));
|
visible: true }));
|
||||||
button.get_style_context().add_class('circular');
|
button.get_style_context().add_class('circular');
|
||||||
hbox.add(button);
|
hbox.add(button);
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
const { Clutter, Gio, Gtk, Shell } = imports.gi;
|
const { Clutter, Gio, Shell } = imports.gi;
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
const Scripting = imports.ui.scripting;
|
const Scripting = imports.ui.scripting;
|
||||||
|
|
||||||
@@ -104,7 +104,10 @@ function *run() {
|
|||||||
yield Scripting.waitLeisure();
|
yield Scripting.waitLeisure();
|
||||||
Scripting.scriptEvent('desktopShown');
|
Scripting.scriptEvent('desktopShown');
|
||||||
|
|
||||||
Gtk.Settings.get_default().gtk_enable_animations = false;
|
let interfaceSettings = new Gio.Settings({
|
||||||
|
schema_id: 'org.gnome.desktop.interface'
|
||||||
|
});
|
||||||
|
interfaceSettings.set_boolean('enable-animations', false);
|
||||||
|
|
||||||
Scripting.scriptEvent('overviewShowStart');
|
Scripting.scriptEvent('overviewShowStart');
|
||||||
Main.overview.show();
|
Main.overview.show();
|
||||||
@@ -200,7 +203,7 @@ function *run() {
|
|||||||
|
|
||||||
yield Scripting.sleep(1000);
|
yield Scripting.sleep(1000);
|
||||||
|
|
||||||
Gtk.Settings.get_default().gtk_enable_animations = true;
|
interfaceSettings.set_boolean('enable-animations', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
let overviewShowStart;
|
let overviewShowStart;
|
||||||
|
@@ -14,39 +14,47 @@ const RENAMED_DESKTOP_IDS = {
|
|||||||
'epiphany.desktop': 'org.gnome.Epiphany.desktop',
|
'epiphany.desktop': 'org.gnome.Epiphany.desktop',
|
||||||
'evolution.desktop': 'org.gnome.Evolution.desktop',
|
'evolution.desktop': 'org.gnome.Evolution.desktop',
|
||||||
'file-roller.desktop': 'org.gnome.FileRoller.desktop',
|
'file-roller.desktop': 'org.gnome.FileRoller.desktop',
|
||||||
|
'five-or-more.desktop': 'org.gnome.five-or-more.desktop',
|
||||||
|
'four-in-a-row.desktop': 'org.gnome.Four-in-a-row.desktop',
|
||||||
'gcalctool.desktop': 'org.gnome.Calculator.desktop',
|
'gcalctool.desktop': 'org.gnome.Calculator.desktop',
|
||||||
'geary.desktop': 'org.gnome.Geary.desktop',
|
'geary.desktop': 'org.gnome.Geary.desktop',
|
||||||
'gedit.desktop': 'org.gnome.gedit.desktop',
|
'gedit.desktop': 'org.gnome.gedit.desktop',
|
||||||
'glchess.desktop': 'gnome-chess.desktop',
|
'glchess.desktop': 'org.gnome.Chess.desktop',
|
||||||
'glines.desktop': 'five-or-more.desktop',
|
'glines.desktop': 'org.gnome.five-or-more.desktop',
|
||||||
'gnect.desktop': 'four-in-a-row.desktop',
|
'gnect.desktop': 'org.gnome.Four-in-a-row.desktop',
|
||||||
'gnibbles.desktop': 'org.gnome.Nibbles.desktop',
|
'gnibbles.desktop': 'org.gnome.Nibbles.desktop',
|
||||||
'gnobots2.desktop': 'gnome-robots.desktop',
|
'gnobots2.desktop': 'org.gnome.Robots.desktop',
|
||||||
'gnome-boxes.desktop': 'org.gnome.Boxes.desktop',
|
'gnome-boxes.desktop': 'org.gnome.Boxes.desktop',
|
||||||
'gnome-calculator.desktop': 'org.gnome.Calculator.desktop',
|
'gnome-calculator.desktop': 'org.gnome.Calculator.desktop',
|
||||||
|
'gnome-chess.desktop': 'org.gnome.Chess.desktop',
|
||||||
'gnome-clocks.desktop': 'org.gnome.clocks.desktop',
|
'gnome-clocks.desktop': 'org.gnome.clocks.desktop',
|
||||||
'gnome-contacts.desktop': 'org.gnome.Contacts.desktop',
|
'gnome-contacts.desktop': 'org.gnome.Contacts.desktop',
|
||||||
'gnome-documents.desktop': 'org.gnome.Documents.desktop',
|
'gnome-documents.desktop': 'org.gnome.Documents.desktop',
|
||||||
'gnome-font-viewer.desktop': 'org.gnome.font-viewer.desktop',
|
'gnome-font-viewer.desktop': 'org.gnome.font-viewer.desktop',
|
||||||
|
'gnome-klotski.desktop': 'org.gnome.Klotski.desktop',
|
||||||
'gnome-nibbles.desktop': 'org.gnome.Nibbles.desktop',
|
'gnome-nibbles.desktop': 'org.gnome.Nibbles.desktop',
|
||||||
'gnome-mahjongg.desktop': 'org.gnome.Mahjongg.desktop',
|
'gnome-mahjongg.desktop': 'org.gnome.Mahjongg.desktop',
|
||||||
|
'gnome-mines.desktop': 'org.gnome.Mines.desktop',
|
||||||
'gnome-music.desktop': 'org.gnome.Music.desktop',
|
'gnome-music.desktop': 'org.gnome.Music.desktop',
|
||||||
'gnome-photos.desktop': 'org.gnome.Photos.desktop',
|
'gnome-photos.desktop': 'org.gnome.Photos.desktop',
|
||||||
|
'gnome-robots.desktop': 'org.gnome.Robots.desktop',
|
||||||
'gnome-screenshot.desktop': 'org.gnome.Screenshot.desktop',
|
'gnome-screenshot.desktop': 'org.gnome.Screenshot.desktop',
|
||||||
'gnome-software.desktop': 'org.gnome.Software.desktop',
|
'gnome-software.desktop': 'org.gnome.Software.desktop',
|
||||||
'gnome-terminal.desktop': 'org.gnome.Terminal.desktop',
|
'gnome-terminal.desktop': 'org.gnome.Terminal.desktop',
|
||||||
|
'gnome-tetravex.desktop': 'org.gnome.Tetravex.desktop',
|
||||||
'gnome-tweaks.desktop': 'org.gnome.tweaks.desktop',
|
'gnome-tweaks.desktop': 'org.gnome.tweaks.desktop',
|
||||||
'gnome-weather.desktop': 'org.gnome.Weather.desktop',
|
'gnome-weather.desktop': 'org.gnome.Weather.desktop',
|
||||||
'gnomine.desktop': 'gnome-mines.desktop',
|
'gnomine.desktop': 'org.gnome.Mines.desktop',
|
||||||
'gnotravex.desktop': 'gnome-tetravex.desktop',
|
'gnotravex.desktop': 'org.gnome.Tetravex.desktop',
|
||||||
'gnotski.desktop': 'gnome-klotski.desktop',
|
'gnotski.desktop': 'org.gnome.Klotski.desktop',
|
||||||
'gtali.desktop': 'tali.desktop',
|
'gtali.desktop': 'org.gnome.Tali.desktop',
|
||||||
'iagno.desktop': 'org.gnome.Reversi.desktop',
|
'iagno.desktop': 'org.gnome.Reversi.desktop',
|
||||||
'nautilus.desktop': 'org.gnome.Nautilus.desktop',
|
'nautilus.desktop': 'org.gnome.Nautilus.desktop',
|
||||||
'org.gnome.gnome-2048.desktop': 'org.gnome.TwentyFortyEight.desktop',
|
'org.gnome.gnome-2048.desktop': 'org.gnome.TwentyFortyEight.desktop',
|
||||||
'org.gnome.taquin.desktop': 'org.gnome.Taquin.desktop',
|
'org.gnome.taquin.desktop': 'org.gnome.Taquin.desktop',
|
||||||
'org.gnome.Weather.Application.desktop': 'org.gnome.Weather.desktop',
|
'org.gnome.Weather.Application.desktop': 'org.gnome.Weather.desktop',
|
||||||
'polari.desktop': 'org.gnome.Polari.desktop',
|
'polari.desktop': 'org.gnome.Polari.desktop',
|
||||||
|
'tali.desktop': 'org.gnome.Tali.desktop',
|
||||||
'totem.desktop': 'org.gnome.Totem.desktop',
|
'totem.desktop': 'org.gnome.Totem.desktop',
|
||||||
'evince.desktop': 'org.gnome.Evince.desktop',
|
'evince.desktop': 'org.gnome.Evince.desktop',
|
||||||
};
|
};
|
||||||
|
@@ -47,10 +47,6 @@ var BoxPointer = GObject.registerClass({
|
|||||||
this._border.connect('repaint', this._drawBorder.bind(this));
|
this._border.connect('repaint', this._drawBorder.bind(this));
|
||||||
this.add_actor(this._border);
|
this.add_actor(this._border);
|
||||||
this.bin.raise(this._border);
|
this.bin.raise(this._border);
|
||||||
this._xOffset = 0;
|
|
||||||
this._yOffset = 0;
|
|
||||||
this._xPosition = 0;
|
|
||||||
this._yPosition = 0;
|
|
||||||
this._sourceAlignment = 0.5;
|
this._sourceAlignment = 0.5;
|
||||||
this._capturedEventId = 0;
|
this._capturedEventId = 0;
|
||||||
this._muteInput();
|
this._muteInput();
|
||||||
@@ -118,23 +114,23 @@ var BoxPointer = GObject.registerClass({
|
|||||||
if (animate & PopupAnimation.SLIDE) {
|
if (animate & PopupAnimation.SLIDE) {
|
||||||
switch (this._arrowSide) {
|
switch (this._arrowSide) {
|
||||||
case St.Side.TOP:
|
case St.Side.TOP:
|
||||||
this.yOffset = -rise;
|
this.translation_y = -rise;
|
||||||
break;
|
break;
|
||||||
case St.Side.BOTTOM:
|
case St.Side.BOTTOM:
|
||||||
this.yOffset = rise;
|
this.translation_y = rise;
|
||||||
break;
|
break;
|
||||||
case St.Side.LEFT:
|
case St.Side.LEFT:
|
||||||
this.xOffset = -rise;
|
this.translation_x = -rise;
|
||||||
break;
|
break;
|
||||||
case St.Side.RIGHT:
|
case St.Side.RIGHT:
|
||||||
this.xOffset = rise;
|
this.translation_x = rise;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Tweener.addTween(this, { opacity: 255,
|
Tweener.addTween(this, { opacity: 255,
|
||||||
xOffset: 0,
|
translation_x: 0,
|
||||||
yOffset: 0,
|
translation_y: 0,
|
||||||
transition: 'linear',
|
transition: 'linear',
|
||||||
onComplete: () => {
|
onComplete: () => {
|
||||||
this._unmuteInput();
|
this._unmuteInput();
|
||||||
@@ -148,8 +144,8 @@ var BoxPointer = GObject.registerClass({
|
|||||||
if (!this.visible)
|
if (!this.visible)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let xOffset = 0;
|
let translationX = 0;
|
||||||
let yOffset = 0;
|
let translationY = 0;
|
||||||
let themeNode = this.get_theme_node();
|
let themeNode = this.get_theme_node();
|
||||||
let rise = themeNode.get_length('-arrow-rise');
|
let rise = themeNode.get_length('-arrow-rise');
|
||||||
let fade = (animate & PopupAnimation.FADE);
|
let fade = (animate & PopupAnimation.FADE);
|
||||||
@@ -158,16 +154,16 @@ var BoxPointer = GObject.registerClass({
|
|||||||
if (animate & PopupAnimation.SLIDE) {
|
if (animate & PopupAnimation.SLIDE) {
|
||||||
switch (this._arrowSide) {
|
switch (this._arrowSide) {
|
||||||
case St.Side.TOP:
|
case St.Side.TOP:
|
||||||
yOffset = rise;
|
translationY = rise;
|
||||||
break;
|
break;
|
||||||
case St.Side.BOTTOM:
|
case St.Side.BOTTOM:
|
||||||
yOffset = -rise;
|
translationY = -rise;
|
||||||
break;
|
break;
|
||||||
case St.Side.LEFT:
|
case St.Side.LEFT:
|
||||||
xOffset = rise;
|
translationX = rise;
|
||||||
break;
|
break;
|
||||||
case St.Side.RIGHT:
|
case St.Side.RIGHT:
|
||||||
xOffset = -rise;
|
translationX = -rise;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -176,15 +172,15 @@ var BoxPointer = GObject.registerClass({
|
|||||||
|
|
||||||
Tweener.removeTweens(this);
|
Tweener.removeTweens(this);
|
||||||
Tweener.addTween(this, { opacity: fade ? 0 : 255,
|
Tweener.addTween(this, { opacity: fade ? 0 : 255,
|
||||||
xOffset: xOffset,
|
translation_x: translationX,
|
||||||
yOffset: yOffset,
|
translation_y: translationY,
|
||||||
transition: 'linear',
|
transition: 'linear',
|
||||||
time: animationTime,
|
time: animationTime,
|
||||||
onComplete: () => {
|
onComplete: () => {
|
||||||
this.hide();
|
this.hide();
|
||||||
this.opacity = 0;
|
this.opacity = 0;
|
||||||
this.xOffset = 0;
|
this.translation_x = 0;
|
||||||
this.yOffset = 0;
|
this.translation_y = 0;
|
||||||
if (onComplete)
|
if (onComplete)
|
||||||
onComplete();
|
onComplete();
|
||||||
}
|
}
|
||||||
@@ -477,11 +473,15 @@ var BoxPointer = GObject.registerClass({
|
|||||||
_reposition() {
|
_reposition() {
|
||||||
let sourceActor = this._sourceActor;
|
let sourceActor = this._sourceActor;
|
||||||
let alignment = this._arrowAlignment;
|
let alignment = this._arrowAlignment;
|
||||||
|
let monitorIndex = Main.layoutManager.findIndexForActor(sourceActor);
|
||||||
|
|
||||||
|
this._sourceAllocation = Shell.util_get_transformed_allocation(sourceActor);
|
||||||
|
this._workArea = Main.layoutManager.getWorkAreaForMonitor(monitorIndex);
|
||||||
|
|
||||||
// Position correctly relative to the sourceActor
|
// Position correctly relative to the sourceActor
|
||||||
let sourceNode = sourceActor.get_theme_node();
|
let sourceNode = sourceActor.get_theme_node();
|
||||||
let sourceContentBox = sourceNode.get_content_box(sourceActor.get_allocation_box());
|
let sourceContentBox = sourceNode.get_content_box(sourceActor.get_allocation_box());
|
||||||
let sourceAllocation = Shell.util_get_transformed_allocation(sourceActor);
|
let sourceAllocation = this._sourceAllocation;
|
||||||
let sourceCenterX = sourceAllocation.x1 + sourceContentBox.x1 + (sourceContentBox.x2 - sourceContentBox.x1) * this._sourceAlignment;
|
let sourceCenterX = sourceAllocation.x1 + sourceContentBox.x1 + (sourceContentBox.x2 - sourceContentBox.x1) * this._sourceAlignment;
|
||||||
let sourceCenterY = sourceAllocation.y1 + sourceContentBox.y1 + (sourceContentBox.y2 - sourceContentBox.y1) * this._sourceAlignment;
|
let sourceCenterY = sourceAllocation.y1 + sourceContentBox.y1 + (sourceContentBox.y2 - sourceContentBox.y1) * this._sourceAlignment;
|
||||||
let [minWidth, minHeight, natWidth, natHeight] = this.get_preferred_size();
|
let [minWidth, minHeight, natWidth, natHeight] = this.get_preferred_size();
|
||||||
@@ -489,8 +489,7 @@ var BoxPointer = GObject.registerClass({
|
|||||||
// We also want to keep it onscreen, and separated from the
|
// We also want to keep it onscreen, and separated from the
|
||||||
// edge by the same distance as the main part of the box is
|
// edge by the same distance as the main part of the box is
|
||||||
// separated from its sourceActor
|
// separated from its sourceActor
|
||||||
let monitorIndex = Main.layoutManager.findIndexForActor(sourceActor);
|
let workarea = this._workArea;
|
||||||
let workarea = Main.layoutManager.getWorkAreaForMonitor(monitorIndex);
|
|
||||||
let themeNode = this.get_theme_node();
|
let themeNode = this.get_theme_node();
|
||||||
let borderWidth = themeNode.get_length('-arrow-border-width');
|
let borderWidth = themeNode.get_length('-arrow-border-width');
|
||||||
let arrowBase = themeNode.get_length('-arrow-base');
|
let arrowBase = themeNode.get_length('-arrow-base');
|
||||||
@@ -584,9 +583,9 @@ var BoxPointer = GObject.registerClass({
|
|||||||
parent = parent.get_parent();
|
parent = parent.get_parent();
|
||||||
}
|
}
|
||||||
|
|
||||||
this._xPosition = Math.floor(x);
|
// Actually set the position
|
||||||
this._yPosition = Math.floor(y);
|
this.x = Math.floor(x);
|
||||||
this._shiftActor();
|
this.y = Math.floor(y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @origin: Coordinate specifying middle of the arrow, along
|
// @origin: Coordinate specifying middle of the arrow, along
|
||||||
@@ -609,25 +608,10 @@ var BoxPointer = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_shiftActor() {
|
|
||||||
// Since the position of the BoxPointer depends on the allocated size
|
|
||||||
// of the BoxPointer and the position of the source actor, trying
|
|
||||||
// to position the BoxPointer via the x/y properties will result in
|
|
||||||
// allocation loops and warnings. Instead we do the positioning via
|
|
||||||
// the anchor point, which is independent of allocation, and leave
|
|
||||||
// x == y == 0.
|
|
||||||
this.set_anchor_point(-(this._xPosition + this._xOffset),
|
|
||||||
-(this._yPosition + this._yOffset));
|
|
||||||
}
|
|
||||||
|
|
||||||
_calculateArrowSide(arrowSide) {
|
_calculateArrowSide(arrowSide) {
|
||||||
let sourceAllocation = Shell.util_get_transformed_allocation(this._sourceActor);
|
let sourceAllocation = this._sourceAllocation;
|
||||||
let [minWidth, minHeight, boxWidth, boxHeight] = this.get_preferred_size();
|
let [minWidth, minHeight, boxWidth, boxHeight] = this.get_preferred_size();
|
||||||
let monitorActor = this.sourceActor;
|
let workarea = this._workArea;
|
||||||
if (!monitorActor)
|
|
||||||
monitorActor = this;
|
|
||||||
let monitorIndex = Main.layoutManager.findIndexForActor(monitorActor);
|
|
||||||
let workarea = Main.layoutManager.getWorkAreaForMonitor(monitorIndex);
|
|
||||||
|
|
||||||
switch (arrowSide) {
|
switch (arrowSide) {
|
||||||
case St.Side.TOP:
|
case St.Side.TOP:
|
||||||
@@ -669,24 +653,6 @@ var BoxPointer = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
set xOffset(offset) {
|
|
||||||
this._xOffset = offset;
|
|
||||||
this._shiftActor();
|
|
||||||
}
|
|
||||||
|
|
||||||
get xOffset() {
|
|
||||||
return this._xOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
set yOffset(offset) {
|
|
||||||
this._yOffset = offset;
|
|
||||||
this._shiftActor();
|
|
||||||
}
|
|
||||||
|
|
||||||
get yOffset() {
|
|
||||||
return this._yOffset;
|
|
||||||
}
|
|
||||||
|
|
||||||
updateArrowSide(side) {
|
updateArrowSide(side) {
|
||||||
this._arrowSide = side;
|
this._arrowSide = side;
|
||||||
this._border.queue_repaint();
|
this._border.queue_repaint();
|
||||||
|
@@ -584,22 +584,18 @@ var Dash = class Dash {
|
|||||||
let firstButton = iconChildren[0].child;
|
let firstButton = iconChildren[0].child;
|
||||||
let firstIcon = firstButton._delegate.icon;
|
let firstIcon = firstButton._delegate.icon;
|
||||||
|
|
||||||
let minHeight, natHeight;
|
// Enforce valid spacings during the size request
|
||||||
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
|
|
||||||
|
|
||||||
// Enforce the current icon size during the size request
|
|
||||||
firstIcon.icon.ensure_style();
|
firstIcon.icon.ensure_style();
|
||||||
let [, currentHeight] = firstIcon.icon.get_size();
|
let [, iconHeight] = firstIcon.icon.get_preferred_height(-1);
|
||||||
firstIcon.icon.set_height(this.iconSize * scaleFactor);
|
let [, buttonHeight] = firstButton.get_preferred_height(-1);
|
||||||
[minHeight, natHeight] = firstButton.get_preferred_height(-1);
|
|
||||||
firstIcon.icon.set_height(currentHeight);
|
|
||||||
|
|
||||||
// Subtract icon padding and box spacing from the available height
|
// Subtract icon padding and box spacing from the available height
|
||||||
availHeight -= iconChildren.length * (natHeight - this.iconSize * scaleFactor) +
|
availHeight -= iconChildren.length * (buttonHeight - iconHeight) +
|
||||||
(iconChildren.length - 1) * spacing;
|
(iconChildren.length - 1) * spacing;
|
||||||
|
|
||||||
let availSize = availHeight / iconChildren.length;
|
let availSize = availHeight / iconChildren.length;
|
||||||
|
|
||||||
|
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
|
||||||
let iconSizes = baseIconSizes.map(s => s * scaleFactor);
|
let iconSizes = baseIconSizes.map(s => s * scaleFactor);
|
||||||
|
|
||||||
let newIconSize = baseIconSizes[0];
|
let newIconSize = baseIconSizes[0];
|
||||||
|
@@ -136,11 +136,12 @@ var WorldClocksSection = class WorldClocksSection {
|
|||||||
layout.attach(header, 0, 0, 2, 1);
|
layout.attach(header, 0, 0, 2, 1);
|
||||||
this.actor.label_actor = header;
|
this.actor.label_actor = header;
|
||||||
|
|
||||||
|
let localOffset = GLib.DateTime.new_now_local().get_utc_offset();
|
||||||
|
|
||||||
for (let i = 0; i < this._locations.length; i++) {
|
for (let i = 0; i < this._locations.length; i++) {
|
||||||
let l = this._locations[i].location;
|
let l = this._locations[i].location;
|
||||||
|
|
||||||
let name = l.get_level() == GWeather.LocationLevel.NAMED_TIMEZONE ? l.get_name()
|
let name = l.get_city_name() || l.get_name();
|
||||||
: l.get_city_name();
|
|
||||||
let label = new St.Label({ style_class: 'world-clocks-city',
|
let label = new St.Label({ style_class: 'world-clocks-city',
|
||||||
text: name,
|
text: name,
|
||||||
x_align: Clutter.ActorAlign.START,
|
x_align: Clutter.ActorAlign.START,
|
||||||
@@ -149,7 +150,8 @@ var WorldClocksSection = class WorldClocksSection {
|
|||||||
|
|
||||||
let time = new St.Label({ style_class: 'world-clocks-time' });
|
let time = new St.Label({ style_class: 'world-clocks-time' });
|
||||||
|
|
||||||
let offset = l.get_timezone().get_offset() / 60.;
|
let otherOffset = this._getTimeAtLocation(l).get_utc_offset();
|
||||||
|
let offset = (otherOffset - localOffset) / GLib.TIME_SPAN_HOUR;
|
||||||
let fmt = (Math.trunc(offset) == offset) ? '%s%.0f' : '%s%.1f';
|
let fmt = (Math.trunc(offset) == offset) ? '%s%.0f' : '%s%.1f';
|
||||||
let prefix = (offset >= 0) ? '+' : '-';
|
let prefix = (offset >= 0) ? '+' : '-';
|
||||||
let tz = new St.Label({ style_class: 'world-clocks-timezone',
|
let tz = new St.Label({ style_class: 'world-clocks-timezone',
|
||||||
@@ -182,11 +184,15 @@ var WorldClocksSection = class WorldClocksSection {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_getTimeAtLocation(location) {
|
||||||
|
let tz = GLib.TimeZone.new(location.get_timezone().get_tzid());
|
||||||
|
return GLib.DateTime.new_now(tz);
|
||||||
|
}
|
||||||
|
|
||||||
_updateLabels() {
|
_updateLabels() {
|
||||||
for (let i = 0; i < this._locations.length; i++) {
|
for (let i = 0; i < this._locations.length; i++) {
|
||||||
let l = this._locations[i];
|
let l = this._locations[i];
|
||||||
let tz = GLib.TimeZone.new(l.location.get_timezone().get_tzid());
|
let now = this._getTimeAtLocation(l.location);
|
||||||
let now = GLib.DateTime.new_now(tz);
|
|
||||||
l.actor.text = Util.formatTime(now, { timeOnly: true });
|
l.actor.text = Util.formatTime(now, { timeOnly: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -252,7 +252,7 @@ var LayoutManager = GObject.registerClass({
|
|||||||
|
|
||||||
// A dummy actor that tracks the mouse or text cursor, based on the
|
// A dummy actor that tracks the mouse or text cursor, based on the
|
||||||
// position and size set in setDummyCursorGeometry.
|
// position and size set in setDummyCursorGeometry.
|
||||||
this.dummyCursor = new St.Widget({ width: 0, height: 0, visible: false });
|
this.dummyCursor = new St.Widget({ width: 0, height: 0, opacity: 0 });
|
||||||
this.uiGroup.add_actor(this.dummyCursor);
|
this.uiGroup.add_actor(this.dummyCursor);
|
||||||
|
|
||||||
global.stage.remove_actor(global.top_window_group);
|
global.stage.remove_actor(global.top_window_group);
|
||||||
|
@@ -95,28 +95,6 @@ var OsdMonitorLabeler = class {
|
|||||||
|
|
||||||
this._reset();
|
this._reset();
|
||||||
|
|
||||||
for (let id in params) {
|
|
||||||
let monitor = this._monitorManager.get_monitor_for_output(id);
|
|
||||||
if (monitor == -1)
|
|
||||||
continue;
|
|
||||||
this._monitorLabels.get(monitor).push(params[id].deep_unpack());
|
|
||||||
}
|
|
||||||
|
|
||||||
// In mirrored display setups, more than one physical outputs
|
|
||||||
// might be showing the same logical monitor. In that case, we
|
|
||||||
// join each output's labels on the same OSD widget.
|
|
||||||
for (let [monitor, labels] of this._monitorLabels.entries()) {
|
|
||||||
labels.sort();
|
|
||||||
this._osdLabels.push(new OsdMonitorLabel(monitor, labels.join(' ')));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
show2(client, params) {
|
|
||||||
if (!this._trackClient(client))
|
|
||||||
return;
|
|
||||||
|
|
||||||
this._reset();
|
|
||||||
|
|
||||||
for (let connector in params) {
|
for (let connector in params) {
|
||||||
let monitor = this._monitorManager.get_monitor_for_connector(connector);
|
let monitor = this._monitorManager.get_monitor_for_connector(connector);
|
||||||
if (monitor == -1)
|
if (monitor == -1)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const { Atk, Clutter, Gio, GLib, GObject, Gtk, Meta, Shell, St } = imports.gi;
|
const { Atk, Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
|
||||||
const Cairo = imports.cairo;
|
const Cairo = imports.cairo;
|
||||||
const Mainloop = imports.mainloop;
|
const Mainloop = imports.mainloop;
|
||||||
|
|
||||||
@@ -201,7 +201,6 @@ var AppMenuButton = GObject.registerClass({
|
|||||||
this._startingApps = [];
|
this._startingApps = [];
|
||||||
|
|
||||||
this._menuManager = panel.menuManager;
|
this._menuManager = panel.menuManager;
|
||||||
this._gtkSettings = Gtk.Settings.get_default();
|
|
||||||
this._targetApp = null;
|
this._targetApp = null;
|
||||||
this._busyNotifyId = 0;
|
this._busyNotifyId = 0;
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const { Clutter, Gio, GLib, Gtk, Meta, Shell, St } = imports.gi;
|
const { Clutter, Gio, GLib, Meta, Shell, St } = imports.gi;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
const GrabHelper = imports.ui.grabHelper;
|
const GrabHelper = imports.ui.grabHelper;
|
||||||
@@ -227,8 +227,6 @@ var SelectArea = class {
|
|||||||
this._lastY = 0;
|
this._lastY = 0;
|
||||||
this._result = null;
|
this._result = null;
|
||||||
|
|
||||||
this._initRubberbandColors();
|
|
||||||
|
|
||||||
this._group = new St.Widget({ visible: false,
|
this._group = new St.Widget({ visible: false,
|
||||||
reactive: true,
|
reactive: true,
|
||||||
x: 0,
|
x: 0,
|
||||||
@@ -248,10 +246,10 @@ var SelectArea = class {
|
|||||||
coordinate: Clutter.BindCoordinate.ALL });
|
coordinate: Clutter.BindCoordinate.ALL });
|
||||||
this._group.add_constraint(constraint);
|
this._group.add_constraint(constraint);
|
||||||
|
|
||||||
this._rubberband = new Clutter.Rectangle({ color: this._background,
|
this._rubberband = new St.Widget({
|
||||||
has_border: true,
|
style_class: 'select-area-rubberband',
|
||||||
border_width: 1,
|
visible: false
|
||||||
border_color: this._border });
|
});
|
||||||
this._group.add_actor(this._rubberband);
|
this._group.add_actor(this._rubberband);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,25 +263,6 @@ var SelectArea = class {
|
|||||||
this._group.visible = true;
|
this._group.visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
_initRubberbandColors() {
|
|
||||||
function colorFromRGBA(rgba) {
|
|
||||||
return new Clutter.Color({ red: rgba.red * 255,
|
|
||||||
green: rgba.green * 255,
|
|
||||||
blue: rgba.blue * 255,
|
|
||||||
alpha: rgba.alpha * 255 });
|
|
||||||
}
|
|
||||||
|
|
||||||
let path = new Gtk.WidgetPath();
|
|
||||||
path.append_type(Gtk.IconView);
|
|
||||||
|
|
||||||
let context = new Gtk.StyleContext();
|
|
||||||
context.set_path(path);
|
|
||||||
context.add_class('rubberband');
|
|
||||||
|
|
||||||
this._background = colorFromRGBA(context.get_background_color(Gtk.StateFlags.NORMAL));
|
|
||||||
this._border = colorFromRGBA(context.get_border_color(Gtk.StateFlags.NORMAL));
|
|
||||||
}
|
|
||||||
|
|
||||||
_getGeometry() {
|
_getGeometry() {
|
||||||
return { x: Math.min(this._startX, this._lastX),
|
return { x: Math.min(this._startX, this._lastX),
|
||||||
y: Math.min(this._startY, this._lastY),
|
y: Math.min(this._startY, this._lastY),
|
||||||
@@ -302,6 +281,7 @@ var SelectArea = class {
|
|||||||
|
|
||||||
this._rubberband.set_position(geometry.x, geometry.y);
|
this._rubberband.set_position(geometry.x, geometry.y);
|
||||||
this._rubberband.set_size(geometry.width, geometry.height);
|
this._rubberband.set_size(geometry.width, geometry.height);
|
||||||
|
this._rubberband.show();
|
||||||
|
|
||||||
return Clutter.EVENT_PROPAGATE;
|
return Clutter.EVENT_PROPAGATE;
|
||||||
}
|
}
|
||||||
|
@@ -79,14 +79,17 @@ var GnomeShell = class {
|
|||||||
for (let param in params)
|
for (let param in params)
|
||||||
params[param] = params[param].deep_unpack();
|
params[param] = params[param].deep_unpack();
|
||||||
|
|
||||||
let { monitor: monitorIndex,
|
let { connector,
|
||||||
label,
|
label,
|
||||||
level,
|
level,
|
||||||
max_level: maxLevel,
|
max_level: maxLevel,
|
||||||
icon: serializedIcon } = params;
|
icon: serializedIcon } = params;
|
||||||
|
|
||||||
if (monitorIndex === undefined)
|
let monitorIndex = -1;
|
||||||
monitorIndex = -1;
|
if (connector) {
|
||||||
|
let monitorManager = Meta.MonitorManager.get();
|
||||||
|
monitorIndex = monitorManager.get_monitor_for_connector(connector);
|
||||||
|
}
|
||||||
|
|
||||||
let icon = null;
|
let icon = null;
|
||||||
if (serializedIcon)
|
if (serializedIcon)
|
||||||
@@ -203,16 +206,10 @@ var GnomeShell = class {
|
|||||||
this._grabbers.delete(name);
|
this._grabbers.delete(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
ShowMonitorLabelsAsync(params, invocation) {
|
|
||||||
let sender = invocation.get_sender();
|
|
||||||
let [dict] = params;
|
|
||||||
Main.osdMonitorLabeler.show(sender, dict);
|
|
||||||
}
|
|
||||||
|
|
||||||
ShowMonitorLabels2Async(params, invocation) {
|
ShowMonitorLabels2Async(params, invocation) {
|
||||||
let sender = invocation.get_sender();
|
let sender = invocation.get_sender();
|
||||||
let [dict] = params;
|
let [dict] = params;
|
||||||
Main.osdMonitorLabeler.show2(sender, dict);
|
Main.osdMonitorLabeler.show(sender, dict);
|
||||||
}
|
}
|
||||||
|
|
||||||
HideMonitorLabelsAsync(params, invocation) {
|
HideMonitorLabelsAsync(params, invocation) {
|
||||||
|
@@ -456,13 +456,28 @@ var TilePreview = class {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var TouchpadWorkspaceSwitchAction = class {
|
var TouchpadWorkspaceSwitchAction = class {
|
||||||
constructor(actor) {
|
constructor(actor, allowedModes) {
|
||||||
|
this._allowedModes = allowedModes;
|
||||||
this._dx = 0;
|
this._dx = 0;
|
||||||
this._dy = 0;
|
this._dy = 0;
|
||||||
|
this._enabled = true;
|
||||||
actor.connect('captured-event', this._handleEvent.bind(this));
|
actor.connect('captured-event', this._handleEvent.bind(this));
|
||||||
this._touchpadSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.peripherals.touchpad'});
|
this._touchpadSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.peripherals.touchpad'});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get enabled() {
|
||||||
|
return this._enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
set enabled(enabled) {
|
||||||
|
if (this._enabled == enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this._enabled = enabled;
|
||||||
|
if (!enabled)
|
||||||
|
this.emit('cancel');
|
||||||
|
}
|
||||||
|
|
||||||
_checkActivated() {
|
_checkActivated() {
|
||||||
let dir;
|
let dir;
|
||||||
|
|
||||||
@@ -482,15 +497,16 @@ var TouchpadWorkspaceSwitchAction = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_handleEvent(actor, event) {
|
_handleEvent(actor, event) {
|
||||||
let allowedModes = Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW;
|
|
||||||
|
|
||||||
if (event.type() != Clutter.EventType.TOUCHPAD_SWIPE)
|
if (event.type() != Clutter.EventType.TOUCHPAD_SWIPE)
|
||||||
return Clutter.EVENT_PROPAGATE;
|
return Clutter.EVENT_PROPAGATE;
|
||||||
|
|
||||||
if (event.get_touchpad_gesture_finger_count() != 4)
|
if (event.get_touchpad_gesture_finger_count() != 4)
|
||||||
return Clutter.EVENT_PROPAGATE;
|
return Clutter.EVENT_PROPAGATE;
|
||||||
|
|
||||||
if ((allowedModes & Main.actionMode) == 0)
|
if ((this._allowedModes & Main.actionMode) == 0)
|
||||||
|
return Clutter.EVENT_PROPAGATE;
|
||||||
|
|
||||||
|
if (!this._enabled)
|
||||||
return Clutter.EVENT_PROPAGATE;
|
return Clutter.EVENT_PROPAGATE;
|
||||||
|
|
||||||
if (event.get_gesture_phase() == Clutter.TouchpadGesturePhase.UPDATE) {
|
if (event.get_gesture_phase() == Clutter.TouchpadGesturePhase.UPDATE) {
|
||||||
@@ -523,10 +539,11 @@ var WorkspaceSwitchAction = GObject.registerClass({
|
|||||||
'motion': { param_types: [GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] },
|
'motion': { param_types: [GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] },
|
||||||
'cancel': { param_types: [] }},
|
'cancel': { param_types: [] }},
|
||||||
}, class WorkspaceSwitchAction extends Clutter.SwipeAction {
|
}, class WorkspaceSwitchAction extends Clutter.SwipeAction {
|
||||||
_init() {
|
_init(allowedModes) {
|
||||||
super._init();
|
super._init();
|
||||||
this.set_n_touch_points(4);
|
this.set_n_touch_points(4);
|
||||||
this._swept = false;
|
this._swept = false;
|
||||||
|
this._allowedModes = allowedModes;
|
||||||
|
|
||||||
global.display.connect('grab-op-begin', () => {
|
global.display.connect('grab-op-begin', () => {
|
||||||
this.cancel();
|
this.cancel();
|
||||||
@@ -534,14 +551,12 @@ var WorkspaceSwitchAction = GObject.registerClass({
|
|||||||
}
|
}
|
||||||
|
|
||||||
vfunc_gesture_prepare(actor) {
|
vfunc_gesture_prepare(actor) {
|
||||||
let allowedModes = Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW;
|
|
||||||
|
|
||||||
this._swept = false;
|
this._swept = false;
|
||||||
|
|
||||||
if (!super.vfunc_gesture_prepare(actor))
|
if (!super.vfunc_gesture_prepare(actor))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return (allowedModes & Main.actionMode);
|
return (this._allowedModes & Main.actionMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
vfunc_gesture_progress(actor) {
|
vfunc_gesture_progress(actor) {
|
||||||
@@ -1043,14 +1058,15 @@ var WindowManager = class {
|
|||||||
global.workspace_manager.override_workspace_layout(Meta.DisplayCorner.TOPLEFT,
|
global.workspace_manager.override_workspace_layout(Meta.DisplayCorner.TOPLEFT,
|
||||||
false, -1, 1);
|
false, -1, 1);
|
||||||
|
|
||||||
let gesture = new WorkspaceSwitchAction();
|
let allowedModes = Shell.ActionMode.NORMAL;
|
||||||
|
let gesture = new WorkspaceSwitchAction(allowedModes);
|
||||||
gesture.connect('motion', this._switchWorkspaceMotion.bind(this));
|
gesture.connect('motion', this._switchWorkspaceMotion.bind(this));
|
||||||
gesture.connect('activated', this._actionSwitchWorkspace.bind(this));
|
gesture.connect('activated', this._actionSwitchWorkspace.bind(this));
|
||||||
gesture.connect('cancel', this._switchWorkspaceCancel.bind(this));
|
gesture.connect('cancel', this._switchWorkspaceCancel.bind(this));
|
||||||
global.stage.add_action(gesture);
|
global.stage.add_action(gesture);
|
||||||
|
|
||||||
// This is not a normal Clutter.GestureAction, doesn't need add_action()
|
// This is not a normal Clutter.GestureAction, doesn't need add_action()
|
||||||
gesture = new TouchpadWorkspaceSwitchAction(global.stage);
|
gesture = new TouchpadWorkspaceSwitchAction(global.stage, allowedModes);
|
||||||
gesture.connect('motion', this._switchWorkspaceMotion.bind(this));
|
gesture.connect('motion', this._switchWorkspaceMotion.bind(this));
|
||||||
gesture.connect('activated', this._actionSwitchWorkspace.bind(this));
|
gesture.connect('activated', this._actionSwitchWorkspace.bind(this));
|
||||||
gesture.connect('cancel', this._switchWorkspaceCancel.bind(this));
|
gesture.connect('cancel', this._switchWorkspaceCancel.bind(this));
|
||||||
@@ -1202,6 +1218,10 @@ var WindowManager = class {
|
|||||||
// Same for OR windows
|
// Same for OR windows
|
||||||
if (window.is_override_redirect())
|
if (window.is_override_redirect())
|
||||||
return;
|
return;
|
||||||
|
// Sticky windows don't need moving, in fact moving would
|
||||||
|
// unstick them
|
||||||
|
if (window.on_all_workspaces)
|
||||||
|
return;
|
||||||
// Windows on workspaces below pos don't need moving
|
// Windows on workspaces below pos don't need moving
|
||||||
let index = window.get_workspace().index();
|
let index = window.get_workspace().index();
|
||||||
if (index < pos)
|
if (index < pos)
|
||||||
|
@@ -1,10 +1,11 @@
|
|||||||
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
|
||||||
|
|
||||||
const { Clutter, Gio, GObject, Meta, St } = imports.gi;
|
const { Clutter, Gio, GObject, Meta, Shell, St } = imports.gi;
|
||||||
const Signals = imports.signals;
|
const Signals = imports.signals;
|
||||||
|
|
||||||
const Main = imports.ui.main;
|
const Main = imports.ui.main;
|
||||||
const Tweener = imports.ui.tweener;
|
const Tweener = imports.ui.tweener;
|
||||||
|
const WindowManager = imports.ui.windowManager;
|
||||||
const Workspace = imports.ui.workspace;
|
const Workspace = imports.ui.workspace;
|
||||||
|
|
||||||
var WORKSPACE_SWITCH_TIME = 0.25;
|
var WORKSPACE_SWITCH_TIME = 0.25;
|
||||||
@@ -82,6 +83,7 @@ var WorkspacesView = class extends WorkspacesViewBase {
|
|||||||
|
|
||||||
this._animating = false; // tweening
|
this._animating = false; // tweening
|
||||||
this._scrolling = false; // swipe-scrolling
|
this._scrolling = false; // swipe-scrolling
|
||||||
|
this._gestureActive = false; // touch(pad) gestures
|
||||||
this._animatingScroll = false; // programatically updating the adjustment
|
this._animatingScroll = false; // programatically updating the adjustment
|
||||||
|
|
||||||
let activeWorkspaceIndex = workspaceManager.get_active_workspace_index();
|
let activeWorkspaceIndex = workspaceManager.get_active_workspace_index();
|
||||||
@@ -211,7 +213,7 @@ var WorkspacesView = class extends WorkspacesViewBase {
|
|||||||
|
|
||||||
for (let w = 0; w < this._workspaces.length; w++) {
|
for (let w = 0; w < this._workspaces.length; w++) {
|
||||||
let workspace = this._workspaces[w];
|
let workspace = this._workspaces[w];
|
||||||
if (this._animating || this._scrolling) {
|
if (this._animating || this._scrolling || this._gestureActive) {
|
||||||
workspace.actor.show();
|
workspace.actor.show();
|
||||||
} else {
|
} else {
|
||||||
if (this._inDrag)
|
if (this._inDrag)
|
||||||
@@ -223,7 +225,7 @@ var WorkspacesView = class extends WorkspacesViewBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_updateScrollAdjustment(index) {
|
_updateScrollAdjustment(index) {
|
||||||
if (this._scrolling)
|
if (this._scrolling || this._gestureActive)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this._animatingScroll = true;
|
this._animatingScroll = true;
|
||||||
@@ -300,6 +302,18 @@ var WorkspacesView = class extends WorkspacesViewBase {
|
|||||||
this._updateVisibility();
|
this._updateVisibility();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
startTouchGesture() {
|
||||||
|
this._gestureActive = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
endTouchGesture() {
|
||||||
|
this._gestureActive = false;
|
||||||
|
|
||||||
|
// Make sure title captions etc are shown as necessary
|
||||||
|
this._scrollToActive();
|
||||||
|
this._updateVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
// sync the workspaces' positions to the value of the scroll adjustment
|
// sync the workspaces' positions to the value of the scroll adjustment
|
||||||
// and change the active workspace if appropriate
|
// and change the active workspace if appropriate
|
||||||
_onScroll(adj) {
|
_onScroll(adj) {
|
||||||
@@ -310,7 +324,7 @@ var WorkspacesView = class extends WorkspacesViewBase {
|
|||||||
let active = workspaceManager.get_active_workspace_index();
|
let active = workspaceManager.get_active_workspace_index();
|
||||||
let current = Math.round(adj.value);
|
let current = Math.round(adj.value);
|
||||||
|
|
||||||
if (active != current) {
|
if (active != current && !this._gestureActive) {
|
||||||
if (!this._workspaces[current]) {
|
if (!this._workspaces[current]) {
|
||||||
// The current workspace was destroyed. This could happen
|
// The current workspace was destroyed. This could happen
|
||||||
// when you are on the last empty workspace, and consolidate
|
// when you are on the last empty workspace, and consolidate
|
||||||
@@ -391,6 +405,12 @@ var ExtraWorkspaceView = class extends WorkspacesViewBase {
|
|||||||
|
|
||||||
endSwipeScroll() {
|
endSwipeScroll() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
startTouchGesture() {
|
||||||
|
}
|
||||||
|
|
||||||
|
endTouchGesture() {
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var DelegateFocusNavigator = GObject.registerClass(
|
var DelegateFocusNavigator = GObject.registerClass(
|
||||||
@@ -430,23 +450,37 @@ var WorkspacesDisplay = class {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < this._workspacesViews.length; i++)
|
this._startSwipeScroll();
|
||||||
this._workspacesViews[i].startSwipeScroll();
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
panAction.connect('gesture-cancel', () => {
|
panAction.connect('gesture-cancel', () => {
|
||||||
clickAction.release();
|
clickAction.release();
|
||||||
for (let i = 0; i < this._workspacesViews.length; i++)
|
this._endSwipeScroll();
|
||||||
this._workspacesViews[i].endSwipeScroll();
|
|
||||||
});
|
});
|
||||||
panAction.connect('gesture-end', () => {
|
panAction.connect('gesture-end', () => {
|
||||||
clickAction.release();
|
clickAction.release();
|
||||||
for (let i = 0; i < this._workspacesViews.length; i++)
|
this._endSwipeScroll();
|
||||||
this._workspacesViews[i].endSwipeScroll();
|
|
||||||
});
|
});
|
||||||
Main.overview.addAction(panAction);
|
Main.overview.addAction(panAction);
|
||||||
this.actor.bind_property('mapped', panAction, 'enabled', GObject.BindingFlags.SYNC_CREATE);
|
this.actor.bind_property('mapped', panAction, 'enabled', GObject.BindingFlags.SYNC_CREATE);
|
||||||
|
|
||||||
|
let allowedModes = Shell.ActionMode.OVERVIEW;
|
||||||
|
let switchGesture = new WindowManager.WorkspaceSwitchAction(allowedModes);
|
||||||
|
switchGesture.connect('motion', this._onSwitchWorkspaceMotion.bind(this));
|
||||||
|
switchGesture.connect('activated', this._onSwitchWorkspaceActivated.bind(this));
|
||||||
|
switchGesture.connect('cancel', this._endTouchGesture.bind(this));
|
||||||
|
Main.overview.addAction(switchGesture);
|
||||||
|
this.actor.bind_property('mapped', switchGesture, 'enabled', GObject.BindingFlags.SYNC_CREATE);
|
||||||
|
|
||||||
|
switchGesture = new WindowManager.TouchpadWorkspaceSwitchAction(global.stage, allowedModes);
|
||||||
|
switchGesture.connect('motion', this._onSwitchWorkspaceMotion.bind(this));
|
||||||
|
switchGesture.connect('activated', this._onSwitchWorkspaceActivated.bind(this));
|
||||||
|
switchGesture.connect('cancel', this._endTouchGesture.bind(this));
|
||||||
|
this.actor.connect('notify::mapped', () => {
|
||||||
|
switchGesture.enabled = this.actor.mapped;
|
||||||
|
});
|
||||||
|
switchGesture.enabled = this.actor.mapped;
|
||||||
|
|
||||||
this._primaryIndex = Main.layoutManager.primaryIndex;
|
this._primaryIndex = Main.layoutManager.primaryIndex;
|
||||||
|
|
||||||
this._workspacesViews = [];
|
this._workspacesViews = [];
|
||||||
@@ -474,6 +508,47 @@ var WorkspacesDisplay = class {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_startSwipeScroll() {
|
||||||
|
for (let i = 0; i < this._workspacesViews.length; i++)
|
||||||
|
this._workspacesViews[i].startSwipeScroll();
|
||||||
|
}
|
||||||
|
|
||||||
|
_endSwipeScroll() {
|
||||||
|
for (let i = 0; i < this._workspacesViews.length; i++)
|
||||||
|
this._workspacesViews[i].endSwipeScroll();
|
||||||
|
}
|
||||||
|
|
||||||
|
_startTouchGesture() {
|
||||||
|
for (let i = 0; i < this._workspacesViews.length; i++)
|
||||||
|
this._workspacesViews[i].startTouchGesture();
|
||||||
|
}
|
||||||
|
|
||||||
|
_endTouchGesture() {
|
||||||
|
for (let i = 0; i < this._workspacesViews.length; i++)
|
||||||
|
this._workspacesViews[i].endTouchGesture();
|
||||||
|
}
|
||||||
|
|
||||||
|
_onSwitchWorkspaceMotion(action, xRel, yRel) {
|
||||||
|
// We don't have a way to hook into start of touchpad actions,
|
||||||
|
// luckily this is safe to call repeatedly.
|
||||||
|
this._startTouchGesture();
|
||||||
|
|
||||||
|
let workspaceManager = global.workspace_manager;
|
||||||
|
let active = workspaceManager.get_active_workspace_index();
|
||||||
|
let adjustment = this._scrollAdjustment;
|
||||||
|
adjustment.value = (active - yRel / this.actor.height) * adjustment.page_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
_onSwitchWorkspaceActivated(action, direction) {
|
||||||
|
let workspaceManager = global.workspace_manager;
|
||||||
|
let activeWorkspace = workspaceManager.get_active_workspace();
|
||||||
|
let newWs = activeWorkspace.get_neighbor(direction);
|
||||||
|
if (newWs != activeWorkspace)
|
||||||
|
newWs.activate(global.get_current_time());
|
||||||
|
|
||||||
|
this._endTouchGesture();
|
||||||
|
}
|
||||||
|
|
||||||
navigateFocus(from, direction) {
|
navigateFocus(from, direction) {
|
||||||
return this._getPrimaryView().actor.navigate_focus(from, direction, false);
|
return this._getPrimaryView().actor.navigate_focus(from, direction, false);
|
||||||
}
|
}
|
||||||
|
@@ -24,6 +24,8 @@
|
|||||||
#ifndef __ST_SETTINGS_H__
|
#ifndef __ST_SETTINGS_H__
|
||||||
#define __ST_SETTINGS_H__
|
#define __ST_SETTINGS_H__
|
||||||
|
|
||||||
|
#include <glib-object.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define ST_TYPE_SETTINGS (st_settings_get_type ())
|
#define ST_TYPE_SETTINGS (st_settings_get_type ())
|
||||||
@@ -31,4 +33,6 @@ G_DECLARE_FINAL_TYPE (StSettings, st_settings, ST, SETTINGS, GObject)
|
|||||||
|
|
||||||
StSettings * st_settings_get (void);
|
StSettings * st_settings_get (void);
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __ST_SETTINGS_H__ */
|
#endif /* __ST_SETTINGS_H__ */
|
||||||
|
Reference in New Issue
Block a user