Commit Graph

39 Commits

Author SHA1 Message Date
Stéphane Démurget
4c55a6f436 modalDialog: do not launch disabled button actions
The "Sign In" button of the login dialog has its look disabled when the
entry is empty, but it can still be triggered by the Enter key.

This fixes the modal dialog so it does not trigger the action of an
insensitive button, and also means we do not need to connect to the
"activate" signal of the entry anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=687113
2012-11-20 21:08:37 +01:00
Stéphane Démurget
c10e4c3117 modalDialog: give more control over the layout
Make the button layout public for callers to be able to have more
control over like adding custom widgets. Also, the clearButtons and
addButton methods are added as convenience for the most frequent usage.

https://bugzilla.gnome.org/show_bug.cgi?id=687113
2012-11-20 21:08:37 +01:00
Florian Müllner
b58f502dd6 main: Add optional keybindingMode parameter to pushModal()
For now we just use it to assign an identifier to modal modes in
which we want to allow some keybindings, but we don't use it for
any actual filtering; we'll start doing this shortly.

https://bugzilla.gnome.org/show_bug.cgi?id=688202
2012-11-17 01:44:22 +01:00
Florian Müllner
c2065cc3e2 main: Use Params for optional parameters to pushModal()
As the number of optional parameters grows, it gets more convenient
to use Params instead of passing in a lot of undefined/null/0 values.

https://bugzilla.gnome.org/show_bug.cgi?id=688202
2012-11-17 01:44:22 +01:00
Jasper St. Pierre
360d94dd67 modalDialog: Remove the fade in buttons code
Due to a typo, it never worked correctly. After a fix-up to the appropriate
method, the behavior is suboptimal, as the buttons only fade in the first time
the modal dialog is constructed. Just remove the fade-in behavior, rather than
keeping this non-working code around.

https://bugzilla.gnome.org/show_bug.cgi?id=677426
2012-10-16 10:49:20 -04:00
Giovanni Campagna
48fb16b570 ScreenShield: show the unlock dialog on the primary monitor when using the keyboard
Make ModalDialog.open() accept an optional onPrimary argument, and
pass it when the dialog is activated using ESC or Return.

https://bugzilla.gnome.org/show_bug.cgi?id=685855
2012-10-15 22:45:19 +02:00
Florian Müllner
55284e418c modalDialog: Add alternative keys to activate default
Currently Return is used to activate the default button of a modal
dialog if no key is specified. It makes sense to allow alternatives
as the keypad's Enter key as well in this case.

https://bugzilla.gnome.org/show_bug.cgi?id=685511
2012-10-04 21:18:54 +02:00
Jasper St. Pierre
cc6744055f gdm: Don't fade in the log in dialog
Instead, directly show it.

https://bugzilla.gnome.org/show_bug.cgi?id=682428
2012-09-19 01:41:17 -03:00
Giovanni Campagna
1a65374e21 Port modal dialogs to the new MonitorConstraint
This commit makes ModalDialog use the new MonitorConstraint instead
of custom code to force itself on the right monitor.
At the same it ports wanda, which has something similar to a modal
dialog, but is not using the ModalDialog module.

https://bugzilla.gnome.org/show_bug.cgi?id=681743
2012-08-16 21:45:21 +02:00
Giovanni Campagna
5a35c57866 ModalDialog: make dialogLayout public
ModalDialog subclasses may want to add content outside contentLayout
(in particular, UnlockDialog wants to have it after the buttons)
2012-08-07 20:35:29 +02:00
Giovanni Campagna
413ace2eb1 UnlockDialog: allow going back to the lock screen by pressing escape
https://bugzilla.gnome.org/show_bug.cgi?id=681143
2012-08-03 19:54:48 +02:00
Giovanni Campagna
c0652bcd8f ScreenShield: implement curtain design
This separates the screen shield into two main screens. One is
the lock screen, and it is shown when coming back from idle status
and when failing authentication. The other is the actual unlock
dialog.
Moving from the first to the second is possible by pressing Escape
or by dragging an arrow on the bottom on the screen.

https://bugzilla.gnome.org/show_bug.cgi?id=619955
2012-07-21 15:40:28 +02:00
Giovanni Campagna
8970e17911 ModalDialog: add 'default' pseudo-class to default button
Add 'default' parameter to setButtons, that controls the binding
of Return (unless overridden) and applies the 'default' pseudo-class.
Currently it has no effect, but it will start having after the
login dialog redesign.

https://bugzilla.gnome.org/show_bug.cgi?id=619955
2012-07-21 15:40:28 +02:00
Tim L
dc004f6eb7 modalDialog: show dialogs on monitor with the mouse pointer
Show the dialog on the monitor containing the pointer, rather than
the monitor with active focused window. This brings it inline with
the behaviour seen when launching applications.

