← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

Re: [Merge] lp:~mcintire-evan/ubuntu-terminal-app/window-font-size into lp:ubuntu-terminal-app

 

And here we go! I've found the reason of such strange behaviour!

Diff comments:

> 
> === modified file 'src/app/qml/ubuntu-terminal-app.qml'
> --- src/app/qml/ubuntu-terminal-app.qml	2016-02-07 18:24:56 +0000
> +++ src/app/qml/ubuntu-terminal-app.qml	2016-02-13 21:25:20 +0000
> @@ -12,8 +12,8 @@
>      applicationName: "com.ubuntu.terminal"
>      automaticOrientation: true
>  
> -    width: units.gu(90)
> -    height: units.gu(55)
> +    width: 40 * settings.fontPixelSize()

1) It's well hidden in the thousands of lines, but at the end I've found the responsible one...

See for example:
http://bazaar.launchpad.net/~ubuntu-terminal-dev/ubuntu-terminal-app/reboot/view/head:/src/plugin/qmltermwidget/lib/TerminalDisplay.cpp#L2947

The terminal widget seems to reserve 2px for margins. The value is hardcoded and cannot be set from QML.
That's a good news, since we can write something like:

<code>
   // 2px is the size of the margins of the terminal canvas.
   // Hardcoded value from TerminalDisplay.h
   width = terminal.fontMetrics.width * 80 + 2
   height = terminal.fontMetrics.height * 24 + 2
</code>

2) Yeah, 'fontMetrics' returned by the terminal is a QSize, since it's a custom implementation. I forgot to mention it because it was a bit late in Italy and I was about to fall asleep :P

> +    height: 24 * settings.fontPixelSize()
>  
>      AuthenticationService {
>          onDenied: Qt.quit();


-- 
https://code.launchpad.net/~mcintire-evan/ubuntu-terminal-app/window-font-size/+merge/285285
Your team Ubuntu Terminal Developers is subscribed to branch lp:ubuntu-terminal-app.


References