networkAgent: Use Clutter.GridLayout

Clutter.TableLayout has been deprecated, so move to the recommended
replacement.
This commit is contained in:
Florian Müllner 2014-08-06 15:16:39 +02:00
parent c15a885418
commit eb69f3aa76

View File

@ -72,7 +72,7 @@ const NetworkSecretDialog = new Lang.Class({
expand: true }); expand: true });
} }
let layout = new Clutter.TableLayout(); let layout = new Clutter.GridLayout({ orientation: Clutter.Orientation.VERTICAL });
let secretTable = new St.Widget({ style_class: 'network-dialog-secret-table', let secretTable = new St.Widget({ style_class: 'network-dialog-secret-table',
layout_manager: layout }); layout_manager: layout });
layout.hookup_style(secretTable); layout.hookup_style(secretTable);
@ -83,14 +83,17 @@ const NetworkSecretDialog = new Lang.Class({
for (let i = 0; i < this._content.secrets.length; i++) { for (let i = 0; i < this._content.secrets.length; i++) {
let secret = this._content.secrets[i]; let secret = this._content.secrets[i];
let label = new St.Label({ style_class: 'prompt-dialog-password-label', let label = new St.Label({ style_class: 'prompt-dialog-password-label',
text: secret.label }); text: secret.label,
x_align: Clutter.ActorAlign.START,
y_align: Clutter.ActorAlign.CENTER });
label.clutter_text.ellipsize = Pango.EllipsizeMode.NONE; label.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
let reactive = secret.key != null; let reactive = secret.key != null;
secret.entry = new St.Entry({ style_class: 'prompt-dialog-password-entry', secret.entry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
text: secret.value, can_focus: reactive, text: secret.value, can_focus: reactive,
reactive: reactive }); reactive: reactive,
x_expand: true });
ShellEntry.addContextMenu(secret.entry, ShellEntry.addContextMenu(secret.entry,
{ isPassword: secret.password }); { isPassword: secret.password });
@ -118,14 +121,12 @@ const NetworkSecretDialog = new Lang.Class({
secret.valid = true; secret.valid = true;
if (rtl) { if (rtl) {
layout.pack(secret.entry, 0, pos); layout.attach(secret.entry, 0, pos, 1, 1);
layout.pack(label, 1, pos); layout.attach(label, 1, pos, 1, 1);
} else { } else {
layout.pack(label, 0, pos); layout.attach(label, 0, pos, 1, 1);
layout.pack(secret.entry, 1, pos); layout.attach(secret.entry, 1, pos, 1, 1);
} }
layout.child_set(label, { x_expand: false, y_fill: false,
x_align: Clutter.TableAlignment.START });
pos++; pos++;
if (secret.password) if (secret.password)