Merge lp:~kill-animals/ubuntu-terminal-app/1349749workaround-select-font-added-to-preferences into lp:ubuntu-terminal-app

Proposed by Kill Animals
Status: Merged
Approved by: Alan Pope 🍺🐧🐱 🦄
Approved revision: 155
Merged at revision: 167
Proposed branch: lp:~kill-animals/ubuntu-terminal-app/1349749workaround-select-font-added-to-preferences
Merge into: lp:ubuntu-terminal-app
Diff against target: 296 lines (+81/-37)
4 files modified
po/com.ubuntu.terminal.pot (+22/-18)
src/app/qml/Configs.qml (+35/-6)
src/app/qml/Terminal.qml (+15/-13)
src/app/qml/config/JsConfig.qml (+9/-0)
To merge this branch: bzr merge lp:~kill-animals/ubuntu-terminal-app/1349749workaround-select-font-added-to-preferences
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Filippo Scognamiglio Approve
David Planella Needs Fixing
Review via email: mp+235621@code.launchpad.net

Commit message

    Configs.qml - Added a drop down list where you can choose from 5 fonts. I chose the fonts based on what I understand will be included in the default image. These will need to be tested though.

    Terminal.qml - I actually unwittingly fixed a bug here, as Ubuntu Mono was not being initially registered. The changes i made were making sure the onConfigChanged registered new fonts, and that the font family being used is being grabbed from the database, which I added an entry.

    JsConfig.qml - I added a DB entry for the fontStyle.

    TerminalDisplay.cpp - I copied the setVTFont function, and added a version where you can feed it parameters for setting a QFont, which needs a string and an integer.

    TerminalDisplay.h - Popey smells of elderberries, and Micheal Hall is a hamster.

Description of the change

    Configs.qml - Added a drop down list where you can choose from 5 fonts. I chose the fonts based on what I understand will be included in the default image. These will need to be tested though.

    Terminal.qml - I actually unwittingly fixed a bug here, as Ubuntu Mono was not being initially registered. The changes i made were making sure the onConfigChanged registered new fonts, and that the font family being used is being grabbed from the database, which I added an entry.

    JsConfig.qml - I added a DB entry for the fontStyle.

    TerminalDisplay.cpp - I copied the setVTFont function, and added a version where you can feed it parameters for setting a QFont, which needs a string and an integer.

    TerminalDisplay.h - Popey smells of elderberries, and Micheal Hall is a hamster.

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
151. By Kill Animals

Removed a Debug Message.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
David Planella (dpm) wrote :

Quick question: in the Ubuntu philosophy of making opionionated decisions
and having a default that works rather than overwhelming users with
multiple settings, would it not make sense to just set the font to Ubuntu
mono?

Cheers,
David.

On Tue, Sep 23, 2014 at 3:26 PM, Ubuntu Phone Apps Jenkins Bot <
<email address hidden>> wrote:

> Review: Approve continuous-integration
>
> PASSED: Continuous integration, rev:151
> http://91.189.93.70:8080/job/ubuntu-terminal-app-ci/104/
> Executed test runs:
> SUCCESS:
> http://91.189.93.70:8080/job/generic-mediumtests-utopic-python3/489
> deb:
> http://91.189.93.70:8080/job/generic-mediumtests-utopic-python3/489/artifact/work/output/*zip*/output.zip
> SUCCESS:
> http://91.189.93.70:8080/job/ubuntu-terminal-app-utopic-amd64-ci/48
>
> Click here to trigger a rebuild:
> http://91.189.93.70:8080/job/ubuntu-terminal-app-ci/104/rebuild
>
> --
>
> https://code.launchpad.net/~akiva/ubuntu-terminal-app/1349749workaround-select-font-added-to-preferences/+merge/235621
> Your team Ubuntu Terminal Developers is requested to review the proposed
> merge of
> lp:~akiva/ubuntu-terminal-app/1349749workaround-select-font-added-to-preferences
> into lp:ubuntu-terminal-app.
>

Revision history for this message
Kill Animals (kill-animals) wrote :

> Quick question: in the Ubuntu philosophy of making opionionated decisions
> and having a default that works rather than overwhelming users with
> multiple settings, would it not make sense to just set the font to Ubuntu
> mono?
>
> Cheers,
> David.
>