Remove the focusMonitor/focusIndex from LayoutManager. These
properties were only used by the modal dialogs. Remove them since
they are not being used elsewhere.

https://bugzilla.gnome.org/show_bug.cgi?id=642591
2012-06-08 23:05:56 -04:00
Rui Matos
b58425d7d7 modalDialog: Fix setting the initial key focus after the 1st time
Checking if _buttonLayout contains _initialKeyFocus always fails since we
destroy all children before. Instead, use a signal handler id when explicitly
setting the initial key focus which is zeroed if/when the actor is destroyed.

https://bugzilla.gnome.org/show_bug.cgi?id=663437
2012-03-12 00:52:34 +01:00
Alejandro Piñeiro
a5baeac428 a11y: Setting role and label-actor for runDialog
https://bugzilla.gnome.org/show_bug.cgi?id=670308
2012-03-10 02:27:19 +01:00
Florian Müllner
760da64a4c modalDialog: Hide button layout by default
For modal dialogs without buttons, the button group still contributes
padding/spacing. To fix that, hide it by default and only show it
when actually adding buttons.

https://bugzilla.gnome.org/show_bug.cgi?id=668209
2012-02-28 18:07:05 +01:00
Jasper St. Pierre
bb862e20c0 st: Remove st-group
Now that ClutterActor/StWidget is concrete, we don't need it.

https://bugzilla.gnome.org/show_bug.cgi?id=670034
2012-02-28 08:14:06 -05:00
Jasper St. Pierre
c892610f27 st-container: Remove st_container_destroy_children
It was a simple wrapper around clutter_actor_destroy_all_children.

https://bugzilla.gnome.org/show_bug.cgi?id=670034
2012-02-22 17:00:44 -05:00
Adel Gadllah
fbf6e032d0 modalDialog: Fix bindConstraint
Clutter.BindCoordinate is an enum not a bitmask, so use Clutter.BindCoordinate.ALL
instead of a bitmask of POSITION and SIZE.
2012-02-15 18:13:10 +01:00
Giovanni Campagna
987099ea55 Port ModalDialog to the class framework
Similar to the previous commits, time to port shell modal dialogs
to the class framework.

https://bugzilla.gnome.org/show_bug.cgi?id=664436
2011-11-24 09:50:04 +01:00
Adel Gadllah
668920cec4 Small coding style fixes 2011-10-20 22:42:30 +02:00
Dan Winship
75b824d032 *.js: Make emacs modelines consistent
js2-mode is no longer developed and we recommend js-mode these days,
so switch the modelines to specify that, and make them consistent
across all files.

https://bugzilla.gnome.org/show_bug.cgi?id=660358
2011-10-11 08:05:12 -04:00
Florian Müllner
6d92af17fd modal-dialog: Don't let buttons steal manually-set focus
ModalDialog provides a method to set the initial focus. However,
when adding buttons, the initial focus is always set to the last
button, thus overwriting a previously set manual focus.
Instead, only set the initial key focus if setInitialKeyFocus()
has not been called manually before.

https://bugzilla.gnome.org/show_bug.cgi?id=659133
2011-09-19 21:26:32 +02:00
Jasper St. Pierre
4352cc231e modalDialog: Don't use a for...in loop for iterating over arrays.
for...in loops do not guarantee that the indexes iterate in order. As a
consequence, buttons may appear in an undesired order.
2011-09-19 13:42:47 -04:00
Ray Strode
db39ba3b9f modalDialog: add mode that leaves shell reactive
A modal dialog in the shell blocks anything but that dialog from
receiving user input. Applications within the session and other
parts of UI are rendered non-reactive.

When GDM gets changed to use the shell for its greeter, the user
list will be presented as a shell dialog. That dialog shouldn't
block access to the panel menus, etc.

This commit adds a shellReactive property that makes the ModalDialog
class continue to block access to applications, but allow the user
to interact with the shell itself.

https://bugzilla.gnome.org/show_bug.cgi?id=657082
2011-08-28 12:36:57 -04:00
Ray Strode
e8914c6699 modalDialog: fade in buttons when first showing them
Right now, if buttons get set on a dialog after it is mapped,
they just pop in instantly.

We shouldn't have any harsh transitions like that, though.

This commit changes the buttons to quickly fade in, instead.

https://bugzilla.gnome.org/show_bug.cgi?id=657082
2011-08-28 12:16:40 -04:00
Giovanni Campagna
2ebdc81c8f Add a system modal dialog for network secrets
Using the new ShellNetworkAgent, show a system modal dialog
(similar to the PolicyKit one) when NetworkManager needs secrets
for connecting to wireless.

