[polari] roomStack: Only consider mapped widgets for entry-area-height
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] roomStack: Only consider mapped widgets for entry-area-height
- Date: Fri, 3 Sep 2021 19:02:15 +0000 (UTC)
commit d36654b569b89c619a34070483b747f4fb22a326
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Sep 3 20:54:22 2021 +0200
roomStack: Only consider mapped widgets for entry-area-height
Size groups no longer force an allocation on unmapped widgets, so
those will report a size of 0 (which is obviously not what we want).
Part-of: <https://gitlab.gnome.org/GNOME/polari/-/merge_requests/229>
src/roomStack.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/roomStack.js b/src/roomStack.js
index 43eebdba..5c150bc1 100644
--- a/src/roomStack.js
+++ b/src/roomStack.js
@@ -63,8 +63,10 @@ export default GObject.registerClass({
vfunc_size_allocate(allocation) {
super.vfunc_size_allocate(allocation);
- const [firstEntry] = this._sizeGroup.get_widgets();
- const entryHeight = firstEntry.get_allocated_height() - 1;
+ const [firstEntry] =
+ this._sizeGroup.get_widgets().filter(w => w.get_mapped());
+ const entryHeight = firstEntry
+ ? firstEntry.get_allocated_height() - 1 : 0;
if (this._entryAreaHeight !== entryHeight) {
this._entryAreaHeight = entryHeight;
this.notify('entry-area-height');
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]