Compare commits

...

114 Commits

Author SHA1 Message Date
b0362945f4 data: Stop providing an Access portal backend
A portal review by the design team has concluded that
it is better to have all portals as application-modal
GTK dialogs, instead of mixing them with some system-modal
shell dialogs.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1994
2020-01-20 17:48:31 +01:00
1fb955b8da theme: Add back run-dialog styling
It was dropped accidentally in commit 02e885b3.
2020-01-20 17:45:56 +01:00
0e3a2654d4 iconGrid: Animate icon positions
As per design guidance, animate the icons when the grid changes.
Each icon takes 250ms to transition, and starts moving 25ms after
the previous one.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/882
2020-01-20 16:40:42 +01:00
ef4009f17d theme/messageList: Add spacing for no-notifications placeholder
https://gitlab.gnome.org/GNOME/gnome-shell/issues/682
2020-01-20 15:26:28 +01:00
31a2758606 endSessionDialog: Redesign according to new mockups
See https://gitlab.gnome.org/GNOME/gnome-shell/issues/1343

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/935
2020-01-20 15:05:41 +01:00
f7153ed340 endSessionDialog: Use a ListSection for application and session list
Since there now are generic ListSection and ListSectionItem widgets for
dialogs, use them for the lists of inhibitors in the endSessionDialog.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/935
2020-01-20 15:05:37 +01:00
02e885b3a4 dialog: Add a ListSection and ListSectionItem
According to the mockups, add a generic ListSection and ListSectionItem
for dialogs. To add items (like a ListSectionItem) to a section,
ListSection exposes a public ListSection.list actor.

See https://gitlab.gnome.org/GNOME/gnome-shell/issues/1343

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/935
2020-01-20 14:49:33 +01:00
012dde3de9 dialog: Split out _setLabel function
This will be useful when adding more generic containers like
MessageDialogContent.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/935
2020-01-20 14:49:33 +01:00
b3db8fc73f endSessionDialog: Don't allow focusing inhibitor items
Those items are not interactive, so it doesn't make sense to be able to
set key-focus to them, disallow that.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/935
2020-01-20 14:46:39 +01:00
aae3789142 endSessionDialog: Fix a signal-name typo
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/935
2020-01-20 14:46:39 +01:00
184f980c18 endSessionDialog: Rename "warning" css class to "battery-warning"
Since this css class is specifically about the low-battery warning, make
the class name a bit more specific, too.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/935
2020-01-20 14:46:39 +01:00
11283339b6 endSessionDialog: Fix a typo
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/935
2020-01-20 14:46:39 +01:00
765895fb19 lightbox: Change vignette brightness to 0.5
Since the overview search results now have a dark background layer, we
can brighten the background image a bit again. As a factor we use 0.5,
since that ensures the texts in the IconGrid are still readable and the
background image is visible, too.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/2133
2020-01-19 18:01:57 +01:00
a68762980f Update Croatian translation 2020-01-19 00:45:45 +00:00
c565186ea8 Remove two line breaks to make comments for translators get displayed
A comment for translators must *immediately* precede a message:
https://wiki.gnome.org/TranslationProject/DevGuidelines/Use%20comments
These two comments were previously not displayed in any po files.
2020-01-18 14:07:41 +01:00
efd6be60e3 altTab: Allow pressing uppercase keys to close apps and windows
Right now only pressing "w" and "q" will close a window or an app, don't
confuse people who have caps-lock enabled or are holding down shift.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/168
2020-01-17 14:34:34 +00:00
84250bbf88 altTab: Don't return from _init() if there are no windows/apps
If a new SwitcherPopup is created and there are no windows or apps to
switch through found, instead of returning from _init(), still
initialize the SwitcherPopup and let the check in SwitcherPopup.show()
return false to terminate the popup.

In both cases, with or without the return statements,
WindowManager._startSwitcher() will call SwicherPopup.destroy(), which
will try to disconnect signal handlers, destroy actors etc. Now if the
constructor can't finish creating the popup, some of the functions
called from _onDestroy() will fail and throw errors.

One of those cases is when window-switcher is limited to the current
workspace, and a WindowCyclerPopup is initiated on an empty workspace.
Because this._highlight hasn't been created, _onDestroy() will fail when
trying to destroy the actor of this._highlight.

Also, the actor of this._switcherList will not get destroyed in case
show() returns because this._items is empty. For example, this will
happen when a new AppSwitcherPopup is initialized with at least 1
running app, but 0 windows on the active workspace.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/168
2020-01-17 14:34:34 +00:00
79ccf1a0b5 altTab: Rename List* classes to Switcher*
Calling those classes ThumbnailSwitcher and WindowSwitcher makes more
sense since we are using this naming scheme for all classes extending
SwitcherPopup.SwitcherList.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/168
2020-01-17 14:34:34 +00:00
b3770fd923 Update Slovak translation 2020-01-17 13:55:15 +00:00
f0e04e7892 theme: Don't apply the search entry style to the login entry
The password entry is not a search entry.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2088
2020-01-17 12:21:44 +00:00
889863f353 theme: Don't recolor buttons and entries in dialogs and notifications
We should have a consistent dialog style in the whole system.

See https://gitlab.gnome.org/GNOME/gnome-shell/issues/1343
2020-01-17 12:21:44 +00:00
9726aba257 theme: Normalize entry focus style
This fixes the focus style of the regular entry to match with the GTK
one.

This will allow removing a number of overrides of entries for
normalization.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/931
2020-01-17 12:21:44 +00:00
c4646c15e9 theme: Regain focus ring in %bubble_button
Instead of removing all button shadows forcibly with
`box-shadow: none !important`, remove only the drop shadows selectively
with button(). This allows %bubble_button to preserve the focus ring
while eliminating the drop shadows.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2088
2020-01-17 12:21:44 +00:00
5195f6f92e theme: Improve button styling
- Move the more generic %button style before %bubble_button to reduce
  ugly overrides.
- Remove sizing factors from _drawing.scss to reduce ugly !importants.
- Make the %bubble_button style more consistent.
- Add missing focus styling to %notification_bubble.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/931
2020-01-17 12:21:44 +00:00
7ed39f7905 theme/hotplug: Remove some dead code
Those style classes were removed about 5 years ago and no longer exist.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/931
2020-01-17 12:21:44 +00:00
ebf6e75b5e theme: Fix off-centered clickable area of dash items
https://gitlab.gnome.org/GNOME/gnome-shell/issues/2088
2020-01-17 12:21:44 +00:00
b0ca52ffdc theme: Don't apply inconsistent hover style to menu items in submenus
https://gitlab.gnome.org/GNOME/gnome-shell/issues/2088
2020-01-17 12:21:44 +00:00
fbfa22f964 theme: Add missing border-radius to the active workspace in the switcher
https://gitlab.gnome.org/GNOME/gnome-shell/issues/2088
2020-01-17 12:21:44 +00:00
260cce9d92 theme: Don't jump the today button on hover/focus
This seemed quite buggy as no other button jumps on hover/focus in the
theme.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2088
2020-01-17 12:21:44 +00:00
dcf7ba3bc7 theme: Separate run dialog specific style from generic dialog style
Like other specific dialog styles already do.

Also move .modal-dialog-linked-button into .modal-dialog as well as
.modal-dialog-content-box.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/931
2020-01-17 12:21:44 +00:00
2ae8606e5e theme: Remove unnecessary %bubble_panel extensions
Since these dialogs have .modal-dialog class, there is no need to extend
%bubble_panel.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/931
2020-01-17 12:21:44 +00:00
9719b13cf8 theme: Remove invalid button styling
There is no ".message-list-clear-button .button" selector, but
".message-list-clear-button.button". To make it clear, this commit adds
.button to .message-list-clear-button.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/931
2020-01-17 12:21:44 +00:00
d27638e37e shellEntry: Show popup menu at cursor position when pressing menu key
When pressing the menu key to show the popupMenu inside a ShellEntry,
the menu is currently aligned with the end of the entered text, this
causes a bug in case the text is overflowing the width of the entry: The
menu will be shown outside of the entry field, because it's aligned with
the (invisible) end of the text.

Fix that by simply aligning the popup menu with the cursor of the entry,
which is a behavior that makes sense when pressing the menu-key anyway.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/934
2020-01-15 18:27:31 +01:00
e4cb1a8f4b dialog: Update the layout of dialogs according to the new design
According to the new dialog mockups, update the dialogs paddings and
spacings. Also change the font-weigth of the title to 800 and the
font-size to 18pt, this will make the headings of some dialogs ellipsize
because they contain too much text, we'll have to fix this in subsequent
commits.

See https://gitlab.gnome.org/GNOME/gnome-shell/issues/1343

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/886
2020-01-15 00:18:30 +01:00
2fc84e0fe3 dialog: Remove MessageDialogContent.body property
According to the new dialog design, dialogs generally only have a title
and a description, so the `body` property is no longer needed.

At the places where it's still used, we replace it with the description
property or a plain label we add to MessageDialogContent ourselves.

See https://gitlab.gnome.org/GNOME/gnome-shell/issues/1343

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/886
2020-01-15 00:17:25 +01:00
845c52797b dialog: Rename subtitle property to description
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/886
2020-01-15 00:12:54 +01:00
48f1c4b9d7 dialog: Remove messageBox container from MessageDialogContent
`MessageDialogContent.messageBox` is not really needed and was only
needed to show icons, which is now no longer supported. The styling can
also be done using other CSS classes and this makes it a bit more
straightforward to add actors to the MessageDialogContent.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/886
2020-01-15 00:05:34 +01:00
5d99bdbe5e dialog: Remove icons from dialogs
According to the new mockups, remove the icon from MessageDialogContent

See https://gitlab.gnome.org/GNOME/gnome-shell/issues/1343

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/886
2020-01-15 00:05:34 +01:00
929c2c3921 js: Move dialog parts out of messageBox
Since MessageDialogContent.messageBox is going to be removed in a
subsequent commit, move the parts where it's used out of messageBox and
into the contentLayout instead. This will introduce wrong spacings in
some dialogs, which we're going to fix when implementing the redesigned
individual dialogs.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/886
2020-01-15 00:05:04 +01:00
914c6e48b1 dialog: Remove addContent function
Now that child metas are removed, there's no need for a custom
`addContent` function anymore. It was only used in one place anyway...

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/886
2020-01-15 00:05:02 +01:00
259c44395f dialog: Switch to new indentation style
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/886
2020-01-15 00:05:02 +01:00
5de713b262 css: Remove unused class run-dialog-button-box
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/886
2020-01-15 00:04:47 +01:00
882f6d9a72 Update Indonesian translation 2020-01-14 06:28:04 +00:00
aac01f1c9e status/network: Compare icon name to NULL instead of empty string
Since the last commit we set the gicon property of StIcon to NULL if an
empty string was given when setting the icon name, this means
`st_icon_get_icon_name()` will return NULL instead of an empty string.

When `getIndicatorIcon()` returns an empty string, the icon_name
property will now be set to NULL, so compare it to NULL here.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/888
2020-01-13 14:47:19 +01:00
8b15519160 st/icon: Check icon name for empty string in setter function
Don't try to create a GIcon if the given icon name is empty, it will
lead to failure when loading the icon anyway, instead set the gicon to
NULL just as we do in the `set_gicon()` API when unsetting an icon.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/888
2020-01-13 14:44:08 +01:00
69a5e89096 st/icon: Use own methods for updating GIcon when setting icon names
Instead of reimplementing the functions to set the GIcon inside the
`set_*_icon_name` functions, just use the already defined methods for
that.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/888
2020-01-13 14:44:08 +01:00
e784afe9ac st/icon: Add API to set the fallback GIcon
Let's support the fallback icon a bit better and allow setting its GIcon
just as we do for the normal icon.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/888
2020-01-13 14:44:08 +01:00
8b8d3e28b2 st/icon: Update GtkDoc and annotations
Add missing documentation for some functions and make existing
documentation a bit more precise.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/888
2020-01-13 14:44:08 +01:00
9b673dc98b st/icon: Use existing method for getting gicon property
We have an existing method for this, let's use it instead of accessing
the private property here.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/888
2020-01-13 14:44:08 +01:00
c0fcf2d3a8 st/icon: Simplify property setting in set_gicon()
We can easily use `g_set_object()` to set the gicon property here.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/888
2020-01-13 14:44:08 +01:00
3b46c3910c st/icon: Reorder header file
The order of the functions is currently quite messy, change the order of
the headers so it makes more sense and correct a wrong argument name
while at it.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/888
2020-01-13 14:44:08 +01:00
76961927d5 iconGrid.js: Animate icon spring using translation
Animating the icon spring using the `translation-x/y` properties instead
of the `x/y` properties avoids relayouts. There are still other non-icon
actors moving, but it's a big improvement.

Before: 595 relayouts per spring
After: 94 relayouts per spring

Reducing relayouts reduces reallocation, which reduces CPU-intensive
JavaScript execution.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/926
2020-01-13 16:23:37 +08:00
8064f4498e Update Esperanto translation 2020-01-11 10:30:04 +00:00
b21c8c1290 workspacesView: Round workspace position
Prevent blurring when scrolling workspaces by aligning it to pixel grid,
and be consistent with app grid.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/930
2020-01-11 02:58:19 +05:00
4c6a0678ff screenshot: Fix stripping suffix from relative filename
String.prototype.substr() doesn't support a negative length value
(to subtract from the full length), so we end up with a filename
of '' when hitting that code paths (a relative filename with '.png'
suffix).

Fix this by switching to String.prototype.replace() instead.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2091
2020-01-10 19:31:04 +01:00
a8dcfa4656 windowManager: Use SwipeTracker
Replace existing four-finger gestures with SwipeTracker.

Since TouchpadWorkspaceSwitchAction and WorkspaceSwitchAction are now
unused, remove them.

Change programmatic workspace transition to use easeOutCubic interpolator
to match the gesture.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/756

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/826
2020-01-10 18:20:22 +01:00
3e6bcbb486 appDisplay: Use SwipeTracker
Replace existing panning and touchpad scrolling by SwipeTracker.

Since SwipeTracker only references one actor, redirect scroll events
from page indicators to the main scroll view.

Change programmatic scroll animation to use easeOutCubic interpolator
to match the gesture.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/826
2020-01-10 18:20:22 +01:00
a11f417cd0 workspacesView: Use SwipeTracker
Replace existing panning, touchpad scrolling and four-finger gesture by
SwipeTracker.

Change programmatic workspace animation to use easeOutCubic interpolator
to match the gesture.

Also change the dragging distance to always match the current monitor.

Fixes touchpad parts of https://gitlab.gnome.org/GNOME/gnome-shell/issues/1338

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/826
2020-01-10 18:20:22 +01:00
a0c0e52229 swipeTracker: Introduce swipe tracker
Add a unified swipe tracker supporting dragging, four-finger swipe on both
touchscreen and touchpad, and touchpad scrolling.

The shared logic is largely same as the one in WebKit and libhandy.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/826
2020-01-10 18:20:22 +01:00
1f2116eaf8 screenShield: Stop messing with fixed-position-set
We no longer change the position at all, so this property doesn't
change and doesn't matter (anymore).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/927
2020-01-10 16:26:31 +01:00
ceda02f2da screenShield: Fix showing shield without animation
Commit 24e631ffe2 changed the shield animation to use translation
instead of position.

However once the shield is raised, only an animation will lower it
again, which means the shield is missing when it's supposed to be
shown without animation (for example after an idle blank).

Fix this by resetting the translation-y property in that case.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/927
2020-01-10 16:26:31 +01:00
0df3b47366 Update Slovak translation 2020-01-10 06:41:21 +00:00
e169e5a30a shell/blur-effect: Set float brightness property
The brightness property of ShellBlurEffect is of float type, but
we are calling g_value_set_int() in the GObject::get_property()
handler, which throws warnings when trying to set the property
via g_object_set() and family.

Use g_value_set_float() instead.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/924
2020-01-09 22:03:55 +00:00
0d9dcd4e0a dateMenu: Adjust weather section spacing
Add some vertical spacing above and below the time labels to make
the section less crammed and let forecast icon and temperature
appear as a unit.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1143
2020-01-09 17:13:24 +01:00
6233d87e5b dateMenu: Move weather forecast time above icon
The time is de-emphasized like the header, grouping them together
helps to further accentuate the more important information.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1143
2020-01-09 17:13:24 +01:00
57751a2bef dateMenu: Tweak temperature labels
Together with the forecast icon, the temperature label is the most
important information in the weather section. To emphasize it more,
reduce its space requirement by removing the temperature unit, then
make the text bold.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1143
2020-01-09 17:13:19 +01:00
f93e4d7424 theme: fix HC after refactoring
- panel fg color was derived from bg color. Not a good idea as it's not
  just light/drk, but HC as well.
- deriving from dark theme means contrast for things like popover items
  is better.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/904
2020-01-09 16:43:26 +01:00
3582133e29 theme > message-list: pad to account for scrollbar
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/904
2020-01-09 16:43:26 +01:00
39b206d862 theme: use 99px radius
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/904
2020-01-09 16:43:26 +01:00
29a561c0b1 theme: add space between & and .
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/904
2020-01-09 16:43:26 +01:00
276f912c45 theme: update meson.build with new files
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/904
2020-01-09 16:43:26 +01:00
46878d69f3 theme > search results: revisions to padding, drop bg from app results
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/904
2020-01-09 16:43:26 +01:00
7c0b6c8413 theme: use a widgets.scss file for widget import
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/904
2020-01-09 16:43:26 +01:00
5e1def2642 theme > osd: light variant fixes; variables
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/904
2020-01-09 16:43:26 +01:00
e30144a0dc theme: search-entry, use more variables
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/904
2020-01-09 16:43:26 +01:00
e9d484f77f theme: window-picker, use osd styling for title tooltips; tidy sass
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/904
2020-01-09 16:43:26 +01:00
f2e9757862 theme: tidy the syntax for app-grid; fix border radii
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/904
2020-01-09 16:43:26 +01:00
d713d78745 theme: dash, tidy the sass
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/904
2020-01-09 16:43:26 +01:00
fb3e5a4495 theme: app-grid, refine the padding, fix the tabs
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/904
2020-01-09 16:43:26 +01:00
79a837b87a theme: use the fontsize function consistently
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/904
2020-01-09 16:43:26 +01:00
d50e06dcce theme: adjust padding in calendar popover
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/904
2020-01-09 16:43:26 +01:00
891f2201c5 theme: use spaces instead of tabs
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/904
2020-01-09 16:43:24 +01:00
9ea745bcd4 theme: base of the refactor
- split _common.scss into widgets
- improve _drawing functions
- minify SVG assets

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/904
2020-01-09 16:42:57 +01:00
eb2ebd2bf9 Updated Spanish translation 2020-01-09 14:59:44 +01:00
1ef4d85b50 networkAgent: Handle 'vpn' connections when delaying request
Since commit 90a08ba0b6, we only open a network secret dialog immediately
in response to user action, and show a notification otherwise.

While for the actual request VPNs are handled separately from other connections,
this isn't true when we show the notification - we need to handle 'vpn' together
with the other types there, or we fall through to the default 'invalid type'
exception.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2008
2020-01-09 01:26:01 +00:00
fc7bcf4761 workspacesView: Add timeout for mouse scrolling
Prevent uncontrollably fast scrolling. Use the same duration as switching
animation, but add a separate timeout to account for disabled animations.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1338

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/825
2020-01-08 23:41:49 +01:00
08ebfa1acf appDisplay: Add timeout for mouse scrolling
Prevent uncontrollably fast scrolling. Use the same duration as switching
animation, but add a separate timeout to account for disabled animations.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1338

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/825
2020-01-08 23:41:49 +01:00
944b835fa9 appDisplay: Reduce page switch time to 250ms
Be consistent with workspace switching.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/825
2020-01-09 03:26:16 +05:00
9c1940ef9d workspaceThumbnail: Sync indicator with WorkspacesDisplay
Now that both ThumbnailsBox and WorkspacesDisplay use single adjustments for
controlling indicator and scrolling, create the adjustment in OverviewControls
and pass it to both objects, effectively syncing indicator to scrolling.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/821
2020-01-08 23:07:08 +01:00
f55ff01239 workspaceThumbnail: Use scroll adjustment
This will allow it to share adjustment with WorkspacesDisplay in the next
commit.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/821
2020-01-08 23:07:08 +01:00
8f4414de97 workspacesView: Use shared adjustment
Instead of having a scroll adjustment in each WorkspacesView, and using the
one from primary screen in WorkspacesDisplay, have just one adjustment in
WorkspacesDisplay, and sync the changes between WorkspacesView.

This will allow to share the adjustment between WorkspacesDisplay and
ThumbnailsBox in the next commits.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/821
2020-01-08 23:07:08 +01:00
24e631ffe2 screenShield: Animate shield using translation_y
Instead of using the 'y', which queues a full relayout and
thus forces effects to be reapplied, use the 'translation_y'
property, that doesn't force relayouts and allows a future
blur effect to actually use the cached framebuffers a lot more.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/864
2020-01-08 15:59:15 -03:00
248eb7419e Introduce ShellBlurEffect
This is a moderately fast two-pass gaussian blur implementation.
It downscales the framebuffer dynamically before applying the
gaussian shader, which cuts down rendering time quite considerably.

The blur shader takes 2 uniforms as input: the blur radius; and
whether to blur vertically or horizontally.

The blur radius is treated as an integer in C land to simplify
calculations. The vertical parameter is treated as an integer by
the shader simply due to Cogl not having proper boolean support
in snippets.

At last, brightness is also added to avoid needing to use an extra
effect to achieve that. Brightness is applied in a different pipeline
than blur, so we can control it more tightly.

ShellBlurEffect also implements a "background" mode, where the contents
beneath the actor are blurred, but not the actor itself. This mode is
performance-heavy.

Related: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1848

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/864
2020-01-08 15:59:15 -03:00
49f32d2a43 Updated Spanish translation 2020-01-08 16:47:48 +01:00
b0753f78cc systemActions: Alias power-off to halt and stop
Those are words users may reasonably use when trying to shut down their
computer, so add them to the list of keywords.

https://bugzilla.gnome.org/show_bug.cgi?id=791659
2020-01-08 15:32:28 +00:00
dfb9270a2c Update Basque translation 2020-01-08 10:39:23 +00:00
dd2e560255 gitlab: Add issue templates
This adds two GitLab issue templates for:
* Epics
* Features

The actual templates are inspired by the ones Geary provides.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/763
2020-01-07 22:42:46 +00:00
d0507ec69f Update default favorite apps list
Many of the apps in the favorite apps list have fallen out of favor.

Replacing Rhythmbox with Music and Shotwell with Photos are obvious
moves. Rhythmbox and Shotwell are not core apps, and that means we
assume they are not installed by default. It doesn't really make sense
to have non-default apps in the apps list.

Evolution is also not a core app, and that is not likely to change, so
it should also be removed. Adding Geary might be more controversial. It
is a strong candidate to become a core app, GNOME Mail, in the near
future, but it is not there yet. So this could arguably be considered
premature. But I figure a GSettings
default is a cheap thing; we can always change it later if desired.

Calendar is added at the request of GNOME design team ("replacing" the
calendar functionality of Evolution).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/907
2020-01-07 15:03:50 +00:00
27b927448b data: Drop old bugzilla references in .desktop files
They are obsolete, and I don't think we have a gitlab replacement
(plus the fields probably stopped being relevant when bug-buddy
went out of fashion ages ago).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/920
2020-01-07 12:41:57 +01:00
2d4941f432 build: Use python postinstall script
This is what most GNOME modules now use instead of a shell script,
which makes sense given that the build system itself is written
in python.

This particular copy comes from nautilus ...

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/920
2020-01-07 12:41:57 +01:00
45fe925a1b docs: Conform to coding style in HACKING guide
The document is supposed to outline our best practices on the
javascript side, so make sure the code snippets actually conform
to the enforced style.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/919
2020-01-06 19:53:21 +01:00
9dc85d76d9 environment: Remove unused ease parameter
In an earlier iteration of the ease patch set, animatable properties
and easing parameters were different arguments.

This wasn't the case in the final version, so remove the left-overs.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/917
2020-01-06 13:17:59 +00:00
10818c74a6 extensionPrefs: Don't (re-)bind text domain
Gettext is already set up from the binary, no need to do it again
in JS.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/918
2020-01-06 13:10:43 +00:00
460cf9df30 Bump version to 3.35.3
Update NEWS.
2020-01-05 12:22:35 +01:00
42af514c51 keyboard: Fix input-source switcher alignment
More fallout from commit 104071acbd.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/916
2020-01-04 23:00:02 +00:00
3244c280d8 Update Catalan translation 2020-01-03 23:07:19 +01:00
e07a5749b7 switchMonitor: Center align switcher icon's label
Fallout from 104071acbd.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/913
2020-01-02 13:03:08 +05:30
a8f44be5c1 Updated Spanish translation 2019-12-30 12:50:57 +01:00
8f8892aa20 Update Catalan translation 2019-12-27 14:16:47 +01:00
45a8b92d84 Update Galician translation 2019-12-25 02:40:58 +00:00
6b4017fbb6 Update Friulian translation 2019-12-22 18:59:02 +00:00
28d42628d1 windowManager: Always reset window actors when minimize animation is cancelled
This was left out in b6d47c18c. Fixes an occasional warning:
`this._minimizeWindowOverwritten is not a function`

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/911
2019-12-21 15:28:32 +01:00
c1d738d60c st/password-entry: Initialize :show-peek-icon property
The icon is shown by default, but the struct member that backs the
property starts out as FALSE.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/910
2019-12-21 04:12:03 +01:00
c2609227ff st/password-entry: Fix memory leak
The peek-password icon is currently created twice, whoops.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/910
2019-12-21 04:12:03 +01:00
113 changed files with 11478 additions and 9559 deletions

2
.gitignore vendored
View File

