[polari] mainWindow: Only use fixed-size-sidebar hack for natural size
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] mainWindow: Only use fixed-size-sidebar hack for natural size
- Date: Wed, 24 Feb 2016 12:49:12 +0000 (UTC)
commit 0c2e1375324b99bfa29aaf8f3c55c468dee70211
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Feb 24 13:22:25 2016 +0100
mainWindow: Only use fixed-size-sidebar hack for natural size
Reporting a fixed minimum size apparently confuses GTK+ in some
cases - luckily we don't actually need it, as GtkWidget already
allows to override it via set_size_request(), so use that and
limit the hack to restricting the maximum size.
https://bugzilla.gnome.org/show_bug.cgi?id=762590
src/mainWindow.js | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 5e1b557..e6eb44b 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -58,6 +58,7 @@ const FixedSizeFrame = new Lang.Class({
return;
this._height = height;
this.notify('height');
+ this.set_size_request(this._width, this._height);
this._queueRedraw();
},
@@ -71,21 +72,18 @@ const FixedSizeFrame = new Lang.Class({
this._width = width;
this.notify('width');
+ this.set_size_request(this._width, this._height);
this._queueRedraw();
},
vfunc_get_preferred_width_for_height: function(forHeight) {
- if (this._width < 0)
- return this.parent(forHeight);
- else
- return [this._width, this._width];
+ let [min, nat] = this.parent(forHeight);
+ return [min, this._width < 0 ? nat : this._width];
},
vfunc_get_preferred_height_for_width: function(forWidth) {
- if (this._height < 0)
- return this.parent(forWidth);
- else
- return [this._height, this._height];
+ let [min, nat] = this.parent(forWidth);
+ return [min, this._height < 0 ? nat : this._height];
}
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]