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
=== modified file 'po/com.ubuntu.terminal.pot'
--- po/com.ubuntu.terminal.pot 2014-10-06 12:22:53 +0000
+++ po/com.ubuntu.terminal.pot 2014-10-07 11:18:20 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: \n"9"Project-Id-Version: \n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2014-09-26 08:27-0700\n"11"POT-Creation-Date: 2014-10-07 04:16-0700\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -52,38 +52,42 @@
52msgstr ""52msgstr ""
5353
54#: ../src/app/qml/Configs.qml:6954#: ../src/app/qml/Configs.qml:69
55msgid "Color scheme"55msgid "Color Scheme:"
56msgstr ""56msgstr ""
5757
58#: ../src/app/qml/Configs.qml:8558#: ../src/app/qml/Configs.qml:81
59msgid "Font size"59msgid "Select Font:"
60msgstr ""60msgstr ""
6161
62#: ../src/app/qml/Configs.qml:10862#: ../src/app/qml/Configs.qml:113
63msgid "Enable effects:"63msgid "Font Size:"
64msgstr ""64msgstr ""
6565
66#: ../src/app/qml/Configs.qml:12666#: ../src/app/qml/Configs.qml:136
67msgid "Enable Effects:"
68msgstr ""
69
70#: ../src/app/qml/Configs.qml:155
67msgid "Screen color"71msgid "Screen color"
68msgstr ""72msgstr ""
6973
70#: ../src/app/qml/Configs.qml:13974#: ../src/app/qml/Configs.qml:168
71msgid "Color intensity"75msgid "Color intensity"
72msgstr ""76msgstr ""
7377
74#: ../src/app/qml/Configs.qml:16778#: ../src/app/qml/Configs.qml:196
75msgid "Bloom"79msgid "Bloom"
76msgstr ""80msgstr ""
7781
78#: ../src/app/qml/Configs.qml:19582#: ../src/app/qml/Configs.qml:224
79msgid "Curvature"83msgid "Curvature"
80msgstr ""84msgstr ""
8185
82#: ../src/app/qml/Configs.qml:22386#: ../src/app/qml/Configs.qml:252
83msgid "Noise"87msgid "Noise"
84msgstr ""88msgstr ""
8589
86#: ../src/app/qml/Configs.qml:25190#: ../src/app/qml/Configs.qml:280
87msgid "Jitter"91msgid "Jitter"
88msgstr ""92msgstr ""
8993
9094
=== modified file 'src/app/qml/Configs.qml'
--- src/app/qml/Configs.qml 2014-10-06 12:22:53 +0000
+++ src/app/qml/Configs.qml 2014-10-07 11:18:20 +0000
@@ -5,8 +5,8 @@
55
6Item {6Item {
7 id: mparent7 id: mparent
8 JsConfig{id: jsConf }8 JsConfig {id: jsConf }
9 ColorDialog{9 ColorDialog {
10 id: colorDialog10 id: colorDialog
11 selectedColor: jsConf.getScreenColor();11 selectedColor: jsConf.getScreenColor();
12 onSelectedColorChanged: {12 onSelectedColorChanged: {
@@ -66,7 +66,7 @@
66 }66 }
67 }67 }
6868
69 text: i18n.tr("Color scheme") + ":"69 text: i18n.tr("Color Scheme:")
70 onSelectedIndexChanged: {70 onSelectedIndexChanged: {
71 if(colorSchemeLoaded) {71 if(colorSchemeLoaded) {
72 var val = model[selectedIndex];72 var val = model[selectedIndex];
@@ -76,16 +76,44 @@
76 }76 }
77 }77 }
7878
79 ListItem.ItemSelector {
80 id: selectFont
81 text: i18n.tr("Select Font:")
82 width: parent.width
83 function getIndex() {
84 var i = 0;
85 while (jsConf.getFontStyle() !== model[i]) {
86 i += 1;
87 if (i > model.length) {
88 return 0
89 }
90 }
91 return i
92 }
93
94 selectedIndex: getIndex()
95 model: [
96 "Droid Sans Mono",
97 "Liberation Mono",
98 "Monospace",
99 "Ubuntu Mono"
100 ]
101 onSelectedIndexChanged: {
102 jsConf.setFontStyle(model[selectedIndex]);
103 configChanged(true);
104 }
105 }
106
79 Label {107 Label {
80 anchors {108 anchors {
81 left: parent.left109 left: parent.left
82 leftMargin: units.gu(2)110 leftMargin: units.gu(2)
83 }111 }
84112
85 text: i18n.tr("Font size") + ":"113 text: i18n.tr("Font Size:")
86 }114 }
87115
88 Slider{116 Slider {
89 id: slFont117 id: slFont
90 objectName: "slFont"118 objectName: "slFont"
91 anchors {119 anchors {
@@ -105,7 +133,7 @@
105 ListItem.ThinDivider { }133 ListItem.ThinDivider { }
106134
107 ListItem.Standard {135 ListItem.Standard {
108 text: i18n.tr("Enable effects:")136 text: i18n.tr("Enable Effects:")
109 control: Switch {137 control: Switch {
110 id: effectsEnableSwitch138 id: effectsEnableSwitch
111 onCheckedChanged: {139 onCheckedChanged: {
@@ -113,6 +141,7 @@
113 }141 }
114 }142 }
115 }143 }
144
116 Column {145 Column {
117 id: effectsColumn146 id: effectsColumn
118 width: parent.width147 width: parent.width
119148
=== modified file 'src/app/qml/Terminal.qml'
--- src/app/qml/Terminal.qml 2014-09-20 10:54:37 +0000
+++ src/app/qml/Terminal.qml 2014-10-07 11:18:20 +0000
@@ -8,7 +8,7 @@
8 id: mparent8 id: mparent
9 anchors.fill: parent9 anchors.fill: parent
1010
11 function hideFocus(){11 function hideFocus() {
12 kterm.focus = false;12 kterm.focus = false;
13 }13 }
1414
@@ -22,8 +22,8 @@
2222
23 //property int headerHeight: units.gu(10);23 //property int headerHeight: units.gu(10);
2424
25 function showExtraPanel(i){25 function showExtraPanel(i) {
26 switch (i){26 switch (i) {
27 case 1:27 case 1:
28 kbCtrl.visible = true;28 kbCtrl.visible = true;
29 kbFn.visible = false;29 kbFn.visible = false;
@@ -87,6 +87,7 @@
87 onConfigChanged: {87 onConfigChanged: {
88 kterm.font.pointSize = jsConf.getFontSize();88 kterm.font.pointSize = jsConf.getFontSize();
89 kterm.colorScheme = jsConf.getColorScheme();89 kterm.colorScheme = jsConf.getColorScheme();
90 kterm.font.family = jsConf.getFontStyle();
90 }91 }
91 }92 }
9293
@@ -95,7 +96,7 @@
95 onActiveChanged: hideFocus();96 onActiveChanged: hideFocus();
96 }97 }
9798
98 JsConfig{id: jsConf }99 JsConfig {id: jsConf }
99100
100101
101 Column {102 Column {
@@ -121,7 +122,7 @@
121 objectName: "kbCtrl"122 objectName: "kbCtrl"
122 visible: false123 visible: false
123 width: parent.width124 width: parent.width
124 anchors{125 anchors {
125 left: parent.left126 left: parent.left
126 leftMargin: units.gu(3)127 leftMargin: units.gu(3)
127 }128 }
@@ -137,7 +138,7 @@
137 objectName: "kbFn"138 objectName: "kbFn"
138 visible: false139 visible: false
139 width: parent.width140 width: parent.width
140 anchors{141 anchors {
141 left: parent.left142 left: parent.left
142 leftMargin: units.gu(0.5)143 leftMargin: units.gu(0.5)
143 }144 }
@@ -154,7 +155,7 @@
154 objectName: "kbScrl"155 objectName: "kbScrl"
155 visible: false156 visible: false
156 width: parent.width157 width: parent.width
157 anchors{158 anchors {
158 left: parent.left159 left: parent.left
159 leftMargin: units.gu(1)160 leftMargin: units.gu(1)
160 }161 }
@@ -220,7 +221,7 @@
220 }221 }
221 }222 }
222223
223 Item{224 Item {
224 id: ktermContainer225 id: ktermContainer
225 anchors.fill: parent226 anchors.fill: parent
226227
@@ -232,10 +233,7 @@
232 /// FONT SIZE = 24 (FINE FOR GNEXUS)233 /// FONT SIZE = 24 (FINE FOR GNEXUS)
233 /// FONT SIZE = 12 (FINE FOR DESKTOP)234 /// FONT SIZE = 12 (FINE FOR DESKTOP)
234 //////////////////////////////////////235 //////////////////////////////////////
235 font.family: "Ubuntu Mono"
236 font.pointSize: jsConf.getFontSize() //units.gu(1.5)
237236
238 colorScheme: jsConf.getColorScheme() //"DarkPastels"
239 width: parent.width237 width: parent.width
240 height: Qt.inputMethod.visible ? parent.height - Qt.inputMethod.keyboardRectangle.height : parent.height238 height: Qt.inputMethod.visible ? parent.height - Qt.inputMethod.keyboardRectangle.height : parent.height
241239
@@ -250,13 +248,17 @@
250 }248 }
251249
252 Component.onCompleted: {250 Component.onCompleted: {
251 kterm.font.pointSize = jsConf.getFontSize();
252 kterm.colorScheme = jsConf.getColorScheme();
253 kterm.font.family = jsConf.getFontStyle();
254
253 // Change directory to $HOME255 // Change directory to $HOME
254 ksession.sendText("cd $HOME;clear;\n");256 ksession.sendText("cd $HOME;clear;\n");
255 }257 }
256 }258 }
257 }259 }
258260
259 Loader{261 Loader {
260 id: graphicalTerminal262 id: graphicalTerminal
261 z: 1.1263 z: 1.1
262 active: true264 active: true
@@ -267,7 +269,7 @@
267 updateGraphicalParams();269 updateGraphicalParams();
268 }270 }
269271
270 function updateGraphicalParams(){272 function updateGraphicalParams() {
271 active = jsConf.getEffectsEnabled();273 active = jsConf.getEffectsEnabled();
272 item.bloom = jsConf.getBloom();274 item.bloom = jsConf.getBloom();
273 item.noise_strength = jsConf.getNoiseStrenght() * 0.8;275 item.noise_strength = jsConf.getNoiseStrenght() * 0.8;
274276
=== modified file 'src/app/qml/config/JsConfig.qml'
--- src/app/qml/config/JsConfig.qml 2014-09-20 10:54:37 +0000
+++ src/app/qml/config/JsConfig.qml 2014-10-07 11:18:20 +0000
@@ -33,6 +33,15 @@
33 setSetting("fontSize", Math.round(size).toString() );33 setSetting("fontSize", Math.round(size).toString() );
34 }34 }
3535
36 //FontStyle
37 function getFontStyle(){
38 return getSetting("fontStyle", "Ubuntu Mono")
39 }
40
41 function setFontStyle(style){
42 setSetting("fontStyle", style)
43 }
44
36 //Effects global switch45 //Effects global switch
37 function getEffectsEnabled(){46 function getEffectsEnabled(){
38 return getSetting("effectsEnabled", "true") === "true";47 return getSetting("effectsEnabled", "true") === "true";

Subscribers

People subscribed via source and target branches