The immediate issue unfortunately is that Ubuntu Mono does not exactly *work* at this time, and neither does Monospace for that matter. Thus this work around was created.

For my part though on the question of design; When it comes to a Terminal Emulator, I think leaving features, and flexibility within it will be a driver for attracting super users away from android, and perhaps even IOS, to bask in the glory of a Terminal Emulator with kde-like flexibility. It is something that is perhaps the coolest thing you can demo on an ubuntu-touch right now, with the old terminal functionality, and I look forward to showing it off to my friends.

Otherwise though; if this were not a Terminal, I would be in agreement.

Revision history for this message
Filippo Scognamiglio (flscogna) wrote :

Sorry for the intrusion but I'd like to share my two cents on this merge proposal.

First of all I agree with David that we should not overwhelm the users with settings but I also think that font selection might be worthy (on the desktop they are mandatory on the phone maybe not).

Anyway I really think the implementation might use some work. Before we were using a Q_PROPERTY to set the font. Why are you making setVTFont Q_INVOKABLE and calling it directly instead of using the previous mechanism?

Moreover storing the selected font as an index is not wise when we take into account future updates since we will be forced to add new fonts only at the end of the list. I suggest to store the font.family string in the db and then compute the index.

review: Needs Fixing
Revision history for this message
Kill Animals (kill-animals) wrote :

> Sorry for the intrusion but I'd like to share my two cents on this merge
> proposal.
>
> First of all I agree with David that we should not overwhelm the users with
> settings but I also think that font selection might be worthy (on the desktop
> they are mandatory on the phone maybe not).
>
> Anyway I really think the implementation might use some work. Before we were
> using a Q_PROPERTY to set the font. Why are you making setVTFont Q_INVOKABLE
> and calling it directly instead of using the previous mechanism?
>
> Moreover storing the selected font as an index is not wise when we take into
> account future updates since we will be forced to add new fonts only at the
> end of the list. I suggest to store the font.family string in the db and then
> compute the index.

No no; Intrude !

> First of all I agree with David that we should not overwhelm the users with
> settings but I also think that font selection might be worthy (on the desktop
> they are mandatory on the phone maybe not).

We could put an "Advanced Options" selection at the bottom; what do you think about that?

> Anyway I really think the implementation might use some work. Before we were
> using a Q_PROPERTY to set the font. Why are you making setVTFont Q_INVOKABLE
> and calling it directly instead of using the previous mechanism?

Uhm, I copied the mechanism that was being used for setting the font size, which was done by someone else. Q_INVOKABLE (Although I initially researched it, and wondered why it was not being utilized for this) is not used for the font. I do not know why, but needless to say; it is not in my merge at all. Could you please clarify your comments? Perhaps point to the code you are speaking of?

> Moreover storing the selected font as an index is not wise when we take into
> account future updates since we will be forced to add new fonts only at the
> end of the list. I suggest to store the font.family string in the db and then
> compute the index.

Oh I see what you mean. I do not think that actually will cause anything to break though. The font is not being read as an index; the font is being read as a string. The font is being written as an index, and that write is only triggered on an index change.

ergo

The user will have to physically select the font to something else.
When he physically selects the font, the index will be corrected at that point, updating to the current list.
After the index is changed, the model[index] returns the font selected to the database.
This triggers the configChanged
The configChanged triggers a read to the database, which returns the appropriate string.

Revision history for this message
Filippo Scognamiglio (flscogna) wrote :

Sorry for the previous fast comment, but I wanted to write that before launch! :D

> We could put an "Advanced Options" selection at the bottom; what do you think about that?

