[polari] chatView: Update indent on DPI changes
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] chatView: Update indent on DPI changes
- Date: Tue, 2 Feb 2016 21:16:17 +0000 (UTC)
commit a6edea98efc642468bc5201f822a96552ca145e1
Author: Florian Müllner <fmuellner gnome org>
Date: Tue Feb 2 01:52:24 2016 +0100
chatView: Update indent on DPI changes
Part of the indent is based on the average width of characters, which
depends on the resolution Pango uses to render text. The user can
influence that indirectly through the 'text-scaling-factor' setting,
so make sure we pick up changes correctly to keep chat log and entry
aligned as intended.
src/chatView.js | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index 09d5377..a0c36f7 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -422,6 +422,11 @@ const ChatView = new Lang.Class({
Lang.bind(this, this._handleButtonTagsHover));
this._view.connect('leave-notify-event',
Lang.bind(this, this._handleButtonTagsHover));
+ /* pick up DPI changes (e.g. via the 'text-scaling-factor' setting):
+ the default handler calls pango_cairo_context_set_resolution(), so
+ update the indent after that */
+ this._view.connect_after('style-updated',
+ Lang.bind(this, this._updateIndent));
},
_onDestroy: function() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]