@ -21,6 +21,8 @@ data/org.gnome.shell.gschema.valid
data/org.gnome.Shell.PortalHelper.desktop
data/org.gnome.Shell.PortalHelper.service
data/theme/.sass-cache
data/theme/gnome-shell*.css.map
data/theme/gnome-shell*.css
docs/reference/*/*.args
docs/reference/*/*.bak
docs/reference/*/*.hierarchy

View File

@ -0,0 +1,55 @@
<!--
Please read https://wiki.gnome.org/Community/GettingInTouch/BugReportingGuidelines
first to ensure that you create a clear and specific issue.
-->
### Affected version
<!--
Provide at least the following information:
* Your OS and version
* Affected GNOME Shell version
* Does this issue appear in XOrg and/or Wayland
-->
### Bug summary
<!--
Provide a short summary of the bug you encountered.
-->
### Steps to reproduce
<!--
1. Step one
2. Step two
3. ...
-->
### What happened
<!--
What did GNOME Shell do that was unexpected?
-->
### What did you expect to happen
<!--
What did you expect GNOME Shell to do?
-->
### Relevant logs, screenshots, screencasts etc.
<!--
If you have further information, such as technical documentation, logs,
screenshots or screencasts related, please provide them here.
If the bug is a crash, please obtain a stack trace with installed debug
symbols (at least for GNOME Shell and Mutter) and attach it to
this issue following the instructions on
https://wiki.gnome.org/Community/GettingInTouch/Bugzilla/GettingTraces.
-->
<!-- Do not remove the following line. -->
/label ~"1. Bug"

View File

@ -0,0 +1,30 @@
<!--
Please read https://wiki.gnome.org/Community/GettingInTouch/BugReportingGuidelines
first to ensure that you create a clear and specific issue.
-->
### Feature summary
<!--
Describe what you would like to be able to do with GNOME Shell
that you currently cannot do.
-->
### How would you like it to work
<!--
If you can think of a way GNOME Shell might be able to do this,
let us know here.
-->
### Relevant links, screenshots, screencasts etc.
<!--
If you have further information, such as technical documentation,
code, mockups or a similar feature in another desktop environments,
please provide them here.
-->
<!-- Do not remove the following line. -->
/label ~"1. Feature"

View File

@ -29,9 +29,8 @@ what to do.
bar = do_thing(b);
if (var == 5) {
for (let i = 0; i < 10; i++) {
for (let i = 0; i < 10; i++)
print(i);
}
} else {
print(20);
}
@ -102,9 +101,8 @@ under the imports:
Always use either `const` or `let` when defining a variable.
```javascript
// Iterating over an array
for (let i = 0; i < arr.length; ++i) {
for (let i = 0; i < arr.length; ++i)
let item = arr[i];
}
// Iterating over an object's properties
for (let prop in someobj) {
@ -252,7 +250,7 @@ variable that can be captured in closures.
All closures should be wrapped with Function.prototype.bind or use arrow
notation.
```javascript
let closure1 = () => { this._fnorbate(); };
let closure1 = () => this._fnorbate();
let closure2 = this._fnorbate.bind(this);
```

19
NEWS
View File

@ -1,3 +1,22 @@
3.35.3
======
* Add discrete GPU support for NVidia drivers [Bastien; #1810]
* Fix DND of window previews with tablet devices [Carlos; !897]
* Update pad OSD actions dynamically on mode changes [Carlos; !898]
* st: Add dedicated PasswordEntry widget [Umang; !619]
* Allow stand-alone builds of gnome-extensions tool [Florian; !877]
* extension-tool: Don't treat missing .js handler as error [Chuck; !905]
* Disallow top bar menus without top bar [Florian; #2002]
* Misc. bug fixes and cleanups [Georges, Florian, Robert, Umang; !901,
#789937, !909, !910, !911, !913, !916]
Contributors:
Michael Catanzaro, Chuck, Carlos Garnacho, Umang Jain, Robert Mader,
Florian Müllner, Georges Basile Stavracas Neto, Bastien Nocera
Translators:
Fabio Tomat [fur], Fran Dieguez [gl], Jordi Mas [ca], Daniel Mustieles [es]
3.35.2
======
* Fix unredirection after cancelled animations [Florian; #1788]

View File

@ -1,15 +0,0 @@
<node>
<interface name="org.freedesktop.impl.portal.Access">
<method name="AccessDialog">
<arg type="o" name="handle" direction="in"/>
<arg type="s" name="app_id" direction="in"/>
<arg type="s" name="parent_window" direction="in"/>
<arg type="s" name="title" direction="in"/>
<arg type="s" name="subtitle" direction="in"/>
<arg type="s" name="body" direction="in"/>
<arg type="a{sv}" name="options" direction="in"/>
<arg type="u" name="response" direction="out"/>
<arg type="a{sv}" name="results" direction="out"/>
</method>
</interface>
</node>

View File

@ -9,7 +9,6 @@
<file preprocess="xml-stripblanks">org.freedesktop.DBus.xml</file>
<file preprocess="xml-stripblanks">org.freedesktop.GeoClue2.Agent.xml</file>
<file preprocess="xml-stripblanks">org.freedesktop.GeoClue2.Manager.xml</file>
<file preprocess="xml-stripblanks">org.freedesktop.impl.portal.Access.xml</file>
<file preprocess="xml-stripblanks">org.freedesktop.impl.portal.PermissionStore.xml</file>
<file preprocess="xml-stripblanks">org.freedesktop.impl.portal.Request.xml</file>
<file preprocess="xml-stripblanks">org.freedesktop.login1.Manager.xml</file>

View File

@ -3,10 +3,6 @@ Type=Application
Name=Shell Extensions
Comment=Configure GNOME Shell Extensions
Exec=@bindir@/gnome-shell-extension-prefs %u
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gnome-shell
X-GNOME-Bugzilla-Component=extensions
X-GNOME-Bugzilla-Version=@VERSION@
Categories=GNOME;GTK;
OnlyShowIn=GNOME;
NoDisplay=true

View File

@ -1,4 +0,0 @@
[portal]
DBusName=org.freedesktop.impl.portal.desktop.gnome
Interfaces=org.freedesktop.impl.portal.Access
UseIn=gnome

View File

@ -13,7 +13,6 @@ desktopconf = configuration_data()
# We substitute in bindir so it works as an autostart
# file when built in a non-system prefix
desktopconf.set('bindir', bindir)
desktopconf.set('VERSION', meson.project_version())
desktopconf.set('systemd_hidden', have_systemd ? 'true' : 'false')
foreach desktop_file : desktop_files
@ -73,7 +72,6 @@ configure_file(
)
install_data('gnome-shell.portal', install_dir: portaldir)
install_data('50-gnome-shell-system.xml', install_dir: keysdir)

View File

@ -3,10 +3,6 @@ Type=Application
Name=GNOME Shell
Comment=Window management and application launching
Exec=@bindir@/gnome-shell
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gnome-shell
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-Version=@VERSION@
Categories=GNOME;GTK;Core;
OnlyShowIn=GNOME;
NoDisplay=true

View File

@ -50,7 +50,7 @@
</description>
</key>
<key name="favorite-apps" type="as">
<default>[ 'org.gnome.Epiphany.desktop', 'org.gnome.Evolution.desktop', 'rhythmbox.desktop', 'org.gnome.Shotwell.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.Software.desktop' ]</default>
<default>[ 'org.gnome.Epiphany.desktop', 'org.gnome.Geary.desktop', 'org.gnome.Calendar.desktop', 'org.gnome.Music.desktop', 'org.gnome.Photos.desktop', 'org.gnome.Nautilus.desktop', 'org.gnome.Software.desktop' ]</default>
<summary>List of desktop file IDs for favorite applications</summary>
<description>
The applications corresponding to these identifiers

View File

@ -1,16 +1,17 @@
$variant: 'light';
$variant: 'dark';
@import "gnome-shell-sass/_high-contrast-colors"; //use gtk colors
@import "gnome-shell-sass/_drawing";
@import "gnome-shell-sass/_common";
@import "gnome-shell-sass/_widgets";
//force symbolic icons
stage {
-st-icon-style: symbolic;
-st-icon-style: symbolic;
}
.toggle-switch { width: 48px; }
.toggle-switch-us, .toggle-switch-intl {
background-image: url("resource:///org/gnome/shell/theme/toggle-off-hc.svg");
&:checked { background-image: url("resource:///org/gnome/shell/theme/toggle-on-hc.svg"); }
background-image: url("resource:///org/gnome/shell/theme/toggle-off-hc.svg");
&:checked { background-image: url("resource:///org/gnome/shell/theme/toggle-on-hc.svg"); }
}

View File

@ -1,16 +1,15 @@
// When color definition differs for dark and light variant,
// it gets @if ed depending on $variant
$base_color: if($variant == 'light', #ffffff, lighten(desaturate(#241f31, 20%), 2%));
$base_color: if($variant == 'light', #fff, lighten(desaturate(#241f31, 20%), 2%));
$bg_color: if($variant == 'light', #f6f5f4, darken(desaturate(#3d3846, 100%), 4%));
$fg_color: if($variant == 'light', #2e3436, #eeeeec);
$selected_fg_color: #ffffff;
$selected_fg_color: #fff;
$selected_bg_color: if($variant == 'light', #3584e4, darken(#3584e4, 10%));
$selected_borders_color: if($variant== 'light', darken($selected_bg_color, 15%), darken($selected_bg_color, 30%));
$borders_color: if($variant == 'light', darken($bg_color, 18%), darken($bg_color, 10%));
$borders_edge: if($variant == 'light', transparentize(white, 0.2), transparentize($fg_color, 0.93));
$borders_color: if($variant == 'light', darken($bg_color, 18%), darken($bg_color, 8%));
$borders_edge: if($variant == 'light', rgba(255,255,255,0.8), transparentize($fg_color, 0.93));
$link_color: if($variant == 'light', darken($selected_bg_color, 10%), lighten($selected_bg_color, 20%));
$link_visited_color: if($variant == 'light', darken($selected_bg_color, 20%), lighten($selected_bg_color, 10%));
$top_hilight: $borders_edge;
@ -20,21 +19,20 @@ $error_color: #ff8080;
$success_color: if($variant == 'light', #33d17a, darken(#33d17a, 10%));
$destructive_color: if($variant == 'light', #e01b24, darken(#e01b24, 10%));
$osd_fg_color: #eeeeec;
$osd_text_color: white;
$osd_bg_color: transparentize(darken(desaturate(#3d3846, 100%), 12%),0.04);
$osd_fg_color: $fg_color;
$osd_text_color: if($variant == 'light', #000, #fff);
$osd_bg_color: if($variant == 'light', rgba(255,255,255,0.9), transparentize(darken(desaturate(#3d3846, 100%), 12%),0.04));
$osd_insensitive_bg_color: transparentize(mix($osd_fg_color, opacify($osd_bg_color, 1), 10%), 0.5);
$osd_insensitive_fg_color: mix($osd_fg_color, opacify($osd_bg_color, 1), 50%);
$osd_borders_color: transparentize(black, 0.3);
$osd_outer_borders_color: transparentize(white, 0.84);
$osd_borders_color: if($variant == 'light', rgba(255,255,255,0.1), rgba(0,0,0,0.7));
$osd_outer_borders_color: if($variant == 'light', rgba(0,0,0,0.1), lighten($osd_bg_color, 7%));
$tooltip_borders_color: $osd_outer_borders_color;
$shadow_color: transparentize(black, 0.9);
$shadow_color: if($variant == 'light', rgba(0,0,0,0.1), rgba(0,0,0,0.2));
//insensitive state derived colors
$insensitive_fg_color: mix($fg_color, $bg_color, 50%);
$insensitive_bg_color: mix($bg_color, $base_color, 60%);
$insensitive_borders_color: $borders_color;
$insensitive_borders_color: mix($borders_color, $base_color, 60%);
//colors for the backdrop state, derived from the main colors.
$backdrop_base_color: if($variant =='light', darken($base_color,1%), lighten($base_color,1%));
@ -42,4 +40,4 @@ $backdrop_bg_color: $bg_color;
$backdrop_fg_color: mix($fg_color, $backdrop_bg_color, 80%);
$backdrop_insensitive_color: if($variant =='light', darken($backdrop_bg_color,15%), lighten($backdrop_bg_color,15%));
$backdrop_borders_color: mix($borders_color, $bg_color, 90%);
$backdrop_dark_fill: mix($backdrop_borders_color,$backdrop_bg_color, 35%);
$backdrop_dark_fill: mix($backdrop_borders_color,$backdrop_bg_color, 35%);

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
// generic drawing of more complex things
@function _widget_edge($c:$borders_edge) {
@function draw_widget_edge($c:$borders_edge) {
// outer highlight "used" on most widgets
@return 0 1px $c;
}
@ -13,7 +13,7 @@
//font-size: ($size / $base) * 1rem;
}
@mixin _shadows($shadow1, $shadow2:none, $shadow3:none, $shadow4:none) {
@mixin draw_shadows($shadow1, $shadow2:none, $shadow3:none, $shadow4:none) {
//
// Helper function to stack up to 4 box-shadows;
//
@ -31,8 +31,7 @@
//
// $t: entry type
// $fc: focus color
// $edge: set to none to not draw the bottom edge or specify a color to not
// use the default one
// $edge: set to none to not draw the bottom edge or specify a color to not use the default one
//
// possible $t values:
// normal, focus, insensitive
@ -45,8 +44,9 @@
}
@if $t==focus {
border-color: if($fc==$selected_bg_color,
$selected_borders_color,
darken($fc,35%));
$selected_borders_color,
darken($fc,35%));
box-shadow: inset 0 0 0 1px $fc;
}
@if $t==hover { }
@if $t==insensitive {
@ -58,36 +58,39 @@
// buttons
@function _border_color ($c) { @return darken($c,25%); } // colored buttons want
// the border form the
// base color
@function draw_border_color ($c) {
//
// colored buttons want the border form the base color
//
@return if($variant == 'light', darken($c, 18%), darken($c, 4%));
}
@function _text_shadow_color ($tc:$fg_color, $bg:$bg_color) {
@function draw_text_shadow_color ($tc:$fg_color, $bg:$bg_color) {
//
// calculate the color of text shadows
//
// $tc is the text color
// $bg is the background color
//
$_lbg: lightness($bg)/100%;
@if lightness($tc)<50% { @return transparentize(white,1-$_lbg/($_lbg*1.3)); }
@else { @return transparentize(black,$_lbg*0.8); }
$lbg: lightness($bg)/100%;
@if lightness($tc)<50% { @return rgba(255,255,255,$lbg/($lbg*1.3)); }
@else { @return rgba(0,0,0,1-$lbg*0.8); }
}
@function _button_hilight_color($c) {
@function draw_button_hilight_color($c) {
//
// calculate the right top hilight color for buttons
//
// $c: base color;
//
@if lightness($c)>90% { @return white; }
@else if lightness($c)>80% { @return transparentize(white, 0.3); }
@else if lightness($c)>50% { @return transparentize(white, 0.5); }
@else if lightness($c)>40% { @return transparentize(white, 0.7); }
@else { @return transparentize(white, 0.9); }
@else if lightness($c)>80% { @return rgba(255,255,255, 0.7); }
@else if lightness($c)>50% { @return rgba(255,255,255, 0.5); }
@else if lightness($c)>40% { @return rgba(255,255,255, 0.3); }
@else { @return rgba(255,255,255, 0.1); }
}
@mixin _button_text_shadow ($tc:$fg_color, $bg:$bg_color) {
@mixin draw_button_text_shadow ($tc:$fg_color, $bg:$bg_color) {
//
// helper function for the text emboss effect
//
@ -96,19 +99,19 @@
// TODO: this functions needs a way to deal with special cases
//
$_shadow: _text_shadow_color($tc, $bg);
$shadow: draw_text_shadow_color($tc, $bg);
@if lightness($tc)<50% {
text-shadow: 0 1px $_shadow;
icon-shadow: 0 1px $_shadow;
text-shadow: 0 1px $shadow;
icon-shadow: 0 1px $shadow;
}
@else {
text-shadow: 0 -1px $_shadow;
icon-shadow: 0 -1px $_shadow;
text-shadow: 0 -1px $shadow;
icon-shadow: 0 -1px $shadow;
}
}
@mixin button($t, $c:$bg_color, $tc:$fg_color, $edge: $borders_edge) {
@mixin button($t, $c:$bg_color, $tc:$fg_color, $edge: $borders_edge, $shadow: $shadow_color) {
//
// Button drawing function
//
@ -117,6 +120,8 @@
// $tc: optional text color for colored* types
// $edge: set to none to not draw the bottom edge or specify a color to not
// use the default one
// $shadow: set to none to not draw the drop shadow or specify a color to not
// use the default one
//
// possible $t values:
// normal, hover, active, insensitive, insensitive-active,
@ -124,79 +129,68 @@
// osd, osd-hover, osd-active, osd-insensitive, osd-backdrop, undecorated
//
$_hilight_color: _button_hilight_color($c);
$_button_edge: if($edge == none, none, _widget_edge($edge));
$_blank_edge: if($edge == none, none, _widget_edge(transparentize($edge,1)));
$_button_shadow: 0 1px 2px transparentize($shadow_color, 0.03);
$hilight_color: draw_button_hilight_color($c);
$button_edge: if($edge == none, none, draw_widget_edge($edge));
$blank_edge: if($edge == none, none, draw_widget_edge(transparentize($edge,1)));
$button_shadow: if($shadow == none, none, 0 1px 1px 0 $shadow);
@if $t==normal {
//
// normal button
//
@if $t==normal {
color: $tc;
background-color: $c;
border-color: $borders_color;
box-shadow: $_button_shadow;
text-shadow: 0 1px black;
icon-shadow: 0 1px black;
background-color: lighten($c, 3%) !important;
border-color: draw_border_color($c);
@include draw_shadows($button_shadow);
// box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
text-shadow: 0 1px $text_shadow_color;
icon-shadow: 0 1px $text_shadow_color;
}
@if $t==focus {
//
// focused button
//
@if $t==focus {
color: $tc;
text-shadow: 0 1px black;
icon-shadow: 0 1px black;
box-shadow: inset 0px 0px 0px 2px $selected_bg_color;
text-shadow: 0 1px $text_shadow_color;
icon-shadow: 0 1px $text_shadow_color;
box-shadow: inset 0 0 0 2px transparentize($selected_bg_color, 0.7);
//border-color: $selected_bg_color;
}
// hover button
@else if $t==hover {
//
// active osd button
//
color: $tc;
border-color: $borders_color;
background-color: $c;
box-shadow: $_button_shadow;
text-shadow: 0 1px black;
icon-shadow: 0 1px black;
background-color: lighten($c, if($variant == 'light', 8%, 5%)) !important;
border-color: if($variant == 'light', draw_border_color(lighten($c, 7%)), draw_border_color($c));
@include draw_shadows($button_shadow);
text-shadow: 0 1px $text_shadow_color;
icon-shadow: 0 1px $text_shadow_color;
}
// active button
@else if $t==active {
//
// active osd button
//
color: $tc;
border-color: $borders_color;
background-color: $c;
background-color: darken($c,3%) !important;
border-color: draw_border_color(if($variant == 'light', $c, darken($c,7%)));
text-shadow: none;
icon-shadow: none;
box-shadow: none;
}
@else if $t==insensitive {
// insensitive button
@else if $t==insensitive {
color: $insensitive_fg_color;
border-color: $insensitive_borders_color;
background-color: $insensitive_bg_color;
background-color: $insensitive_bg_color !important;
box-shadow: none;
text-shadow: none;
icon-shadow: none;
}
@else if $t==undecorated {
//
// reset
//
@else if $t==undecorated {
border-color: transparent;
background-color: transparent;
background-image: none;
@include _shadows(inset 0 1px transparentize(white,1),
$_blank_edge);
@include draw_shadows(inset 0 1px rgba(255,255,255,0),$blank_edge);
text-shadow: none;
icon-shadow: none;
}
}

View File

@ -22,11 +22,10 @@ $destructive_color: darken(#ef2929,10%);
$osd_fg_color: #eeeeec;
$osd_bg_color: #2e3436;
$osd_borders_color: transparentize(black, 0.3);
$osd_outer_borders_color: transparentize(white, 0.9);
$osd_borders_color: rgba(0,0,0, 0.7);
$osd_outer_borders_color: rgba(255,255,255, 0.1);
$tooltip_borders_color: $osd_outer_borders_color;
$shadow_color: transparentize(black, 0.9);
$shadow_color: rgba(0,0,0, 0.1);
//insensitive state derived colors
$insensitive_fg_color: mix($fg_color, $bg_color, 50%);

View File

@ -0,0 +1,39 @@
//
// Shell widgets stylesheets are placed in separate .scss files
// in 'widgets' and imported into the main stylesheet in this file.
// To create or update a widget for the shell modify the list below.
//
/* WIDGETS */
@import 'widgets/app-grid';
@import 'widgets/app-switcher';
@import 'widgets/buttons';
@import 'widgets/calendar';
@import 'widgets/check-box';
@import 'widgets/corner-ripple';
@import 'widgets/dash';
@import 'widgets/dialogs';
@import 'widgets/end-session-dialog';
@import 'widgets/entries';
@import 'widgets/hotplug';
@import 'widgets/ibus-popup';
@import 'widgets/keyboard';
@import 'widgets/login-dialog';
@import 'widgets/looking-glass';
@import 'widgets/message-list';
@import 'widgets/notifications';
@import 'widgets/misc';
@import 'widgets/network-dialog';
@import 'widgets/osd';
@import 'widgets/overview';
@import 'widgets/panel';
@import 'widgets/popovers';
@import 'widgets/screen-shield';
@import 'widgets/scrollbars';
@import 'widgets/search-entry';
@import 'widgets/search-results';
@import 'widgets/slider';
@import 'widgets/switches';
@import 'widgets/tiled-previews';
@import 'widgets/window-picker';
@import 'widgets/workspace-switcher';

View File

@ -0,0 +1,208 @@
/* App Grid */
$app_icon_size: 96px;
$app_icon_padding: 24px;
// app icons
.icon-grid {
-shell-grid-horizontal-item-size: $app_icon_size + $app_icon_padding * 2;
-shell-grid-vertical-item-size: $app_icon_size + $app_icon_padding * 2;
spacing: $base_spacing * 6;
.overview-icon {
icon-size: $app_icon_size;
StIcon { margin-bottom: $base_margin; } // margin on icon so label isn't close
}
}
//.app-display { spacing: 20px; }
/* App Icons */
$app_grid_fg_color: #fff;
// Outline for low res icons
.lowres-icon {
icon-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
// Dropshadow for large icons
.icon-dropshadow {
icon-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
// Icon tiles in the app grid
.app-well-app,
.app-folder {
.overview-icon {
@extend %icon_tile;
color: $app_grid_fg_color !important;
}
&:selected {
.overview-icon {
background-color: transparentize($osd_bg_color,0.7);
color: $app_grid_fg_color;
}
}
&:hover,
&:focus,
&:selected {
.overview-icon {
background-color: transparentize($osd_fg_color,0.9);
color: $osd_fg_color;
}
}
&:focus {
.overview-icon {
background-color: transparentize($osd_fg_color,0.7 );
// border-color: $selected_bg_color;
color: $app_grid_fg_color;
}
}
&:drop {
.overview-icon {
background-color: transparentize($selected_bg_color,.15);
}
}
&:active,
&:checked {
.overview-icon {
background-color: transparentize(darken($osd_bg_color,10%), 0.5);
}
}
}
/* App Folders */
.app-folder {
.overview-icon {
@extend %icon_tile;
}
}
// expanded folder
.app-folder-popup {
-arrow-border-radius: 8px;
-arrow-background-color: transparentize(darken($osd_bg_color,10%), 0.5);
-arrow-base: 24px;
-arrow-rise: 11px;
}
.app-folder-popup-bin { padding: $base_padding - 1px; }
.app-folder-icon {
padding: $base_padding;
spacing-rows: $base_spacing;
spacing-columns: $base_spacing;
}
// Running app indicator (also shown in dash)
.app-well-app-running-dot {
height: 5px;
width: 5px;
border-radius:5px;
background-color: $osd_fg_color;
margin-bottom: 1px;
}
// Rename popup for app folders
.rename-folder-popup {
.rename-folder-popup-item {
spacing: $base_spacing;
&:ltr, &:rtl { padding: 0 $base_padding * 2; }
}
}
// right-click app menu
.app-menu,
.app-well-menu {
max-width: 27.25em;
}
// App Grid pagination indicators
.page-indicator {
padding: 15px 20px;
.page-indicator-icon {
width: 10px;
height: 10px;
border-radius: 10px; // the same as height&width
background-color: white;
}
}
// Some hacks I don't even know
.all-apps,
.frequent-apps > StBoxLayout {
// horizontal padding to make sure scrollbars or dash don't overlap content
padding: 0px 88px 10px 88px;
}
.app-well-app > .overview-icon.overview-icon-with-label {
padding: 10px 8px 5px 8px;
spacing: $base_spacing;
}
// Label when no frequent apps
.no-frequent-applications-label { @extend %status_text; }
// shutdown and other actions in the grid
.system-action-icon {
background-color: rgba(0,0,0,0.8);
color: #fff;
border-radius: 99px;
icon-size: $app_icon_size * 0.5;
}
/* Frequent | All toggle */
// container
.app-view-controls {
padding-bottom: 32px;
}
// buttons
.app-view-control {
padding: $base_padding $base_padding*5;
margin: 0;
background-color: transparentize($osd_bg_color, 0.5);
border-width: 1px;
color: darken($osd_fg_color, 25%);
&:hover {
background-color: transparentize($osd_bg_color, 0.5) !important;
box-shadow:none !important;
color: darken($osd_fg_color, 25%);
}
&:active {
box-shadow: none;
background-color: $selected_bg_color !important;
&:hover {
background-color: lighten($selected_bg_color, 11%) !important;
}
}
&:checked {
background-color: $selected_bg_color !important;
color: $selected_fg_color;
box-shadow: none;
&:active { background-color: darken($selected_bg_color, 4%) !important; }
&:hover { background-color: lighten($selected_bg_color, 7%) !important; }
}
&:first-child {
border-right-width: 0 !important;
border-radius: $base_border_radius 0 0 $base_border_radius;
}
&:last-child {
border-radius: 0 $base_border_radius $base_border_radius 0;
}
}

View File

@ -0,0 +1,55 @@
/* App Switcher */
.switcher-popup {
padding: 8px;
spacing: $base_spacing * 4;
}
// switcher onscreen panel
.switcher-list {
@extend %osd_panel;
.item-box {
padding: 8px;
border-radius: $base_border_radius + 1px;
border: 1px solid transparent;
&:outlined {
border: 1px solid darken($borders_color,5%);
background-color: transparentize($osd_fg_color, 0.9);
box-shadow: inset 0 2px 2px 0 rgba(0,0,0,0.4);
}
&:selected {
background-color: transparentize($osd_fg_color, 0.9);
color: $osd_fg_color;
}
}
// window thumbnails
.thumbnail-box {
padding: 2px;
spacing: $base_spacing;
}
.thumbnail {
width: 256px;
}
.separator {
width: 1px;
background: $borders_color;
}
.switcher-list-item-container {
spacing: $base_spacing * 2;
}
}
.switcher-arrow {
border-color: rgba(0,0,0,0);
color: transparentize($fg_color,0.2);
&:highlighted {
color: $fg_color;
}
}

View File

@ -0,0 +1,5 @@
/* Buttons */
.button {
@extend %button; // that's it
}

View File

@ -0,0 +1,266 @@
/* Date/Time Menu */
// overall menu
#calendarArea {
padding:0;
margin:0;
}
// Calendar menu side column
.datemenu-calendar-column {
spacing: 0;
border: 0 solid $bubble_borders_color;
padding: $base_padding * 2;
padding-bottom: 3em; // account for the notifications clear button
padding-top:0;
&:ltr {margin-right: $base_margin * 2; border-left-width: 1px; }
&:rtl {margin-left: $base_margin * 2; border-right-width: 1px; }
// today button (the date)
.datemenu-today-button {
padding: $base_padding * 1.5;
margin: $base_margin;
border: 1px solid transparent;
border-radius: $base_border_radius + 2px;
&:hover { @include button(hover);}
&:focus { @include button(focus);}
&:active {
@include button(active);
}
// weekday label
.day-label {
@include fontsize($base_font_size+1);
font-weight: bold;
}
// date label
.date-label {
@include fontsize($base_font_size+7);
font-weight: 1000;
}
}
// calendar
.calendar {
@extend %notification_bubble;
margin:$base_margin !important;
margin-bottom: $base_padding + $base_margin !important;
padding:$base_padding !important;
// more below for sub-elements
}
.datemenu-displays-section {
margin:0;
}
.datemenu-displays-box {
spacing: $base_spacing;
margin:0;
// world clocks and weather
.world-clocks-button,
.weather-button {
@extend %notification_bubble;
padding:$base_padding !important;
}
}
}
.events-section-title {
color: desaturate(darken($fg_color,40%), 10%);
font-weight: bold;
border-radius: 4px;
padding: .4em;
}
/* Calendar */
.calendar {
// month
.calendar-month-label {
color: lighten($fg_color,5%);
font-weight: bold;
padding: 8px 0;
&:focus {}
}
// prev/next month icons
.calendar-change-month-back StIcon,
.calendar-change-month-forward StIcon {
icon-size: $base_icon_size;
}
.pager-button {
background-color: transparent;
height: 32px;
width: 32px;
border-radius: $base_border_radius;
&:hover, &:focus { background-color: lighten($hover_bg_color, 5%); }
&:active { background-color: $active_bg_color; }
}
$calendar_day_size: 32px;
.calendar-day-base {
@include fontsize($base_font_size - 3);
text-align: center;
width: $calendar_day_size;
height: $calendar_day_size;
padding: 0;
margin: 2px;
border-radius: $calendar_day_size * 0.5 + 2px;
border: 1px solid transparent; //avoid jumparound due to today
font-feature-settings: "tnum";
&:hover, &:focus { background-color: $hover_bg_color; }
&:active,&:selected {
color: lighten($fg_color,10%);
background-color: darken($bg_color,5%);
}
// day of week heading
&.calendar-day-heading {
color: lighten($fg_color,10%);
margin-top: 1em;
@include fontsize($base_font_size - 4);
}
}
.calendar-day { //border collapse hack - see calendar.js
border-width: 0;
}
.calendar-day-top {
border-top-width: 1px;
}
.calendar-day-left { border-left-width: 1px; }
.calendar-work-day {}
.calendar-nonwork-day {
color: $insensitive_fg_color;
}
// Today
.calendar-today {
font-weight: bold;
border: 1px solid transparent;
background-color: $selected_bg_color;
color: $selected_fg_color;
&:hover,&:focus {
background-color:lighten($selected_bg_color, 3%);
color: $selected_fg_color;
}
&:active,&:selected {
background-color: $selected_bg_color;
color: $selected_fg_color;
&:hover,&:focus {
background-color:lighten($selected_bg_color, 3%);
color: $selected_fg_color;
}
}
}
.calendar-day-with-events {
color: lighten($fg_color,10%);
font-weight: bold;
background-image: url("resource:///org/gnome/shell/theme/calendar-today.svg");
}
.calendar-other-month-day {
color: transparentize($fg_color ,0.5);
opacity: 0.5;
}
.calendar-week-number {
@include fontsize($base_font_size - 4);
font-weight: bold;
height: 1.8em;
width: 2.3em;
border-radius: 2px;
padding: 0.5em 0 0;
margin: 6px;
background-color: darken($bg_color, 2%);
color: lighten($fg_color, 5%);
}
}
/* Weather */
.weather-box {
spacing: $base_spacing;
padding:$base_padding;
.weather-header {
color: desaturate(darken($fg_color,40%), 10%);
font-weight: bold;
&.location {
font-weight: normal;
@include fontsize($base_font_size - 1);
}
}
.weather-grid {
margin-top: $base_margin;
spacing-rows: $base_spacing;
spacing-columns: $base_spacing * 2;
}
.weather-forecast-time {
color: darken($fg_color,30%);
font-feature-settings: "tnum";
@include fontsize($base_font_size - 2);
font-weight: normal;
padding-top: 0.2em;
padding-bottom: 0.4em;
}
.weather-forecast-icon {
icon-size: $base_icon_size * 2;
}
.weather-forecast-temp {
font-weight: bold;
}
}
/* World clocks */
.world-clocks-grid {
padding:$base_padding;
spacing-rows: $base_spacing;
spacing-columns: $base_spacing * 2;
// title
.world-clocks-header {
color: desaturate(darken($fg_color,40%), 10%);
font-weight: bold;
}
// city label
.world-clocks-city {
color: $fg_color;
@include fontsize($base_font_size);
font-weight: normal;
}
// timezone time
.world-clocks-time {
font-weight: bold;
color: $fg_color;
font-feature-settings: "lnum";
@include fontsize($base_font_size);
text-align: right;
}
// timezone offset label
.world-clocks-timezone {
color: darken($fg_color,20%);
font-feature-settings: "tnum";
@include fontsize($base_font_size - 1);
}
}

View File

@ -0,0 +1,18 @@
/* Check Boxes */
// these are equal to the size of the SVG assets
$check_height: 22px;
$check_width: 24px;
.check-box {
StBoxLayout { spacing: .8em; }
StBin {
width: $check_width;
height: $check_height;
background-image: url("resource:///org/gnome/shell/theme/checkbox-off.svg");
}
&:focus StBin { background-image: url("resource:///org/gnome/shell/theme/checkbox-off-focused.svg"); }
&:checked StBin { background-image: url("resource:///org/gnome/shell/theme/checkbox.svg"); }
&:focus:checked StBin { background-image: url("resource:///org/gnome/shell/theme/checkbox-focused.svg"); }
}

View File

@ -0,0 +1,24 @@
/* Activities Ripple */
$ripple_size: 50px;
.ripple-box {
background-color: lighten(transparentize($selected_bg_color, 0.7), 40%);
box-shadow: 0 0 2px 2px lighten($selected_bg_color, 20%);
// plus + 2px for the border (box-shadow)
width: $ripple_size + 2px;
height: $ripple_size + 2px;
border-radius: 0 0 $ripple_size + 2px 0; // radius equals the size of the box to give us the curve
// just a simple change to the border radius position
&:rtl { border-radius: 0 0 0 $ripple_size + 2px; }
}
// Pointer location
.ripple-pointer-location {
width: $ripple_size;
height: $ripple_size;
border-radius: $ripple_size * 0.5; // radius equals the size of the box to give us the curve
background-color: lighten(transparentize($selected_bg_color, 0.7), 30%);
box-shadow: 0 0 2px 2px lighten($selected_bg_color, 20%);
}

View File

@ -0,0 +1,86 @@
/* Dash */
$dash_placeholder_size: 32px;
$dash_spacing: $base_padding + 4px;
$dash_border_radius: $modal_radius * 1.5;
#dash {
@extend %overview_panel;
@include fontsize($base_font_size - 2);
padding: ($dash_spacing / 2) 0;
//fixme: can't have non uniform borders :(
border-radius: 0 $dash_border_radius $dash_border_radius 0;
border-left-width: 0 !important;
&:rtl {
border-radius: $dash_border_radius 0 0 $dash_border_radius;
border-right-width: 0 !important;
}
.placeholder {
// background-image: url("resource:///org/gnome/shell/theme/dash-placeholder.svg");
background-image:none;
background-size: contain;
height: $dash_placeholder_size;
}
.empty-dash-drop-target {
width: $dash_placeholder_size;
height: $dash_placeholder_size;
}
}
// Dash Items
.dash-item-container > StWidget {
padding: ($dash_spacing / 2) $dash_spacing;
}
// OSD Tooltip
.dash-label {
background-color: transparentize($osd_bg_color,0.05);
border-radius: $base_border_radius + 2px;
border:none;
box-shadow:0 0 0 1px $osd_outer_borders_color;
color: $osd_fg_color;
margin-top: $base_margin + 4px;
padding: $base_padding $base_padding + 2px;
text-align: center;
-x-offset: $base_margin * 2; // distance from the dash edge
}
// Show apps button
.show-apps {
color: $osd_fg_color;
& .overview-icon {
@extend %icon_tile;
color: $osd_fg_color;
}
&:hover,
&:focus,
&:selected {
.overview-icon {
background-color: transparentize($osd_fg_color,0.9);
color: $osd_fg_color;
}
}
&:drop .overview-icon {
background-color: transparentize($selected_bg_color,.15);
}
&:active, &:checked {
.overview-icon {
background-color: darken($osd_bg_color,10%);
}
}
&:checked, &:focus {
.show-apps-icon {
color: $fg_color;
transition-duration: 100ms;
}
}
}

View File

@ -0,0 +1,283 @@
/* Modal Dialogs */
.modal-dialog {
border-radius: $modal_radius;
@extend %bubble_panel;
.modal-dialog-content-box {
margin: 32px 40px;
spacing: 32px;
max-width: 28em;
}
.modal-dialog-linked-button {
@extend %bubble_button;
}
}
.mount-dialog-subject {
@include fontsize($base_font_size + 3);
}
/* Message Dialog */
.message-dialog-content {
spacing: 18px;
.message-dialog-title {
text-align: center;
font-size: 18pt;
font-weight: 800;
}
.message-dialog-description { text-align: center; }
}
/* Dialog List */
.dialog-list {
spacing: 18px;
.dialog-list-title {
text-align: center;
font-weight: bold;
}
.dialog-list-scrollview { max-height: 200px; }
.dialog-list-box {
spacing: 1em;
.dialog-list-item {
spacing: 1em;
.dialog-list-item-title { font-weight: bold; }
.dialog-list-item-description {
color: darken($fg_color,5%);
@include fontsize($base_font_size - 1);
}
}
}
}
/* Run Dialog */
.run-dialog {
.run-dialog-entry { width: 20em; margin-bottom: 6px; }
.run-dialog-error-box {
padding-top: 16px;
spacing: 6px;
}
.run-dialog-label {
@include fontsize($base_font_size + 1.1);
font-weight: normal;
color: $fg_color;
padding-bottom: .4em;
}
}
/* ShellMountOperation Dialogs */
.shell-mount-operation-icon {
icon-size: $base_icon_size * 3;
}
.mount-dialog {
spacing: 24px;
.message-dialog-title {
padding-top: 10px;
padding-left: 17px;
padding-bottom: 6px;
max-width: 34em;
}
.message-dialog-title:rtl {
padding-left: 0px;
padding-right: 17px;
}
.message-dialog-description {
padding-left: 17px;
width: 28em;
}
.message-dialog-description:rtl {
padding-left: 0px;
padding-right: 17px;
}
}
.mount-dialog-app-list {
max-height: 200px;
padding-top: 24px;
padding-left: 49px;
padding-right: 32px;
}
.mount-dialog-app-list:rtl {
padding-right: 49px;
padding-left: 32px;
}
.mount-dialog-app-list-item {
color: lighten($fg_color,10%);
&:hover { color: $fg_color; }
&:ltr { padding-right: 1em; }
&:rtl { padding-left: 1em; }
}
.mount-dialog-app-list-item-icon {
&:ltr { padding-right: 17px; }
&:rtl { padding-left: 17px; }
}
.mount-dialog-app-list-item-name {
@include fontsize($base_font_size - 1);
}
/* Password or Authentication Dialog */
.prompt-dialog {
//this is the width of the entire modal popup
width: 34em;
.message-dialog-content { spacing: $base_spacing * 4; }
.message-dialog-title { color: lighten($fg_color,15%); }
}
.prompt-dialog-description:rtl {
text-align: right;
}
.prompt-dialog-password-box {
spacing: 1em;
padding-bottom: 1em;
}
.prompt-dialog-error-label {
@include fontsize($base_font_size - 1);
color: $warning_color;
padding-bottom: 8px;
}
.prompt-dialog-info-label {
@include fontsize($base_font_size - 1);
padding-bottom: 8px;
}
.prompt-dialog-null-label {
@include fontsize($base_font_size - 1);
padding-bottom: 8px;
}
.prompt-dialog-pim-box {
spacing: 1em;
}
.prompt-dialog-grid {
spacing-rows: 15px;
spacing-columns: 1em;
}
.prompt-dialog-keyfiles-box {
spacing: 1em;
}
.prompt-dialog-button.button {
padding: 8px;
}
.prompt-dialog-caps-lock-warning {
@extend .prompt-dialog-error-label;
padding-left: 6.2em;
}
/* Polkit Dialog */
.polkit-dialog-user-layout {
padding-left: 10px;
spacing: 10px;
&:rtl {
padding-left: 0px;
padding-right: 10px;
}
}
.polkit-dialog-user-root-label {
color: $warning_color;
}
.polkit-dialog-user-icon {
border-radius: 99px;
background-size: contain;
width: 48px;
height: 48px;
}
/* Audio selection dialog */
.audio-device-selection-dialog {
spacing: 30px;
}
.audio-selection-content {
spacing: 20px;
padding: 24px;
}
.audio-selection-title {
font-weight: bold;
text-align: center;
}
.audio-selection-box {
spacing: 20px;
}
.audio-selection-device {
border: 1px solid $bubble_borders_color;
border-radius: 12px;
&:hover,&:focus { background-color: $hover_bg_color; }
&:active {
background-color: $selected_bg_color;
color: $selected_fg_color;
}
}
.audio-selection-device-box {
padding: 20px;
spacing: 20px;
}
.audio-selection-device-icon {
icon-size: $base_icon_size * 4;
}
/* Access Dialog */
.access-dialog {
spacing: 30px;
}
/* Geolocation Dialog */
.geolocation-dialog {
spacing: 30px;
}
/* Extension Dialog */
.extension-dialog {
.message-dialog-title { font-weight: normal; color: $fg_color; }
}
/* Inhibit-Shortcuts Dialog */
.inhibit-shortcuts-dialog {
spacing: 30px;
}
/* Network Agent Dialog */
.network-dialog-secret-table {
spacing-rows: 15px;
spacing-columns: 1em;
}
.keyring-dialog-control-table {
spacing-rows: 15px;
spacing-columns: 1em;
}

