[gnome-shell] dialog: Check whether text changed when setting title or description
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] dialog: Check whether text changed when setting title or description
- Date: Mon, 29 Jun 2020 10:25:42 +0000 (UTC)
commit e4bb2037ca16a7f6fff06f1e28fd633f5bb0048f
Author: Jonas Dreßler <verdre v0yd nl>
Date: Sun Jun 28 13:06:26 2020 +0200
dialog: Check whether text changed when setting title or description
As usually with GObject setters, we should check whether the property
actually changed before setting the value and notifying the property. So
check whether the title or description text actually changed before
setting it.
This fixes a bug which makes the title flicker and change its size,
because when updating the title we remove the "leightweight" css class
and reapply it inside a later, which makes the title appear larger for
one frame.
Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2574
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1336
js/ui/dialog.js | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/js/ui/dialog.js b/js/ui/dialog.js
index dacdf3d399..8e9fb50908 100644
--- a/js/ui/dialog.js
+++ b/js/ui/dialog.js
@@ -228,6 +228,9 @@ var MessageDialogContent = GObject.registerClass({
}
set title(title) {
+ if (this._title.text === title)
+ return;
+
_setLabel(this._title, title);
this._title.remove_style_class_name('leightweight');
@@ -237,6 +240,9 @@ var MessageDialogContent = GObject.registerClass({
}
set description(description) {
+ if (this._description.text === description)
+ return;
+
_setLabel(this._description, description);
this.notify('description');
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]