[gnome-shell] Rename CSS selectors for password prompts



commit 602da771f6c08c9c1239831d3e12330a089aff4a
Author: Stef Walter <stefw gnome org>
Date:   Thu Feb 9 21:52:21 2012 +0100

    Rename CSS selectors for password prompts
    
     * Use .prompt-xxx selectors instead of .polkit-xxx,
       as the selectors are now used by various non-polkit
       dialogs as well
    
    https://bugzilla.gnome.org/show_bug.cgi?id=669776

 data/theme/gnome-shell.css         |   60 +++++++++++++++++++-----------------
 js/ui/networkAgent.js              |   14 ++++----
 js/ui/polkitAuthenticationAgent.js |   20 ++++++------
 js/ui/wanda.js                     |    6 ++--
 4 files changed, 52 insertions(+), 48 deletions(-)
---
diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css
index 6669946..6133cff 100644
--- a/data/theme/gnome-shell.css
+++ b/data/theme/gnome-shell.css
@@ -1887,55 +1887,41 @@ StTooltip StLabel {
     font-size: 10pt;
 }
 
-/* PolicyKit Authentication Dialog */
-.polkit-dialog {
+/* Password or Authentication Dialog */
+.prompt-dialog {
     /* this is the width of the entire modal popup */
     width: 500px;
 }
 
-.polkit-dialog-main-layout {
+.prompt-dialog-main-layout {
     spacing: 24px;
     padding: 10px;
 }
 
-.polkit-dialog-message-layout {
+.prompt-dialog-message-layout {
     spacing: 16px;
 }
 
-.polkit-dialog-headline {
+.prompt-dialog-headline {
     font-size: 12pt;
     font-weight: bold;
     color: #666666;
 }
 
-.polkit-dialog-description {
+.prompt-dialog-description {
     font-size: 10pt;
     color: white;
 }
 
-.polkit-dialog-user-layout {
-    padding-left: 10px;
-    spacing: 10px;
-}
-
-.polkit-dialog-user-layout:rtl {
-    padding-left: 0px;
-    padding-right: 10px;
-}
-
-.polkit-dialog-user-root-label {
-    color: #ff0000;
-}
-
-.polkit-dialog-password-label:ltr {
+.prompt-dialog-password-label:ltr {
     padding-right: 0.5em;
 }
 
-.polkit-dialog-password-label:rtl {
+.prompt-dialog-password-label:rtl {
     padding-left: 0.5em;
 }
 
-.polkit-dialog-password-entry {
+.prompt-dialog-password-entry {
     background-gradient-start: rgb(236,236,236);
     background-gradient-end: white;
     background-gradient-direction: vertical;
@@ -1945,34 +1931,52 @@ StTooltip StLabel {
     border: 2px solid #555753;
 }
 
-.polkit-dialog-password-entry:focus {
+.prompt-dialog-password-entry:focus {
     border: 2px solid #3465a4;
 }
 
-.polkit-dialog-password-entry .capslock-warning {
+.prompt-dialog-password-entry .capslock-warning {
     icon-size: 16px;
     warning-color: #999;
     padding: 0 4px;
 }
 
-.polkit-dialog-error-label {
+.prompt-dialog-error-label {
     font-size: 10pt;
     color: #ffff00;
     padding-bottom: 8px;
 }
 
-.polkit-dialog-info-label {
+.prompt-dialog-info-label {
     font-size: 10pt;
     padding-bottom: 8px;
 }
 
 /* intentionally left transparent to avoid dialog changing size */
-.polkit-dialog-null-label {
+.prompt-dialog-null-label {
     font-size: 10pt;
     color: rgba(0,0,0,0);
     padding-bottom: 8px;
 }
 
+/* Polkit Dialog */
+
+.polkit-dialog-user-layout {
+    padding-left: 10px;
+    spacing: 10px;
+}
+
+.polkit-dialog-user-layout:rtl {
+    padding-left: 0px;
+    padding-right: 10px;
+}
+
+.polkit-dialog-user-root-label {
+    color: #ff0000;
+}
+
+/* Network Agent Dialog */
+
 .network-dialog-secret-table {
     spacing-rows: 15px;
 }
diff --git a/js/ui/networkAgent.js b/js/ui/networkAgent.js
index 48337dd..2f88480 100644
--- a/js/ui/networkAgent.js
+++ b/js/ui/networkAgent.js
@@ -37,7 +37,7 @@ const NetworkSecretDialog = new Lang.Class({
     Extends: ModalDialog.ModalDialog,
 
     _init: function(agent, requestId, connection, settingName, hints) {
-        this.parent({ styleClass: 'polkit-dialog' });
+        this.parent({ styleClass: 'prompt-dialog' });
 
         this._agent = agent;
         this._requestId = requestId;
@@ -47,7 +47,7 @@ const NetworkSecretDialog = new Lang.Class({
 
         this._content = this._getContent();
 
-        let mainContentBox = new St.BoxLayout({ style_class: 'polkit-dialog-main-layout',
+        let mainContentBox = new St.BoxLayout({ style_class: 'prompt-dialog-main-layout',
                                                 vertical: false });
         this.contentLayout.add(mainContentBox,
                                { x_fill: true,
@@ -60,19 +60,19 @@ const NetworkSecretDialog = new Lang.Class({
                              x_align: St.Align.END,
                              y_align: St.Align.START });
 
-        let messageBox = new St.BoxLayout({ style_class: 'polkit-dialog-message-layout',
+        let messageBox = new St.BoxLayout({ style_class: 'prompt-dialog-message-layout',
                                             vertical: true });
         mainContentBox.add(messageBox,
                            { y_align: St.Align.START });
 
-        let subjectLabel = new St.Label({ style_class: 'polkit-dialog-headline',
+        let subjectLabel = new St.Label({ style_class: 'prompt-dialog-headline',
                                             text: this._content.title });
         messageBox.add(subjectLabel,
                        { y_fill:  false,
                          y_align: St.Align.START });
 
         if (this._content.message != null) {
-            let descriptionLabel = new St.Label({ style_class: 'polkit-dialog-description',
+            let descriptionLabel = new St.Label({ style_class: 'prompt-dialog-description',
                                                   text: this._content.message,
                                                   // HACK: for reasons unknown to me, the label
                                                   // is not asked the correct height for width,
@@ -93,12 +93,12 @@ const NetworkSecretDialog = new Lang.Class({
         let pos = 0;
         for (let i = 0; i < this._content.secrets.length; i++) {
             let secret = this._content.secrets[i];
-            let label = new St.Label({ style_class: 'polkit-dialog-password-label',
+            let label = new St.Label({ style_class: 'prompt-dialog-password-label',
                                        text: secret.label });
 
             let reactive = secret.key != null;
 
-            secret.entry = new St.Entry({ style_class: 'polkit-dialog-password-entry',
+            secret.entry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
                                           text: secret.value, can_focus: reactive,
                                           reactive: reactive });
             ShellEntry.addContextMenu(secret.entry,
diff --git a/js/ui/polkitAuthenticationAgent.js b/js/ui/polkitAuthenticationAgent.js
index fc9ceac..6a05e1a 100644
--- a/js/ui/polkitAuthenticationAgent.js
+++ b/js/ui/polkitAuthenticationAgent.js
@@ -41,7 +41,7 @@ const AuthenticationDialog = new Lang.Class({
     Extends: ModalDialog.ModalDialog,
 
     _init: function(actionId, message, cookie, userNames) {
-        this.parent({ styleClass: 'polkit-dialog' });
+        this.parent({ styleClass: 'prompt-dialog' });
 
         this.actionId = actionId;
         this.message = message;
@@ -49,7 +49,7 @@ const AuthenticationDialog = new Lang.Class({
         this._wasDismissed = false;
         this._completed = false;
 
-        let mainContentBox = new St.BoxLayout({ style_class: 'polkit-dialog-main-layout',
+        let mainContentBox = new St.BoxLayout({ style_class: 'prompt-dialog-main-layout',
                                                 vertical: false });
         this.contentLayout.add(mainContentBox,
                                { x_fill: true,
@@ -62,19 +62,19 @@ const AuthenticationDialog = new Lang.Class({
                              x_align: St.Align.END,
                              y_align: St.Align.START });
 
-        let messageBox = new St.BoxLayout({ style_class: 'polkit-dialog-message-layout',
+        let messageBox = new St.BoxLayout({ style_class: 'prompt-dialog-message-layout',
                                             vertical: true });
         mainContentBox.add(messageBox,
                            { y_align: St.Align.START });
 
-        this._subjectLabel = new St.Label({ style_class: 'polkit-dialog-headline',
+        this._subjectLabel = new St.Label({ style_class: 'prompt-dialog-headline',
                                             text: _("Authentication Required") });
 
         messageBox.add(this._subjectLabel,
                        { y_fill:  false,
                          y_align: St.Align.START });
 
-        this._descriptionLabel = new St.Label({ style_class: 'polkit-dialog-description',
+        this._descriptionLabel = new St.Label({ style_class: 'prompt-dialog-description',
                                                 text: message });
         this._descriptionLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
         this._descriptionLabel.clutter_text.line_wrap = true;
@@ -137,9 +137,9 @@ const AuthenticationDialog = new Lang.Class({
 
         this._passwordBox = new St.BoxLayout({ vertical: false });
         messageBox.add(this._passwordBox);
-        this._passwordLabel = new St.Label(({ style_class: 'polkit-dialog-password-label' }));
+        this._passwordLabel = new St.Label(({ style_class: 'prompt-dialog-password-label' }));
         this._passwordBox.add(this._passwordLabel);
-        this._passwordEntry = new St.Entry({ style_class: 'polkit-dialog-password-entry',
+        this._passwordEntry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
                                              text: "",
                                              can_focus: true});
         ShellEntry.addContextMenu(this._passwordEntry, { isPassword: true });
@@ -149,13 +149,13 @@ const AuthenticationDialog = new Lang.Class({
         this.setInitialKeyFocus(this._passwordEntry);
         this._passwordBox.hide();
 
-        this._errorMessageLabel = new St.Label({ style_class: 'polkit-dialog-error-label' });
+        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;
         messageBox.add(this._errorMessageLabel);
         this._errorMessageLabel.hide();
 
-        this._infoMessageLabel = new St.Label({ style_class: 'polkit-dialog-info-label' });
+        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;
         messageBox.add(this._infoMessageLabel);
@@ -165,7 +165,7 @@ const AuthenticationDialog = new Lang.Class({
          * infoMessage and errorMessageLabel - but it is still invisible because
          * gnome-shell.css sets the color to be transparent
          */
-        this._nullMessageLabel = new St.Label({ style_class: 'polkit-dialog-null-label',
+        this._nullMessageLabel = new St.Label({ style_class: 'prompt-dialog-null-label',
                                                 text: 'abc'});
         this._nullMessageLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
         this._nullMessageLabel.clutter_text.line_wrap = true;
diff --git a/js/ui/wanda.js b/js/ui/wanda.js
index 98228aa..cfbe47e 100644
--- a/js/ui/wanda.js
+++ b/js/ui/wanda.js
@@ -124,14 +124,14 @@ const FortuneDialog = new Lang.Class({
             text = _("Sorry, no wisdom for you today:\n%s").format(e.message);
         }
 
-        this._title = new St.Label({ style_class: 'polkit-dialog-headline',
+        this._title = new St.Label({ style_class: 'prompt-dialog-headline',
                                      text: _("%s the Oracle says").format(name) });
-        this._label = new St.Label({ style_class: 'polkit-dialog-description',
+        this._label = new St.Label({ style_class: 'prompt-dialog-description',
                                      text: text });
         this._label.clutter_text.line_wrap = true;
 
         this._box = new St.BoxLayout({ vertical: true,
-                                       style_class: 'polkit-dialog' // this is just to force a reasonable width
+                                       style_class: 'prompt-dialog' // this is just to force a reasonable width
                                      });
         this._box.add(this._title, { align: St.Align.MIDDLE });
         this._box.add(this._label, { expand: true });



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]