View File

@ -0,0 +1,12 @@
/* End Session Dialog */
$end_session_dialog_width: 28em;
.end-session-dialog-battery-warning {
width: $end_session_dialog_width;
color: $warning_color;
}
.end-session-dialog .dialog-list-title {
color: $warning_color;
}

View File

@ -0,0 +1,23 @@
/* Entries */
StEntry {
border-radius: $base_border_radius;
padding: 4px;
border-width: 1px;
color: $fg_color;
@include entry(normal);
//&:hover { @include entry(hover);}
&:focus { @include entry(focus);}
&:insensitive { @include entry(insensitive);}
selection-background-color: $selected_bg_color;
selected-color: $selected_fg_color;
StIcon.capslock-warning {
icon-size: 16px;
warning-color: $warning_color;
padding: 0 4px;
}
StIcon.peek-password {
icon-size: $base_icon_size;
padding: 0 4px;
}
}

View File

@ -0,0 +1,10 @@
// hotplug
.hotplug-notification-item {
@extend %bubble_button;
}
.hotplug-notification-item-icon {
icon-size: 24px;
padding: 0 4px;
}

View File

@ -0,0 +1,30 @@
// IBus Candidate Popup
.candidate-popup-content {
padding: 0.5em;
spacing: 0.3em;
}
.candidate-index {
padding: 0 0.5em 0 0;
color: darken($fg_color,10%);
}
.candidate-box {
padding: 0.3em 0.5em 0.3em 0.5em;
border-radius: $base_border_radius;
&:selected,&:hover { background-color: $selected_bg_color; color: $selected_fg_color; }
}
.candidate-page-button-box {
height: 2em;
.vertical & { padding-top: 0.5em; }
.horizontal & { padding-left: 0.5em; }
}
.candidate-page-button {
padding: 4px;
}
.candidate-page-button-previous { border-radius: $base_border_radius 0px 0px $base_border_radius; border-right-width: 0; }
.candidate-page-button-next { border-radius: 0px $base_border_radius $base_border_radius 0px; }
.candidate-page-button-icon { icon-size: 1em; }

View File

@ -0,0 +1,124 @@
/* On-screen Keyboard */
$key_size: 1.2em;
$key_border_radius: $base_border_radius + 3px;
$key_bg_color: $bg_color;
// $default_key_bg_color: darken($key_bg_color, 4%);
$default_key_bg_color: if($variant=='light', darken($osd_bg_color, 11%), lighten($osd_bg_color, 2%));
// draw keys using button function
#keyboard {
background-color: transparentize(if($variant=='light', darken($bg_color, 5%), darken($bg_color, 8%)), 0.1);
box-shadow: inset 0 1px 0 0 $osd_outer_borders_color !important;
.page-indicator {
padding: $base_padding;
.page-indicator-icon {
width: 8px;
height: 8px;
}
}
}
// the container for individual keys
.key-container {
padding: $base_margin;
spacing: $base_margin;
}
// the keys
.keyboard-key {
@include button(normal, $c:$key_bg_color);
&:focus { @include button(focus);}
&:hover, &:checked { @include button(hover, $c: $key_bg_color);}
&:active { @include button(active, $c: $key_bg_color); }
@include fontsize($base_font_size + 5);
min-height: $key_size;
min-width: $key_size;
border-width: 1px;
border-style: solid;
border-radius: $key_border_radius;
&:grayed { //FIXMEy
background-color: darken($bg_color, 3%);
color: $osd_fg_color;
border-color: $osd_borders_color;
}
// non-character keys
&.default-key {
// size of the icon asset
background-size: 24px;
@include button(normal, $c:$default_key_bg_color);
&:hover, &:checked {@include button(hover, $c: $default_key_bg_color);}
&:active { @include button(active, $c: $default_key_bg_color);}
}
// enter key is suggested-action
&.enter-key {
background-image: url("resource:///org/gnome/shell/theme/key-enter.svg");
@include button(normal, $c:$selected_bg_color, $tc:$selected_fg_color);
&:hover, &:checked { @include button(hover, $c: lighten($selected_bg_color, 3%));}
&:active {@include button(active, $c: darken($selected_bg_color, 2%));}
}
// key assets
&.shift-key-lowercase {background-image: url("resource:///org/gnome/shell/theme/key-shift.svg");}
&.shift-key-uppercase {background-image: url("resource:///org/gnome/shell/theme/key-shift-uppercase.svg");}
&.shift-key-uppercase:latched {background-image: url("resource:///org/gnome/shell/theme/key-shift-latched-uppercase.svg");}
&.hide-key {background-image: url("resource:///org/gnome/shell/theme/key-hide.svg");}
&.layout-key {background-image: url("resource:///org/gnome/shell/theme/key-layout.svg");}
}
// long press on a key popup
.keyboard-subkeys {
color: $osd_fg_color;
-arrow-border-radius: $modal_radius;
-arrow-background-color: $osd_bg_color;
-arrow-border-width: 1px;
-arrow-border-color: lighten($osd_bg_color, 9%);
-arrow-base: 20px;
-arrow-rise: 10px;
-boxpointer-gap: $base_spacing;
.keyboard-key {
@include button(normal, $c:$key_bg_color);
&:focus { @include button(focus);}
&:hover, &:checked { @include button(hover, $c: $key_bg_color);}
&:active { @include button(active, $c: $key_bg_color); }
border-radius:$base_border_radius;
}
}
// emoji
.emoji-page {
.keyboard-key {
background-color: transparent;
border: none;
color: initial;
}
}
.emoji-panel {
.keyboard-key:latched {
border-color: lighten($selected_bg_color, 5%);
background-color: $selected_bg_color;
}
}
// suggestions
.word-suggestions {
@include fontsize($base_font_size + 3);
spacing: 12px;
min-height: 20pt;
}

View File

@ -0,0 +1,151 @@
/* Login Dialog */
.login-dialog-banner-view {
padding-top: 24px;
max-width: 23em;
}
.login-dialog {
//reset
border: none;
background-color: transparent;
$_gdm_bg: lighten(#2e3436, 19%);
StEntry {
@if $variant=='dark' {
$_gdm_entry_bg: transparentize(lighten(desaturate(#241f31, 20%), 2%), 0.5);
background-color: $_gdm_entry_bg;
color: $osd_fg_color;
}
}
.modal-dialog-button-box { spacing: 3px; }
.modal-dialog-button {
padding: 4px 18px;
box-shadow: 0 1px 3px rgba(0,0,0,0.2);
background-color: $_gdm_bg;
border-color: $_gdm_bg;
color: $fg_color;
$_hover_c: lighten($_gdm_bg, 5%);
&:hover, &:focus {
background-color: $_hover_c;
border-color: $_hover_c;
}
&:active {
$_active_c: darken($_gdm_bg, 5%);
box-shadow: none;
background-color: $_active_c;
border-color: $_active_c;
}
&:insensitive {
@include button(insensitive);
border-color: darken($_gdm_bg, 5%);
background-color: darken($_gdm_bg, 5%);
color: transparentize($fg_color, 0.3);
}
&:default {
@include button(normal, $c:$selected_bg_color, $tc:$selected_fg_color);
border-color: $selected_bg_color;
&:hover, &:focus {
@include button(hover,$c:$selected_bg_color, $tc:$selected_fg_color);
$_def_hover_c: lighten($selected_bg_color, 5%);
background-color: $_def_hover_c;
border-color: $_def_hover_c;
}
&:active {
@include button(active,$c:$selected_bg_color, $tc:$selected_fg_color);
$_def_active_c: darken($selected_bg_color, 5%);
background-color: $_def_active_c;
border-color: $_def_active_c;
}
&:insensitive {
@include button(insensitive);
border-color: darken($selected_bg_color, 10%);
background-color: darken($selected_bg_color, 10%);
color: transparentize($selected_fg_color, 0.3);
}
}
}
}
.login-dialog-logo-bin { padding: 24px 0px; }
.login-dialog-banner { color: darken($osd_fg_color,10%); }
.login-dialog-button-box { spacing: 5px; }
.login-dialog-message-warning { color: $warning_color; }
.login-dialog-message-hint { padding-top: 0; padding-bottom: 20px; }
.login-dialog-user-selection-box { padding: 100px 0px; }
.login-dialog-not-listed-label {
padding-left: 2px;
.login-dialog-not-listed-button:focus &,
.login-dialog-not-listed-button:hover & {
color: $osd_fg_color;
}
}
.login-dialog-not-listed-label {
@include fontsize($base_font_size - 1);
font-weight: bold;
color: darken($osd_fg_color,30%);
padding-top: 1em;
}
.login-dialog-user-list-view { -st-vfade-offset: 1em; }
.login-dialog-user-list {
spacing: 12px;
width: 23em;
&:expanded .login-dialog-user-list-item:selected { background-color: $selected_bg_color; color: $selected_fg_color; }
&:expanded .login-dialog-user-list-item:logged-in { border-right: 2px solid $selected_bg_color; }
}
.login-dialog-user-list-item {
border-radius: 5px;
padding: 6px;
color: darken($osd_fg_color,30%);
&:ltr .user-widget { padding-right: 1em; }
&:rtl .user-widget { padding-left: 1em; }
.login-dialog-timed-login-indicator {
height: 2px;
margin-top: 6px;
background-color: $osd_fg_color;
}
&:focus .login-dialog-timed-login-indicator { background-color: $selected_fg_color; }
}
.login-dialog-username,
.user-widget-label {
color: $osd_fg_color;
@include fontsize($base_font_size + 2);
font-weight: bold;
text-align: left;
padding-left: 15px;
}
.user-widget-label {
&:ltr { padding-left: 14px; }
&:rtl { padding-right: 14px; }
}
.login-dialog-prompt-layout {
padding-top: 24px;
padding-bottom: 12px;
spacing: $base_spacing * 2;
width: 23em;
}
.login-dialog-prompt-label {
color: darken($osd_fg_color, 20%);
@include fontsize($base_font_size + 1);
padding-top: 1em;
}
.login-dialog-session-list-button StIcon {
icon-size: 1.25em;
}
.login-dialog-session-list-button {
color: darken($osd_fg_color,30%);
&:hover,&:focus { color: $osd_fg_color; }
&:active { color: darken($osd_fg_color, 50%); }
}

View File

@ -0,0 +1,97 @@
/* Looking Glass */
// Dialog
#LookingGlassDialog {
background-color: $osd_bg_color;
spacing: $base_spacing;
padding: 4px;
border: 2px solid transparentize($osd_fg_color, 0.8);
border-top-width:0;
border-radius: 0 0 $base_border_radius $base_border_radius;
& > #Toolbar {
border: none;
border-radius: $base_border_radius;
background-color: darken($osd_bg_color, 10%);
}
.labels { spacing: $base_spacing; }
.notebook-tab {
-natural-hpadding: $base_padding * 2;
-minimum-hpadding: 6px;
font-weight: bold;
color: $fg_color;
transition-duration: 100ms;
padding-left: .3em;
padding-right: .3em;
&:hover {
color: white;
text-shadow: black 0px 2px 2px;
}
&:selected {
border-bottom-width: 2px;
border-color: lighten($selected_bg_color,5%);
color: white;
text-shadow: black 0px 2px 2px;
}
}
StBoxLayout#EvalBox { padding: 4px; spacing: $base_spacing; }
StBoxLayout#ResultsArea { spacing: $base_spacing; }
}
.lg-dialog {
StEntry {
selection-background-color: #bbbbbb;
selected-color: $osd_bg_color;
}
.shell-link {
color: #999999;
&:hover { color: #dddddd; }
}
}
.lg-completions-text {
font-size: .9em;
font-style: italic;
}
.lg-obj-inspector-title {
spacing: $base_spacing;
}
.lg-obj-inspector-button {
border: 1px solid gray;
padding: 4px;
border-radius: $base_border_radius;
&:hover { border: 1px solid #ffffff; }
}
// Extensions
#lookingGlassExtensions { padding: 4px; }
.lg-extensions-list {
padding: 4px;
spacing: 6px;
}
.lg-extension {
border: 1px solid $osd_borders_color;
border-radius: $base_border_radius;
padding: 4px;
}
.lg-extension-name {
font-weight: bold;
}
.lg-extension-meta {
spacing: 6px;
}
// Inspector
#LookingGlassPropertyInspector {
background: $osd_bg_color;
border: 1px solid $osd_borders_color;
border-radius: $base_border_radius;
padding: 6px;
}

View File

@ -0,0 +1,146 @@
/* Message List */
// a.k.a. notifications in the menu
// main list
.message-list {
width: 31.5em;
padding: 0 $base_padding * 2;
.message-list-placeholder { spacing: 12px; }
}
.message-list-sections {
spacing: $base_spacing;
margin: $base_margin * 4; // to account for scrollbar
}
.message-list-section,
.message-list-section-list {
spacing: $base_spacing;
}
.message-list-section-list {
&:ltr {padding:0;}
&:rtl {padding:0;}
}
// clear button
.message-list-clear-button.button {
margin:$base_margin $base_margin*2;
}
// message bubbles
.message {
@extend %notification_bubble;
// title
.message-title {
color: $fg_color;
font-weight: bold;
margin-bottom:4px;
}
// content
.message-content {
color: darken($fg_color, 10%);
padding: $base_padding 0;
margin:$base_margin * 2;
&:ltr {
margin-left: $base_margin;
padding-right:$base_padding;
}
&:rtl {
margin-right: $base_margin;
padding-left:$base_padding;
}
}
// close button
.message-close-button {
color: lighten($fg_color, 15%);
&:hover { color: if($variant=='light', lighten($fg_color, 30%), darken($fg_color, 10%)); }
&:active { color: if($variant=='light', lighten($fg_color, 40%), darken($fg_color, 20%)); }
}
// icon container
.message-icon-bin {
padding: $base_padding;
margin:$base_padding 0;
&:rtl {
// padding: $base_padding;
}
// icon size and color
> StIcon {
color: $fg_color;
icon-size: $base_icon_size*2; // 32px
-st-icon-style: symbolic;
padding:0;
margin:$base_padding;
}
// fallback
> .fallback-window-icon {
width: $base_icon_size;
height: $base_icon_size;
}
}
// secondary container in title box
.message-secondary-bin {
padding: 0;
// notification time stamp
> .event-time {
color: transparentize($fg_color, 0.5);
@include fontsize($base_font_size - 2);
text-align: right;
margin: 0 $base_margin * 2;
/* HACK: the label should be baseline-aligned with a 1em label, fake this with some bottom padding */
padding-bottom: $base_padding;
}
}
}
/* Media Controls */
.message-media-control {
padding: $base_padding * 2 $base_padding * 4;
color: darken($fg_color, 15%);
// uses $hover_bg_color since the media controls are in a notification_bubble
&:hover {
background-color: lighten($hover_bg_color, 5%);
color: $fg_color;
}
&:active {
background-color: darken($hover_bg_color, 2%);
color: $fg_color;
}
&:insensitive { color: darken($fg_color,40%); }
// fix border-radius for last button on hover
&:last-child:ltr { &:hover {border-radius: 0 $base_border_radius+2 $base_border_radius+2 0;} }
&:last-child:rtl { &:hover {border-radius: $base_border_radius+2 0 0 $base_border_radius+2;} }
}
// album-art
.media-message-cover-icon {
icon-size: $base_icon_size*2 !important; // 48px
border-radius: $base_border_radius;
// when there is no artwork
&.fallback {
color: darken($fg_color, 17%);
background-color: $bg_color;
border: 1px solid transparent;
border-radius: $base_border_radius;
icon-size: $base_icon_size * 2 !important;
padding: $base_padding * 2;
}
}

View File

@ -0,0 +1,59 @@
// Links/URLs
.shell-link {
color: $link_color;
&:hover { color: lighten($link_color,10%); }
}
.url-highlighter { link-color: $link_color; }
// Rubberband for select-area screenshots
.select-area-rubberband {
background-color: transparentize($selected_bg_color,0.7);
border: 1px solid $selected_bg_color;
}
// Pointer accessibility notifications
.pie-timer {
width: 60px;
height: 60px;
-pie-border-width: 3px;
-pie-border-color: $selected_bg_color;
-pie-background-color: lighten(transparentize($selected_bg_color, 0.7), 40%);
}
// Screen zoom/Magnifier
.magnifier-zoom-region {
border: 2px solid $selected_bg_color;
&.full-screen { border-width: 0; }
}
// User icon
.user-icon {
background-size: contain;
color: $osd_fg_color;
border-radius: 99px;
&:hover {
color: lighten($osd_fg_color,30%);
}
}
// Input Source Switcher
.input-source-switcher-symbol {
font-size: 34pt;
width: 96px;
height: 96px;
}
// Window cycler highlight
.cycler-highlight {
border: 5px solid $selected_bg_color;
}
// Text
.headline { @include fontsize($base_font_size + 1); }
.lightbox { background-color: black; }
.flashspot { background-color: white; }
// Hidden
.hidden { color: rgba(0,0,0,0);}

View File

@ -0,0 +1,56 @@
/* Network Dialogs */
.nm-dialog {
max-height: 34em;
min-height: 31em;
min-width: 32em;
}
.nm-dialog-content {
spacing: 20px;
padding: 24px;
}
.nm-dialog-airplane-box { spacing: 12px; }
.nm-dialog-airplane-headline {
font-weight: bold;
text-align: center;
}
.nm-dialog-airplane-text { color: $fg_color; }
// header
.nm-dialog-header {
font-weight: bold;
}
.nm-dialog-header-icon {
icon-size: $base_icon_size * 2;
}
.nm-dialog-header-hbox { spacing: 10px; }
// list of networks
.nm-dialog-scroll-view {
border: 1px solid $borders_color;
padding:0;
background-color: darken($bg_color, 3%);
}
// list item
.nm-dialog-item {
@include fontsize($base_font_size);
border-bottom: 1px solid $borders_color;
padding: $base_padding * 2;
spacing: 0px;
&:selected {
background-color: $selected_bg_color;
color: $selected_fg_color;
}
}
// icons in list
.nm-dialog-icon { icon-size: $base_icon_size; }
.nm-dialog-icons { spacing: $base_spacing * 2; }
// no networks
.no-networks-label { color: $insensitive_fg_color; }
.no-networks-box { spacing: $base_padding; }

View File

@ -0,0 +1,90 @@
/* Notifications & Mesage Tray */
$notification_banner_height: 64px;
$notification_banner_width: 34em;
// Banner notifications
.notification-banner {
min-height: $notification_banner_height;
width: $notification_banner_width;
@include fontsize($base_font_size);
margin: $base_margin;
border-radius: $modal_radius;
.message-title { color: $fg_color }
.message-content { color: $fg_color; }
&:hover { background: $bg_color; }
&, &:focus, &:active {
background-color: $bg_color;
.message-title { color: $fg_color }
.message-content { color: $fg_color; }
}
// icon
.message-icon-bin > StIcon {
icon-size: $base_icon_size * 2;
color: $fg_color;
}
.notification-icon {
padding: 5px;
}
.notification-content {
padding: 5px;
spacing: 5px;
}
.secondary-icon { icon-size: $base_icon_size; }
.notification-actions {
padding-top: 0;
spacing: 0;
}
.notification-button {
@extend %bubble_button;
}
}
// counter
.summary-source-counter {
font-size: $base_font_size - 1pt;
font-weight: bold;
height: 1.6em;
width: 1.6em;
-shell-counter-overlap-x: 3px;
-shell-counter-overlap-y: 3px;
background-color: $selected_bg_color;
color: $selected_fg_color;
border: 2px solid $fg_color;
box-shadow: 0 2px 2px rgba(0,0,0,0.5);
border-radius: 0.9em; // should be 0.8 but whatever; wish I could do 50%;
}
.secondary-icon { icon-size: $base_icon_size; }
// chat bubbles
.chat-body { spacing: 5px; }
.chat-response { margin: 5px; }
.chat-log-message { color: darken($fg_color,10%); }
.chat-new-group { padding-top: 1em; }
.chat-received {
padding-left: 4px;
&:rtl { padding-left: 0px; padding-right: 4px; }
}
.chat-sent {
padding-left: 18pt;
color: lighten($fg_color, 15%);
&:rtl { padding-left: 0; padding-right: 18pt; }
}
.chat-meta-message {
padding-left: 4px;
@include fontsize($base_font_size - 2);
font-weight: bold;
color: lighten($fg_color,18%);
&:rtl { padding-left: 0; padding-right: 4px; }
}

View File

@ -0,0 +1,45 @@
/* OSD */
$osd_levelbar_height:8px;
.osd-window {
@extend %osd_panel;
text-align: center;
font-weight: bold;
spacing: $base_spacing * 2; // 12px
margin: $base_margin * 8; // 32px
min-width: 64px;
min-height: 64px;
StIcon {
icon-size:$base_icon_size * 6;
}
.osd-monitor-label { font-size: 3em; }
.level {
height: $osd_levelbar_height;
-barlevel-height: $osd_levelbar_height;
-barlevel-background-color: transparentize($osd_fg_color, if($variant=='light', 0.7, 0.9));
-barlevel-active-background-color: $osd_fg_color;
-barlevel-overdrive-color: $destructive_color;
-barlevel-overdrive-separator-width: 3px;
}
}
/* Pad OSD */
.pad-osd-window {
padding: 32px;
background-color: transparentize(#000, 0.2);
.pad-osd-title-box { spacing: 12px; }
.pad-osd-title-menu-box { spacing: 6px; }
}
.combo-box-label {
width: 15em;
}
.resize-popup {
@extend %osd_panel;
}

View File

@ -0,0 +1,10 @@
/* OVERVIEW */
#overview {
spacing: 24px;
background-color: transparent;
}
.overview-controls {
padding-bottom: 32px;
}

View File

@ -0,0 +1,106 @@
/* Top Bar */
// a.k.a. the panel
$panel_corner_radius: $base_border_radius+1;
$panel_bg_color: if($variant == 'light', rgba(0,0,0,0.9), #000);
$panel_fg_color: if($variant == 'light', darken($fg_color, 15%), darken($fg_color, 10%));
$panel_height: 1.86em;
#panel {
background-color: $panel_bg_color;
font-weight: bold;
height: $panel_height;
font-feature-settings: "tnum";
// transparent panel on lock & login screens
&.unlock-screen,
&.login-screen,
&.lock-screen {
background-color: transparent;
.panel-corner {
-panel-corner-radius: 0;
-panel-corner-background-color: transparent;
-panel-corner-border-color: transparent;
}
}
// spacing between activities, app menu and such
#panelLeft, #panelCenter {
spacing: $base_spacing;
}
// the rounded outset corners
.panel-corner {
-panel-corner-radius: $panel_corner_radius;
-panel-corner-background-color: $panel_bg_color;
-panel-corner-border-width: 2px;
-panel-corner-border-color: transparent;
&:active, &:overview, &:focus {
-panel-corner-border-color: lighten($selected_bg_color,5%);
}
}
// panel menus
.panel-button {
font-weight: bold;
color: $panel_fg_color;
-natural-hpadding: $base_padding * 2;
-minimum-hpadding: $base_padding;
&:hover {
color: lighten($panel_fg_color, 20%);
}
&:active, &:overview, &:focus, &:checked {
background-color: $panel_bg_color; // Trick due to St limitations. It needs a background to draw a box-shadow
box-shadow: inset 0 -2px 0 0 lighten($selected_bg_color,5%);
color: lighten($panel_fg_color, 20%);
}
// status area icons
.system-status-icon {
icon-size: $base_icon_size;
padding: $base_padding - 1px;
}
// app menu icon
.app-menu-icon {
margin-left: $base_margin;
margin-right: $base_margin;
-st-icon-style: symbolic;
// dimensions of the icon are hardcoded
}
// lock & login screen styles
.unlock-screen &,
.login-screen &,
.lock-screen & {
color: lighten($fg_color, 10%);
&:focus, &:hover, &:active { color: lighten($fg_color, 10%); }
}
}
.panel-status-indicators-box,
.panel-status-menu-box {
spacing: 2px;
}
// spacing between power icon and (optional) percentage label
.power-status.panel-status-indicators-box {
spacing: 0;
}
// indicator for active
.screencast-indicator,
.remote-access-indicator { color: $warning_color; }
}
// App Menu
#appMenu {
spacing: $base_spacing;
.label-shadow { color: transparent; }
}

View File

@ -0,0 +1,121 @@
/* Popovers/Menus */
$popover_arrow_height: 12px;
//.the popover itself
.popup-menu-boxpointer,
.candidate-popup-boxpointer {
-arrow-border-radius: $base_border_radius+4;
-arrow-background-color: $bg_color;
-arrow-border-width: 1px;
-arrow-border-color: $borders_color;
-arrow-base: $popover_arrow_height * 2;
-arrow-rise: $popover_arrow_height;
-arrow-box-shadow: 0 1px 3px rgba(0,0,0,0.5); // dreaming bugzilla #689995
}
// container of the popover menu
.popup-menu {
min-width: 15em;
color: $fg_color;
//.popup-status-menu-item { font-weight: normal; color: pink; } //dunno what that is
&.panel-menu {
-boxpointer-gap: $base_margin; // distance from the panel
margin-bottom: 1.75em;
}
}
.popup-menu-content {
padding: $base_padding * 2 + $base_margin 0;
}
// menu items
.popup-menu-item {
spacing: $base_padding;
padding: $base_padding;
&:ltr { padding-right:1.75em; padding-left: 0; }
&:rtl { padding-right: 0; padding-left:1.75em; }
&:checked {
background-color: lighten($bg_color, 2%);
box-shadow: none;
}
&.selected {
background-color: transparentize(white, if($variant=='light', 0.2, 0.9));
color: $fg_color;
}
&:active {
background-color: $selected_bg_color;
color: $selected_fg_color;
}
&:insensitive { color: transparentize($fg_color,0.5);}
}
// all icons and other graphical elements
.popup-inactive-menu-item {
color: $fg_color;
&:insensitive { color: transparentize($fg_color,0.5); }
}
// symbolic icons in popover
.popup-menu-arrow,
.popup-menu-icon { icon-size: $base_icon_size; }
// popover submenus
.popup-sub-menu {
background-color: darken($bg_color, 3%);
box-shadow: none;
border-top: 1px solid transparentize($borders_color, 0.2);
border-bottom: 1px solid transparentize($borders_color, 0.2);
}
// container for radio and check boxes
.popup-menu-ornament {
text-align: right;
width: 1.2em;
}
// separator
.popup-separator-menu-item {
//-margin-horizontal: 24px;
height: 1px; //not really the whole box
margin: 6px 64px;
background-color: lighten($borders_color, 2%);
border: none !important;
}
// desktop background menu
.background-menu {
-boxpointer-gap: $base_margin;
-arrow-rise: 0px; // hide the beak on the menu
}
// system status menu
.aggregate-menu {
min-width: 21em;
// lock screen, shutdown, etc. buttons
.popup-menu-icon {
padding:0;
margin: 0 $base_margin;
-st-icon-style: symbolic;
}
.popup-sub-menu .popup-menu-item > :first-child {
// account for icons in submenus with padding
&:ltr {
padding-left: $base_padding + $base_margin * 2;
margin-left: $base_icon_size;
}
&:rtl {
padding-right: $base_padding + $base_margin * 2; ;
margin-right: $base_icon_size;
}
}
}

View File

@ -0,0 +1,83 @@
/* Screen Shield */
$_screenshield_shadow: 0px 0px 6px rgba(0, 0, 0, 0.726);
.screen-shield-arrows {
padding-bottom: 3em;
}
.screen-shield-arrows Gjs_Arrow {
color: white;
width: 80px;
height: 48px;
-arrow-thickness: 12px;
-arrow-shadow: $_screenshield_shadow;
}
.screen-shield-clock {
color: white;
text-shadow: $_screenshield_shadow;
font-weight: bold;
text-align: center;
padding-bottom: 1.5em;
}
.screen-shield-clock-time {
font-size: 72pt;
text-shadow: $_screenshield_shadow;
font-feature-settings: "tnum";
}
.screen-shield-clock-date {
font-size: 28pt;
font-weight: normal;
}
.screen-shield-notifications-container {
spacing: 6px;
width: 30em;
background-color: transparent;
max-height: 500px;
.summary-notification-stack-scrollview {
padding-top: 0;
padding-bottom: 0;
}
.notification,
.screen-shield-notification-source {
padding: 12px 6px;
border: 1px solid $osd_outer_borders_color;
background-color: transparentize($osd_bg_color,0.5);
color: $osd_fg_color;
border-radius: 4px;
}
.notification { margin-right: 15px; } //compensate for space allocated to the scrollbar
}
.screen-shield-notification-label {
font-weight: bold;
padding: 0px 0px 0px 12px;
}
.screen-shield-notification-count-text { padding: 0px 0px 0px 12px; }
#panel.lock-screen { background-color: transparentize($osd_bg_color, 0.5); }
.screen-shield-background { //just the shadow, really
background: black;
box-shadow: 0px 2px 4px rgba(0,0,0,0.6);
}
#lockDialogGroup {
background: lighten(#2e3436, 8%) url(resource:///org/gnome/shell/theme/noise-texture.png);
background-repeat: repeat;
}
#screenShieldNotifications {
StButton#vhandle, StButton#hhandle {
background-color: transparentize($bg_color,0.7);
&:hover, &:focus { background-color: transparentize($bg_color,0.5); }
&:active { background-color: transparentize($selected_bg_color,0.5); }
}
}

View File

@ -0,0 +1,29 @@
/* Scrollbars */
StScrollView {
&.vfade { -st-vfade-offset: 68px; }
&.hfade { -st-hfade-offset: 68px; }
}
StScrollBar {
padding: 0;
StScrollView & {
min-width: 14px;
min-height: 14px;
}
StBin#trough {
border-radius: 0;
background-color: transparent;
}
StButton#vhandle, StButton#hhandle {
border-radius: 8px;
background-color: mix($fg_color, $bg_color, 60%);
//border: 3px solid transparent; //would be nice to margin or at least to transparent
margin: 3px;
&:hover { background-color: mix($fg_color, $bg_color, 80%); }
&:active { background-color: $selected_bg_color; }
}
}

View File

