Commit Graph

620 Commits

Author SHA1 Message Date
Florian Müllner
8fb5476a1c build: Drop syntax-checks from meson test
Those checks are just as well handled by the CI, and removing them
makes for a nice build system cleanup.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/116
2020-04-11 01:08:02 +02:00
Florian Müllner
4722b89cc3 cleanup: Don't linebreak before closing parentheses
Otherwise recent versions of eslint want "dangling" commas,
which is at least ugly considering that most functions don't
allow adding arguments at leisure.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/116
2020-04-11 01:03:38 +02:00
Florian Müllner
bce63d3168 places-menu: Emphasize eject buttons here as well
We already align the buttons correctly here, but otherwise they can
use the same treatment as in the drive-menu.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/223
2020-04-10 14:31:40 +00:00
Florian Müllner
0426d1d8d5 drive-menu: Emphasize eject buttons as distinct controls
The buttons currently appear more as an attachment to the label
than as distinct controls. Address that by:

 - applying .button styling
 - increasing spacing between label and button
 - aligning buttons at the end

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/223
2020-04-10 14:31:40 +00:00
Xiaoguang Wang
f9aaa732b2 windowPicker: Wrong signal ID _nWorkspacesNotifyId
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/106
2020-04-10 16:27:41 +02:00
Florian Müllner
7d5c985004 build: Switch to js68 for tests
It's what the cool kids use nowadays ...
2020-03-07 23:07:37 +01:00
Florian Müllner
1ee3803265 window-list: Fix typo
Whoops, missed a shift-press there. Another issues that sneaked
in thanks to the broken eslint check.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/105
2020-01-26 23:43:18 +01:00
Florian Müllner
b25c4d07a7 style: Avoid unnecessary parentheses
The eslint check in CI is broken, and some style nits weren't caught
as a consequence.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/105
2020-01-26 23:43:18 +01:00
Florian Müllner
330e7b312d windowsNavigator: Adjust to deprecated API removal
The old raise/lower methods have been deprecated for years, and
mutter finally removed those APIs.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/104
2020-01-26 23:30:55 +01:00
Florian Müllner
01f921541f windowsNavigator: Use normal inheritance for non-GObject class
More fallout from commit 63615cb657.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/104
2020-01-26 23:30:55 +01:00
Florian Müllner
cc52f4a260 windowsNavigator: Add missing imports
Commit 63615cb657 missed that, which is an easy mistake to make.

But how on earth did CI not catch this?!

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/104
2020-01-26 23:25:38 +01:00
Florian Müllner
c958e2d0fd window-list: Force single-line window titles
While window titles really really shouldn't contain newline characters,
they are under application control and therefore may very well do.
Force the corresponding labels to be single line, to prevent offending
applications from messing up the whole window list layout.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/202
2020-01-17 15:03:54 +01:00
Florian Müllner
9c964eaf1b drive-menu: Stop using deprecated child properties
StBoxLayout's child properties were deprecated in favor of the generic
expand/align properties.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/102
2020-01-09 20:16:39 +01:00
Florian Müllner
0500480d75 window-list: Stop using deprecated child properties
StBoxLayout's child properties were deprecated in favor of the generic
expand/align properties.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/102
2020-01-09 20:15:52 +01:00
Florian Müllner
37a09b7be1 apps-menu: Stop using deprecated (child) properties
StBoxLayout's child properties were deprecated in favor of the generic
expand/align properties.

StBin now uses the same Clutter.Actor properties instead of its own.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/102
2020-01-09 20:13:11 +01:00
Florian Müllner
25b6b562d9 windowPicker: Adjust to gnome-shell changes
WorkspacesDisplay now takes an adjustment for the workspace position,
provide that.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/100
2020-01-09 19:25:25 +01:00
Willy Stadnick
a2b014ccbf screenshot-window-sizer: Fix cycling through all valid sizes
When cycling through window sizes, we should skip any sizes that are
bigger than the available area. We do that, but the current code
assumes that the possible sizes are sorted, which is no longer the
case since the addition of "phone" sizes in commit 5b43d4733c.