Yeah, that might be the sweet spot; Anyway might be interesting to have the opinion of a UX expert (I'm definitely not).

>Uhm, I copied the mechanism that was being used for setting the font size, which was done by >someone else. Q_INVOKABLE (Although I initially researched it, and wondered why it was not being >utilized for this) is not used for the font. I do not know why, but needless to say; it is not in >my merge at all. Could you please clarify your comments? Perhaps point to the code you are >speaking of?

Q_INVOKABLE are functions that can be called from the QtQuick side. In this case you are directly calling setVTFont(const QString& s, int n) from QML:

Terminal.qml:236 font.family: kterm.setVTFont(jsConf.getFontStyle(), kterm.font.pointSize);

What you are doing it is calling the invokable function setVTFont(font, size), grab the return type (void) and assign that to the property font.family. That might even work but it is extremely convoluted.
The solution I propose is to get rid of the overloaded setVTFont(font, size) and using property assignments as you are doing here.

Terminal.qml:88 kterm.font.pointSize = jsConf.getFontSize();
Terminal.qml:89 kterm.colorScheme = jsConf.getColorScheme();
Terminal.qml:90 kterm.font.family = jsConf.getFontStyle();

The property will then trigger the setVTFont(font) function, preserving the plugin interface.
I really hope that's clear enough (I still have issues explaining non trivial concepts in english).

>Oh I see what you mean. I do not think that actually will cause anything to break though. The >font is not being read as an index; the font is being read as a string. The font is being >written as an index, and that write is only triggered on an index change.

Forget that, I'm an idiot. You was suggesting you to do exactly what you did! Sorry :)

I just noticed the changes to TerminalDisply.h... Awesome! :D

Revision history for this message
Kill Animals (kill-animals) wrote :

> you are doing it is calling the invokable function

This is what I don't get though, and trust me; I WAS CONFUSED
There is no Q_INVOKABLE for setVTFont's class.
It's invoked... SOMEHOW! but for the life of me I could not figure out where or how it was done.

The Q_INVOKABLE macro only appears in two places:
http://i.imgur.com/QAVVlDo.jpg

Also (I Think)
font.family: kterm.setVTFont(jsConf.getFontStyle(), kterm.font.pointSize);
Is initiated in the constructor; changing it on the fly if I recall, does not work; you require some signal handles which are in the configs scope.

To everything else; sounds fine though.

T

Revision history for this message
Filippo Scognamiglio (flscogna) wrote :

>There is no Q_INVOKABLE for setVTFont's class.

I believe that it works anyway because setVTFont is declared as a public
slot and not a public method. (some reminiscences in by brain).

>Also (I Think)
>font.family: kterm.setVTFont(jsConf.
>getFontStyle(), kterm.font.pointSize);
>Is initiated in the constructor; changing it on the fly if I recall, does
not work; you require some signal handles which are in the configs scope.

That's true but as a side effect. Writing "font.family: kterm.setVTFont()",
is read as: set to font.family what is returned by the function
kterm.setVTFont().
This is not what happens. The function kterm.setVTFont() doesn't return
anything but sets the font itself. If you want to call it this way the
proper place to put it is in Component.onCompleted.

What's wrong with "font.family: jsConf.getFontStyle()" ?

2014-09-24 14:50 GMT+02:00 Akiva <email address hidden>:

> > you are doing it is calling the invokable function
>
> This is what I don't get though, and trust me; I WAS CONFUSED
> There is no Q_INVOKABLE for setVTFont's class.
> It's invoked... SOMEHOW! but for the life of me I could not figure out
> where or how it was done.
>
> The Q_INVOKABLE macro only appears in two places:
> http://i.imgur.com/QAVVlDo.jpg
>
> Also (I Think)
> font.family: kterm.setVTFont(jsConf.getFontStyle(), kterm.font.pointSize);
> Is initiated in the constructor; changing it on the fly if I recall, does
> not work; you require some signal handles which are in the configs scope.
>
> To everything else; sounds fine though.
>
>
> T
> --
>
> https://code.launchpad.net/~akiva/ubuntu-terminal-app/1349749workaround-select-font-added-to-preferences/+merge/235621
> You are reviewing the proposed merge of
> lp:~akiva/ubuntu-terminal-app/1349749workaround-select-font-added-to-preferences
> into lp:ubuntu-terminal-app.
>

Revision history for this message
Kill Animals (kill-animals) wrote :

> I believe that it works anyway because setVTFont is declared as a public
slot and not a public method. (some reminiscences in by brain).

Good golly! I wish someone told me it was that easy... Bloody macros uglying up my code

> That's true but as a side effect. Writing "font.family: kterm.setVTFont()",
is read as: set to font.family what is returned by the function
kterm.setVTFont().

Oh yah thats true; I am not setting a property; I am sending a signal. Good point; I'll move it on over to onCompleted.

> What's wrong with "font.family: jsConf.getFontStyle()" ?

Doesn't work ; its the same as "font.family: "Ubuntu Mono"" which also was not working...

Revision history for this message
Kill Animals (kill-animals) wrote :

So you made me question myself, and so I downloaded the branch, took out the font.family and removed

                        font.family: kterm.setVTFont(jsConf.getFontStyle(), kterm.font.pointSize);
                        font.pointSize: jsConf.getFontSize() //units.gu(1.5)

To no consequence that I could see. Everything still worked fine; even after starting and stopping the app. Perhaps this is only important if you have nothing to start with. I don't know how to test this though.

Perhaps though these should just be removed if they arent doing anything.

Revision history for this message
Filippo Scognamiglio (flscogna) wrote :

Sorry for the late response.

> Perhaps though these should just be removed if they arent doing anything.

Agreed, since those are set only on construction we should simply put everything in Component.onComplete (where they should work in theory).

We still need to remove the overloaded setVTFont(font, size) since I think that's unnecessary code duplicatoin and might be replaced by something like that in Component.onCompleted:

Component.onCompleted: {
    kterm.font.pointSize: jsConf.getFontSize()
    kterm.font.family: jsConf.getFontStyle()
    //Something else
}

>Doesn't work ; its the same as "font.family: "Ubuntu Mono"" which also was not working...

This is surely a problem with how we are initializing the plugin. It is something that might be worth checking in the future, but if we can force them from Component.onCompleted the pedantic me would be happy enough :)