@ -0,0 +1,35 @@
// Search entry
$search_entry_width: 320px;
$search_entry_height: 36px;
%search_entry,
.search-entry {
width: $search_entry_width;
padding: $base_padding+1 $base_padding+3;
border-radius: $search_entry_height * 0.5; // half the height
color: transparentize($fg_color,0.3);
background-color: $bg_color;
border-color: $borders_color;
&:hover {
background-color: $hover_bg_color;
border-color: $hover_borders_color;
color: $hover_fg_color;
}
&:focus {
padding: $base_padding $base_padding+2; // 1px less to account for wider border
border-width: 2px;
border-style: solid;
border-color: $selected_bg_color;
color: $fg_color;
box-shadow: inset 0 1px 2px 1px rgba(0,0,0,0.2);
}
.search-entry-icon {
icon-size: $base_icon_size;
padding: 0 4px;
color: inherit;
}
}

View File

@ -0,0 +1,151 @@
/* Search */
// search overview container
#searchResultsContent {
max-width: 1024px;
}
// search results sections "the boxes"
.search-section {
spacing: $base_margin * 2;
padding:0 !important;
margin:0 !important;
background-color:transparent;
box-shadow:none;
border:none;
// separator
.search-section-separator {
// margin-top: $base_padding * 2;
// height: 1px;
// background-color: $osd_outer_borders_color;
height: 0;
background-color: transparent;
}
}
// content
.search-section-content {
background-color: transparentize(lighten($osd_bg_color, 5%), 0.2);
border-radius: $modal_radius+3;
border: 1px solid $osd_outer_borders_color;
box-shadow: 0 2px 4px 0 $shadow_color;
text-shadow: 0 1px if($variant == 'light', rgba(255,255,255,0.2), rgba(0,0,0,0.2));
color: $osd_fg_color;
padding: $base_padding * 3;
margin: $base_margin 0;
spacing: 0;
}
// "no results" text
.search-statustext {
@extend %status_text;
}
// Search results with icons
.grid-search-result {
> .overview-icon {
@extend %icon_tile;
color: $osd_fg_color;
}
> .overview-icon.overview-icon-with-label {
padding: 10px 8px 5px 8px;
spacing: $base_spacing;
}
&:hover,
&:focus,
&:selected {
.overview-icon {
background-color: transparentize($osd_bg_color,0.8);
color: $osd_fg_color;
}
}
&:drop .overview-icon {
background-color: transparentize($selected_bg_color,.15);
}
&:active .overview-icon,
&:checked .overview-icon {
background-color: transparentize(darken($osd_bg_color,10%), 0.5);
}
}
// search result provider
.search-provider-icon {
@extend %icon_tile;
padding: $base_padding;
spacing: 0;
margin-right: $base_margin * 2;
&:focus,
&:selected,
&:hover {
background-color: transparentize($osd_fg_color,.9);
transition-duration: 200ms;
}
&:active,
&:checked {
background-color: transparentize(darken($osd_bg_color,10%),.1);
}
// content
.list-search-provider-content {
spacing: $base_spacing * 2;
// provider labels
.list-search-provider-details {
width: 120px;
margin-top: 0;
color: darken($osd_fg_color, 8%);
// font-weight: bold;
}
}
}
// search results list
.list-search-results {
spacing: $base_spacing;
}
// search result listitem
.list-search-result {
@extend %icon_tile;
spacing: 0;
padding: $base_padding;
color: $osd_fg_color;
border-radius: $base_border_radius + 2px !important;
&:focus,
&:selected,
&:hover {
background-color: transparentize($osd_fg_color,.9);
transition-duration: 200ms;
}
&:active,
&:checked {
background-color: transparentize(darken($osd_bg_color,10%),.1);
}
// content
.list-search-result-content {
spacing: 0;
}
// list item title
.list-search-result-title {
color: $osd_fg_color;
spacing: $base_spacing * 2;
padding-right: $base_padding;
// font-weight: bold;
}
// list item description
.list-search-result-description {
color: darken($osd_fg_color, 30%);
}
}

View File

@ -0,0 +1,27 @@
/* Slider */
$slider_size: 15px;
.slider {
height: $slider_size;
// slider trough
-barlevel-height: 3px; // has to be an odd number
-barlevel-background-color: $borders_color; //background of the trough
-barlevel-border-width: 1px;
-barlevel-border-color: $borders_color; // trough border color
// fill style
-barlevel-active-background-color: $selected_bg_color; //active trough fill
-barlevel-active-border-color: if($variant == 'light', darken($selected_bg_color, 4%), lighten($selected_bg_color, 2%)); //active trough border
// overfill style (red in this case)
-barlevel-overdrive-color: $destructive_color;
-barlevel-overdrive-border-color: if($variant == 'light', darken($destructive_color, 4%), lighten($destructive_color, 2%)); //trough border when red;
-barlevel-overdrive-separator-width:1px;
// slider hander
-slider-handle-radius: $slider_size * 0.5; // half the size of the size
-slider-handle-border-width: 1px;
-slider-handle-border-color: if($variant == 'light', $borders_color, $fg_color);
color: if($variant == 'light', lighten($bg_color, 10%), $fg_color);
&:hover { color: $hover_bg_color; }
&:active { color: $active_bg_color; }
}

View File

@ -0,0 +1,16 @@
/* Switches */
// these are equal to the size of the SVG assets
$switch_height: 22px;
$switch_width: 46px;
.toggle-switch {
color: $fg_color;
height: $switch_height;
width: $switch_width;
background-size: contain;
background-image: if($variant == 'light', url("resource:///org/gnome/shell/theme/toggle-off.svg"),url("resource:///org/gnome/shell/theme/toggle-off-dark.svg"));
&:checked {
background-image: if($variant == 'light', url("resource:///org/gnome/shell/theme/toggle-on.svg"),url("resource:///org/gnome/shell/theme/toggle-on-dark.svg"));
}
}

View File

@ -0,0 +1,19 @@
/* Tiled window previews */
$tile_corner_radius: $base_border_radius + 1px;
.tile-preview {
background-color: transparentize($selected_bg_color,0.5);
border: 1px solid $selected_bg_color;
}
.tile-preview-left.on-primary {
border-radius: $tile_corner_radius 0 0 0;
}
.tile-preview-right.on-primary {
border-radius: 0 $tile_corner_radius 0 0;
}
.tile-preview-left.tile-preview-right.on-primary {
border-radius: $tile_corner_radius $tile_corner_radius 0 0;
}

View File

@ -0,0 +1,66 @@
/* Window Picker */
$window_picker_spacing: $base_spacing * 8; // 48px
$window_picker_padding: $base_padding * 10; // 60px
$window_thumbnail_border_color:transparentize($selected_fg_color, 0.65);
$window_close_button_size: 24px;
$window_close_button_padding: 3px;
// Window picker
.window-picker {
// Space between window thumbnails
-horizontal-spacing: $window_picker_spacing;
-vertical-spacing: $window_picker_spacing;
// Padding for container around window thumbnails
padding: $window_picker_padding;
&.external-monitor { padding: $window_picker_padding; }
}
// Borders on window thumbnails
.window-clone-border {
border-width: 6px;
border-style: solid;
border-color: $window_thumbnail_border_color;
border-radius: $base_border_radius + 2;
// For window decorations with round corners we can't match
// the exact shape when the window is scaled. So apply a shadow
// to fix that case
box-shadow: inset 0 0 0 1px transparentize($borders_color, 0.8);
}
// Window titles
.window-caption {
color: $osd_fg_color;
background-color: $osd_bg_color;
border:1px solid $osd_outer_borders_color;
border-radius: $base_border_radius + 1;
padding: $base_padding $base_padding * 2;
font-weight: bold;
@include fontsize($base_font_size + 1);
}
// Close button
.window-close {
background-color: $selected_bg_color;
color: $selected_fg_color;
border: none;
border-radius: $window_close_button_size * 0.5 + $window_close_button_padding * 2;
padding: $window_close_button_padding;
height: $window_close_button_size;
width: $window_close_button_size;
box-shadow: -1px 1px 5px 0px rgba(0,0,0,0.5);
-shell-close-overlap: $window_close_button_size * 0.5;
&:hover {
background-color: lighten($selected_bg_color, 5%);
}
&:active {
background-color: darken($selected_bg_color, 5%);
}
}

View File

@ -0,0 +1,72 @@
/* Workspace Switcher */
.workspace-switcher-group {
padding: $base_padding * 2;
}
.workspace-switcher-container {
@extend %osd_panel;
}
.workspace-switcher {
background: transparent;
border: none;
border-radius: 0;
padding: 0;
spacing: $base_spacing * 2;
}
.ws-switcher-box {
// background: transparent;
background: transparent;
height: 50px;
background-size: 32px;
border: 1px solid transparentize($osd_fg_color,0.9);
border-radius: $base_border_radius + 3px;
}
// active workspace in the switcher
.ws-switcher-active-up,
.ws-switcher-active-down,
.ws-switcher-active-left,
.ws-switcher-active-right {
background-color: $selected_bg_color;
border: 1px solid if($variant=='light', darken($selected_bg_color, 8%), lighten($selected_bg_color, 5%));
border-radius: $base_border_radius + 3px;
color: $selected_fg_color;
}
/* Workspace pager */
// thumbnails in overview
.workspace-thumbnails {
@extend %overview_panel;
visible-width: 32px; //amount visible before hover
spacing: $base_spacing;
padding: $base_padding;
border-radius: $modal_radius 0 0 $modal_radius;
border-right-width: 0 !important;
//fixme: can't have non uniform borders :(
border-top-left-radius:0 !important;
border-bottom-left-radius:0 !important;
&:rtl {
border-radius: 0 $modal_radius $modal_radius 0;
border-left-width: 0 !important;
}
// drag and drop indicator
.placeholder {
background-image: url("resource:///org/gnome/shell/theme/dash-placeholder.svg");
background-size: contain;
height: 24px;
}
}
// selected indicator
.workspace-thumbnail-indicator {
border: 3px solid $selected_bg_color;
border-radius: 3px;
padding: 0px;
// background-color: transparentize($selected_bg_color, 0.9);
}

View File

@ -3,3 +3,4 @@ $variant: 'dark';
@import "gnome-shell-sass/_colors"; //use gtk colors
@import "gnome-shell-sass/_drawing";
@import "gnome-shell-sass/_common";
@import "gnome-shell-sass/_widgets";

View File

@ -1,109 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32"
viewBox="0 0 32 32"
version="1.1"
id="svg7384"
height="32"
sodipodi:docname="key-enter.svg"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1744"
inkscape:window-height="866"
id="namedview19"
showgrid="false"
inkscape:zoom="14.75"
inkscape:cx="7.9322034"
inkscape:cy="14.554666"
inkscape:window-x="0"
inkscape:window-y="55"
inkscape:window-maximized="0"
inkscape:current-layer="svg7384" />
<metadata
id="metadata90">
<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>Gnome Symbolic Icon Theme</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<title
id="title9167">Gnome Symbolic Icon Theme</title>
<defs
id="defs7386">
<linearGradient
osb:paint="solid"
id="linearGradient19282"
gradientTransform="matrix(-2.7365795,0.28202934,-0.18908311,-0.99988321,239.54008,-879.45557)">
<stop
style="stop-color:#666666;stop-opacity:1;"
offset="0"
id="stop19284" />
</linearGradient>
</defs>
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="layer9" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="layer10" />
<g
transform="translate(-141.0002,-791)"
id="layer11" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="layer13" />
<g
transform="translate(-141.0002,-791)"
id="layer14" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="layer15" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="g71291" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="g4953" />
<g
transform="matrix(2,0,0,2,-281.56285,-1615.0002)"
style="display:inline"
id="layer12">
<path
id="path16589"
d="m 148.00015,821.0002 h -1 c -0.26528,0 -0.53057,-0.093 -0.71875,-0.2812 l -3.71875,-3.7188 c 0,0 2.47917,-2.4792 3.71875,-3.7187 0.18817,-0.1882 0.45344,-0.2813 0.71875,-0.2813 h 1 v 1 c 0,0.2653 -0.0931,0.5306 -0.28125,0.7188 l -2.28125,2.2812 2.28125,2.2813 c 0.18811,0.1881 0.28129,0.4534 0.28125,0.7187 z"
style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:'Bitstream Vera Sans';-inkscape-font-specification:'Bitstream Vera Sans';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:#bebebe;fill-opacity:1;stroke:none;stroke-width:2;marker:none;enable-background:accumulate"
inkscape:connector-curvature="0" />
<path
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:#bebebe;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
d="m 154.0002,810 v 4.5 c 0,1.3807 -1.11929,2.5 -2.5,2.5 h -6.50005"
id="path16591"
inkscape:connector-curvature="0" />
</g>
<svg xmlns="http://www.w3.org/2000/svg" class="keyboard-key" width="24" height="24">
<path overflow="visible" font-weight="400" style="line-height:normal;-inkscape-font-specification:'Bitstream Vera Sans';text-indent:0;text-align:start;text-decoration-line:none;text-transform:none;marker:none" d="M10 23H8.5c-.398 0-.796-.14-1.079-.422L.345 15.5l7.078-7.078C7.704 8.14 8.102 8 8.5 8H10v1.5c0 .398-.14.796-.422 1.079L4.657 15.5l4.921 4.922c.282.282.422.68.422 1.078z" color="#000" font-family="Bitstream Vera Sans" fill="#fff"/>
<path overflow="visible" d="M22 1.5v9a5 5 0 01-5 5H4" style="marker:none" color="#000" fill="none" stroke="#fff" stroke-width="3"/>
</svg>

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 676 B

View File

@ -1,114 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32"
viewBox="0 0 32 32"
version="1.1"
id="svg7384"
height="32"
sodipodi:docname="key-hide.svg"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1919"
inkscape:window-height="1011"
id="namedview19"
showgrid="false"
inkscape:zoom="14.75"
inkscape:cx="-12.338983"
inkscape:cy="14.554666"
inkscape:window-x="0"
inkscape:window-y="55"
inkscape:window-maximized="0"
inkscape:current-layer="svg7384" />
<metadata
id="metadata90">
<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>Gnome Symbolic Icon Theme</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<title
id="title9167">Gnome Symbolic Icon Theme</title>
<defs
id="defs7386">
<linearGradient
osb:paint="solid"
id="linearGradient19282"
gradientTransform="matrix(-2.7365795,0.28202934,-0.18908311,-0.99988321,239.54008,-879.45557)">
<stop
style="stop-color:#666666;stop-opacity:1;"
offset="0"
id="stop19284" />
</linearGradient>
</defs>
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="layer9" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="layer10" />
<g
transform="translate(-141.0002,-791)"
id="layer11" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="layer13" />
<g
transform="translate(-141.0002,-791)"
id="layer14" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="layer15" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="g71291" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="g4953" />
<g
style="display:inline"
inkscape:label="go-down"
id="g11722"
transform="matrix(2,0,0,2,-362.0004,-1494)">
<rect
transform="rotate(90)"
style="color:#bebebe;display:inline;overflow:visible;visibility:visible;fill:none;stroke:none;stroke-width:1;marker:none;enable-background:new"
id="rect11718"
y="-197.0002"
x="747"
height="16"
width="16" />
<path
style="display:inline;fill:#e5e5e5;fill-opacity:1;stroke:none"
d="m 189.0002,759.4375 -5.71875,-5.7187 C 183.08558,753.5229 183.0002,753.2556 183.0002,753 v -1 h 1 c 0.25562,0 0.52288,0.085 0.71875,0.2813 l 4.28125,4.2812 4.28125,-4.2812 C 193.47732,752.0854 193.74458,752 194.0002,752 h 1 v 1 c 0,0.2556 -0.0854,0.5229 -0.28125,0.7188 z"
id="path11720"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccscsccsscscc" />
</g>
<svg class="keyboard-key" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<path d="M12 20.875L.562 9.438C.171 9.046 0 8.51 0 8V6h2c.511 0 1.046.17 1.438.563L12 15.125l8.563-8.562C20.953 6.17 21.488 6 22 6h2v2c0 .511-.17 1.046-.563 1.438z" fill="#e5e5e5"/>
</svg>

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 278 B

View File

@ -1,129 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32"
viewBox="0 0 32 32"
version="1.1"
id="svg7384"
height="32"
sodipodi:docname="key-layout.svg"
inkscape:version="0.92.3 (2405546, 2018-03-11)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="3440"
inkscape:window-height="1376"
id="namedview19"
showgrid="false"
inkscape:zoom="1"
inkscape:cx="46.246852"
inkscape:cy="17.474578"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg7384">
<inkscape:grid
type="xygrid"
id="grid861" />
</sodipodi:namedview>
<metadata
id="metadata90">
<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>Gnome Symbolic Icon Theme</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<title
id="title9167">Gnome Symbolic Icon Theme</title>
<defs
id="defs7386">
<linearGradient
osb:paint="solid"
id="linearGradient19282"
gradientTransform="matrix(-2.7365795,0.28202934,-0.18908311,-0.99988321,239.54008,-879.45557)">
<stop
style="stop-color:#666666;stop-opacity:1;"
offset="0"
id="stop19284" />
</linearGradient>
</defs>
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="layer9" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="layer10" />
<g
transform="translate(-141.0002,-791)"
id="layer11" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="layer13" />
<g
transform="translate(-141.0002,-791)"
id="layer14" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="layer15" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="g71291" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="g4953" />
<g
style="stroke-width:0.5;enable-background:new"
id="g3561"
inkscape:label="preferences-desktop-locale"
transform="matrix(2,0,0,2,135.99464,-895.9793)">
<path
sodipodi:nodetypes="cc"
inkscape:connector-curvature="0"
id="path3535"
d="m -65,450 v 12"
style="fill:#e5e5e5;fill-opacity:1;fill-rule:evenodd;stroke:#e5e5e5;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
sodipodi:nodetypes="ccccccccc"
inkscape:connector-curvature="0"
id="path3537"
d="m -65,456 h 4 l 1,2 h 5 v -6 h -4 l -1,-2 h -5 z"
style="fill:none;fill-rule:evenodd;stroke:#e5e5e5;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
style="opacity:1;vector-effect:none;fill:#e5e5e5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="m -65,456 h 4 l 1,2 h 5 v -6 h -4 l -1,-2 h -5 z"
id="path3539"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccccc" />
<rect
style="color:#bebebe;display:inline;overflow:visible;visibility:visible;fill:none;stroke:none;stroke-width:0.89050001;marker:none;enable-background:new"
id="rect3543"
y="448"
x="-68"
height="16"
width="16" />
</g>
<svg xmlns="http://www.w3.org/2000/svg" class="keyboard-key" width="24" height="24">
<path d="M4.5 2v21" fill="#e5e5e5" fill-rule="evenodd" stroke="#e5e5e5" stroke-width="3"/>
<path d="M4 12h6l2 4h8V6h-6l-2-4H4z" fill="none" stroke="#e5e5e5" stroke-width="2" stroke-linejoin="round"/>
<path d="M4 12h6l2 4h8V6h-6l-2-4H4z" fill="#e5e5e5" fill-rule="evenodd"/>
</svg>

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 378 B

View File

@ -1,109 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32"
viewBox="0 0 32 32"
version="1.1"
id="svg7384"
height="32"
sodipodi:docname="key-shift-latched-uppercase.svg"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1791"
inkscape:window-height="984"
id="namedview19"
showgrid="false"
inkscape:zoom="14.75"
inkscape:cx="-0.77966097"
inkscape:cy="18.847458"
inkscape:window-x="0"
inkscape:window-y="55"
inkscape:window-maximized="0"
inkscape:current-layer="svg7384" />
<metadata
id="metadata90">
<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>Gnome Symbolic Icon Theme</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<title
id="title9167">Gnome Symbolic Icon Theme</title>
<defs
id="defs7386">
<linearGradient
osb:paint="solid"
id="linearGradient19282"
gradientTransform="matrix(-2.7365795,0.28202934,-0.18908311,-0.99988321,239.54008,-879.45557)">
<stop
style="stop-color:#666666;stop-opacity:1;"
offset="0"
id="stop19284" />
</linearGradient>
</defs>
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="layer9" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="layer10" />
<g
transform="translate(-141.0002,-791)"
id="layer11" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="layer13" />
<g
transform="translate(-141.0002,-791)"
id="layer14" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="layer15" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="g71291" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="g4953" />
<g
transform="matrix(2,0,0,2,-282.0004,-1614.2187)"
style="display:inline;fill:#006098;fill-opacity:1"
id="layer12">
<path
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#006098;fill-opacity:1;stroke:none;stroke-width:2;marker:none;enable-background:new"
d="m 147,818 v -4 h -3.1248 l 5.125,-5.7813 5.125,5.7813 h -3.1875 v 4 z"
id="path16532"
inkscape:connector-curvature="0" />
<path
id="path16534"
d="m 147,822 v -2 h 3.9377 v 2 z"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#006098;fill-opacity:1;stroke:none;stroke-width:2;marker:none;enable-background:new"
inkscape:connector-curvature="0" />
</g>
<svg class="keyboard-key" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<path style="marker:none" d="M12 0L2 12h6v6h8v-6h6zM8 21v3h8v-3z" color="#000" overflow="visible" fill="#3584e4"/>
</svg>

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 211 B

View File

@ -1,104 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32"
viewBox="0 0 32 32"
version="1.1"
id="svg7384"
height="32"
sodipodi:docname="key-shift-uppercase.svg"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2160"
inkscape:window-height="1311"
id="namedview18"
showgrid="false"
inkscape:zoom="14.75"
inkscape:cx="-27.898305"
inkscape:cy="8"
inkscape:window-x="0"
inkscape:window-y="55"
inkscape:window-maximized="1"
inkscape:current-layer="svg7384" />
<metadata
id="metadata90">
<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>Gnome Symbolic Icon Theme</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<title
id="title9167">Gnome Symbolic Icon Theme</title>
<defs
id="defs7386">
<linearGradient
osb:paint="solid"
id="linearGradient19282"
gradientTransform="matrix(-2.7365795,0.28202934,-0.18908311,-0.99988321,239.54008,-879.45557)">
<stop
style="stop-color:#666666;stop-opacity:1;"
offset="0"
id="stop19284" />
</linearGradient>
</defs>
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="layer9" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="layer10" />
<g
transform="translate(-141.0002,-791)"
id="layer11" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="layer13" />
<g
transform="translate(-141.0002,-791)"
id="layer14" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="layer15" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="g71291" />
<g
transform="translate(-141.0002,-791)"
style="display:inline"
id="g4953" />
<g
transform="matrix(2,0,0,2,-282.0008,-1614.2187)"
style="display:inline;fill:#006098;fill-opacity:1"
id="layer12">
<path
id="path16548"
d="m 147.0002,820 v -4 h -3.1248 l 5.125,-5.7813 5.125,5.7813 h -3.1875 v 4 z"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#006098;fill-opacity:1;stroke:none;stroke-width:2;marker:none;enable-background:new"
inkscape:connector-curvature="0" />
</g>
<svg class="keyboard-key" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<path d="M8 22v-8H2L12 2l10 12h-6v8z" style="marker:none" color="#000" overflow="visible" fill="#3584e4"/>
</svg>

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 203 B

View File

@ -1,108 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="32"
viewBox="0 0 32 32"
version="1.1"
id="svg7384"
height="32"
sodipodi:docname="key-shift.svg"
inkscape:version="0.92.2 (5c3e80d, 2017-08-06)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1400"
inkscape:window-height="1034"
id="namedview4569"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="14.75"
inkscape:cx="1.5993763"
inkscape:cy="5"
inkscape:window-x="0"
inkscape:window-y="55"
inkscape:window-maximized="0"
inkscape:current-layer="svg7384" />
<metadata
id="metadata90">
<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>Gnome Symbolic Icon Theme</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<title
id="title9167">Gnome Symbolic Icon Theme</title>
<defs
id="defs7386">
<linearGradient
osb:paint="solid"
id="linearGradient19282"
gradientTransform="matrix(-2.7365795,0.28202934,-0.18908311,-0.99988321,239.54008,-879.45557)">
<stop
style="stop-color:#666666;stop-opacity:1;"
offset="0"
id="stop19284" />
</linearGradient>
</defs>
<g
transform="translate(-143.8754,-788)"
style="display:inline"
id="layer9" />
<g
transform="translate(-143.8754,-788)"
style="display:inline"
id="layer10" />
<g
transform="translate(-143.8754,-788)"
id="layer11" />
<g
transform="translate(-143.8754,-788)"
style="display:inline"
id="layer13" />
<g
transform="translate(-143.8754,-788)"
id="layer14" />
<g
transform="translate(-143.8754,-788)"
style="display:inline"
id="layer15" />
<g
transform="translate(-143.8754,-788)"
style="display:inline"
id="g71291" />
<g
transform="translate(-143.8754,-788)"
style="display:inline"
id="g4953" />
<g
transform="matrix(2,0,0,2,-282.0008,-1614.2187)"
style="display:inline"
id="layer12">
<path
id="path16548"
d="m 147.0002,820 v -4 h -3.1248 l 5.125,-5.7813 5.125,5.7813 h -3.1875 v 4 z"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#bebebe;fill-opacity:1;stroke:none;stroke-width:2;marker:none;enable-background:new"
inkscape:connector-curvature="0" />
</g>
<svg class="keyboard-key" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
<path d="M8 22v-8H2L12 2l10 12h-6v8z" style="marker:none" color="#000" overflow="visible" fill="#bebebe"/>
</svg>

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 203 B

View File

@ -4,7 +4,40 @@ theme_sources = files([
'gnome-shell-sass/_colors.scss',
'gnome-shell-sass/_common.scss',
'gnome-shell-sass/_drawing.scss',
'gnome-shell-sass/_high-contrast-colors.scss'
'gnome-shell-sass/_high-contrast-colors.scss',
'gnome-shell-sass/_widgets.scss',
'gnome-shell-sass/widgets/_app-grid.scss',
'gnome-shell-sass/widgets/_app-switcher.scss',
'gnome-shell-sass/widgets/_buttons.scss',
'gnome-shell-sass/widgets/_calendar.scss',
'gnome-shell-sass/widgets/_check-box.scss',
'gnome-shell-sass/widgets/_corner-ripple.scss',
'gnome-shell-sass/widgets/_dash.scss',
'gnome-shell-sass/widgets/_dialogs.scss',
'gnome-shell-sass/widgets/_end-session-dialog.scss',
'gnome-shell-sass/widgets/_entries.scss',
'gnome-shell-sass/widgets/_hotplug.scss',
'gnome-shell-sass/widgets/_ibus-popup.scss',
'gnome-shell-sass/widgets/_keyboard.scss',
'gnome-shell-sass/widgets/_login-dialog.scss',
'gnome-shell-sass/widgets/_looking-glass.scss',
'gnome-shell-sass/widgets/_message-list.scss',
'gnome-shell-sass/widgets/_misc.scss',
'gnome-shell-sass/widgets/_network-dialog.scss',
'gnome-shell-sass/widgets/_notifications.scss',
'gnome-shell-sass/widgets/_osd.scss',
'gnome-shell-sass/widgets/_overview.scss',
'gnome-shell-sass/widgets/_panel.scss',
'gnome-shell-sass/widgets/_popovers.scss',
'gnome-shell-sass/widgets/_screen-shield.scss',
'gnome-shell-sass/widgets/_scrollbars.scss',
'gnome-shell-sass/widgets/_search-entry.scss',
'gnome-shell-sass/widgets/_search-results.scss',
'gnome-shell-sass/widgets/_slider.scss',
'gnome-shell-sass/widgets/_switches.scss',
'gnome-shell-sass/widgets/_tiled-previews.scss',
'gnome-shell-sass/widgets/_window-picker.scss',
'gnome-shell-sass/widgets/_workspace-switcher.scss'
])
styles = [
@ -23,3 +56,4 @@ foreach style: styles
],
depend_files: theme_sources)
endforeach

View File