https://bugzilla.gnome.org/show_bug.cgi?id=650244
2011-08-29 18:11:50 +02:00
Allan Day
dec55a3291 theme: make modal dialog buttons match the mockups
The buttons should have a glassy transparent look. Also, they should not
be as tall, should light up on hover, and their labels should be white
in order to stand out. Making the labels solid white requires removing the
transparency set in modalDialog.js. Also, add a separate color setting
for the dialog as a whole - this avoids having a white icon.

https://bugzilla.gnome.org/show_bug.cgi?id=655428
2011-08-03 11:23:22 +01:00
Dan Winship
64b2b4a7d4 layout: new file handling shell layout
Remove ShellGlobal's monitor-related methods, and have
Main.layoutManager provide that information instead. Move
Main._relayout() to LayoutManager, and have other objects connect to
the layout manager's 'monitors-changed' signal to know when the screen
geometry has changed.

https://bugzilla.gnome.org/show_bug.cgi?id=636963
2011-07-06 08:38:35 -04:00
Dan Winship
898b2b903d environment: put gettext stuff into global environment
Rather than defining _() as a local function in every module, put it
into the global environment (along with C_() and ngettext()).

https://bugzilla.gnome.org/show_bug.cgi?id=649203
2011-05-16 14:57:21 -04:00
Dan Winship
59c3e3a179 endSessionDialog: fix keyboard navigation
The addition of _backgroundStack to ModalDialog broke focus
navigation, because it was interposed between the focus group root and
all of the interesting content, but since it isn't an StWidget,
st_widget_navigate_focus() was unable to navigate through it. Fix this
by moving the focus root to this._dialogLayout (inside the
_backgroundStack) instead.

Additionally, in EndSessionDialog specifically, _initialKeyFocus
wasn't being set until after opening the dialog, so it was ignored.

Also change ModalDialog.close() to clear the _savedKeyFocus that
popModal() set, so that dialogs that are repeatedly closed and
reopened will have their focus revert back to _initialKeyFocus each
time.

https://bugzilla.gnome.org/show_bug.cgi?id=646740
2011-04-14 17:53:40 -04:00
Ray Strode
35e410fe96 endSessionDialog: clean up appearance
This commit lines up the app list with the description,
adds spacing between controls of the dialog, and increases
the wrap width of the text.

https://bugzilla.gnome.org/show_bug.cgi?id=641375
2011-03-22 14:22:55 -04:00
Maxim Ermilov
133b854f1b modalDialog: constrain container to the size of the stage
The lightbox will be sized to the size of its parent container,
so we need to make the parent container reliably the size of the
stage, instead of letting it be auto-sized to the size of its contents.

https://bugzilla.gnome.org/show_bug.cgi?id=644889
2011-03-21 21:18:37 -04:00
Dan Winship
a40daa3c22 runDialog: popModal before running the command
If you run a command from Alt+F2 that tries to get a server grab (eg,
xmag), it will fail if it starts up before the run dialog is finished
hiding.

Additionally, the run dialog currently stays focused while it is
fading out, potentially stealing keystrokes (or causing the user to
accidentally launch two copies of a program).

Change ModalDialog.close() to call popModal() immediately

Add a ModalDialog.popModal method, and call that before running the
RunDialog command. If the command succeeds, close the dialog as
before. If it fails, call ModalDialog.pushModal() to put things back
to normal before displaying the error.

https://bugzilla.gnome.org/show_bug.cgi?id=644857
2011-03-21 14:26:08 -04:00
Dan Winship
bad8dbc2d2 modalDialog: grab focus immediately, not after fade-in
If the user types Alt+F2 and then immediately starts typing, some keys
can get lost. Fix that by grabbing focus sooner.

https://bugzilla.gnome.org/show_bug.cgi?id=644857
2011-03-21 14:26:08 -04:00
Maxim Ermilov
0310f07eab modalDialog: remove old actions from _actionKeys in setButtons
https://bugzilla.gnome.org/show_bug.cgi?id=640781
2011-02-01 23:41:28 +03:00
Maxim Ermilov
e3acaa05be Remove st_container_remove_all & rewrite st_container_destroy_children
1. Both functions leaked the nodes in priv->children
2. st_container_remove_all wasn't properly updating first_child and last_child
3. remove_all() is almost never right since it won't cause signal handlers
   on the children to be removed. In the rare cases where it might be needed
   the caller can simply use clutter_container_remove().
https://bugzilla.gnome.org/show_bug.cgi?id=640781
2011-02-01 23:41:21 +03:00
Ray Strode
47b8d16067 modalDialog: Add modal dialog base class
This is a base class to make it easier to
gain a consistent look for system modal dialogs.

It handles creating a darkened backdrop behind the dialog, setting
up buttons in the dialog, keynav, etc.

https://bugzilla.gnome.org/show_bug.cgi?id=637187
2011-01-14 00:11:10 -05:00