As a result, we may now skip sizes that would fit perfectly fine.
Address this by filtering out invalid sizes beforehand instead of
assuming a certain order (wich no longer work due to the addition
of a portrait format).

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/97
2019-11-26 00:49:08 +01:00
Florian Müllner
95131dc252 workspace-indicator: Exclude DESKTOP windows from window previews
While nautilus removed its desktop support a while ago in favor of an
extension, it's still possible that some external X11 desktop icon app
is used. As DESKTOP windows cannot be moved between workspaces or stacked,
and aren't perceived as regular windows, it doesn't make sense to show
them as previews in the workspace switcher.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/93
2019-11-21 21:42:16 +00:00
Florian Müllner
f3acb27d61 window-list: Exclude DESKTOP windows from window previews
While nautilus removed its desktop support a while ago in favor of an
extension, it's still possible that some external X11 desktop icon app
is used. As DESKTOP windows cannot be moved between workspaces or stacked,
and aren't perceived as regular windows, it doesn't make sense to show
them as previews in the workspace switcher.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/93
2019-11-21 21:42:16 +00:00
Florian Müllner
a904d51cf7 window-list: Fix faking overview
The public overview properties are now read-only, so switch to the
private properties which back them to fake the overview visibility.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/96
2019-11-21 22:38:50 +01:00
Florian Müllner
30ad3d670f extensions: Stop setting GTypeName
The type name generated by gjs now includes the filename, so we
don't have to set it ourselves to make sure it's unique.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/95
2019-11-21 22:25:43 +01:00
Marco Trevisan (Treviño)
63615cb657 cleanup: Use inheritance for Actor classes instead of composition
Use GObject types when inheriting from native actor classes.

Related to https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/559

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/89
2019-11-21 21:22:26 +00:00
Florian Müllner
9077687c0a places-menu: Fix loop
Fix fallout from commit 63c07bdc73.
2019-08-21 20:00:22 +00:00
Florian Müllner
fcbfaec53e apps-menu: Adjust to mutter API change
The global grab API got dropped from mutter's Clutter fork, so use the
corresponding input device API instead.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/90
2019-08-21 19:39:11 +02:00
Florian Müllner
7c170e7e90 cleanup: Always use type-safe comparisons
The type coercion performed by the regular == and != operators can
have surprising results. It is therefore considered good practice
to use the type-safe === and !== variants instead.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:44 +00:00
Florian Müllner
ed7a292805 cleanup: Don't use comparison operator when checking falsy values
We mostly use the regular == and != comparison operators over their
type-safe === and !== counterparts. This is about to change, but there
are some places where we don't care whether a value is null, undefined
or 0; just check for falsiness there instead of using operators, so
we can start to consistently use the type-safe operators everywhere
else in a follow-up commit.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:44 +00:00
Florian Müllner
eb79f5b512 cleanup: Require "dangling" commas
Since ES5, trailing commas in arrays and object literals are valid.
We generally haven't used them so far, but they are actually a good
idea, as they make additions and removals in diffs much cleaner.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:44 +00:00
Florian Müllner
eceff51ba1 cleanup: Use consistent brace style of blocks
Our coding style has always been to avoid braces when all blocks
are single-lines. Make sure we apply that style consistently.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:44 +00:00
Florian Müllner
63c07bdc73 cleanup: Don't shadow variables
Having variables that share the same name in overlapping scopes is
confusing and error-prone, and is best avoided.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:44 +00:00
Florian Müllner
fdc3dda484 cleanup: Fix stray/missing spaces
Those are wrong according to our style guidelines, but the previous
eslint ruleset didn't catch them.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:44 +00:00
Florian Müllner
fca516e58a cleanup: Disambiguate assignments in arrow functions
As arrow functions have an implicit return value, an assignment of
this.foo = bar could have been intended as a this.foo === bar
comparison. To catch those errors, we will disallow these kinds
of assignments unless they are marked explicitly by an extra pair
of parentheses.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:43 +00:00
Florian Müllner
c14f7f6fb8 cleanup: Use consistent style for ternary operator
We are currently inconsistent whether to put the operators in front
of the corresonding line or at the end of the preceding one. The
former makes more sense, so go with that.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:43 +00:00
Florian Müllner
2497dc6d31 cleanup: Use object destructuring where possible
ES6's destructuring is a nice way of assigning a variable in a concise way,
without duplicating the name of the object property. Use it consistently
where possible.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:43 +00:00
Florian Müllner
a1f38d818d cleanup: Use some more array destructuring
Array destructuring has been supported by gjs/mozjs for quite some time,
so we are already using it heavily where it makes sense.

