[polari] ui: Fix default dialog button style
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] ui: Fix default dialog button style
- Date: Wed, 20 Aug 2014 10:17:59 +0000 (UTC)
commit 6bcca6c792838e1906a1ed4b878cbc753f142dda
Author: Florian Müllner <fmuellner gnome org>
Date: Mon Jul 28 12:14:24 2014 +0200
ui: Fix default dialog button style
GTK+ now manages the suggested-action style class automatically,
data/resources/join-room-dialog.ui | 3 ---
data/resources/message-user-dialog.ui | 3 ---
src/joinDialog.js | 15 +++++++++------
src/messageDialog.js | 2 ++
4 files changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/data/resources/join-room-dialog.ui b/data/resources/join-room-dialog.ui
index 7f75981..9e73856 100644
--- a/data/resources/join-room-dialog.ui
+++ b/data/resources/join-room-dialog.ui
@@ -57,9 +57,6 @@
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
- <style>
- <class name="suggested-action"/>
- </style>
</object>
<packing>
<property name="pack-type">end</property>
diff --git a/data/resources/message-user-dialog.ui b/data/resources/message-user-dialog.ui
index af27390..f592a4b 100644
--- a/data/resources/message-user-dialog.ui
+++ b/data/resources/message-user-dialog.ui
@@ -41,9 +41,6 @@
<property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
- <style>
- <class name="suggested-action"/>
- </style>
</object>
<packing>
<property name="pack-type">end</property>
diff --git a/src/joinDialog.js b/src/joinDialog.js
index 1a1265f..c0480ef 100644
--- a/src/joinDialog.js
+++ b/src/joinDialog.js
@@ -176,13 +176,18 @@ const JoinDialog = new Lang.Class({
},
_updateCanConfirm: function() {
+ let sensitive;
+
if (this._page == DialogPage.MAIN) {
- let sensitive = this._connectionCombo.get_active() > -1 &&
- this._nameEntry.get_text_length() > 0;
- this._confirmButton.sensitive = sensitive;
+ sensitive = this._connectionCombo.get_active() > -1 &&
+ this._nameEntry.get_text_length() > 0;
} else {
- this._confirmButton.sensitive = this._details.canConfirm;
+ sensitive = this._details.canConfirm;
}
+
+ this._confirmButton.sensitive = sensitive;
+ this.widget.set_default_response(sensitive ? Gtk.ResponseType.OK
+ : Gtk.ResponseType.NONE);
},
get _page() {
@@ -198,8 +203,6 @@ const JoinDialog = new Lang.Class({
if (isMain)
this._details.reset();
- this._confirmButton.grab_default();
-
this._backButton.visible = !isMain;
this._cancelButton.visible = isMain;
this._titlebar.title = isMain ? _("Join Chat Room")
diff --git a/src/messageDialog.js b/src/messageDialog.js
index 117679a..9c67df8 100644
--- a/src/messageDialog.js
+++ b/src/messageDialog.js
@@ -167,5 +167,7 @@ const MessageDialog = new Lang.Class({
let sensitive = this._connectionCombo.get_active() > -1 &&
this._nameEntry.get_text_length() > 0;
this._messageButton.sensitive = sensitive;
+ this.widget.set_default_response(sensitive ? Gtk.ResponseType.OK
+ : Gtk.ResponseType.NONE);
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]