Revision history for this message
Kill Animals (kill-animals) wrote :

> Agreed, since those are set only on construction we should simply put everything in Component.onComplete (where they should work in theory).

Sounds good.

> We still need to remove the overloaded setVTFont(font, size) since I think that's unnecessary code duplicatoin and might be replaced by something like that in Component.onCompleted:

Component.onCompleted: {
    kterm.font.pointSize: jsConf.getFontSize()
    kterm.font.family: jsConf.getFontStyle()
    //Something else
}

I'll have to look at it. Remember; I overloaded the function on purpose because I needed a way to set the font on the fly, and to set the font, I need QFont, which requires size and family parameters. Component.onCompleted afaik will only set it initially on startup. Not when I go into settings and adjust it.
Either way, if I can eliminate the overload, i'll do it.

> This is surely a problem with how we are initializing the plugin. It is something that might be worth checking in the future, but if we can force them from Component.onCompleted the pedantic me would be happy enough :)

Yah I guess it does need to be fixed. Was font.xxxx defined in this program? If that is the case, then I can't imagine it being too difficult. Either way; worst case scenario leaves us with this small patch.

In the spirit of keeping merges small, can we patch the "Advanced Options" in a future patch?

Revision history for this message
Kill Animals (kill-animals) wrote :

@flippo

Okay so... good catch. I am seriously embarrassed; I did not realize that I overloaded the function for something that I was doing earlier, but took out.

Jeepers :P

Okay updating the code.

152. By Kill Animals

Took out overloaded function setVtFont(string, int) -- was mistakenly left in. Thanks for pointing that out.

Took out property settings, and had them defined only on completion of the kterm component.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
David Planella (dpm) wrote :

Before going further into a more detailed review, a few style nitpicks:

review: Needs Fixing
Revision history for this message
Filippo Scognamiglio (flscogna) wrote :

Very good work Akiva. Now the pedantic me is really happy! :)

153. By Kill Animals

Fixed Style via David Planella's suggestions.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Filippo Scognamiglio (flscogna) wrote :

Wow, you also fixed some styling issues I introduced. Thank you Akiva!

review: Approve
Revision history for this message
Kill Animals (kill-animals) wrote :

Good to hear it. You can thank David for the styling though; hes pretty good with that in my experience.

154. By Kill Animals

Merged with Trunk; Tested on Emulator; Took out Dejavu Sans Mono because I believe it was actually just reverting to monospace.

155. By Kill Animals