However one place still sneaked through where using destructuring makes
sense, as the element's position has semantic meaning (instead of just
making it the first, second, ... element).

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:43 +00:00
Florian Müllner
9646149f9a cleanup: Use object shorthand where possible
ES6 allows to omit property names where they match the name of the
assigned variable, which makes code less redundant and thus cleaner.
We will soon enforce that in our eslint rules, so make sure we use
the shorthand wherever possible.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:43 +00:00
Florian Müllner
b6d02f8e1f cleanup: Use operator shorthands where possible
Shorthands like a += b are well-established, so prefer them over the
less concise a = a + b.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:43 +00:00
Florian Müllner
5f96b3c11c cleanup: Don't omit parens when constructing
While it is legal to omit parentheses when invoking a constructor
with no arguments, we generally avoid that in our coding style.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:43 +00:00
Florian Müllner
e217f23767 cleanup: Avoid unnecessary parentheses
Extra parentheses usually add noise rather than clarity, so avoid
them.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:43 +00:00
Florian Müllner
579a290bae screenshot-window-sizer: Rearrange calculation
eslint has a rule to prohibit unnecessary parentheses. While this is
generally a good idea stylistically, the parentheses in a calculation
of (a / b) * c add more clarity, as a / b * c lacks the unambiguity of
proper math notation:

   a                a
  --- * c   vs   -------
   b              b * c

We can still follow the style rule by rearranging to the unambiguous
c * a / b.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:43 +00:00
Florian Müllner
2dc4325a90 places-menu: Use spread operator for variadic function
Invoking functions via Function.prototype.apply() and .call() is
less performant than a regular function call, and makes code harder
to read.

Before ES6 there was no other way of writing a function with variadic
arguments, but since we now have the spread operator, we can use that
as the better alternative.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:43 +00:00
Florian Müllner
376502e952 windowsNavigator: Don't add linebreak before operator
When breaking overly long conditions into multiple lines, the operator
should end the previous line instead of starting the new one.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:43 +00:00
Florian Müllner
91c9982d7f workspace-indicator: Remove some inactive code
This code has been commented out since it was added, presumably due to
difficulty in avoiding a cycle of reloading rows on settings changes
and writing settings on row changes.

Considering that the setting changing while the preference dialog is
up is extremely unlikely, don't bother with making it work and just
remove the dead code.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:43 +00:00
Florian Müllner
c721121a2d native-window-placement: Fix weird comment styles
Don't use gtk-doc style comments for regular comments, and WTF is
/// comment ////?!

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:43 +00:00
Florian Müllner
4007b61cf2 apps-menu: Minor cleanup
We have a much more idiomatic way of transforming one array
into another than pushing values while iterating over the
original array ...

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
2019-08-21 15:13:43 +00:00
Florian Müllner
6aab09bd06 screenshot-window-sizer: Fix imports
Since we replaced Tweener with Clutter animations, we must import the
latter and don't need the former.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/88
2019-08-10 18:33:18 +02:00
Florian Müllner
80de26dc16 cleanup: Stop using Tweener
gnome-shell added convenience API for Clutter animations and replaced
Tweener everywhere; follow suite and do the same.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/87
2019-08-10 00:27:20 +02:00
Florian Müllner
af6f5fea54 window-list: Adjust animation time
gnome-shell changed all animations times to use milliseconds.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/86
2019-08-10 00:25:08 +02:00
Florian Müllner
9743054174 window-list: Don't override existing signal
Since commit b6a6de9bb5 turned WindowPicker into a ClutterActor
subclass, we already have a 'scroll-event' signal and don't need
to define our own.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/86
2019-08-10 00:25:08 +02:00
Florian Müllner
827af154b8 window-list: Support showing windows from all workspaces
gnome-panel's window list applet has such an option, so let's support
it as well.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/154
2019-08-09 22:20:43 +00:00
Florian Müllner
b6a6de9bb5 window-list: Actorize
gnome-shell is in the process of moving from composition to subclassing.
Do the same here, and use custom actor classes instead of "actor" and
"_delegate" properties.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/84
2019-07-20 00:20:51 +02:00