← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

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

 

Evan McIntire has proposed merging lp:~mcintire-evan/ubuntu-terminal-app/window-font-size into lp:ubuntu-terminal-app.

Commit message:
Window size scales with font size

Requested reviews:
  Ubuntu Terminal Developers (ubuntu-terminal-dev)

For more details, see:
https://code.launchpad.net/~mcintire-evan/ubuntu-terminal-app/window-font-size/+merge/285285

Window size scales with font size
-- 
Your team Ubuntu Terminal Developers is requested to review the proposed merge of lp:~mcintire-evan/ubuntu-terminal-app/window-font-size into lp:ubuntu-terminal-app.
=== modified file 'src/app/main.cpp'
--- src/app/main.cpp	2016-01-25 12:37:14 +0000
+++ src/app/main.cpp	2016-02-13 21:25:20 +0000
@@ -53,7 +53,7 @@
 {
     QApplication a(argc, argv);
     QQuickView view;
-    view.setResizeMode(QQuickView::SizeRootObjectToView);
+    view.setResizeMode(QQuickView::SizeViewToRootObject);
 
     FileIO fileIO;
     view.engine()->rootContext()->setContextProperty("fileIO", &fileIO);

=== modified file 'src/app/qml/TerminalComponent.qml'
--- src/app/qml/TerminalComponent.qml	2016-02-06 16:31:36 +0000
+++ src/app/qml/TerminalComponent.qml	2016-02-13 21:25:20 +0000
@@ -12,7 +12,7 @@
 
         colorScheme: settings.colorScheme
         font.family: settings.fontStyle
-        font.pixelSize: FontUtils.sizeToPixels("medium") * settings.fontSize / 10
+        font.pixelSize: settings.fontPixelSize()
 
         signal sessionFinished(var session);
 

=== modified file 'src/app/qml/TerminalSettings.qml'
--- src/app/qml/TerminalSettings.qml	2016-02-06 18:09:05 +0000
+++ src/app/qml/TerminalSettings.qml	2016-02-13 21:25:20 +0000
@@ -34,6 +34,10 @@
         jsonVisibleProfiles = JSON.stringify(result);
     }
 
+    function fontPixelSize() {
+        return FontUtils.sizeToPixels("medium") * settings.fontSize / 10;
+    }
+
     Settings {
         id: innerSettings
         property int fontSize: defaultFontSize

=== 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()
+    height: 24 * settings.fontPixelSize()
 
     AuthenticationService {
         onDenied: Qt.quit();


Follow ups