took out translations for the select font, because I do not think that the filename, which depends on the string, will change on other computers.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'po/com.ubuntu.terminal.pot'
2--- po/com.ubuntu.terminal.pot 2014-10-06 12:22:53 +0000
3+++ po/com.ubuntu.terminal.pot 2014-10-07 11:18:20 +0000
4@@ -8,7 +8,7 @@
5 msgstr ""
6 "Project-Id-Version: \n"
7 "Report-Msgid-Bugs-To: \n"
8-"POT-Creation-Date: 2014-09-26 08:27-0700\n"
9+"POT-Creation-Date: 2014-10-07 04:16-0700\n"
10 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13@@ -52,38 +52,42 @@
14 msgstr ""
15
16 #: ../src/app/qml/Configs.qml:69
17-msgid "Color scheme"
18-msgstr ""
19-
20-#: ../src/app/qml/Configs.qml:85
21-msgid "Font size"
22-msgstr ""
23-
24-#: ../src/app/qml/Configs.qml:108
25-msgid "Enable effects:"
26-msgstr ""
27-
28-#: ../src/app/qml/Configs.qml:126
29+msgid "Color Scheme:"
30+msgstr ""
31+
32+#: ../src/app/qml/Configs.qml:81
33+msgid "Select Font:"
34+msgstr ""
35+
36+#: ../src/app/qml/Configs.qml:113
37+msgid "Font Size:"
38+msgstr ""
39+
40+#: ../src/app/qml/Configs.qml:136
41+msgid "Enable Effects:"
42+msgstr ""
43+
44+#: ../src/app/qml/Configs.qml:155
45 msgid "Screen color"
46 msgstr ""
47
48-#: ../src/app/qml/Configs.qml:139
49+#: ../src/app/qml/Configs.qml:168
50 msgid "Color intensity"
51 msgstr ""
52
53-#: ../src/app/qml/Configs.qml:167
54+#: ../src/app/qml/Configs.qml:196
55 msgid "Bloom"
56 msgstr ""
57
58-#: ../src/app/qml/Configs.qml:195
59+#: ../src/app/qml/Configs.qml:224
60 msgid "Curvature"
61 msgstr ""
62
63-#: ../src/app/qml/Configs.qml:223
64+#: ../src/app/qml/Configs.qml:252
65 msgid "Noise"
66 msgstr ""
67
68-#: ../src/app/qml/Configs.qml:251
69+#: ../src/app/qml/Configs.qml:280
70 msgid "Jitter"
71 msgstr ""
72
73
74=== modified file 'src/app/qml/Configs.qml'
75--- src/app/qml/Configs.qml 2014-10-06 12:22:53 +0000
76+++ src/app/qml/Configs.qml 2014-10-07 11:18:20 +0000
77@@ -5,8 +5,8 @@
78
79 Item {
80 id: mparent
81- JsConfig{id: jsConf }
82- ColorDialog{
83+ JsConfig {id: jsConf }
84+ ColorDialog {
85 id: colorDialog
86 selectedColor: jsConf.getScreenColor();
87 onSelectedColorChanged: {
88@@ -66,7 +66,7 @@
89 }
90 }
91
92- text: i18n.tr("Color scheme") + ":"
93+ text: i18n.tr("Color Scheme:")
94 onSelectedIndexChanged: {
95 if(colorSchemeLoaded) {
96 var val = model[selectedIndex];
97@@ -76,16 +76,44 @@
98 }
99 }
100
101+ ListItem.ItemSelector {
102+ id: selectFont
103+ text: i18n.tr("Select Font:")
104+ width: parent.width
105+ function getIndex() {
106+ var i = 0;
107+ while (jsConf.getFontStyle() !== model[i]) {
108+ i += 1;
109+ if (i > model.length) {
110+ return 0
111+ }
112+ }
113+ return i
114+ }
115+
116+ selectedIndex: getIndex()
117+ model: [
118+ "Droid Sans Mono",
119+ "Liberation Mono",
120+ "Monospace",
121+ "Ubuntu Mono"
122+ ]
123+ onSelectedIndexChanged: {
124+ jsConf.setFontStyle(model[selectedIndex]);
125+ configChanged(true);
126+ }
127+ }
128+
129 Label {
130 anchors {
131 left: parent.left
132 leftMargin: units.gu(2)
133 }
134
135- text: i18n.tr("Font size") + ":"
136+ text: i18n.tr("Font Size:")
137 }
138
139- Slider{
140+ Slider {
141 id: slFont
142 objectName: "slFont"
143 anchors {
144@@ -105,7 +133,7 @@
145 ListItem.ThinDivider { }
146
147 ListItem.Standard {
148- text: i18n.tr("Enable effects:")
149+ text: i18n.tr("Enable Effects:")
150 control: Switch {
151 id: effectsEnableSwitch
152 onCheckedChanged: {
153@@ -113,6 +141,7 @@
154 }
155 }
156 }
157+
158 Column {
159 id: effectsColumn
160 width: parent.width
161
162=== modified file 'src/app/qml/Terminal.qml'
163--- src/app/qml/Terminal.qml 2014-09-20 10:54:37 +0000
164+++ src/app/qml/Terminal.qml 2014-10-07 11:18:20 +0000
165@@ -8,7 +8,7 @@
166 id: mparent
167 anchors.fill: parent
168
169- function hideFocus(){
170+ function hideFocus() {
171 kterm.focus = false;
172 }
173
174@@ -22,8 +22,8 @@
175
176 //property int headerHeight: units.gu(10);
177
178- function showExtraPanel(i){
179- switch (i){
180+ function showExtraPanel(i) {
181+ switch (i) {
182 case 1:
183 kbCtrl.visible = true;
184 kbFn.visible = false;
185@@ -87,6 +87,7 @@
186 onConfigChanged: {
187 kterm.font.pointSize = jsConf.getFontSize();
188 kterm.colorScheme = jsConf.getColorScheme();
189+ kterm.font.family = jsConf.getFontStyle();
190 }
191 }
192
193@@ -95,7 +96,7 @@
194 onActiveChanged: hideFocus();
195 }
196
197- JsConfig{id: jsConf }
198+ JsConfig {id: jsConf }
199
200
201 Column {
202@@ -121,7 +122,7 @@
203 objectName: "kbCtrl"
204 visible: false
205 width: parent.width
206- anchors{
207+ anchors {
208 left: parent.left
209 leftMargin: units.gu(3)
210 }
211@@ -137,7 +138,7 @@
212 objectName: "kbFn"
213 visible: false
214 width: parent.width
215- anchors{
216+ anchors {
217 left: parent.left
218 leftMargin: units.gu(0.5)
219 }
220@@ -154,7 +155,7 @@
221 objectName: "kbScrl"
222 visible: false
223 width: parent.width
224- anchors{
225+ anchors {
226 left: parent.left
227 leftMargin: units.gu(1)
228 }
229@@ -220,7 +221,7 @@
230 }
231 }
232
233- Item{
234+ Item {
235 id: ktermContainer
236 anchors.fill: parent
237
238@@ -232,10 +233,7 @@
239 /// FONT SIZE = 24 (FINE FOR GNEXUS)
240 /// FONT SIZE = 12 (FINE FOR DESKTOP)
241 //////////////////////////////////////
242- font.family: "Ubuntu Mono"
243- font.pointSize: jsConf.getFontSize() //units.gu(1.5)
244
245- colorScheme: jsConf.getColorScheme() //"DarkPastels"
246 width: parent.width
247 height: Qt.inputMethod.visible ? parent.height - Qt.inputMethod.keyboardRectangle.height : parent.height
248
249@@ -250,13 +248,17 @@
250 }
251
252 Component.onCompleted: {
253+ kterm.font.pointSize = jsConf.getFontSize();
254+ kterm.colorScheme = jsConf.getColorScheme();
255+ kterm.font.family = jsConf.getFontStyle();
256+
257 // Change directory to $HOME
258 ksession.sendText("cd $HOME;clear;\n");
259 }
260 }
261 }
262
263- Loader{
264+ Loader {
265 id: graphicalTerminal
266 z: 1.1
267 active: true
268@@ -267,7 +269,7 @@
269 updateGraphicalParams();
270 }
271
272- function updateGraphicalParams(){
273+ function updateGraphicalParams() {
274 active = jsConf.getEffectsEnabled();
275 item.bloom = jsConf.getBloom();
276 item.noise_strength = jsConf.getNoiseStrenght() * 0.8;
277
278=== modified file 'src/app/qml/config/JsConfig.qml'
279--- src/app/qml/config/JsConfig.qml 2014-09-20 10:54:37 +0000
280+++ src/app/qml/config/JsConfig.qml 2014-10-07 11:18:20 +0000
281@@ -33,6 +33,15 @@
282 setSetting("fontSize", Math.round(size).toString() );
283 }
284
285+ //FontStyle
286+ function getFontStyle(){
287+ return getSetting("fontStyle", "Ubuntu Mono")
288+ }
289+
290+ function setFontStyle(style){
291+ setSetting("fontStyle", style)
292+ }
293+
294 //Effects global switch
295 function getEffectsEnabled(){
296 return getSetting("effectsEnabled", "true") === "true";

Subscribers

People subscribed via source and target branches