@ -8,7 +8,6 @@ const Format = imports.format;
const _ = Gettext.gettext;
const Config = imports.misc.config;
const ExtensionUtils = imports.misc.extensionUtils;
const { loadInterfaceXML } = imports.misc.fileUtils;
@ -692,8 +691,5 @@ function initEnvironment() {
function main(argv) {
initEnvironment();
Gettext.bindtextdomain(Config.GETTEXT_PACKAGE, Config.LOCALEDIR);
Gettext.textdomain(Config.GETTEXT_PACKAGE);
new Application().run(argv);
}

View File

@ -32,7 +32,6 @@
<file>perf/core.js</file>
<file>perf/hwtest.js</file>
<file>ui/accessDialog.js</file>
<file>ui/altTab.js</file>
<file>ui/animation.js</file>
<file>ui/appDisplay.js</file>
@ -98,6 +97,7 @@
<file>ui/shellEntry.js</file>
<file>ui/shellMountOperation.js</file>
<file>ui/slider.js</file>
<file>ui/swipeTracker.js</file>
<file>ui/switcherPopup.js</file>
<file>ui/switchMonitor.js</file>
<file>ui/tweener.js</file>

View File

@ -89,7 +89,7 @@ const SystemActions = GObject.registerClass({
name: C_("search-result", "Power Off"),
iconName: 'system-shutdown-symbolic',
// Translators: A list of keywords that match the power-off action, separated by semicolons
keywords: _("power off;shutdown;reboot;restart").split(/[; ]/),
keywords: _('power off;shutdown;reboot;restart;halt;stop').split(/[; ]/),
available: false,
});
this._actions.set(LOCK_SCREEN_ACTION_ID, {

View File

@ -1,154 +0,0 @@
/* exported AccessDialogDBus */
const { Clutter, Gio, GLib, GObject, Shell } = imports.gi;
const CheckBox = imports.ui.checkBox;
const Dialog = imports.ui.dialog;
const ModalDialog = imports.ui.modalDialog;
const { loadInterfaceXML } = imports.misc.fileUtils;
const RequestIface = loadInterfaceXML('org.freedesktop.impl.portal.Request');
const AccessIface = loadInterfaceXML('org.freedesktop.impl.portal.Access');
var DialogResponse = {
OK: 0,
CANCEL: 1,
CLOSED: 2,
};
var AccessDialog = GObject.registerClass(
class AccessDialog extends ModalDialog.ModalDialog {
_init(invocation, handle, title, subtitle, body, options) {
super._init({ styleClass: 'access-dialog' });
this._invocation = invocation;
this._handle = handle;
this._requestExported = false;
this._request = Gio.DBusExportedObject.wrapJSObject(RequestIface, this);
for (let option in options)
options[option] = options[option].deep_unpack();
this._buildLayout(title, subtitle, body, options);
}
_buildLayout(title, subtitle, body, options) {
// No support for non-modal system dialogs, so ignore the option
// let modal = options['modal'] || true;
let denyLabel = options['deny_label'] || _("Deny Access");
let grantLabel = options['grant_label'] || _("Grant Access");
let iconName = options['icon'] || null;
let choices = options['choices'] || [];
let contentParams = { title, subtitle, body };
if (iconName)
contentParams.icon = new Gio.ThemedIcon({ name: iconName });
let content = new Dialog.MessageDialogContent(contentParams);
this.contentLayout.add_actor(content);
this._choices = new Map();
for (let i = 0; i < choices.length; i++) {
let [id, name, opts, selected] = choices[i];
if (opts.length > 0)
continue; // radio buttons, not implemented
let check = new CheckBox.CheckBox();
check.getLabelActor().text = name;
check.checked = selected == "true";
content.insertBeforeBody(check);
this._choices.set(id, check);
}
this.addButton({ label: denyLabel,
action: () => {
this._sendResponse(DialogResponse.CANCEL);
},
key: Clutter.KEY_Escape });
this.addButton({ label: grantLabel,
action: () => {
this._sendResponse(DialogResponse.OK);
} });
}
open() {
super.open();
let connection = this._invocation.get_connection();
this._requestExported = this._request.export(connection, this._handle);
}
CloseAsync(invocation, _params) {
if (this._invocation.get_sender() != invocation.get_sender()) {
invocation.return_error_literal(Gio.DBusError,
Gio.DBusError.ACCESS_DENIED,
'');
return;
}
this._sendResponse(DialogResponse.CLOSED);
}
_sendResponse(response) {
if (this._requestExported)
this._request.unexport();
this._requestExported = false;
let results = {};
if (response == DialogResponse.OK) {
for (let [id, check] of this._choices) {
let checked = check.checked ? 'true' : 'false';
results[id] = new GLib.Variant('s', checked);
}
}
// Delay actual response until the end of the close animation (if any)
this.connect('closed', () => {
this._invocation.return_value(new GLib.Variant('(ua{sv})',
[response, results]));
});
this.close();
}
});
var AccessDialogDBus = class {
constructor() {
this._accessDialog = null;
this._windowTracker = Shell.WindowTracker.get_default();
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(AccessIface, this);
this._dbusImpl.export(Gio.DBus.session, '/org/freedesktop/portal/desktop');
Gio.DBus.session.own_name('org.freedesktop.impl.portal.desktop.gnome', Gio.BusNameOwnerFlags.REPLACE, null, null);
}
AccessDialogAsync(params, invocation) {
if (this._accessDialog) {
invocation.return_error_literal(Gio.DBusError,
Gio.DBusError.LIMITS_EXCEEDED,
'Already showing a system access dialog');
return;
}
let [handle, appId, parentWindow_, title, subtitle, body, options] = params;
// We probably want to use parentWindow and global.display.focus_window
// for this check in the future
if (appId && `${appId}.desktop` != this._windowTracker.focus_app.id) {
invocation.return_error_literal(Gio.DBusError,
Gio.DBusError.ACCESS_DENIED,
'Only the focused app is allowed to show a system access dialog');
return;
}
let dialog = new AccessDialog(invocation, handle, title,
subtitle, body, options);
dialog.open();
dialog.connect('closed', () => (this._accessDialog = null));
this._accessDialog = dialog;
}
};

View File

@ -64,9 +64,6 @@ class AppSwitcherPopup extends SwitcherPopup.SwitcherPopup {
let apps = Shell.AppSystem.get_default().get_running();
if (apps.length == 0)
return;
this._switcherList = new AppSwitcher(apps, this);
this._items = this._switcherList.icons;
}
@ -178,7 +175,7 @@ class AppSwitcherPopup extends SwitcherPopup.SwitcherPopup {
this._select(this._next());
} else if (action == Meta.KeyBindingAction.SWITCH_APPLICATIONS_BACKWARD) {
this._select(this._previous());
} else if (keysym === Clutter.KEY_q) {
} else if (keysym == Clutter.KEY_q || keysym === Clutter.KEY_Q) {
this._quitApplication(this._selectedIndex);
} else if (this._thumbnailsFocused) {
if (keysym === Clutter.KEY_Left)
@ -187,7 +184,7 @@ class AppSwitcherPopup extends SwitcherPopup.SwitcherPopup {
this._select(this._selectedIndex, this._nextWindow());
else if (keysym === Clutter.KEY_Up)
this._select(this._selectedIndex, null, true);
else if (keysym === Clutter.KEY_w || keysym === Clutter.KEY_F4)
else if (keysym === Clutter.KEY_w || keysym === Clutter.KEY_W || keysym === Clutter.KEY_F4)
this._closeAppWindow(this._selectedIndex, this._currentWindow);
else
return Clutter.EVENT_PROPAGATE;
@ -248,20 +245,20 @@ class AppSwitcherPopup extends SwitcherPopup.SwitcherPopup {
this._select(n);
}
_windowActivated(thumbnailList, n) {
_windowActivated(thumbnailSwitcher, n) {
let appIcon = this._items[this._selectedIndex];
Main.activateWindow(appIcon.cachedWindows[n]);
this.fadeAndDestroy();
}
_windowEntered(thumbnailList, n) {
_windowEntered(thumbnailSwitcher, n) {
if (!this.mouseActive)
return;
this._select(this._selectedIndex, n);
}
_windowRemoved(thumbnailList, n) {
_windowRemoved(thumbnailSwitcher, n) {
let appIcon = this._items[this._selectedIndex];
if (!appIcon)
return;
@ -373,7 +370,7 @@ class AppSwitcherPopup extends SwitcherPopup.SwitcherPopup {
}
_createThumbnails() {
this._thumbnails = new ThumbnailList(this._items[this._selectedIndex].cachedWindows);
this._thumbnails = new ThumbnailSwitcher(this._items[this._selectedIndex].cachedWindows);
this._thumbnails.connect('item-activated', this._windowActivated.bind(this));
this._thumbnails.connect('item-entered', this._windowEntered.bind(this));
this._thumbnails.connect('item-removed', this._windowRemoved.bind(this));
@ -481,9 +478,6 @@ var CyclerPopup = GObject.registerClass({
this._items = this._getWindows();
if (this._items.length == 0)
return;
this._highlight = new CyclerHighlight();
global.window_group.add_actor(this._highlight);
@ -559,11 +553,8 @@ class WindowSwitcherPopup extends SwitcherPopup.SwitcherPopup {
let windows = this._getWindowList();
if (windows.length == 0)
return;
let mode = this._settings.get_enum('app-icon-mode');
this._switcherList = new WindowList(windows, mode);
this._switcherList = new WindowSwitcher(windows, mode);
this._items = this._switcherList.icons;
}
@ -596,7 +587,7 @@ class WindowSwitcherPopup extends SwitcherPopup.SwitcherPopup {
this._select(this._previous());
else if (keysym == Clutter.KEY_Right)
this._select(this._next());
else if (keysym == Clutter.KEY_w || keysym == Clutter.KEY_F4)
else if (keysym === Clutter.KEY_w || keysym === Clutter.KEY_W || keysym === Clutter.KEY_F4)
this._closeWindow(this._selectedIndex);
else
return Clutter.EVENT_PROPAGATE;
@ -811,7 +802,7 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
}
// We override SwitcherList's highlight() method to also deal with
// the AppSwitcher->ThumbnailList arrows. Apps with only 1 window
// the AppSwitcher->ThumbnailSwitcher arrows. Apps with only 1 window
// will hide their arrows by default, but show them when their
// thumbnails are visible (ie, when the app icon is supposed to be
// in justOutline mode). Apps with multiple windows will normally
@ -868,8 +859,8 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
}
});
var ThumbnailList = GObject.registerClass(
class ThumbnailList extends SwitcherPopup.SwitcherList {
var ThumbnailSwitcher = GObject.registerClass(
class ThumbnailSwitcher extends SwitcherPopup.SwitcherList {
_init(windows) {
super._init(false);
@ -1022,8 +1013,8 @@ class WindowIcon extends St.BoxLayout {
}
});
var WindowList = GObject.registerClass(
class WindowList extends SwitcherPopup.SwitcherList {
var WindowSwitcher = GObject.registerClass(
class WindowSwitcher extends SwitcherPopup.SwitcherList {
_init(windows, mode) {
super._init(true);

View File

@ -13,6 +13,7 @@ const Main = imports.ui.main;
const PageIndicators = imports.ui.pageIndicators;
const PopupMenu = imports.ui.popupMenu;
const Search = imports.ui.search;
const SwipeTracker = imports.ui.swipeTracker;
const Params = imports.misc.params;
const Util = imports.misc.util;
const SystemActions = imports.misc.systemActions;
@ -35,7 +36,7 @@ var MIN_FREQUENT_APPS_COUNT = 3;
var VIEWS_SWITCH_TIME = 400;
var VIEWS_SWITCH_ANIMATION_DELAY = 100;
var PAGE_SWITCH_TIME = 300;
var PAGE_SWITCH_TIME = 250;
var APP_ICON_SCALE_IN_TIME = 500;
var APP_ICON_SCALE_IN_DELAY = 700;
@ -327,7 +328,9 @@ var AllView = GObject.registerClass({
(indicators, pageIndex) => {
this.goToPage(pageIndex);
});
this._pageIndicators.connect('scroll-event', this._onScroll.bind(this));
this._pageIndicators.connect('scroll-event', (actor, event) => {
this._scrollView.event(event, false);
});
this.add_actor(this._pageIndicators);
this._folderIcons = [];
@ -353,13 +356,12 @@ var AllView = GObject.registerClass({
this._scrollView.connect('scroll-event', this._onScroll.bind(this));
let panAction = new Clutter.PanAction({ interpolate: false });
panAction.connect('pan', this._onPan.bind(this));
panAction.connect('gesture-cancel', this._onPanEnd.bind(this));
panAction.connect('gesture-end', this._onPanEnd.bind(this));
this._panAction = panAction;
this._scrollView.add_action(panAction);
this._panning = false;
this._swipeTracker = new SwipeTracker.SwipeTracker(
this._scrollView, Shell.ActionMode.OVERVIEW);
this._swipeTracker.connect('begin', this._swipeBegin.bind(this));
this._swipeTracker.connect('update', this._swipeUpdate.bind(this));
this._swipeTracker.connect('end', this._swipeEnd.bind(this));
this._clickAction = new Clutter.ClickAction();
this._clickAction.connect('clicked', () => {
if (!this._currentPopup)
@ -376,6 +378,9 @@ var AllView = GObject.registerClass({
this._displayingPopup = false;
this._currentPopupDestroyId = 0;
this._canScroll = true; // limiting scrolling speed
this._scrollTimeoutId = 0;
this._availWidth = 0;
this._availHeight = 0;
@ -406,12 +411,22 @@ var AllView = GObject.registerClass({
Main.overview.connect('item-drag-begin', this._onDragBegin.bind(this));
Main.overview.connect('item-drag-end', this._onDragEnd.bind(this));
this.connect('destroy', this._onDestroy.bind(this));
}
_onDestroy() {
if (this._scrollTimeoutId !== 0) {
GLib.source_remove(this._scrollTimeoutId);
this._scrollTimeoutId = 0;
}
}
vfunc_map() {
this._keyPressEventId =
global.stage.connect('key-press-event',
this._onKeyPressEvent.bind(this));
this._swipeTracker.enabled = true;
super.vfunc_map();
}
@ -420,6 +435,7 @@ var AllView = GObject.registerClass({
global.stage.disconnect(this._keyPressEventId);
this._keyPressEventId = 0;
}
this._swipeTracker.enabled = false;
super.vfunc_unmap();
}
@ -565,7 +581,7 @@ var AllView = GObject.registerClass({
return this._grid.getPageY(this._grid.currentPage);
}
goToPage(pageNumber) {
goToPage(pageNumber, animate = true) {
pageNumber = clamp(pageNumber, 0, this._grid.nPages() - 1);
if (this._grid.currentPage == pageNumber && this._displayingPopup && this._currentPopup)
@ -580,42 +596,16 @@ var AllView = GObject.registerClass({
return;
}
let velocity;
if (!this._panning)
velocity = 0;
else
velocity = Math.abs(this._panAction.get_velocity(0)[2]);
// Tween the change between pages.
// If velocity is not specified (i.e. scrolling with mouse wheel),
// use the same speed regardless of original position
// if velocity is specified, it's in pixels per milliseconds
let diffToPage = this._diffToPage(pageNumber);
let childBox = this._scrollView.get_allocation_box();
let totalHeight = childBox.y2 - childBox.y1;
let time;
// Only take the velocity into account on page changes, otherwise
// return smoothly to the current page using the default velocity
if (this._grid.currentPage != pageNumber) {
let minVelocity = totalHeight / PAGE_SWITCH_TIME;
velocity = Math.max(minVelocity, velocity);
time = diffToPage / velocity;
} else {
time = PAGE_SWITCH_TIME * diffToPage / totalHeight;
}
// When changing more than one page, make sure to not take
// longer than PAGE_SWITCH_TIME
time = Math.min(time, PAGE_SWITCH_TIME);
if (this._grid.currentPage === pageNumber)
return;
this._grid.currentPage = pageNumber;
this._adjustment.ease(this._grid.getPageY(pageNumber), {
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
duration: time,
});
}
_diffToPage(pageNumber) {
let currentScrollPosition = this._adjustment.value;
return Math.abs(currentScrollPosition - this._grid.getPageY(pageNumber));
// Tween the change between pages.
this._adjustment.ease(this._grid.getPageY(this._grid.currentPage), {
mode: Clutter.AnimationMode.EASE_OUT_CUBIC,
duration: animate ? PAGE_SWITCH_TIME : 0,
});
}
openSpaceForPopup(item, side, nRows) {
@ -638,43 +628,62 @@ var AllView = GObject.registerClass({
if (this._displayingPopup || !this._scrollView.reactive)
return Clutter.EVENT_STOP;
if (this._swipeTracker.canHandleScrollEvent(event))
return Clutter.EVENT_PROPAGATE;
if (!this._canScroll)
return Clutter.EVENT_STOP;
let direction = event.get_scroll_direction();
if (direction == Clutter.ScrollDirection.UP)
this.goToPage(this._grid.currentPage - 1);
else if (direction == Clutter.ScrollDirection.DOWN)
this.goToPage(this._grid.currentPage + 1);
else
return Clutter.EVENT_STOP;
this._canScroll = false;
this._scrollTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
PAGE_SWITCH_TIME, () => {
this._canScroll = true;
this._scrollTimeoutId = 0;
return GLib.SOURCE_REMOVE;
}
);
return Clutter.EVENT_STOP;
}
_onPan(action) {
if (this._displayingPopup)
return false;
this._panning = true;
this._clickAction.release();
let [dist_, dx_, dy] = action.get_motion_delta(0);
let adjustment = this._adjustment;
adjustment.value -= (dy / this._scrollView.height) * adjustment.page_size;
return false;
}
_onPanEnd(action) {
if (this._displayingPopup)
_swipeBegin(tracker, monitor) {
if (monitor !== Main.layoutManager.primaryIndex)
return;
let pageHeight = this._grid.getPageHeight();
let adjustment = this._adjustment;
adjustment.remove_transition('value');
// Calculate the scroll value we'd be at, which is our current
// scroll plus any velocity the user had when they released
// their finger.
let progress = adjustment.value / adjustment.page_size;
let points = Array.from({ length: this._grid.nPages() }, (v, i) => i);
let velocity = -action.get_velocity(0)[2];
let endPanValue = this._adjustment.value + velocity;
tracker.confirmSwipe(this._scrollView.height,
points, progress, Math.round(progress));
}
let closestPage = Math.round(endPanValue / pageHeight);
this.goToPage(closestPage);
_swipeUpdate(tracker, progress) {
let adjustment = this._adjustment;
adjustment.value = progress * adjustment.page_size;
}
this._panning = false;
_swipeEnd(tracker, duration, endProgress) {
let adjustment = this._adjustment;
let value = endProgress * adjustment.page_size;
adjustment.ease(value, {
mode: Clutter.AnimationMode.EASE_OUT_CUBIC,
duration,
onComplete: () => {
this.goToPage(endProgress, false);
},
});
}
_onKeyPressEvent(actor, event) {

View File

@ -863,12 +863,10 @@ class EventsSection extends MessageList.MessageListSection {
let now = new Date();
if (sameYear(this._date, now)) {
/* Translators: Shown on calendar heading when selected day occurs on current year */
dayFormat = Shell.util_translate_time_string(NC_("calendar heading",
"%A, %B %-d"));
dayFormat = Shell.util_translate_time_string(NC_("calendar heading", "%A, %B %-d"));
} else {
/* Translators: Shown on calendar heading when selected day occurs on different year */
dayFormat = Shell.util_translate_time_string(NC_("calendar heading",
"%A, %B %-d, %Y"));
dayFormat = Shell.util_translate_time_string(NC_("calendar heading", "%A, %B %-d, %Y"));
}
this._title.label = this._date.toLocaleFormat(dayFormat);
}

View File

@ -1,7 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported CloseDialog */
const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
const { Clutter, GLib, GObject, Meta, Shell, St } = imports.gi;
const Dialog = imports.ui.dialog;
const Main = imports.ui.main;
@ -40,10 +40,9 @@ var CloseDialog = GObject.registerClass({
/* Translators: %s is an application name */
let title = _("“%s” is not responding.").format(windowApp.get_name());
let subtitle = _("You may choose to wait a short while for it to " +
"continue or force the application to quit entirely.");
let icon = new Gio.ThemedIcon({ name: 'dialog-warning-symbolic' });
return new Dialog.MessageDialogContent({ icon, title, subtitle });
let description = _('You may choose to wait a short while for it to ' +
'continue or force the application to quit entirely.');
return new Dialog.MessageDialogContent({ title, description });
}
_updateScale() {
@ -67,7 +66,7 @@ var CloseDialog = GObject.registerClass({
this._dialog.width = windowActor.width;
this._dialog.height = windowActor.height;
this._dialog.addContent(this._createDialogContent());
this._dialog.contentLayout.add_child(this._createDialogContent());
this._dialog.addButton({ label: _('Force Quit'),
action: this._onClose.bind(this),
default: true });

View File

@ -21,12 +21,11 @@ class KeyringDialog extends ModalDialog.ModalDialog {
this.prompt.connect('show-confirm', this._onShowConfirm.bind(this));
this.prompt.connect('prompt-close', this._onHidePrompt.bind(this));
let icon = new Gio.ThemedIcon({ name: 'dialog-password-symbolic' });
this._content = new Dialog.MessageDialogContent({ icon });
this._content = new Dialog.MessageDialogContent();
this.contentLayout.add(this._content);
this.prompt.bind_property('message', this._content, 'title', GObject.BindingFlags.SYNC_CREATE);
this.prompt.bind_property('description', this._content, 'body', GObject.BindingFlags.SYNC_CREATE);
this.prompt.bind_property('description', this._content, 'description', GObject.BindingFlags.SYNC_CREATE);
this._workSpinner = null;
this._controlTable = null;
@ -154,7 +153,7 @@ class KeyringDialog extends ModalDialog.ModalDialog {
}
this._controlTable = table;
this._content.messageBox.add_child(table);
this._content.add_child(table);
}
_updateSensitivity(sensitive) {

View File

@ -29,11 +29,10 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
else
this._content = this._getContent();
let icon = new Gio.ThemedIcon({ name: 'dialog-password-symbolic' });
let contentParams = { icon,
title: this._content.title,
body: this._content.message };
let contentBox = new Dialog.MessageDialogContent(contentParams);
let contentBox = new Dialog.MessageDialogContent({
title: this._content.title,
description: this._content.message,
});
this.contentLayout.add_actor(contentBox);
let layout = new Clutter.GridLayout({ orientation: Clutter.Orientation.VERTICAL });
@ -109,7 +108,7 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
layout.attach(this._capsLockWarningLabel, 1, pos, 1, 1);
}
contentBox.messageBox.add(secretTable);
contentBox.add_child(secretTable);
if (flags & NM.SecretAgentGetSecretsFlags.WPS_PBC_ACTIVE) {
let descriptionLabel = new St.Label({ style_class: 'prompt-dialog-description',
@ -117,7 +116,7 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
descriptionLabel.clutter_text.line_wrap = true;
descriptionLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
contentBox.messageBox.add_child(descriptionLabel);
contentBox.add_child(descriptionLabel);
}
this._okButton = {
@ -725,6 +724,10 @@ var NetworkAgent = class {
title = _("Mobile broadband network password");
body = _("A password is required to connect to “%s”.").format(connectionSetting.get_id());
break;
case 'vpn':
title = _("VPN password");
body = _("A password is required to connect to “%s”.").format(connectionSetting.get_id());
break;
default:
log(`Invalid connection type: ${connectionType}`);
this._native.respond(requestId, Shell.NetworkAgentResponse.INTERNAL_ERROR);

View File

@ -1,7 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported Component */
const { AccountsService, Clutter, Gio, GLib,
const { AccountsService, Clutter, GLib,
GObject, Pango, PolkitAgent, Polkit, Shell, St } = imports.gi;
const Animation = imports.ui.animation;
@ -25,11 +25,11 @@ const DELAYED_RESET_TIMEOUT = 200;
var AuthenticationDialog = GObject.registerClass({
Signals: { 'done': { param_types: [GObject.TYPE_BOOLEAN] } },
}, class AuthenticationDialog extends ModalDialog.ModalDialog {
_init(actionId, body, cookie, userNames) {
_init(actionId, description, cookie, userNames) {
super._init({ styleClass: 'prompt-dialog' });
this.actionId = actionId;
this.message = body;
this.message = description;
this.userNames = userNames;
this._sessionUpdatedId = Main.sessionMode.connect('updated', () => {
@ -38,10 +38,9 @@ var AuthenticationDialog = GObject.registerClass({
this.connect('closed', this._onDialogClosed.bind(this));
let icon = new Gio.ThemedIcon({ name: 'dialog-password-symbolic' });
let title = _("Authentication Required");
let content = new Dialog.MessageDialogContent({ icon, title, body });
let content = new Dialog.MessageDialogContent({ title, description });
this.contentLayout.add_actor(content);
if (userNames.length > 1) {
@ -62,7 +61,7 @@ var AuthenticationDialog = GObject.registerClass({
style_class: 'polkit-dialog-user-layout',
vertical: false,
});
content.messageBox.add(userBox);
content.add_child(userBox);
this._userAvatar = new UserWidget.Avatar(this._user, {
iconSize: DIALOG_ICON_SIZE,
@ -84,7 +83,7 @@ var AuthenticationDialog = GObject.registerClass({
userBox.add_child(this._userLabel);
this._passwordBox = new St.BoxLayout({ vertical: false, style_class: 'prompt-dialog-password-box' });
content.messageBox.add(this._passwordBox);
content.add_child(this._passwordBox);
this._passwordLabel = new St.Label({
style_class: 'prompt-dialog-password-label',
y_align: Clutter.ActorAlign.CENTER,
@ -110,18 +109,18 @@ var AuthenticationDialog = GObject.registerClass({
this._passwordBox.hide();
this._capsLockWarningLabel = new ShellEntry.CapsLockWarning({ style_class: 'prompt-dialog-caps-lock-warning' });
content.messageBox.add(this._capsLockWarningLabel);
content.add_child(this._capsLockWarningLabel);
this._errorMessageLabel = new St.Label({ style_class: 'prompt-dialog-error-label' });
this._errorMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
this._errorMessageLabel.clutter_text.line_wrap = true;
content.messageBox.add_child(this._errorMessageLabel);
content.add_child(this._errorMessageLabel);
this._errorMessageLabel.hide();
this._infoMessageLabel = new St.Label({ style_class: 'prompt-dialog-info-label' });
this._infoMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
this._infoMessageLabel.clutter_text.line_wrap = true;
content.messageBox.add(this._infoMessageLabel);
content.add_child(this._infoMessageLabel);
this._infoMessageLabel.hide();
/* text is intentionally non-blank otherwise the height is not the same as for
@ -133,7 +132,7 @@ var AuthenticationDialog = GObject.registerClass({
this._nullMessageLabel.add_style_class_name('hidden');
this._nullMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
this._nullMessageLabel.clutter_text.line_wrap = true;
content.messageBox.add(this._nullMessageLabel);
content.add_child(this._nullMessageLabel);
this._nullMessageLabel.show();
this._cancelButton = this.addButton({ label: _("Cancel"),

View File

@ -348,7 +348,14 @@ class WeatherSection extends St.Button {
timeOnly: true,
ampm: false,
});
const [, tempValue] = fc.get_value_temp(GWeather.TemperatureUnit.DEFAULT);
const tempPrefix = tempValue >= 0 ? ' ' : '';
let time = new St.Label({
style_class: 'weather-forecast-time',
text: timeStr,
x_align: Clutter.ActorAlign.CENTER,
});
let icon = new St.Icon({
style_class: 'weather-forecast-icon',
icon_name: fc.get_symbolic_icon_name(),
@ -357,21 +364,16 @@ class WeatherSection extends St.Button {
});
let temp = new St.Label({
style_class: 'weather-forecast-temp',
text: fc.get_temp_summary(),
x_align: Clutter.ActorAlign.CENTER,
});
let time = new St.Label({
style_class: 'weather-forecast-time',
text: timeStr,
text: '%s%.0f°'.format(tempPrefix, tempValue),
x_align: Clutter.ActorAlign.CENTER,
});
temp.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
time.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
layout.attach(icon, col, 0, 1, 1);
layout.attach(temp, col, 1, 1, 1);
layout.attach(time, col, 2, 1, 1);
layout.attach(time, col, 0, 1, 1);
layout.attach(icon, col, 1, 1, 1);
layout.attach(temp, col, 2, 1, 1);
col++;
});
}

View File

@ -1,7 +1,14 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported Dialog, MessageDialogContent */
/* exported Dialog, MessageDialogContent, ListSection, ListSectionItem */
const { Clutter, Gio, GObject, Pango, St } = imports.gi;
const { Clutter, GObject, Pango, St } = imports.gi;
function _setLabel(label, value) {
label.set({
text: value || '',
visible: value !== null,
});
}
var Dialog = GObject.registerClass(
class Dialog extends St.Widget {
@ -25,10 +32,12 @@ class Dialog extends St.Widget {
}
_createDialog() {
this._dialog = new St.BoxLayout({ style_class: 'modal-dialog',
x_align: Clutter.ActorAlign.CENTER,
y_align: Clutter.ActorAlign.CENTER,
vertical: true });
this._dialog = new St.BoxLayout({
style_class: 'modal-dialog',
x_align: Clutter.ActorAlign.CENTER,
y_align: Clutter.ActorAlign.CENTER,
vertical: true,
});
// modal dialogs are fixed width and grow vertically; set the request
// mode accordingly so wrapped labels are handled correctly during
@ -43,7 +52,9 @@ class Dialog extends St.Widget {
});
this._dialog.add_child(this.contentLayout);
this.buttonLayout = new St.Widget({ layout_manager: new Clutter.BoxLayout({ homogeneous: true }) });
this.buttonLayout = new St.Widget({
layout_manager: new Clutter.BoxLayout({ homogeneous: true }),
});
this._dialog.add_child(this.buttonLayout);
}
@ -95,10 +106,6 @@ class Dialog extends St.Widget {
return this._initialKeyFocus || this;
}
addContent(actor) {
this.contentLayout.add(actor, { expand: true });
}
addButton(buttonInfo) {
let { label, action, key } = buttonInfo;
let isDefault = buttonInfo['default'];
@ -111,13 +118,15 @@ class Dialog extends St.Widget {
else
keys = [];
let button = new St.Button({ style_class: 'modal-dialog-linked-button',
button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
reactive: true,
can_focus: true,
x_expand: true,
y_expand: true,
label });
let button = new St.Button({
style_class: 'modal-dialog-linked-button',
button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
reactive: true,
can_focus: true,
x_expand: true,
y_expand: true,
label,
});
button.connect('clicked', action);
buttonInfo['button'] = button;
@ -144,99 +153,170 @@ class Dialog extends St.Widget {
var MessageDialogContent = GObject.registerClass({
Properties: {
'icon': GObject.ParamSpec.object('icon', 'icon', 'icon',
GObject.ParamFlags.READWRITE |
GObject.ParamFlags.CONSTRUCT,
Gio.Icon.$gtype),
'title': GObject.ParamSpec.string('title', 'title', 'title',
GObject.ParamFlags.READWRITE |
GObject.ParamFlags.CONSTRUCT,
null),
'subtitle': GObject.ParamSpec.string('subtitle', 'subtitle', 'subtitle',
GObject.ParamFlags.READWRITE |
GObject.ParamFlags.CONSTRUCT,
null),
'body': GObject.ParamSpec.string('body', 'body', 'body',
GObject.ParamFlags.READWRITE |
GObject.ParamFlags.CONSTRUCT,
null),
'title': GObject.ParamSpec.string(
'title', 'title', 'title',
GObject.ParamFlags.READWRITE |
GObject.ParamFlags.CONSTRUCT,
null),
'description': GObject.ParamSpec.string(
'description', 'description', 'description',
GObject.ParamFlags.READWRITE |
GObject.ParamFlags.CONSTRUCT,
null),
},
}, class MessageDialogContent extends St.BoxLayout {
_init(params) {
this._icon = new St.Icon({ y_align: Clutter.ActorAlign.START });
this._title = new St.Label({ style_class: 'headline' });
this._subtitle = new St.Label();
this._body = new St.Label();
this._title = new St.Label({ style_class: 'message-dialog-title' });
this._description = new St.Label({ style_class: 'message-dialog-description' });
['icon', 'title', 'subtitle', 'body'].forEach(prop => {
this[`_${prop}`].add_style_class_name(`message-dialog-${prop}`);
});
this._description.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
this._description.clutter_text.line_wrap = true;
let textProps = { ellipsize: Pango.EllipsizeMode.NONE,
line_wrap: true };
this._subtitle.clutter_text.set(textProps);
this._body.clutter_text.set(textProps);
let defaultParams = { style_class: 'message-dialog-main-layout' };
let defaultParams = {
style_class: 'message-dialog-content',
x_expand: true,
vertical: true,
};
super._init(Object.assign(defaultParams, params));
this.messageBox = new St.BoxLayout({ style_class: 'message-dialog-content',
x_expand: true,
vertical: true });
this.messageBox.add_actor(this._title);
this.messageBox.add_actor(this._subtitle);
this.messageBox.add_actor(this._body);
this.add_actor(this._icon);
this.add_actor(this.messageBox);
}
get icon() {
return this._icon.gicon;
this.add_child(this._title);
this.add_child(this._description);
}
get title() {
return this._title.text;
}
get subtitle() {
return this._subtitle.text;
}
get body() {
return this._body.text;
}
set icon(icon) {
this._icon.set({
gicon: icon,
visible: icon != null,
});
this.notify('icon');
get description() {
return this._description.text;
}
set title(title) {
this._setLabel(this._title, 'title', title);
_setLabel(this._title, title);
this.notify('title');
}
set subtitle(subtitle) {
this._setLabel(this._subtitle, 'subtitle', subtitle);
}
set body(body) {
this._setLabel(this._body, 'body', body);
}
_setLabel(label, prop, value) {
label.set({
text: value || '',
visible: value != null,
});
this.notify(prop);
}
insertBeforeBody(actor) {
this.messageBox.insert_child_below(actor, this._body);
set description(description) {
_setLabel(this._description, description);
this.notify('description');
}
});
var ListSection = GObject.registerClass({
Properties: {
'title': GObject.ParamSpec.string(
'title', 'title', 'title',
GObject.ParamFlags.READWRITE |
GObject.ParamFlags.CONSTRUCT,
null),
},
}, class ListSection extends St.BoxLayout {
_init(params) {
this._title = new St.Label({ style_class: 'dialog-list-title' });
this._listScrollView = new St.ScrollView({
style_class: 'dialog-list-scrollview',
hscrollbar_policy: St.PolicyType.NEVER,
});
this.list = new St.BoxLayout({
style_class: 'dialog-list-box',
vertical: true,
});
this._listScrollView.add_actor(this.list);
let defaultParams = {
style_class: 'dialog-list',
x_expand: true,
vertical: true,
};
super._init(Object.assign(defaultParams, params));
this.label_actor = this._title;
this.add_child(this._title);
this.add_child(this._listScrollView);
}
get title() {
return this._title.text;
}
set title(title) {
_setLabel(this._title, title);
this.notify('title');
}
});
var ListSectionItem = GObject.registerClass({
Properties: {
'icon-actor': GObject.ParamSpec.object(
'icon-actor', 'icon-actor', 'Icon actor',
GObject.ParamFlags.READWRITE,
Clutter.Actor.$gtype),
'title': GObject.ParamSpec.string(
'title', 'title', 'title',
GObject.ParamFlags.READWRITE |
GObject.ParamFlags.CONSTRUCT,
null),
'description': GObject.ParamSpec.string(
'description', 'description', 'description',
GObject.ParamFlags.READWRITE |
GObject.ParamFlags.CONSTRUCT,
null),
},
}, class ListSectionItem extends St.BoxLayout {
_init(params) {
this._iconActorBin = new St.Bin();
let textLayout = new St.BoxLayout({
vertical: true,
y_expand: true,
y_align: Clutter.ActorAlign.CENTER,
});
this._title = new St.Label({ style_class: 'dialog-list-item-title' });
this._description = new St.Label({
style_class: 'dialog-list-item-title-description',
});
textLayout.add_child(this._title);
textLayout.add_child(this._description);
let defaultParams = { style_class: 'dialog-list-item' };
super._init(Object.assign(defaultParams, params));
this.label_actor = this._title;
this.add_child(this._iconActorBin);
this.add_child(textLayout);
}
// eslint-disable-next-line camelcase
get icon_actor() {
return this._iconActorBin.get_child();
}
// eslint-disable-next-line camelcase
set icon_actor(actor) {
this._iconActorBin.set_child(actor);
this.notify('icon-actor');
}
get title() {
return this._title.text;
}
set title(title) {
_setLabel(this._title, title);
this.notify('title');
}
get description() {
return this._description.text;
}
set description(description) {
_setLabel(this._description, description);
this.notify('description');
}
});

View File

@ -21,6 +21,7 @@ const { AccountsService, Clutter, Gio,
GLib, GObject, Pango, Polkit, Shell, St } = imports.gi;
const CheckBox = imports.ui.checkBox;
const Dialog = imports.ui.dialog;
const GnomeSession = imports.misc.gnomeSession;
const LoginManager = imports.misc.loginManager;
const ModalDialog = imports.ui.modalDialog;
@ -28,8 +29,7 @@ const UserWidget = imports.ui.userWidget;
const { loadInterfaceXML } = imports.misc.fileUtils;
const _ITEM_ICON_SIZE = 48;
const _DIALOG_ICON_SIZE = 48;
const _ITEM_ICON_SIZE = 64;
const EndSessionDialogIface = loadInterfaceXML('org.gnome.SessionManager.EndSessionDialog');
@ -49,7 +49,6 @@ const logoutDialogContent = {
showBatteryWarning: false,
confirmButtons: [{ signal: 'ConfirmedLogout',
label: C_("button", "Log Out") }],
iconStyleClass: 'end-session-dialog-logout-icon',
showOtherSessions: false,
};
@ -68,7 +67,6 @@ const shutdownDialogContent = {
{ signal: 'ConfirmedShutdown',
label: C_("button", "Power Off") }],
iconName: 'system-shutdown-symbolic',
iconStyleClass: 'end-session-dialog-shutdown-icon',
showOtherSessions: true,
};
@ -83,7 +81,6 @@ const restartDialogContent = {
confirmButtons: [{ signal: 'ConfirmedReboot',
label: C_("button", "Restart") }],
iconName: 'view-refresh-symbolic',
iconStyleClass: 'end-session-dialog-shutdown-icon',
showOtherSessions: true,
};
@ -101,7 +98,6 @@ const restartUpdateDialogContent = {
unusedFutureButtonForTranslation: C_("button", "Install &amp; Power Off"),
unusedFutureCheckBoxForTranslation: C_("checkbox", "Power off after updates are installed"),
iconName: 'view-refresh-symbolic',
iconStyleClass: 'end-session-dialog-shutdown-icon',
showOtherSessions: true,
};
@ -119,7 +115,6 @@ const restartUpgradeDialogContent = {
confirmButtons: [{ signal: 'ConfirmedReboot',
label: C_("button", "Restart &amp; Install") }],
iconName: 'view-refresh-symbolic',
iconStyleClass: 'end-session-dialog-shutdown-icon',
showOtherSessions: true,
};
@ -192,16 +187,6 @@ function _roundSecondsToInterval(totalSeconds, secondsLeft, interval) {
return time;
}
function _setLabelText(label, text) {
if (text) {
label.set_text(text);
label.show();
} else {
label.set_text('');
label.hide();
}
}
function _setCheckBoxLabel(checkBox, text) {
let label = checkBox.getLabelActor();
@ -260,75 +245,34 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
this.connect('opened',
this._onOpened.bind(this));
this._userLoadedId = this._user.connect('notify::is_loaded', this._sync.bind(this));
this._userLoadedId = this._user.connect('notify::is-loaded', this._sync.bind(this));
this._userChangedId = this._user.connect('changed', this._sync.bind(this));
let mainContentLayout = new St.BoxLayout({
vertical: false,
x_expand: true,
y_expand: false,
});
this.contentLayout.add_child(mainContentLayout);
this._iconBin = new St.Bin({
x_expand: true,
x_align: Clutter.ActorAlign.END,
});
mainContentLayout.add_child(this._iconBin);
let messageLayout = new St.BoxLayout({ vertical: true,
style_class: 'end-session-dialog-layout' });
mainContentLayout.add_child(messageLayout);
this._subjectLabel = new St.Label({ style_class: 'end-session-dialog-subject' });
messageLayout.add_child(this._subjectLabel);
this._descriptionLabel = new St.Label({
style_class: 'end-session-dialog-description',
y_expand: true,
});
this._descriptionLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
this._descriptionLabel.clutter_text.line_wrap = true;
messageLayout.add_child(this._descriptionLabel);
this._messageDialogContent = new Dialog.MessageDialogContent();
this._checkBox = new CheckBox.CheckBox();
this._checkBox.connect('clicked', this._sync.bind(this));
messageLayout.add(this._checkBox);
this._messageDialogContent.add_child(this._checkBox);
this._batteryWarning = new St.Label({ style_class: 'end-session-dialog-warning',
text: _("Running on battery power: please plug in before installing updates.") });
this._batteryWarning = new St.Label({
style_class: 'end-session-dialog-battery-warning',
text: _('Running on battery power: Please plug in before installing updates.'),
});
this._batteryWarning.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
this._batteryWarning.clutter_text.line_wrap = true;
messageLayout.add(this._batteryWarning);
this._messageDialogContent.add_child(this._batteryWarning);
this._scrollView = new St.ScrollView({
style_class: 'end-session-dialog-list',
x_expand: true,
y_expand: true,
this.contentLayout.add_child(this._messageDialogContent);
this._applicationSection = new Dialog.ListSection({
title: _('Some applications are busy or have unsaved work'),
});
this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
this.contentLayout.add_child(this._scrollView);
this._scrollView.hide();
this.contentLayout.add_child(this._applicationSection);
this._inhibitorSection = new St.BoxLayout({ vertical: true,
style_class: 'end-session-dialog-inhibitor-layout' });
this._scrollView.add_actor(this._inhibitorSection);
this._applicationHeader = new St.Label({ style_class: 'end-session-dialog-list-header',
text: _("Some applications are busy or have unsaved work.") });
this._applicationList = new St.BoxLayout({ style_class: 'end-session-dialog-app-list',
vertical: true });
this._inhibitorSection.add_actor(this._applicationHeader);
this._inhibitorSection.add_actor(this._applicationList);
this._sessionHeader = new St.Label({ style_class: 'end-session-dialog-list-header',
text: _("Other users are logged in.") });
this._sessionList = new St.BoxLayout({ style_class: 'end-session-dialog-session-list',
vertical: true });
this._inhibitorSection.add_actor(this._sessionHeader);
this._inhibitorSection.add_actor(this._sessionList);
this._sessionSection = new Dialog.ListSection({
title: _('Other users are logged in'),
});
this.contentLayout.add_child(this._sessionSection);
this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(EndSessionDialogIface, this);
this._dbusImpl.export(Gio.DBus.session, '/org/gnome/SessionManager/EndSessionDialog');
@ -379,11 +323,8 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
subject = dialogContent.subjectWithUpdates;
if (dialogContent.showBatteryWarning) {
// Warn when running on battery power
if (this._powerProxy.OnBattery && this._checkBox.checked)
this._batteryWarning.opacity = 255;
else
this._batteryWarning.opacity = 0;
this._batteryWarning.visible =
this._powerProxy.OnBattery && this._checkBox.checked;
}
let description;
@ -417,26 +358,14 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
if (!description)
description = dialogContent.description(displayTime);
_setLabelText(this._descriptionLabel, description);
_setLabelText(this._subjectLabel, subject);
if (dialogContent.iconName) {
this._iconBin.child = new St.Icon({ icon_name: dialogContent.iconName,
icon_size: _DIALOG_ICON_SIZE,
style_class: dialogContent.iconStyleClass });
} else {
let avatarWidget = new UserWidget.Avatar(this._user,
{ iconSize: _DIALOG_ICON_SIZE,
styleClass: dialogContent.iconStyleClass });
this._iconBin.child = avatarWidget;
avatarWidget.update();
}
this._messageDialogContent.title = subject;
this._messageDialogContent.description = description;
let hasApplications = this._applications.length > 0;
let hasSessions = this._sessions.length > 0;
this._scrollView.visible = hasApplications || hasSessions;
this._applicationHeader.visible = hasApplications;
this._sessionHeader.visible = hasSessions;
this._applicationSection.visible = hasApplications;
this._sessionSection.visible = hasSessions;
}
_updateButtons() {
@ -593,31 +522,6 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
this._secondsLeft = 0;
}
_constructListItemForApp(inhibitor, app) {
let actor = new St.BoxLayout({ style_class: 'end-session-dialog-app-list-item',
can_focus: true });
actor.add(app.create_icon_texture(_ITEM_ICON_SIZE));
let textLayout = new St.BoxLayout({ vertical: true,
y_expand: true,
y_align: Clutter.ActorAlign.CENTER });
actor.add(textLayout);
let nameLabel = new St.Label({ text: app.get_name(),
style_class: 'end-session-dialog-app-list-item-name' });
textLayout.add(nameLabel);
actor.label_actor = nameLabel;
let [reason] = inhibitor.GetReasonSync();
if (reason) {
let reasonLabel = new St.Label({ text: reason,
style_class: 'end-session-dialog-app-list-item-description' });
textLayout.add(reasonLabel);
}
return actor;
}
_onInhibitorLoaded(inhibitor) {
if (!this._applications.includes(inhibitor)) {
// Stale inhibitor
@ -627,8 +531,13 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
let app = findAppFromInhibitor(inhibitor);
if (app) {
let actor = this._constructListItemForApp(inhibitor, app);
this._applicationList.add(actor);
let [description] = inhibitor.GetReasonSync();
let listItem = new Dialog.ListSectionItem({
icon_actor: app.create_icon_texture(_ITEM_ICON_SIZE),
title: app.get_name(),
description,
});
this._applicationSection.list.add_child(listItem);
} else {
// inhibiting app is a service, not an application
this._applications.splice(this._applications.indexOf(inhibitor), 1);
@ -637,36 +546,6 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
this._sync();
}
_constructListItemForSession(session) {
let avatar = new UserWidget.Avatar(session.user, { iconSize: _ITEM_ICON_SIZE });
avatar.update();
let userName = session.user.get_real_name() ? session.user.get_real_name() : session.username;
let userLabelText;
if (session.remote)
/* Translators: Remote here refers to a remote session, like a ssh login */
userLabelText = _("%s (remote)").format(userName);
else if (session.type == "tty")
/* Translators: Console here refers to a tty like a VT console */
userLabelText = _("%s (console)").format(userName);
else
userLabelText = userName;
let actor = new St.BoxLayout({ style_class: 'end-session-dialog-session-list-item',
can_focus: true });
actor.add(avatar);
let nameLabel = new St.Label({ text: userLabelText,
style_class: 'end-session-dialog-session-list-item-name',
y_expand: true,
y_align: Clutter.ActorAlign.CENTER });
actor.add(nameLabel);
actor.label_actor = nameLabel;
return actor;
}
_loadSessions() {
this._loginManager.listSessions(result => {
let n = 0;
@ -697,8 +576,27 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
remote: proxy.Remote };
this._sessions.push(session);
let actor = this._constructListItemForSession(session);
this._sessionList.add(actor);
let userAvatar = new UserWidget.Avatar(session.user, { iconSize: _ITEM_ICON_SIZE });
userAvatar.update();
userName = session.user.get_real_name()
? session.user.get_real_name() : session.username;
let userLabelText;
if (session.remote)
/* Translators: Remote here refers to a remote session, like a ssh login */
userLabelText = _('%s (remote)').format(userName);
else if (session.type === 'tty')
/* Translators: Console here refers to a tty like a VT console */
userLabelText = _('%s (console)').format(userName);
else
userLabelText = userName;
let listItem = new Dialog.ListSectionItem({
icon_actor: userAvatar,
title: userLabelText,
});
this._sessionSection.list.add_child(listItem);
// limit the number of entries
n++;
@ -724,10 +622,10 @@ class EndSessionDialog extends ModalDialog.ModalDialog {
}
this._applications = [];
this._applicationList.destroy_all_children();
this._applicationSection.list.destroy_all_children();
this._sessions = [];
this._sessionList.destroy_all_children();
this._sessionSection.list.destroy_all_children();
if (!(this._type in DialogContent)) {
invocation.return_dbus_error('org.gnome.Shell.ModalDialog.TypeError',

View File

@ -247,8 +247,8 @@ function init() {
origSetEasingDelay.call(this, adjustAnimationTime(msecs));
};
Clutter.Actor.prototype.ease = function (props, easingParams) {
_easeActor(this, props, easingParams);
Clutter.Actor.prototype.ease = function (props) {
_easeActor(this, props);
};
Clutter.Actor.prototype.ease_property = function (propName, target, params) {
_easeActorProperty(this, propName, target, params);

View File

@ -198,9 +198,6 @@ class InstallExtensionDialog extends ModalDialog.ModalDialog {
let content = new Dialog.MessageDialogContent({
title: _("Download and install “%s” from extensions.gnome.org?").format(info.name),
icon: new Gio.FileIcon({
file: Gio.File.new_for_uri(`${REPOSITORY_URL_BASE}${info.icon}`),
}),
});
this.contentLayout.add(content);

View File

@ -28,6 +28,8 @@ var AnimationDirection = {
var APPICON_ANIMATION_OUT_SCALE = 3;
var APPICON_ANIMATION_OUT_TIME = 250;
const ICON_POSITION_DELAY = 25;
var BaseIcon = GObject.registerClass(
class BaseIcon extends St.Bin {
_init(label, params) {
@ -194,6 +196,23 @@ function zoomOutActorAtPos(actor, x, y) {
});
}
function animateIconPosition(icon, box, flags, nChangedIcons) {
if (!icon.has_allocation() || icon.allocation.equal(box)) {
icon.allocate(box, flags);
return false;
}
icon.save_easing_state();
icon.set_easing_mode(Clutter.AnimationMode.EASE_OUT_QUAD);
icon.set_easing_delay(nChangedIcons * ICON_POSITION_DELAY);
icon.allocate(box, flags);
icon.restore_easing_state();
return true;
}
var IconGrid = GObject.registerClass({
Signals: { 'animation-done': {},
'child-focused': { param_types: [Clutter.Actor.$gtype] } },
@ -366,6 +385,7 @@ var IconGrid = GObject.registerClass({
let y = box.y1 + this.topPadding;
let columnIndex = 0;
let rowIndex = 0;
let nChangedIcons = 0;
for (let i = 0; i < children.length; i++) {
let childBox = this._calculateChildBox(children[i], x, y, box);
@ -375,7 +395,9 @@ var IconGrid = GObject.registerClass({
} else {
if (!animating)
children[i].opacity = 255;
children[i].allocate(childBox, flags);
if (animateIconPosition(children[i], childBox, flags, nChangedIcons))
nChangedIcons++;
}
columnIndex++;
@ -557,14 +579,14 @@ var IconGrid = GObject.registerClass({
actorClone.opacity = 0;
actorClone.set_scale(scaleX, scaleY);
actorClone.set_position(adjustedSourcePositionX, adjustedSourcePositionY);
actorClone.set_translation(
adjustedSourcePositionX, adjustedSourcePositionY, 0);
let delay = (1 - (actor._distance - minDist) / normalization) * ANIMATION_MAX_DELAY_FOR_ITEM;
let [finalX, finalY] = actor._transformedPosition;
movementParams = {
x: finalX,
y: finalY,
translation_x: finalX,
translation_y: finalY,
scale_x: 1,
scale_y: 1,
duration: ANIMATION_TIME_IN,
@ -585,12 +607,12 @@ var IconGrid = GObject.registerClass({
let isLastItem = actor._distance == maxDist;
let [startX, startY] = actor._transformedPosition;
actorClone.set_position(startX, startY);
actorClone.set_translation(startX, startY, 0);
let delay = (actor._distance - minDist) / normalization * ANIMATION_MAX_DELAY_OUT_FOR_ITEM;
movementParams = {
x: adjustedSourcePositionX,
y: adjustedSourcePositionY,
translation_x: adjustedSourcePositionX,
translation_y: adjustedSourcePositionY,
scale_x: scaleX,
scale_y: scaleY,
duration: ANIMATION_TIME_OUT,
@ -875,9 +897,13 @@ var PaginatedIconGrid = GObject.registerClass({
let y = box.y1 + this.topPadding;
let columnIndex = 0;
let nChangedIcons = 0;
for (let i = 0; i < children.length; i++) {
let childBox = this._calculateChildBox(children[i], x, y, box);
children[i].allocate(childBox, flags);
if (animateIconPosition(children[i], childBox, flags, nChangedIcons))
nChangedIcons++;
children[i].show();
columnIndex++;

View File

@ -79,13 +79,12 @@ var InhibitShortcutsDialog = GObject.registerClass({
let title = name
? _("%s wants to inhibit shortcuts").format(name)
: _("Application wants to inhibit shortcuts");
let icon = new Gio.ThemedIcon({ name: 'dialog-warning-symbolic' });
let contentParams = { icon, title };
let contentParams = { title };
let restoreAccel = this._getRestoreAccel();
if (restoreAccel) {
contentParams.subtitle =
contentParams.description =
/* Translators: %s is a keyboard shortcut like "Super+x" */
_("You can restore shortcuts by pressing %s.").format(restoreAccel);
}

View File

@ -22,7 +22,7 @@ class KbdA11yDialog extends GObject.Object {
_showKbdA11yDialog(deviceManager, newFlags, whatChanged) {
let dialog = new ModalDialog.ModalDialog();
let title, body;
let title, description;
let key, enabled;
if (whatChanged & Clutter.KeyboardA11yFlags.SLOW_KEYS_ENABLED) {
@ -31,8 +31,8 @@ class KbdA11yDialog extends GObject.Object {
title = enabled
? _("Slow Keys Turned On")
: _("Slow Keys Turned Off");
body = _("You just held down the Shift key for 8 seconds. This is the shortcut " +
"for the Slow Keys feature, which affects the way your keyboard works.");
description = _('You just held down the Shift key for 8 seconds. This is the shortcut ' +
'for the Slow Keys feature, which affects the way your keyboard works.');
} else if (whatChanged & Clutter.KeyboardA11yFlags.STICKY_KEYS_ENABLED) {
key = KEY_STICKY_KEYS_ENABLED;
@ -40,7 +40,7 @@ class KbdA11yDialog extends GObject.Object {
title = enabled
? _("Sticky Keys Turned On")
: _("Sticky Keys Turned Off");
body = enabled
description = enabled
? _("You just pressed the Shift key 5 times in a row. This is the shortcut " +
"for the Sticky Keys feature, which affects the way your keyboard works.")
: _("You just pressed two keys at once, or pressed the Shift key 5 times in a row. " +
@ -49,8 +49,7 @@ class KbdA11yDialog extends GObject.Object {
return;
}
let icon = new Gio.ThemedIcon({ name: 'preferences-desktop-accessibility-symbolic' });
let contentParams = { icon, title, body, styleClass: 'access-dialog' };
let contentParams = { title, description, styleClass: 'access-dialog' };
let content = new Dialog.MessageDialogContent(contentParams);
dialog.contentLayout.add_actor(content);

View File

@ -6,7 +6,7 @@ const { Clutter, GObject, Shell, St } = imports.gi;
const Params = imports.misc.params;
var DEFAULT_FADE_FACTOR = 0.4;
var VIGNETTE_BRIGHTNESS = 0.2;
var VIGNETTE_BRIGHTNESS = 0.5;
var VIGNETTE_SHARPNESS = 0.7;
const VIGNETTE_DECLARATIONS = '\

View File

@ -2,7 +2,7 @@
/* exported componentManager, notificationDaemon, windowAttentionHandler,
ctrlAltTabManager, padOsdService, osdWindowManager,
osdMonitorLabeler, shellMountOpDBusService, shellDBusService,
shellAccessDialogDBusService, shellAudioSelectionDBusService,
shellAudioSelectionDBusService,
screenSaverDBus, screencastService, uiGroup, magnifier,
xdndHandler, keyboard, kbdA11yDialog, introspectService,
start, pushModal, popModal, activateWindow, createLookingGlass,
@ -10,7 +10,6 @@
const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
const AccessDialog = imports.ui.accessDialog;
const AudioDeviceSelection = imports.ui.audioDeviceSelection;
const Components = imports.ui.components;
const CtrlAltTab = imports.ui.ctrlAltTab;
@ -68,7 +67,6 @@ var padOsdService = null;
var osdWindowManager = null;
var osdMonitorLabeler = null;
var sessionMode = null;
var shellAccessDialogDBusService = null;
var shellAudioSelectionDBusService = null;
var shellDBusService = null;
var shellMountOpDBusService = null;
@ -137,7 +135,6 @@ function start() {
St.Settings.get().connect('notify::gtk-theme', _loadDefaultStylesheet);
_initializeUI();
shellAccessDialogDBusService = new AccessDialog.AccessDialogDBus();
shellAudioSelectionDBusService = new AudioDeviceSelection.AudioDeviceSelectionDBus();
shellDBusService = new ShellDBus.GnomeShell();
shellMountOpDBusService = new ShellMountOperation.GnomeShellMountOpHandler();

View File

@ -436,11 +436,28 @@ class ControlsManager extends St.Widget {
this._dashSpacer = new DashSpacer();
this._dashSpacer.setDashActor(this._dashSlider);
this._thumbnailsBox = new WorkspaceThumbnail.ThumbnailsBox();
let workspaceManager = global.workspace_manager;
let activeWorkspaceIndex = workspaceManager.get_active_workspace_index();
this._workspaceAdjustment = new St.Adjustment({
value: activeWorkspaceIndex,
lower: 0,
page_increment: 1,
page_size: 1,
step_increment: 0,
upper: workspaceManager.n_workspaces,
});
this._nWorkspacesNotifyId =
workspaceManager.connect('notify::n-workspaces',
this._updateAdjustment.bind(this));
this._thumbnailsBox =
new WorkspaceThumbnail.ThumbnailsBox(this._workspaceAdjustment);
this._thumbnailsSlider = new ThumbnailsSlider(this._thumbnailsBox);
this.viewSelector = new ViewSelector.ViewSelector(searchEntry,
this.dash.showAppsButton);
this._workspaceAdjustment, this.dash.showAppsButton);
this.viewSelector.connect('page-changed', this._setVisibility.bind(this));
this.viewSelector.connect('page-empty', this._onPageEmpty.bind(this));
@ -457,6 +474,24 @@ class ControlsManager extends St.Widget {
layout.connect('allocation-changed', this._updateWorkspacesGeometry.bind(this));
Main.overview.connect('showing', this._updateSpacerVisibility.bind(this));
this.connect('destroy', this._onDestroy.bind(this));
}
_onDestroy() {
global.workspace_manager.disconnect(this._nWorkspacesNotifyId);
}
_updateAdjustment() {
let workspaceManager = global.workspace_manager;
let newNumWorkspaces = workspaceManager.n_workspaces;
let activeIndex = workspaceManager.get_active_workspace_index();
this._workspaceAdjustment.upper = newNumWorkspaces;
// A workspace might have been inserted or removed before the active
// one, causing the adjustment to go out of sync, so update the value
this._workspaceAdjustment.value = activeIndex;
}
_updateWorkspacesGeometry() {

View File

@ -777,7 +777,7 @@ var ScreenShield = class {
let newY = currentY - origY;
newY = clamp(newY, -global.stage.height, 0);
this._lockScreenGroup.y = newY;
this._lockScreenGroup.translation_y = newY;
return true;
}
@ -785,7 +785,7 @@ var ScreenShield = class {
_onDragEnd(_action, _actor, _eventX, _eventY, _modifiers) {
if (this._lockScreenState != MessageTray.State.HIDING)
return;
if (this._lockScreenGroup.y < -(ARROW_DRAG_THRESHOLD * global.stage.height)) {
if (this._lockScreenGroup.translation_y < -(ARROW_DRAG_THRESHOLD * global.stage.height)) {
// Complete motion automatically
let [velocity_, velocityX_, velocityY] = this._dragAction.get_velocity(0);
this._liftShield(true, -velocityY);
@ -793,14 +793,13 @@ var ScreenShield = class {
// restore the lock screen to its original place
// try to use the same speed as the normal animation
let h = global.stage.height;
let duration = MANUAL_FADE_TIME * -this._lockScreenGroup.y / h;
let duration = MANUAL_FADE_TIME * -this._lockScreenGroup.translation_y / h;
this._lockScreenGroup.remove_all_transitions();
this._lockScreenGroup.ease({
y: 0,
translation_y: 0,
duration,
mode: Clutter.AnimationMode.EASE_IN_QUAD,
onComplete: () => {
this._lockScreenGroup.fixed_position_set = false;
this._lockScreenState = MessageTray.State.SHOWN;
},
});
@ -945,14 +944,14 @@ var ScreenShield = class {
// use the same speed regardless of original position
// if velocity is specified, it's in pixels per milliseconds
let h = global.stage.height;
let delta = h + this._lockScreenGroup.y;
let delta = h + this._lockScreenGroup.translation_y;
let minVelocity = global.stage.height / CURTAIN_SLIDE_TIME;
velocity = Math.max(minVelocity, velocity);
let duration = delta / velocity;
this._lockScreenGroup.ease({
y: -h,
translation_y: -h,
duration,
mode: Clutter.AnimationMode.EASE_IN_QUAD,
onComplete: () => this._hideLockScreenComplete(),
@ -1014,10 +1013,10 @@ var ScreenShield = class {
let fadeToBlack = params.fadeToBlack;
if (params.animateLockScreen) {
this._lockScreenGroup.y = -global.screen_height;
this._lockScreenGroup.translation_y = -global.screen_height;
this._lockScreenGroup.remove_all_transitions();
this._lockScreenGroup.ease({
y: 0,
translation_y: 0,
duration: MANUAL_FADE_TIME,
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onComplete: () => {
@ -1025,7 +1024,7 @@ var ScreenShield = class {
},
});
} else {
this._lockScreenGroup.fixed_position_set = false;
this._lockScreenGroup.translation_y = 0;
this._lockScreenShown({ fadeToBlack, animateFade: false });
}
@ -1103,7 +1102,6 @@ var ScreenShield = class {
this._cursorTracker.set_pointer_visible(false);
this._lockScreenState = MessageTray.State.SHOWN;
this._lockScreenGroup.fixed_position_set = false;
this._lockScreenScrollCounter = 0;
if (params.fadeToBlack && params.animateFade) {

View File

@ -65,8 +65,7 @@ var ScreenshotService = class {
}
*_resolveRelativeFilename(filename) {
if (GLib.str_has_suffix(filename, '.png'))
filename = filename.substr(0, -4);
filename = filename.replace(/\.png$/, '');
let path = [
GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_PICTURES),

View File

@ -116,7 +116,8 @@ function _onButtonPressEvent(actor, event, entry) {
}
function _onPopup(actor, entry) {
let [success, textX, textY_, lineHeight_] = entry.clutter_text.position_to_coords(-1);
let cursorPosition = entry.clutter_text.get_cursor_position();
let [success, textX, textY_, lineHeight_] = entry.clutter_text.position_to_coords(cursorPosition);
if (success)
entry.menu.setSourceAlignment(textX / entry.width);
entry.menu.open(BoxPointer.PopupAnimation.FULL);

View File

@ -38,7 +38,7 @@ function _setLabelsForMessage(content, message) {
let labels = message.split('\n');
content.title = labels.shift();
content.body = labels.join('\n');
content.description = labels.join('\n');
}
/* -------------------------------------------------------- */
@ -99,8 +99,6 @@ var ShellMountOperation = class {
this.close.bind(this));
this.mountOp.connect('show-unmount-progress',
this._onShowUnmountProgress.bind(this));
this._gicon = source.get_icon();
}
_closeExistingDialog() {
@ -113,7 +111,7 @@ var ShellMountOperation = class {
_onAskQuestion(op, message, choices) {
this._closeExistingDialog();
this._dialog = new ShellMountQuestionDialog(this._gicon);
this._dialog = new ShellMountQuestionDialog();
this._dialogId = this._dialog.connect('response',
(object, choice) => {
@ -132,7 +130,7 @@ var ShellMountOperation = class {
this._dialog = this._existingDialog;
this._dialog.reaskPassword();
} else {
this._dialog = new ShellMountPasswordDialog(message, this._gicon, flags);
this._dialog = new ShellMountPasswordDialog(message, flags);
}
this._dialogId = this._dialog.connect('response',
@ -178,7 +176,7 @@ var ShellMountOperation = class {
let message = op.get_show_processes_message();
if (!this._processesDialog) {
this._processesDialog = new ShellProcessesDialog(this._gicon);
this._processesDialog = new ShellProcessesDialog();
this._dialog = this._processesDialog;
this._dialogId = this._processesDialog.connect('response',
@ -259,10 +257,10 @@ class ShellUnmountNotifier extends MessageTray.Source {
var ShellMountQuestionDialog = GObject.registerClass({
Signals: { 'response': { param_types: [GObject.TYPE_INT] } },
}, class ShellMountQuestionDialog extends ModalDialog.ModalDialog {
_init(icon) {
_init() {
super._init({ styleClass: 'mount-dialog' });
this._content = new Dialog.MessageDialogContent({ icon });
this._content = new Dialog.MessageDialogContent();
this.contentLayout.add_child(this._content);
}
@ -280,17 +278,16 @@ var ShellMountPasswordDialog = GObject.registerClass({
GObject.TYPE_BOOLEAN,
GObject.TYPE_UINT] } },
}, class ShellMountPasswordDialog extends ModalDialog.ModalDialog {
_init(message, icon, flags) {
_init(message, flags) {
let strings = message.split('\n');
let title = strings.shift() || null;
let body = strings.shift() || null;
let description = strings.shift() || null;
super._init({ styleClass: 'prompt-dialog' });
let disksApp = Shell.AppSystem.get_default().lookup_app('org.gnome.DiskUtility.desktop');
let content = new Dialog.MessageDialogContent({ icon, title, body });
let content = new Dialog.MessageDialogContent({ title, description });
this.contentLayout.add_actor(content);
content._body.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
let layout = new Clutter.GridLayout({ orientation: Clutter.Orientation.VERTICAL });
let grid = new St.Widget({ style_class: 'prompt-dialog-grid',
@ -306,14 +303,14 @@ var ShellMountPasswordDialog = GObject.registerClass({
});
this._hiddenVolume = new CheckBox.CheckBox(_("Hidden Volume"));
content.messageBox.add(this._hiddenVolume);
content.add_child(this._hiddenVolume);
this._systemVolume = new CheckBox.CheckBox(_("Windows System Volume"));
content.messageBox.add(this._systemVolume);
content.add_child(this._systemVolume);
this._keyfilesCheckbox = new CheckBox.CheckBox(_("Uses Keyfiles"));
this._keyfilesCheckbox.connect("clicked", this._onKeyfilesCheckboxClicked.bind(this));
content.messageBox.add(this._keyfilesCheckbox);
content.add_child(this._keyfilesCheckbox);
this._keyfilesLabel.clutter_text.set_markup(
/* Translators: %s is the Disks application */
@ -321,7 +318,7 @@ var ShellMountPasswordDialog = GObject.registerClass({
);
this._keyfilesLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
this._keyfilesLabel.clutter_text.line_wrap = true;
content.messageBox.add_child(this._keyfilesLabel);
content.add_child(this._keyfilesLabel);
this._pimLabel = new St.Label({ style_class: 'prompt-dialog-password-label',
text: _("PIM Number"),
@ -380,20 +377,20 @@ var ShellMountPasswordDialog = GObject.registerClass({
layout.attach(this._capsLockWarningLabel, 1, 2, 1, 1);
}
content.messageBox.add(grid);
content.add_child(grid);
this._errorMessageLabel = new St.Label({ style_class: 'prompt-dialog-error-label',
text: _("Sorry, that didnt work. Please try again.") });
this._errorMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
this._errorMessageLabel.clutter_text.line_wrap = true;
this._errorMessageLabel.hide();
content.messageBox.add(this._errorMessageLabel);
content.add_child(this._errorMessageLabel);
if (flags & Gio.AskPasswordFlags.SAVING_SUPPORTED) {
this._rememberChoice = new CheckBox.CheckBox(_("Remember Password"));
this._rememberChoice.checked =
global.settings.get_boolean(REMEMBER_MOUNT_PASSWORD_KEY);
content.messageBox.add(this._rememberChoice);
content.add_child(this._rememberChoice);
} else {
this._rememberChoice = null;
}
@ -498,10 +495,10 @@ var ShellMountPasswordDialog = GObject.registerClass({
var ShellProcessesDialog = GObject.registerClass({
Signals: { 'response': { param_types: [GObject.TYPE_INT] } },
}, class ShellProcessesDialog extends ModalDialog.ModalDialog {
_init(icon) {
_init() {
super._init({ styleClass: 'mount-dialog' });
this._content = new Dialog.MessageDialogContent({ icon });
this._content = new Dialog.MessageDialogContent();
this.contentLayout.add_child(this._content);
let scrollView = new St.ScrollView({
@ -617,12 +614,6 @@ var GnomeShellMountOpHandler = class {
}
}
_createGIcon(iconName) {
let realIconName = iconName ? iconName : 'drive-harddisk';
return new Gio.ThemedIcon({ name: realIconName,
use_default_fallbacks: true });
}
/**
* AskPassword:
* @param {Array} params
@ -649,7 +640,7 @@ var GnomeShellMountOpHandler = class {
* attempt went wrong.
*/
AskPasswordAsync(params, invocation) {
let [id, message, iconName, defaultUser_, defaultDomain_, flags] = params;
let [id, message, iconName_, defaultUser_, defaultDomain_, flags] = params;
if (this._setCurrentRequest(invocation, id, ShellMountOperationType.ASK_PASSWORD)) {
this._dialog.reaskPassword();
@ -658,7 +649,7 @@ var GnomeShellMountOpHandler = class {
this._closeDialog();
this._dialog = new ShellMountPasswordDialog(message, this._createGIcon(iconName), flags);
this._dialog = new ShellMountPasswordDialog(message, flags);
this._dialog.connect('response',
(object, choice, password, remember, hiddenVolume, systemVolume, pim) => {
let details = {};
@ -699,7 +690,7 @@ var GnomeShellMountOpHandler = class {
* update the dialog with the new question.
*/
AskQuestionAsync(params, invocation) {
let [id, message, iconName, choices] = params;
let [id, message, iconName_, choices] = params;
if (this._setCurrentRequest(invocation, id, ShellMountOperationType.ASK_QUESTION)) {
this._dialog.update(message, choices);
@ -708,7 +699,7 @@ var GnomeShellMountOpHandler = class {
this._closeDialog();
this._dialog = new ShellMountQuestionDialog(this._createGIcon(iconName), message);
this._dialog = new ShellMountQuestionDialog(message);
this._dialog.connect('response', (object, choice) => {
this._clearCurrentRequest(Gio.MountOperationResult.HANDLED,
{ choice: GLib.Variant.new('i', choice) });
@ -737,7 +728,7 @@ var GnomeShellMountOpHandler = class {
* of processes.
*/
ShowProcessesAsync(params, invocation) {
let [id, message, iconName, applicationPids, choices] = params;
let [id, message, iconName_, applicationPids, choices] = params;
if (this._setCurrentRequest(invocation, id, ShellMountOperationType.SHOW_PROCESSES)) {
this._dialog.update(message, applicationPids, choices);
@ -746,7 +737,7 @@ var GnomeShellMountOpHandler = class {
this._closeDialog();
this._dialog = new ShellProcessesDialog(this._createGIcon(iconName));
this._dialog = new ShellProcessesDialog();
this._dialog.connect('response', (object, choice) => {
let response;
let details = {};

View File

@ -117,11 +117,18 @@ class InputSourceSwitcher extends SwitcherPopup.SwitcherList {
let box = new St.BoxLayout({ vertical: true });
let bin = new St.Bin({ style_class: 'input-source-switcher-symbol' });
let symbol = new St.Label({ text: item.shortName });
let symbol = new St.Label({
text: item.shortName,
x_align: Clutter.ActorAlign.CENTER,
y_align: Clutter.ActorAlign.CENTER,
});
bin.set_child(symbol);
box.add_child(bin);
let text = new St.Label({ text: item.displayName });
let text = new St.Label({
text: item.displayName,
x_align: Clutter.ActorAlign.CENTER,
});
box.add_child(text);
this.addItem(box, text);

View File

@ -1,7 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported Indicator */
const { Clutter, Gio, GLib, GObject, Shell } = imports.gi;
const { Clutter, Gio, GLib, GObject, Shell, St } = imports.gi;
const Dialog = imports.ui.dialog;
const Main = imports.ui.main;
@ -347,20 +347,22 @@ var AppAuthorizer = class {
var GeolocationDialog = GObject.registerClass({
Signals: { 'response': { param_types: [GObject.TYPE_UINT] } },
}, class GeolocationDialog extends ModalDialog.ModalDialog {
_init(name, subtitle, reqAccuracyLevel) {
_init(name, description, reqAccuracyLevel) {
super._init({ styleClass: 'geolocation-dialog' });
this.reqAccuracyLevel = reqAccuracyLevel;
let icon = new Gio.ThemedIcon({ name: 'find-location-symbolic' });
/* Translators: %s is an application name */
let title = _("Give %s access to your location?").format(name);
let body = _("Location access can be changed at any time from the privacy settings.");
let contentParams = { icon, title, subtitle, body };
let content = new Dialog.MessageDialogContent(contentParams);
let content = new Dialog.MessageDialogContent({ title, description });
this.contentLayout.add_actor(content);
let infoLabel = new St.Label({
text: _('Location access can be changed at any time from the privacy settings.'),
x_align: Clutter.ActorAlign.CENTER,
});
content.add_child(infoLabel);
let button = this.addButton({ label: _("Deny Access"),
action: this._onDenyClicked.bind(this),
key: Clutter.KEY_Escape });

View File

@ -2069,6 +2069,6 @@ class Indicator extends PanelMenu.SystemIndicator {
}
this._vpnIndicator.icon_name = this._vpnSection.getIndicatorIcon();
this._vpnIndicator.visible = this._vpnIndicator.icon_name != '';
this._vpnIndicator.visible = this._vpnIndicator.icon_name !== null;
}
});

648
js/ui/swipeTracker.js Normal file
View File

@ -0,0 +1,648 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported SwipeTracker */
const { Clutter, Gio, GObject, Meta } = imports.gi;
const Main = imports.ui.main;
const Params = imports.misc.params;
// FIXME: ideally these values matches physical touchpad size. We can get the
// correct values for gnome-shell specifically, since mutter uses libinput
// directly, but GTK apps cannot get it, so use an arbitrary value so that
// it's consistent with apps.
const TOUCHPAD_BASE_HEIGHT = 300;
const TOUCHPAD_BASE_WIDTH = 400;
const SCROLL_MULTIPLIER = 10;
const SWIPE_MULTIPLIER = 0.5;
const MIN_ANIMATION_DURATION = 100;
const MAX_ANIMATION_DURATION = 400;
const VELOCITY_THRESHOLD = 0.4;
// Derivative of easeOutCubic at t=0
const DURATION_MULTIPLIER = 3;
const ANIMATION_BASE_VELOCITY = 0.002;
const State = {
NONE: 0,
SCROLLING: 1,
};
function clamp(value, min, max) {
return Math.max(min, Math.min(max, value));
}
const TouchpadSwipeGesture = GObject.registerClass({
Properties: {
'enabled': GObject.ParamSpec.boolean(
'enabled', 'enabled', 'enabled',
GObject.ParamFlags.READWRITE,
true),
'orientation': GObject.ParamSpec.enum(
'orientation', 'orientation', 'orientation',
GObject.ParamFlags.READWRITE,
Clutter.Orientation, Clutter.Orientation.VERTICAL),
},
Signals: {
'begin': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] },
'update': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE] },
'end': { param_types: [GObject.TYPE_UINT] },
},
}, class TouchpadSwipeGesture extends GObject.Object {
_init(allowedModes) {
super._init();
this._allowedModes = allowedModes;
this._touchpadSettings = new Gio.Settings({
schema_id: 'org.gnome.desktop.peripherals.touchpad',
});
this._orientation = Clutter.Orientation.VERTICAL;
this._enabled = true;
global.stage.connect('captured-event', this._handleEvent.bind(this));
}
get enabled() {
return this._enabled;
}
set enabled(enabled) {
if (this._enabled === enabled)
return;
this._enabled = enabled;
this.notify('enabled');
}
get orientation() {
return this._orientation;
}
set orientation(orientation) {
if (this._orientation === orientation)
return;
this._orientation = orientation;
this.notify('orientation');
}
_handleEvent(actor, event) {
if (event.type() !== Clutter.EventType.TOUCHPAD_SWIPE)
return Clutter.EVENT_PROPAGATE;
if (event.get_touchpad_gesture_finger_count() !== 4)
return Clutter.EVENT_PROPAGATE;
if ((this._allowedModes & Main.actionMode) === 0)
return Clutter.EVENT_PROPAGATE;
if (!this.enabled)
return Clutter.EVENT_PROPAGATE;
let time = event.get_time();
let [x, y] = event.get_coords();
let [dx, dy] = event.get_gesture_motion_delta();
let delta;
if (this._orientation === Clutter.Orientation.VERTICAL)
delta = dy / TOUCHPAD_BASE_HEIGHT;
else
delta = dx / TOUCHPAD_BASE_WIDTH;
switch (event.get_gesture_phase()) {
case Clutter.TouchpadGesturePhase.BEGIN:
this.emit('begin', time, x, y);
break;
case Clutter.TouchpadGesturePhase.UPDATE:
if (this._touchpadSettings.get_boolean('natural-scroll'))
delta = -delta;
this.emit('update', time, delta * SWIPE_MULTIPLIER);
break;
case Clutter.TouchpadGesturePhase.END:
case Clutter.TouchpadGesturePhase.CANCEL:
this.emit('end', time);
break;
}
return Clutter.EVENT_STOP;
}
});
const TouchSwipeGesture = GObject.registerClass({
Properties: {
'distance': GObject.ParamSpec.double(
'distance', 'distance', 'distance',
GObject.ParamFlags.READWRITE,
0, Infinity, 0),
'orientation': GObject.ParamSpec.enum(
'orientation', 'orientation', 'orientation',
GObject.ParamFlags.READWRITE,
Clutter.Orientation, Clutter.Orientation.VERTICAL),
},
Signals: {
'begin': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] },
'update': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE] },
'end': { param_types: [GObject.TYPE_UINT] },
'cancel': { param_types: [GObject.TYPE_UINT] },
},
}, class TouchSwipeGesture extends Clutter.GestureAction {
_init(allowedModes, nTouchPoints, thresholdTriggerEdge) {
super._init();
this.set_n_touch_points(nTouchPoints);
this.set_threshold_trigger_edge(thresholdTriggerEdge);
this._allowedModes = allowedModes;
this._distance = global.screen_height;
this._orientation = Clutter.Orientation.VERTICAL;
global.display.connect('grab-op-begin', () => {
this.cancel();
});
this._lastPosition = 0;
}
get distance() {
return this._distance;
}
set distance(distance) {
if (this._distance === distance)
return;
this._distance = distance;
this.notify('distance');
}
get orientation() {
return this._orientation;
}
set orientation(orientation) {
if (this._orientation === orientation)
return;
this._orientation = orientation;
this.notify('orientation');
}
vfunc_gesture_prepare(actor) {
if (!super.vfunc_gesture_prepare(actor))
return false;
if ((this._allowedModes & Main.actionMode) === 0)
return false;
let time = this.get_last_event(0).get_time();
let [xPress, yPress] = this.get_press_coords(0);
let [x, y] = this.get_motion_coords(0);
this._lastPosition =
this._orientation === Clutter.Orientation.VERTICAL ? y : x;
this.emit('begin', time, xPress, yPress);
return true;
}
vfunc_gesture_progress(_actor) {
let [x, y] = this.get_motion_coords(0);
let pos = this._orientation === Clutter.Orientation.VERTICAL ? y : x;
let delta = pos - this._lastPosition;
this._lastPosition = pos;
let time = this.get_last_event(0).get_time();
this.emit('update', time, -delta / this._distance);
return true;
}
vfunc_gesture_end(_actor) {
let time = this.get_last_event(0).get_time();
this.emit('end', time);
}
vfunc_gesture_cancel(_actor) {
let time = Clutter.get_current_event_time();
this.emit('cancel', time);
}
});
const ScrollGesture = GObject.registerClass({
Properties: {
'enabled': GObject.ParamSpec.boolean(
'enabled', 'enabled', 'enabled',
GObject.ParamFlags.READWRITE,
true),
'orientation': GObject.ParamSpec.enum(
'orientation', 'orientation', 'orientation',
GObject.ParamFlags.READWRITE,
Clutter.Orientation, Clutter.Orientation.VERTICAL),
},
Signals: {
'begin': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] },
'update': { param_types: [GObject.TYPE_UINT, GObject.TYPE_DOUBLE] },
'end': { param_types: [GObject.TYPE_UINT] },
},
}, class ScrollGesture extends GObject.Object {
_init(actor, allowedModes) {
super._init();
this._allowedModes = allowedModes;
this._began = false;
this._enabled = true;
this._orientation = Clutter.Orientation.VERTICAL;
actor.connect('scroll-event', this._handleEvent.bind(this));
}
get enabled() {
return this._enabled;
}
set enabled(enabled) {
if (this._enabled === enabled)
return;
this._enabled = enabled;
this.notify('enabled');
}
get orientation() {
return this._orientation;
}
set orientation(orientation) {
if (this._orientation === orientation)
return;
this._orientation = orientation;
this.notify('orientation');
}
canHandleEvent(event) {
if (event.type() !== Clutter.EventType.SCROLL)
return false;
if (event.get_scroll_source() !== Clutter.ScrollSource.FINGER &&
event.get_source_device().get_device_type() !== Clutter.InputDeviceType.TOUCHPAD_DEVICE)
return false;
if (!this.enabled)
return false;
if ((this._allowedModes & Main.actionMode) === 0)
return false;
return true;
}
_handleEvent(actor, event) {
if (!this.canHandleEvent(event))
return Clutter.EVENT_PROPAGATE;
if (event.get_scroll_direction() !== Clutter.ScrollDirection.SMOOTH)
return Clutter.EVENT_PROPAGATE;
let time = event.get_time();
let [dx, dy] = event.get_scroll_delta();
if (dx === 0 && dy === 0) {
this.emit('end', time);
this._began = false;
return Clutter.EVENT_STOP;
}
if (!this._began) {
let [x, y] = event.get_coords();
this.emit('begin', time, x, y);
this._began = true;
}
let delta;
if (this._orientation === Clutter.Orientation.VERTICAL)
delta = dy / TOUCHPAD_BASE_HEIGHT;
else
delta = dx / TOUCHPAD_BASE_WIDTH;
this.emit('update', time, delta * SCROLL_MULTIPLIER);
return Clutter.EVENT_STOP;
}
});
// USAGE:
//
// To correctly implement the gesture, there must be handlers for the following
// signals:
//
// begin(tracker, monitor)
// The handler should check whether a deceleration animation is currently
// running. If it is, it should stop the animation (without resetting
// progress). Then it should call:
// tracker.confirmSwipe(distance, snapPoints, currentProgress, cancelProgress)
// If it's not called, the swipe would be ignored.
// The parameters are:
// * distance: the page size;
// * snapPoints: an (sorted with ascending order) array of snap points;
// * currentProgress: the current progress;
// * cancelprogress: a non-transient value that would be used if the gesture
// is cancelled.
// If no animation was running, currentProgress and cancelProgress should be
// same. The handler may set 'orientation' property here.
//
// update(tracker, progress)
// The handler should set the progress to the given value.
//
// end(tracker, duration, endProgress)
// The handler should animate the progress to endProgress. If endProgress is
// 0, it should do nothing after the animation, otherwise it should change the
// state, e.g. change the current page or switch workspace.
// NOTE: duration can be 0 in some cases, in this case it should finish
// instantly.
/** A class for handling swipe gestures */
var SwipeTracker = GObject.registerClass({
Properties: {
'enabled': GObject.ParamSpec.boolean(
'enabled', 'enabled', 'enabled',
GObject.ParamFlags.READWRITE,
true),
'orientation': GObject.ParamSpec.enum(
'orientation', 'orientation', 'orientation',
GObject.ParamFlags.READWRITE,
Clutter.Orientation, Clutter.Orientation.VERTICAL),
'distance': GObject.ParamSpec.double(
'distance', 'distance', 'distance',
GObject.ParamFlags.READWRITE,
0, Infinity, 0),
},
Signals: {
'begin': { param_types: [GObject.TYPE_UINT] },
'update': { param_types: [GObject.TYPE_DOUBLE] },
'end': { param_types: [GObject.TYPE_UINT64, GObject.TYPE_DOUBLE] },
},
}, class SwipeTracker extends GObject.Object {
_init(actor, allowedModes, params) {
super._init();
params = Params.parse(params, { allowDrag: true, allowScroll: true });
this._allowedModes = allowedModes;
this._enabled = true;
this._orientation = Clutter.Orientation.VERTICAL;
this._distance = global.screen_height;
this._reset();
this._touchpadGesture = new TouchpadSwipeGesture(allowedModes);
this._touchpadGesture.connect('begin', this._beginGesture.bind(this));
this._touchpadGesture.connect('update', this._updateGesture.bind(this));
this._touchpadGesture.connect('end', this._endGesture.bind(this));
this.bind_property('enabled', this._touchpadGesture, 'enabled', 0);
this.bind_property('orientation', this._touchpadGesture, 'orientation', 0);
this._touchGesture = new TouchSwipeGesture(allowedModes, 4,
Clutter.GestureTriggerEdge.NONE);
this._touchGesture.connect('begin', this._beginTouchSwipe.bind(this));
this._touchGesture.connect('update', this._updateGesture.bind(this));
this._touchGesture.connect('end', this._endGesture.bind(this));
this._touchGesture.connect('cancel', this._cancelGesture.bind(this));
this.bind_property('enabled', this._touchGesture, 'enabled', 0);
this.bind_property('orientation', this._touchGesture, 'orientation', 0);
this.bind_property('distance', this._touchGesture, 'distance', 0);
global.stage.add_action(this._touchGesture);
if (params.allowDrag) {
this._dragGesture = new TouchSwipeGesture(allowedModes, 1,
Clutter.GestureTriggerEdge.AFTER);
this._dragGesture.connect('begin', this._beginGesture.bind(this));
this._dragGesture.connect('update', this._updateGesture.bind(this));
this._dragGesture.connect('end', this._endGesture.bind(this));
this._dragGesture.connect('cancel', this._cancelGesture.bind(this));
this.bind_property('enabled', this._dragGesture, 'enabled', 0);
this.bind_property('orientation', this._dragGesture, 'orientation', 0);
this.bind_property('distance', this._dragGesture, 'distance', 0);
actor.add_action(this._dragGesture);
} else {
this._dragGesture = null;
}
if (params.allowScroll) {
this._scrollGesture = new ScrollGesture(actor, allowedModes);
this._scrollGesture.connect('begin', this._beginGesture.bind(this));
this._scrollGesture.connect('update', this._updateGesture.bind(this));
this._scrollGesture.connect('end', this._endGesture.bind(this));
this.bind_property('enabled', this._scrollGesture, 'enabled', 0);
this.bind_property('orientation', this._scrollGesture, 'orientation', 0);
} else {
this._scrollGesture = null;
}
}
/**
* canHandleScrollEvent:
* @param {Clutter.Event} scrollEvent: an event to check
* @returns {bool} whether the event can be handled by the tracker
*
* This function can be used to combine swipe gesture and mouse
* scrolling.
*/
canHandleScrollEvent(scrollEvent) {
if (!this.enabled || this._scrollGesture === null)
return false;
return this._scrollGesture.canHandleEvent(scrollEvent);
}
get enabled() {
return this._enabled;
}
set enabled(enabled) {
if (this._enabled === enabled)
return;
this._enabled = enabled;
if (!enabled && this._state === State.SCROLLING)
this._interrupt();
this.notify('enabled');
}
get orientation() {
return this._orientation;
}
set orientation(orientation) {
if (this._orientation === orientation)
return;
this._orientation = orientation;
this.notify('orientation');
}
get distance() {
return this._distance;
}
set distance(distance) {
if (this._distance === distance)
return;
this._distance = distance;
this.notify('distance');
}
_reset() {
this._state = State.NONE;
this._snapPoints = [];
this._initialProgress = 0;
this._cancelProgress = 0;
this._prevOffset = 0;
this._progress = 0;
this._prevTime = 0;
this._velocity = 0;
this._cancelled = false;
}
_interrupt() {
this.emit('end', 0, this._cancelProgress);
this._reset();
}
_beginTouchSwipe(gesture, time, x, y) {
if (this._dragGesture)
this._dragGesture.cancel();
this._beginGesture(gesture, time, x, y);
}
_beginGesture(gesture, time, x, y) {
if (this._state === State.SCROLLING)
return;
this._prevTime = time;
let rect = new Meta.Rectangle({ x, y, width: 1, height: 1 });
let monitor = global.display.get_monitor_index_for_rect(rect);
this.emit('begin', monitor);
}
_updateGesture(gesture, time, delta) {
if (this._state !== State.SCROLLING)
return;
if ((this._allowedModes & Main.actionMode) === 0 || !this.enabled) {
this._interrupt();
return;
}
if (this.orientation === Clutter.Orientation.HORIZONTAL &&
Clutter.get_default_text_direction() === Clutter.TextDirection.RTL)
delta = -delta;
this._progress += delta;
if (time !== this._prevTime)
this._velocity = delta / (time - this._prevTime);
let firstPoint = this._snapPoints[0];
let lastPoint = this._snapPoints[this._snapPoints.length - 1];
this._progress = clamp(this._progress, firstPoint, lastPoint);
this._progress = clamp(this._progress,
this._initialProgress - 1, this._initialProgress + 1);
this.emit('update', this._progress);
this._prevTime = time;
}
_getClosestSnapPoints() {
let upper = this._snapPoints.find(p => p >= this._progress);
let lower = this._snapPoints.slice().reverse().find(p => p <= this._progress);
return [lower, upper];
}
_getEndProgress() {
if (this._cancelled)
return this._cancelProgress;
let [lower, upper] = this._getClosestSnapPoints();
let middle = (upper + lower) / 2;
if (this._progress > middle) {
let thresholdMet = this._velocity * this._distance > -VELOCITY_THRESHOLD;
return thresholdMet || this._initialProgress > upper ? upper : lower;
} else {
let thresholdMet = this._velocity * this._distance < VELOCITY_THRESHOLD;
return thresholdMet || this._initialProgress < lower ? lower : upper;
}
}
_endGesture(_gesture, _time) {
if (this._state !== State.SCROLLING)
return;
if ((this._allowedModes & Main.actionMode) === 0 || !this.enabled) {
this._interrupt();
return;
}
let endProgress = this._getEndProgress();
let velocity = ANIMATION_BASE_VELOCITY;
if ((endProgress - this._progress) * this._velocity > 0)
velocity = this._velocity;
let duration = Math.abs((this._progress - endProgress) / velocity * DURATION_MULTIPLIER);
if (duration > 0) {
duration = clamp(duration,
MIN_ANIMATION_DURATION, MAX_ANIMATION_DURATION);
}
this.emit('end', duration, endProgress);
this._reset();
}
_cancelGesture(gesture, time) {
if (this._state !== State.SCROLLING)
return;
this._cancelled = true;
this._endGesture(gesture, time);
}
/**
* confirmSwipe:
* @param {number} distance: swipe distance in pixels
* @param {number[]} snapPoints:
* An array of snap points, sorted in ascending order
* @param {number} currentProgress: initial progress value
* @param {number} cancelProgress: the value to be used on cancelling
*
* Confirms a swipe. User has to call this in 'begin' signal handler,
* otherwise the swipe wouldn't start. If there's an animation running,
* it should be stopped first.
*
* @cancel_progress must always be a snap point, or a value matching
* some other non-transient state.
*/
confirmSwipe(distance, snapPoints, currentProgress, cancelProgress) {
this.distance = distance;
this._snapPoints = snapPoints;
this._initialProgress = currentProgress;
this._progress = currentProgress;
this._cancelProgress = cancelProgress;
this._velocity = 0;
this._state = State.SCROLLING;
}
});

View File

@ -86,7 +86,10 @@ class SwitchMonitorSwitcher extends SwitcherPopup.SwitcherList {
icon_size: APP_ICON_SIZE });
box.add_child(icon);
let text = new St.Label({ text: item.label });
let text = new St.Label({
text: item.label,
x_align: Clutter.ActorAlign.CENTER,
});
box.add_child(text);
this.addItem(box, text);

View File

@ -330,6 +330,11 @@ var SwitcherPopup = GObject.registerClass({
GLib.source_remove(this._initialDelayTimeoutId);
if (this._noModsTimeoutId != 0)
GLib.source_remove(this._noModsTimeoutId);
// Make sure the SwitcherList is always destroyed, it may not be
// a child of the actor at this point.
if (this._switcherList)
this._switcherList.destroy();
}
_select(num) {

View File

@ -128,7 +128,7 @@ var ViewSelector = GObject.registerClass({
'page-empty': {},
},
}, class ViewSelector extends Shell.Stack {
_init(searchEntry, showAppsButton) {
_init(searchEntry, workspaceAdjustment, showAppsButton) {
super._init({
name: 'viewSelector',
x_expand: true,
@ -171,7 +171,8 @@ var ViewSelector = GObject.registerClass({
this._iconClickedId = 0;
this._capturedEventId = 0;
this._workspacesDisplay = new WorkspacesView.WorkspacesDisplay();
this._workspacesDisplay =
new WorkspacesView.WorkspacesDisplay(workspaceAdjustment);
this._workspacesPage = this._addPage(this._workspacesDisplay,
_("Windows"), 'focus-windows-symbolic');

View File

@ -2,7 +2,6 @@
/* exported WindowManager */
const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
const Signals = imports.signals;
const AltTab = imports.ui.altTab;
const AppFavorites = imports.ui.appFavorites;
@ -15,6 +14,7 @@ const WindowMenu = imports.ui.windowMenu;
const PadOsd = imports.ui.padOsd;
const EdgeDragAction = imports.ui.edgeDragAction;
const CloseDialog = imports.ui.closeDialog;
const SwipeTracker = imports.ui.swipeTracker;
const SwitchMonitor = imports.ui.switchMonitor;
const IBusManager = imports.misc.ibusManager;
@ -30,7 +30,6 @@ var WINDOW_ANIMATION_TIME = 250;
var DIM_BRIGHTNESS = -0.3;
var DIM_TIME = 500;
var UNDIM_TIME = 250;
var WS_MOTION_THRESHOLD = 100;
var APP_MOTION_THRESHOLD = 30;
var ONE_SECOND = 1000; // in ms
@ -52,13 +51,11 @@ class DisplayChangeDialog extends ModalDialog.ModalDialog {
this._countDown = Meta.MonitorManager.get_display_configuration_timeout();
let iconName = 'preferences-desktop-display-symbolic';
let icon = new Gio.ThemedIcon({ name: iconName });
let title = _("Do you want to keep these display settings?");
let body = this._formatCountDown();
let description = this._formatCountDown();
this._content = new Dialog.MessageDialogContent({
icon, title, body,
title, description,
x_expand: true,
y_expand: true,
});
@ -104,7 +101,7 @@ class DisplayChangeDialog extends ModalDialog.ModalDialog {
return GLib.SOURCE_REMOVE;
}
this._content.body = this._formatCountDown();
this._content.description = this._formatCountDown();
return GLib.SOURCE_CONTINUE;
}
@ -468,147 +465,6 @@ class TilePreview extends St.Widget {
}
});
var TouchpadWorkspaceSwitchAction = class {
constructor(actor, allowedModes) {
this._allowedModes = allowedModes;
this._dx = 0;
this._dy = 0;
this._enabled = true;
actor.connect('captured-event', this._handleEvent.bind(this));
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() {
let dir;
if (this._dy < -WS_MOTION_THRESHOLD)
dir = Meta.MotionDirection.DOWN;
else if (this._dy > WS_MOTION_THRESHOLD)
dir = Meta.MotionDirection.UP;
else if (this._dx < -WS_MOTION_THRESHOLD)
dir = Meta.MotionDirection.RIGHT;
else if (this._dx > WS_MOTION_THRESHOLD)
dir = Meta.MotionDirection.LEFT;
else
return false;
this.emit('activated', dir);
return true;
}
_handleEvent(actor, event) {
if (event.type() != Clutter.EventType.TOUCHPAD_SWIPE)
return Clutter.EVENT_PROPAGATE;
if (event.get_touchpad_gesture_finger_count() != 4)
return Clutter.EVENT_PROPAGATE;
if ((this._allowedModes & Main.actionMode) == 0)
return Clutter.EVENT_PROPAGATE;
if (!this._enabled)
return Clutter.EVENT_PROPAGATE;
if (event.get_gesture_phase() == Clutter.TouchpadGesturePhase.UPDATE) {
let [dx, dy] = event.get_gesture_motion_delta();
// Scale deltas up a bit to make it feel snappier
this._dx += dx * 2;
if (!this._touchpadSettings.get_boolean('natural-scroll'))
this._dy -= dy * 2;
else
this._dy += dy * 2;
this.emit('motion', this._dx, this._dy);
} else {
if ((event.get_gesture_phase() == Clutter.TouchpadGesturePhase.END && !this._checkActivated()) ||
event.get_gesture_phase() == Clutter.TouchpadGesturePhase.CANCEL)
this.emit('cancel');
this._dx = 0;
this._dy = 0;
}
return Clutter.EVENT_STOP;
}
};
Signals.addSignalMethods(TouchpadWorkspaceSwitchAction.prototype);
var WorkspaceSwitchAction = GObject.registerClass({
Signals: { 'activated': { param_types: [Meta.MotionDirection.$gtype] },
'motion': { param_types: [GObject.TYPE_DOUBLE, GObject.TYPE_DOUBLE] },
'cancel': { param_types: [] } },
}, class WorkspaceSwitchAction extends Clutter.SwipeAction {
_init(allowedModes) {
super._init();
this.set_n_touch_points(4);
this._swept = false;
this._allowedModes = allowedModes;
global.display.connect('grab-op-begin', () => {
this.cancel();
});
}
vfunc_gesture_prepare(actor) {
this._swept = false;
if (!super.vfunc_gesture_prepare(actor))
return false;
return this._allowedModes & Main.actionMode;
}
vfunc_gesture_progress(_actor) {
let [x, y] = this.get_motion_coords(0);
let [xPress, yPress] = this.get_press_coords(0);
this.emit('motion', x - xPress, y - yPress);
return true;
}
vfunc_gesture_cancel(_actor) {
if (!this._swept)
this.emit('cancel');
}
vfunc_swipe(actor, direction) {
let [x, y] = this.get_motion_coords(0);
let [xPress, yPress] = this.get_press_coords(0);
if (Math.abs(x - xPress) < WS_MOTION_THRESHOLD &&
Math.abs(y - yPress) < WS_MOTION_THRESHOLD) {
this.emit('cancel');
return;
}
let dir;
if (direction & Clutter.SwipeDirection.UP)
dir = Meta.MotionDirection.DOWN;
else if (direction & Clutter.SwipeDirection.DOWN)
dir = Meta.MotionDirection.UP;
else if (direction & Clutter.SwipeDirection.LEFT)
dir = Meta.MotionDirection.RIGHT;
else if (direction & Clutter.SwipeDirection.RIGHT)
dir = Meta.MotionDirection.LEFT;
this._swept = true;
this.emit('activated', dir);
}
});
var AppSwitchAction = GObject.registerClass({
Signals: { 'activated': {} },
}, class AppSwitchAction extends Clutter.GestureAction {
@ -1054,10 +910,17 @@ var WindowManager = class {
Main.overview.connect('showing', () => {
for (let i = 0; i < this._dimmedWindows.length; i++)
this._undimWindow(this._dimmedWindows[i]);
if (this._switchData) {
if (this._switchData.gestureActivated)
this._switchWorkspaceStop();
this._swipeTracker.enabled = false;
}
});
Main.overview.connect('hiding', () => {
for (let i = 0; i < this._dimmedWindows.length; i++)
this._dimWindow(this._dimmedWindows[i]);
this._swipeTracker.enabled = true;
});
this._windowMenuManager = new WindowMenu.WindowMenuManager();
@ -1068,18 +931,12 @@ var WindowManager = class {
global.workspace_manager.override_workspace_layout(Meta.DisplayCorner.TOPLEFT,
false, -1, 1);
let allowedModes = Shell.ActionMode.NORMAL;
let workspaceSwitchAction = new WorkspaceSwitchAction(allowedModes);
workspaceSwitchAction.connect('motion', this._switchWorkspaceMotion.bind(this));
workspaceSwitchAction.connect('activated', this._actionSwitchWorkspace.bind(this));
workspaceSwitchAction.connect('cancel', this._switchWorkspaceCancel.bind(this));
global.stage.add_action(workspaceSwitchAction);
// This is not a normal Clutter.GestureAction, doesn't need add_action()
let touchpadSwitchAction = new TouchpadWorkspaceSwitchAction(global.stage, allowedModes);
touchpadSwitchAction.connect('motion', this._switchWorkspaceMotion.bind(this));
touchpadSwitchAction.connect('activated', this._actionSwitchWorkspace.bind(this));
touchpadSwitchAction.connect('cancel', this._switchWorkspaceCancel.bind(this));
let swipeTracker = new SwipeTracker.SwipeTracker(global.stage,
Shell.ActionMode.NORMAL, { allowDrag: false, allowScroll: false });
swipeTracker.connect('begin', this._switchWorkspaceBegin.bind(this));
swipeTracker.connect('update', this._switchWorkspaceUpdate.bind(this));
swipeTracker.connect('end', this._switchWorkspaceEnd.bind(this));
this._swipeTracker = swipeTracker;
let appSwitchAction = new AppSwitchAction();
appSwitchAction.connect('activated', this._switchApp.bind(this));
@ -1121,52 +978,6 @@ var WindowManager = class {
return this._currentPadOsd;
}
_switchWorkspaceMotion(action, xRel, yRel) {
let workspaceManager = global.workspace_manager;
let activeWorkspace = workspaceManager.get_active_workspace();
if (!this._switchData)
this._prepareWorkspaceSwitch(activeWorkspace.index(), -1);
if (yRel < 0 && !this._switchData.surroundings[Meta.MotionDirection.DOWN])
yRel = 0;
if (yRel > 0 && !this._switchData.surroundings[Meta.MotionDirection.UP])
yRel = 0;
if (xRel < 0 && !this._switchData.surroundings[Meta.MotionDirection.RIGHT])
xRel = 0;
if (xRel > 0 && !this._switchData.surroundings[Meta.MotionDirection.LEFT])
xRel = 0;
this._switchData.container.set_position(xRel, yRel);
}
_switchWorkspaceCancel() {
if (!this._switchData || this._switchData.inProgress)
return;
let switchData = this._switchData;
this._switchData = null;
switchData.container.ease({
x: 0,
y: 0,
duration: WINDOW_ANIMATION_TIME,
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onComplete: () => this._finishWorkspaceSwitch(switchData),
});
}
_actionSwitchWorkspace(action, direction) {
let workspaceManager = global.workspace_manager;
let activeWorkspace = workspaceManager.get_active_workspace();
let newWs = activeWorkspace.get_neighbor(direction);
if (newWs == activeWorkspace) {
this._switchWorkspaceCancel();
} else {
this._switchData.gestureActivated = true;
this.actionMoveWorkspace(newWs);
}
}
_lookupIndex(windows, metaWindow) {
for (let i = 0; i < windows.length; i++) {
if (windows[i].metaWindow == metaWindow)
@ -1280,7 +1091,8 @@ var WindowManager = class {
}
_shouldAnimate() {
return !Main.overview.visible;
return !(Main.overview.visible ||
(this._switchData && this._switchData.gestureActivated));
}
_shouldAnimateActor(actor, types) {
@ -1315,12 +1127,7 @@ var WindowManager = class {
opacity: 0,
duration: MINIMIZE_WINDOW_ANIMATION_TIME,
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onStopped: isFinished => {
if (isFinished)
this._minimizeWindowDone(shellwm, actor);
else
this._minimizeWindowOverwritten(shellwm, actor);
},
onStopped: () => this._minimizeWindowDone(shellwm, actor),
});
} else {
let xDest, yDest, xScale, yScale;
@ -1865,13 +1672,17 @@ var WindowManager = class {
continue;
}
let info = { index: ws.index(),
actor: new Clutter.Actor() };
let [x, y] = this._getPositionForDirection(dir, curWs, ws);
let info = {
index: ws.index(),
actor: new Clutter.Actor(),
xDest: x,
yDest: y,
};
switchData.surroundings[dir] = info;
switchData.container.add_actor(info.actor);
switchData.container.set_child_above_sibling(info.actor, null);
let [x, y] = this._getPositionForDirection(dir, curWs, ws);
info.actor.set_position(x, y);
}
@ -1953,11 +1764,7 @@ var WindowManager = class {
return;
}
// If we come from a gesture, switchData will already be set,
// and we don't want to overwrite it.
if (!this._switchData)
this._prepareWorkspaceSwitch(from, to, direction);
this._prepareWorkspaceSwitch(from, to, direction);
this._switchData.inProgress = true;
let workspaceManager = global.workspace_manager;
@ -1977,7 +1784,7 @@ var WindowManager = class {
x: xDest,
y: yDest,
duration: WINDOW_ANIMATION_TIME,
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
mode: Clutter.AnimationMode.EASE_OUT_CUBIC,
onComplete: () => this._switchWorkspaceDone(shellwm),
});
}
@ -1987,6 +1794,158 @@ var WindowManager = class {
shellwm.completed_switch_workspace();
}
_directionForProgress(progress) {
if (global.workspace_manager.layout_rows === -1) {
return progress > 0
? Meta.MotionDirection.DOWN
: Meta.MotionDirection.UP;
} else if (Clutter.get_default_text_direction() === Clutter.TextDirection.RTL) {
return progress > 0
? Meta.MotionDirection.LEFT
: Meta.MotionDirection.RIGHT;
} else {
return progress > 0
? Meta.MotionDirection.RIGHT
: Meta.MotionDirection.LEFT;
}
}
_getProgressRange() {
if (!this._switchData)
return [0, 0];
let lower = 0;
let upper = 0;
let horiz = global.workspace_manager.layout_rows !== -1;
let baseDistance;
if (horiz)
baseDistance = global.screen_width;
else
baseDistance = global.screen_height;
let direction = this._directionForProgress(-1);
let info = this._switchData.surroundings[direction];
if (info !== null) {
let distance = horiz ? info.xDest : info.yDest;
lower = -Math.abs(distance) / baseDistance;
}
direction = this._directionForProgress(1);
info = this._switchData.surroundings[direction];
if (info !== null) {
let distance = horiz ? info.xDest : info.yDest;
upper = Math.abs(distance) / baseDistance;
}
return [lower, upper];
}
_switchWorkspaceBegin(tracker, monitor) {
if (Meta.prefs_get_workspaces_only_on_primary() &&
monitor !== Main.layoutManager.primaryIndex)
return;
let workspaceManager = global.workspace_manager;
let horiz = workspaceManager.layout_rows !== -1;
tracker.orientation = horiz
? Clutter.Orientation.HORIZONTAL
: Clutter.Orientation.VERTICAL;
let activeWorkspace = workspaceManager.get_active_workspace();
let baseDistance;
if (horiz)
baseDistance = global.screen_width;
else
baseDistance = global.screen_height;
let progress;
if (this._switchData && this._switchData.gestureActivated) {
this._switchData.container.remove_all_transitions();
if (!horiz)
progress = -this._switchData.container.y / baseDistance;
else if (Clutter.get_default_text_direction() === Clutter.TextDirection.RTL)
progress = this._switchData.container.x / baseDistance;
else
progress = -this._switchData.container.x / baseDistance;
} else {
this._prepareWorkspaceSwitch(activeWorkspace.index(), -1);
progress = 0;
}
let points = [];
let [lower, upper] = this._getProgressRange();
if (lower !== 0)
points.push(lower);
points.push(0);
if (upper !== 0)
points.push(upper);
tracker.confirmSwipe(baseDistance, points, progress, 0);
}
_switchWorkspaceUpdate(tracker, progress) {
if (!this._switchData)
return;
let direction = this._directionForProgress(progress);
let info = this._switchData.surroundings[direction];
let xPos = 0;
let yPos = 0;
if (info) {
if (global.workspace_manager.layout_rows === -1)
yPos = -Math.round(progress * global.screen_height);
else if (Clutter.get_default_text_direction() === Clutter.TextDirection.RTL)
xPos = Math.round(progress * global.screen_width);
else
xPos = -Math.round(progress * global.screen_width);
}
this._switchData.container.set_position(xPos, yPos);
}
_switchWorkspaceEnd(tracker, duration, endProgress) {
if (!this._switchData)
return;
let workspaceManager = global.workspace_manager;
let activeWorkspace = workspaceManager.get_active_workspace();
let newWs = activeWorkspace;
let xDest = 0;
let yDest = 0;
if (endProgress !== 0) {
let direction = this._directionForProgress(endProgress);
newWs = activeWorkspace.get_neighbor(direction);
xDest = -this._switchData.surroundings[direction].xDest;
yDest = -this._switchData.surroundings[direction].yDest;
}
let switchData = this._switchData;
switchData.gestureActivated = true;
this._switchData.container.ease({
x: xDest,
y: yDest,
duration,
mode: Clutter.AnimationMode.EASE_OUT_CUBIC,
onComplete: () => {
if (newWs !== activeWorkspace)
this.actionMoveWorkspace(newWs);
this._finishWorkspaceSwitch(switchData);
},
});
}
_switchWorkspaceStop() {
this._switchData.container.x = 0;
this._switchData.container.y = 0;
this._finishWorkspaceSwitch(this._switchData);
}
_showTilePreview(shellwm, window, tileRect, monitorIndex) {
if (!this._tilePreview)
this._tilePreview = new TilePreview();

View File

@ -7,7 +7,6 @@ const Background = imports.ui.background;
const DND = imports.ui.dnd;
const Main = imports.ui.main;
const Workspace = imports.ui.workspace;
const WorkspacesView = imports.ui.workspacesView;
// The maximum size of a thumbnail is 1/10 the width and height of the screen
let MAX_THUMBNAIL_SCALE = 1 / 10.;
@ -628,7 +627,7 @@ var ThumbnailsBox = GObject.registerClass({
0, Infinity, 0),
},
}, class ThumbnailsBox extends St.Widget {
_init() {
_init(scrollAdjustment) {
super._init({ reactive: true,
style_class: 'workspace-thumbnails',
request_mode: Clutter.RequestMode.WIDTH_FOR_HEIGHT });
@ -658,7 +657,6 @@ var ThumbnailsBox = GObject.registerClass({
this._pendingScaleUpdate = false;
this._stateUpdateQueued = false;
this._animatingIndicator = false;
this._indicatorY = 0; // only used when _animatingIndicator is true
this._stateCounts = {};
for (let key in ThumbnailState)
@ -701,6 +699,20 @@ var ThumbnailsBox = GObject.registerClass({
this._nWorkspacesNotifyId = 0;
this._syncStackingId = 0;
this._workareasChangedId = 0;
this._scrollAdjustment = scrollAdjustment;
this._scrollAdjustment.connect('notify::value', adj => {
let workspaceManager = global.workspace_manager;
let activeIndex = workspaceManager.get_active_workspace_index();
this._animatingIndicator = adj.value !== activeIndex;
if (!this._animatingIndicator)
this._queueUpdateStates();
this.queue_relayout();
});
}
_updateSwitcherVisibility() {
@ -901,9 +913,6 @@ var ThumbnailsBox = GObject.registerClass({
_createThumbnails() {
let workspaceManager = global.workspace_manager;
this._switchWorkspaceNotifyId =
global.window_manager.connect('switch-workspace',
this._activeWorkspaceChanged.bind(this));
this._nWorkspacesNotifyId =
workspaceManager.connect('notify::n-workspaces',
this._workspacesChanged.bind(this));
@ -936,10 +945,6 @@ var ThumbnailsBox = GObject.registerClass({
if (this._thumbnails.length == 0)
return;
if (this._switchWorkspaceNotifyId > 0) {
global.window_manager.disconnect(this._switchWorkspaceNotifyId);
this._switchWorkspaceNotifyId = 0;
}
if (this._nWorkspacesNotifyId > 0) {
let workspaceManager = global.workspace_manager;
workspaceManager.disconnect(this._nWorkspacesNotifyId);
@ -1056,21 +1061,6 @@ var ThumbnailsBox = GObject.registerClass({
return this._scale;
}
// eslint-disable-next-line camelcase
set indicator_y(indicatorY) {
if (this._indicatorY == indicatorY)
return;
this._indicatorY = indicatorY;
this.notify('indicator-y');
this.queue_relayout();
}
// eslint-disable-next-line camelcase
get indicator_y() {
return this._indicatorY;
}
_setThumbnailState(thumbnail, state) {
this._stateCounts[thumbnail.state]--;
thumbnail.state = state;
@ -1263,13 +1253,16 @@ var ThumbnailsBox = GObject.registerClass({
else
slideOffset = thumbnailWidth + themeNode.get_padding(St.Side.RIGHT);
let indicatorY1 = this._indicatorY;
let indicatorY2;
// when not animating, the workspace position overrides this._indicatorY
let activeWorkspace = workspaceManager.get_active_workspace();
let indicatorWorkspace = !this._animatingIndicator ? activeWorkspace : null;
let indicatorThemeNode = this._indicator.get_theme_node();
let indicatorValue = this._scrollAdjustment.value;
let indicatorUpperWs = Math.ceil(indicatorValue);
let indicatorLowerWs = Math.floor(indicatorValue);
let indicatorLowerY1 = 0;
let indicatorLowerY2 = 0;
let indicatorUpperY1 = 0;
let indicatorUpperY2 = 0;
let indicatorThemeNode = this._indicator.get_theme_node();
let indicatorTopFullBorder = indicatorThemeNode.get_padding(St.Side.TOP) + indicatorThemeNode.get_border_width(St.Side.TOP);
let indicatorBottomFullBorder = indicatorThemeNode.get_padding(St.Side.BOTTOM) + indicatorThemeNode.get_border_width(St.Side.BOTTOM);
let indicatorLeftFullBorder = indicatorThemeNode.get_padding(St.Side.LEFT) + indicatorThemeNode.get_border_width(St.Side.LEFT);
@ -1321,9 +1314,13 @@ var ThumbnailsBox = GObject.registerClass({
let y2 = Math.round(y + thumbnailHeight);
let roundedVScale = (y2 - y1) / portholeHeight;
if (thumbnail.metaWorkspace == indicatorWorkspace) {
indicatorY1 = y1;
indicatorY2 = y2;
if (i === indicatorUpperWs) {
indicatorUpperY1 = y1;
indicatorUpperY2 = y2;
}
if (i === indicatorLowerWs) {
indicatorLowerY1 = y1;
indicatorLowerY2 = y2;
}
// Allocating a scaled actor is funny - x1/y1 correspond to the origin
@ -1349,29 +1346,15 @@ var ThumbnailsBox = GObject.registerClass({
childBox.x1 = box.x2 - thumbnailWidth;
childBox.x2 = box.x2;
}
let indicatorY1 = indicatorLowerY1 +
(indicatorUpperY1 - indicatorLowerY1) * (indicatorValue % 1);
let indicatorY2 = indicatorLowerY2 +
(indicatorUpperY2 - indicatorLowerY2) * (indicatorValue % 1);
childBox.x1 -= indicatorLeftFullBorder;
childBox.x2 += indicatorRightFullBorder;
childBox.y1 = indicatorY1 - indicatorTopFullBorder;
childBox.y2 = (indicatorY2 ? indicatorY2 : indicatorY1 + thumbnailHeight) + indicatorBottomFullBorder;
childBox.y2 = indicatorY2 + indicatorBottomFullBorder;
this._indicator.allocate(childBox, flags);
}
_activeWorkspaceChanged(_wm, _from, _to, _direction) {
let workspaceManager = global.workspace_manager;
let activeWorkspace = workspaceManager.get_active_workspace();
let thumbnail = this._thumbnails.find(t => t.metaWorkspace == activeWorkspace);
this._animatingIndicator = true;
let indicatorThemeNode = this._indicator.get_theme_node();
let indicatorTopFullBorder = indicatorThemeNode.get_padding(St.Side.TOP) + indicatorThemeNode.get_border_width(St.Side.TOP);
this.indicator_y = this._indicator.allocation.y1 + indicatorTopFullBorder;
this.ease_property('indicator-y', thumbnail.allocation.y1, {
progress_mode: Clutter.AnimationMode.EASE_OUT_QUAD,
duration: WorkspacesView.WORKSPACE_SWITCH_TIME,
onComplete: () => {
this._animatingIndicator = false;
this._queueUpdateStates();
},
});
}
});

View File

@ -1,10 +1,10 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported WorkspacesView, WorkspacesDisplay */
const { Clutter, Gio, GObject, Meta, Shell, St } = imports.gi;
const { Clutter, Gio, GLib, GObject, Meta, Shell, St } = imports.gi;
const Main = imports.ui.main;
const WindowManager = imports.ui.windowManager;
const SwipeTracker = imports.ui.swipeTracker;
const Workspace = imports.ui.workspace;
var WORKSPACE_SWITCH_TIME = 250;
@ -73,25 +73,18 @@ var WorkspacesViewBase = GObject.registerClass({
var WorkspacesView = GObject.registerClass(
class WorkspacesView extends WorkspacesViewBase {
_init(monitorIndex) {
_init(monitorIndex, scrollAdjustment) {
let workspaceManager = global.workspace_manager;
super._init(monitorIndex);
this._animating = false; // tweening
this._scrolling = false; // swipe-scrolling
this._gestureActive = false; // touch(pad) gestures
this._animatingScroll = false; // programmatically updating the adjustment
let activeWorkspaceIndex = workspaceManager.get_active_workspace_index();
this.scrollAdjustment = new St.Adjustment({ value: activeWorkspaceIndex,
lower: 0,
page_increment: 1,
page_size: 1,
step_increment: 0,
upper: workspaceManager.n_workspaces });
this.scrollAdjustment.connect('notify::value',
this._onScroll.bind(this));
this._scrollAdjustment = scrollAdjustment;
this._onScrollId =
this._scrollAdjustment.connect('notify::value',
this._onScroll.bind(this));
this._workspaces = [];
this._updateWorkspaces();
@ -165,14 +158,6 @@ class WorkspacesView extends WorkspacesViewBase {
this._workspaces[i].syncStacking(stackIndices);
}
_scrollToActive() {
let workspaceManager = global.workspace_manager;
let active = workspaceManager.get_active_workspace_index();
this._updateWorkspaceActors(true);
this._updateScrollAdjustment(active);
}
// Update workspace actors parameters
// @showAnimation: iff %true, transition between states
_updateWorkspaceActors(showAnimation) {
@ -197,7 +182,7 @@ class WorkspacesView extends WorkspacesViewBase {
if (showAnimation) {
let easeParams = Object.assign(params, {
duration: WORKSPACE_SWITCH_TIME,
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
mode: Clutter.AnimationMode.EASE_OUT_CUBIC,
});
// we have to call _updateVisibility() once before the
// animation and once afterwards - it does not really
@ -225,7 +210,7 @@ class WorkspacesView extends WorkspacesViewBase {
for (let w = 0; w < this._workspaces.length; w++) {
let workspace = this._workspaces[w];
if (this._animating || this._scrolling || this._gestureActive)
if (this._animating || this._gestureActive)
workspace.show();
else if (this._inDrag)
workspace.visible = Math.abs(w - active) <= 1;
@ -234,25 +219,10 @@ class WorkspacesView extends WorkspacesViewBase {
}
}
_updateScrollAdjustment(index) {
if (this._scrolling || this._gestureActive)
return;
this._animatingScroll = true;
this.scrollAdjustment.ease(index, {
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
duration: WORKSPACE_SWITCH_TIME,
onComplete: () => (this._animatingScroll = false),
});
}
_updateWorkspaces() {
let workspaceManager = global.workspace_manager;
let newNumWorkspaces = workspaceManager.n_workspaces;
this.scrollAdjustment.upper = newNumWorkspaces;
for (let j = 0; j < newNumWorkspaces; j++) {
let metaWorkspace = workspaceManager.get_workspace_by_index(j);
let workspace;
@ -283,13 +253,13 @@ class WorkspacesView extends WorkspacesViewBase {
if (this._scrolling)
return;
this._scrollToActive();
this._updateWorkspaceActors(true);
}
_onDestroy() {
super._onDestroy();
this.scrollAdjustment.run_dispose();
this._scrollAdjustment.disconnect(this._onScrollId);
Main.overview.disconnect(this._overviewShownId);
global.window_manager.disconnect(this._switchWorkspaceNotifyId);
let workspaceManager = global.workspace_manager;
@ -297,18 +267,6 @@ class WorkspacesView extends WorkspacesViewBase {
workspaceManager.disconnect(this._reorderWorkspacesId);
}
startSwipeScroll() {
this._scrolling = true;
}
endSwipeScroll() {
this._scrolling = false;
// Make sure title captions etc are shown as necessary
this._scrollToActive();
this._updateVisibility();
}
startTouchGesture() {
this._gestureActive = true;
}
@ -317,14 +275,14 @@ class WorkspacesView extends WorkspacesViewBase {
this._gestureActive = false;
// Make sure title captions etc are shown as necessary
this._scrollToActive();
this._updateWorkspaceActors(true);
this._updateVisibility();
}
// sync the workspaces' positions to the value of the scroll adjustment
// and change the active workspace if appropriate
_onScroll(adj) {
if (this._animatingScroll)
if (adj.get_transition('value') !== null && !this._gestureActive)
return;
let workspaceManager = global.workspace_manager;
@ -356,7 +314,7 @@ class WorkspacesView extends WorkspacesViewBase {
let workspacesHeight = lastWorkspaceY - firstWorkspaceY;
let currentY = firstWorkspaceY;
let newY = -adj.value / (adj.upper - 1) * workspacesHeight;
let newY = -Math.round(adj.value / (adj.upper - 1) * workspacesHeight);
let dy = newY - currentY;
@ -370,7 +328,7 @@ class WorkspacesView extends WorkspacesViewBase {
let workspacesWidth = lastWorkspaceX - firstWorkspaceX;
let currentX = firstWorkspaceX;
let newX = -adj.value / (adj.upper - 1) * workspacesWidth;
let newX = -Math.round(adj.value / (adj.upper - 1) * workspacesWidth);
let dx = newX - currentX;
@ -424,12 +382,6 @@ class ExtraWorkspaceView extends WorkspacesViewBase {
this._workspace.syncStacking(stackIndices);
}
startSwipeScroll() {
}
endSwipeScroll() {
}
startTouchGesture() {
}
@ -439,10 +391,21 @@ class ExtraWorkspaceView extends WorkspacesViewBase {
var WorkspacesDisplay = GObject.registerClass(
class WorkspacesDisplay extends St.Widget {
_init() {
_init(scrollAdjustment) {
super._init({ clip_to_allocation: true });
this.connect('notify::allocation', this._updateWorkspacesActualGeometry.bind(this));
let workspaceManager = global.workspace_manager;
this._scrollAdjustment = scrollAdjustment;
this._switchWorkspaceId =
global.window_manager.connect('switch-workspace',
this._activeWorkspaceChanged.bind(this));
this._reorderWorkspacesdId =
workspaceManager.connect('workspaces-reordered',
this._workspacesReordered.bind(this));
let clickAction = new Clutter.ClickAction();
clickAction.connect('clicked', action => {
// Only switch to the workspace when there's no application
@ -456,42 +419,14 @@ class WorkspacesDisplay extends St.Widget {
});
Main.overview.addAction(clickAction);
this.bind_property('mapped', clickAction, 'enabled', GObject.BindingFlags.SYNC_CREATE);
this._clickAction = clickAction;
let panAction = new Clutter.PanAction({ threshold_trigger_edge: Clutter.GestureTriggerEdge.AFTER });
panAction.connect('pan', this._onPan.bind(this));
panAction.connect('gesture-begin', () => {
if (this._workspacesOnlyOnPrimary) {
let event = Clutter.get_current_event();
if (this._getMonitorIndexForEvent(event) != this._primaryIndex)
return false;
}
this._startSwipeScroll();
return true;
});
panAction.connect('gesture-cancel', () => {
clickAction.release();
this._endSwipeScroll();
});
panAction.connect('gesture-end', () => {
clickAction.release();
this._endSwipeScroll();
});
Main.overview.addAction(panAction);
this.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.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._swipeTracker = new SwipeTracker.SwipeTracker(
Main.layoutManager.overviewGroup, Shell.ActionMode.OVERVIEW);
this._swipeTracker.connect('begin', this._switchWorkspaceBegin.bind(this));
this._swipeTracker.connect('update', this._switchWorkspaceUpdate.bind(this));
this._swipeTracker.connect('end', this._switchWorkspaceEnd.bind(this));
this.bind_property('mapped', this._swipeTracker, 'enabled', GObject.BindingFlags.SYNC_CREATE);
this._primaryIndex = Main.layoutManager.primaryIndex;
this._workspacesViews = [];
@ -505,9 +440,13 @@ class WorkspacesDisplay extends St.Widget {
this._restackedNotifyId = 0;
this._scrollEventId = 0;
this._keyPressEventId = 0;
this._scrollTimeoutId = 0;
this._fullGeometry = null;
this._gestureActive = false; // touch(pad) gestures
this._canScroll = true; // limiting scrolling speed
this.connect('destroy', this._onDestroy.bind(this));
}
@ -523,64 +462,121 @@ class WorkspacesDisplay extends St.Widget {
Meta.later_remove(this._parentSetLater);
this._parentSetLater = 0;
}
if (this._scrollTimeoutId !== 0) {
GLib.source_remove(this._scrollTimeoutId);
this._scrollTimeoutId = 0;
}
global.window_manager.disconnect(this._switchWorkspaceId);
global.workspace_manager.disconnect(this._reorderWorkspacesdId);
}
_onPan(action) {
let [dist_, dx, dy] = action.get_motion_delta(0);
_workspacesReordered() {
let workspaceManager = global.workspace_manager;
this._scrollAdjustment.value =
workspaceManager.get_active_workspace_index();
}
_activeWorkspaceChanged(_wm, _from, _to, _direction) {
if (this._gestureActive)
return;
this._scrollToActive();
}
_scrollToActive() {
let workspaceManager = global.workspace_manager;
let active = workspaceManager.get_active_workspace_index();
this._updateScrollAdjustment(active);
}
_updateScrollAdjustment(index) {
if (this._gestureActive)
return;
this._scrollAdjustment.ease(index, {
mode: Clutter.AnimationMode.EASE_OUT_CUBIC,
duration: WORKSPACE_SWITCH_TIME,
});
}
_directionForProgress(progress) {
if (global.workspace_manager.layout_rows === -1) {
return progress > 0
? Meta.MotionDirection.DOWN
: Meta.MotionDirection.UP;
} else if (this.text_direction === Clutter.TextDirection.RTL) {
return progress > 0
? Meta.MotionDirection.LEFT
: Meta.MotionDirection.RIGHT;
} else {
return progress > 0
? Meta.MotionDirection.RIGHT
: Meta.MotionDirection.LEFT;
}
}
_switchWorkspaceBegin(tracker, monitor) {
if (this._workspacesOnlyOnPrimary && monitor !== this._primaryIndex)
return;
let workspaceManager = global.workspace_manager;
let adjustment = this._scrollAdjustment;
if (global.workspace_manager.layout_rows == -1)
adjustment.value -= (dy / this.height) * adjustment.page_size;
else if (this.text_direction == Clutter.TextDirection.RTL)
adjustment.value += (dx / this.width) * adjustment.page_size;
else
adjustment.value -= (dx / this.width) * adjustment.page_size;
return false;
}
if (this._gestureActive)
adjustment.remove_transition('value');
_startSwipeScroll() {
for (let i = 0; i < this._workspacesViews.length; i++)
this._workspacesViews[i].startSwipeScroll();
}
tracker.orientation = workspaceManager.layout_rows !== -1
? Clutter.Orientation.HORIZONTAL
: Clutter.Orientation.VERTICAL;
_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();
let monitors = Main.layoutManager.monitors;
let geometry = monitor === this._primaryIndex
? this._fullGeometry : monitors[monitor];
let distance = global.workspace_manager.layout_rows === -1
? geometry.height : geometry.width;
let progress = adjustment.value / adjustment.page_size;
let points = Array.from(
{ length: workspaceManager.n_workspaces }, (v, i) => i);
tracker.confirmSwipe(distance, points, progress, Math.round(progress));
this._gestureActive = true;
}
_switchWorkspaceUpdate(tracker, progress) {
let adjustment = this._scrollAdjustment;
adjustment.value = progress * adjustment.page_size;
}
_switchWorkspaceEnd(tracker, duration, endProgress) {
this._clickAction.release();
let workspaceManager = global.workspace_manager;
let activeWorkspace = workspaceManager.get_active_workspace();
let newWs = workspaceManager.get_workspace_by_index(endProgress);
this._scrollAdjustment.ease(endProgress, {
mode: Clutter.AnimationMode.EASE_OUT_CUBIC,
duration,
onComplete: () => {
if (newWs !== activeWorkspace)
newWs.activate(global.get_current_time());
this._endTouchGesture();
},
});
}
_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;
if (workspaceManager.layout_rows == -1)
adjustment.value = (active - yRel / this.height) * adjustment.page_size;
else if (this.text_direction == Clutter.TextDirection.RTL)
adjustment.value = (active + xRel / this.width) * adjustment.page_size;
else
adjustment.value = (active - xRel / this.width) * 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();
this._gestureActive = false;
}
vfunc_navigate_focus(from, direction) {
@ -658,14 +654,7 @@ class WorkspacesDisplay extends St.Widget {
if (this._workspacesOnlyOnPrimary && i != this._primaryIndex)
view = new ExtraWorkspaceView(i);
else
view = new WorkspacesView(i);
view.connect('scroll-event', this._onScrollEvent.bind(this));
if (i == this._primaryIndex) {
this._scrollAdjustment = view.scrollAdjustment;
this._scrollAdjustment.connect('notify::value',
this._scrollValueChanged.bind(this));
}
view = new WorkspacesView(i, this._scrollAdjustment);
// HACK: Avoid spurious allocation changes while updating views
view.hide();
@ -680,21 +669,6 @@ class WorkspacesDisplay extends St.Widget {
this._updateWorkspacesActualGeometry();
}
_scrollValueChanged() {
for (let i = 0; i < this._workspacesViews.length; i++) {
if (i == this._primaryIndex)
continue;
let adjustment = this._workspacesViews[i].scrollAdjustment;
if (!adjustment)
continue;
// the adjustments work in terms of workspaces, so the
// values map directly
adjustment.value = this._scrollAdjustment.value;
}
}
_getMonitorIndexForEvent(event) {
let [x, y] = event.get_coords();
let rect = new Meta.Rectangle({ x, y, width: 1, height: 1 });
@ -781,6 +755,9 @@ class WorkspacesDisplay extends St.Widget {
}
_onScrollEvent(actor, event) {
if (this._swipeTracker.canHandleScrollEvent(event))
return Clutter.EVENT_PROPAGATE;
if (!this.mapped)
return Clutter.EVENT_PROPAGATE;
@ -788,6 +765,9 @@ class WorkspacesDisplay extends St.Widget {
this._getMonitorIndexForEvent(event) != this._primaryIndex)
return Clutter.EVENT_PROPAGATE;
if (!this._canScroll)
return Clutter.EVENT_PROPAGATE;
let workspaceManager = global.workspace_manager;
let activeWs = workspaceManager.get_active_workspace();
let ws;
@ -808,6 +788,16 @@ class WorkspacesDisplay extends St.Widget {
return Clutter.EVENT_PROPAGATE;
}
Main.wm.actionMoveWorkspace(ws);
this._canScroll = false;
this._scrollTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
WORKSPACE_SWITCH_TIME, () => {
this._canScroll = true;
this._scrollTimeoutId = 0;
return GLib.SOURCE_REMOVE;
}
);
return Clutter.EVENT_STOP;
}

View File

@ -1,5 +1,5 @@
project('gnome-shell', 'c',
version: '3.35.2',
version: '3.35.3',
meson_version: '>= 0.47.0',
license: 'GPLv2+'
)
@ -25,7 +25,7 @@ gio_req = '>= 2.56.0'
gi_req = '>= 1.49.1'
gjs_req = '>= 1.63.2'
gtk_req = '>= 3.15.0'
mutter_req = '>= 3.35.2'
mutter_req = '>= 3.35.3'
polkit_req = '>= 0.100'
schemas_req = '>= 3.33.1'
startup_req = '>= 0.11'
@ -57,7 +57,6 @@ convertdir = join_paths(datadir, 'GConf', 'gsettings')
desktopdir = join_paths(datadir, 'applications')
ifacedir = join_paths(datadir, 'dbus-1', 'interfaces')
localedir = join_paths(datadir, 'locale')
portaldir = join_paths(datadir, 'xdg-desktop-portal', 'portals')
schemadir = join_paths(datadir, 'glib-2.0', 'schemas')
servicedir = join_paths(datadir, 'dbus-1', 'services')
@ -266,4 +265,4 @@ if get_option('gtk_doc')
subdir('docs/reference')
endif
meson.add_install_script('meson/meson-postinstall.sh')
meson.add_install_script('meson/postinstall.py')

View File

@ -1,10 +0,0 @@
#!/bin/sh
# Package managers set this so we don't need to run
if [ -z "$DESTDIR" ]; then
echo Compiling GSettings schemas...
glib-compile-schemas ${MESON_INSTALL_PREFIX}/share/glib-2.0/schemas
echo Updating desktop database...
update-desktop-database -q ${MESON_INSTALL_PREFIX}/share/applications
fi

21
meson/postinstall.py Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env python3
import os
import subprocess
prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local')
datadir = os.path.join(prefix, 'share')
# Packaging tools define DESTDIR and this isn't needed for them
if 'DESTDIR' not in os.environ:
print('Updating desktop database...')
desktop_database_dir = os.path.join(datadir, 'applications')
if not os.path.exists(desktop_database_dir):
os.makedirs(desktop_database_dir)
subprocess.call(['update-desktop-database', '-q', desktop_database_dir])
print('Compiling GSettings schemas...')
schemas_dir = os.path.join(datadir, 'glib-2.0', 'schemas')
if not os.path.exists(schemas_dir):
os.makedirs(schemas_dir)
subprocess.call(['glib-compile-schemas', schemas_dir])

View File

@ -12,7 +12,6 @@ js/gdm/util.js
js/misc/systemActions.js
js/misc/util.js
js/portalHelper/main.js
js/ui/accessDialog.js
js/ui/appDisplay.js
js/ui/appFavorites.js
js/ui/audioDeviceSelection.js

1369
po/ca.po

File diff suppressed because it is too large Load Diff

1437
po/eo.po

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More