Merge lp:~michael-sheldon/ubuntu-keyboard/custom-opacity into lp:ubuntu-keyboard

Proposed by Michael Sheldon
Status: Merged
Approved by: Michael Sheldon
Approved revision: 528
Merged at revision: 528
Proposed branch: lp:~michael-sheldon/ubuntu-keyboard/custom-opacity
Merge into: lp:ubuntu-keyboard
Diff against target: 166 lines (+39/-2)
7 files modified
data/schemas/com.canonical.keyboard.maliit.gschema.xml (+6/-0)
qml/Keyboard.qml (+3/-2)
src/plugin/inputmethod.cpp (+7/-0)
src/plugin/inputmethod.h (+3/-0)
src/plugin/inputmethod_p.h (+6/-0)
src/plugin/keyboardsettings.cpp (+12/-0)
src/plugin/keyboardsettings.h (+2/-0)
To merge this branch: bzr merge lp:~michael-sheldon/ubuntu-keyboard/custom-opacity
Reviewer Review Type Date Requested Status
Jonas G. Drange (community) Approve
system-apps-ci-bot continuous-integration Approve
Review via email: mp+312960@code.launchpad.net

Commit message

Add custom opacity setting

Description of the change

Add custom opacity setting

To post a comment you must log in.
Revision history for this message
system-apps-ci-bot (system-apps-ci-bot) wrote :

PASSED: Continuous integration, rev:528
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-keyboard-ci/47/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build/2171
    SUCCESS: https://jenkins.canonical.com/system-apps/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=default/561
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-0-fetch/2174
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2002
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2002/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2002
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2002/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=zesty/2002
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=amd64,release=zesty/2002/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2002
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2002/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2002
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2002/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=zesty/2002
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=armhf,release=zesty/2002/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/2002
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=vivid+overlay/2002/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/2002
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=xenial+overlay/2002/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=zesty/2002
        deb: https://jenkins.canonical.com/system-apps/job/build-2-binpkg/arch=i386,release=zesty/2002/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/system-apps/job/lp-ubuntu-keyboard-ci/47/rebuild

review: Approve (continuous-integration)
Revision history for this message
Jonas G. Drange (jonas-drange) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/schemas/com.canonical.keyboard.maliit.gschema.xml'
2--- data/schemas/com.canonical.keyboard.maliit.gschema.xml 2015-04-24 15:20:08 +0000
3+++ data/schemas/com.canonical.keyboard.maliit.gschema.xml 2016-12-10 01:18:10 +0000
4@@ -76,5 +76,11 @@
5 <description>A list of locations to search for keyboard layout plugins in addition to the keyboard data directory.</description>
6 <default>['/custom/share/maliit/plugins/com/ubuntu/lib/']</default>
7 </key>
8+ <key name="opacity" type="d">
9+ <summary>Opacity</summary>
10+ <description>Specifies how much transparency to apply to the keyboard</description>
11+ <range min="0.5" max="1.0"/>
12+ <default>1.0</default>
13+ </key>
14 </schema>
15 </schemalist>
16
17=== modified file 'qml/Keyboard.qml'
18--- qml/Keyboard.qml 2016-08-02 12:05:45 +0000
19+++ qml/Keyboard.qml 2016-12-10 01:18:10 +0000
20@@ -84,6 +84,8 @@
21 onWidthChanged: fullScreenItem.reportKeyboardVisibleRect();
22 onHeightChanged: fullScreenItem.reportKeyboardVisibleRect();
23
24+ opacity: maliit_input_method.opacity
25+
26 MouseArea {
27 id: swipeArea
28
29@@ -168,9 +170,8 @@
30 color: UI.backgroundColor
31 }
32
33- Rectangle {
34+ Item {
35 id: borderTop
36- color: UI.backgroundColor
37 width: parent.width
38 anchors.top: parent.top.bottom
39 height: wordRibbon.visible ? 0 : units.gu(UI.top_margin)
40
41=== modified file 'src/plugin/inputmethod.cpp'
42--- src/plugin/inputmethod.cpp 2016-10-12 12:43:45 +0000
43+++ src/plugin/inputmethod.cpp 2016-12-10 01:18:10 +0000
44@@ -126,6 +126,7 @@
45 d->registerDoubleSpaceFullStop();
46 d->registerStayHidden();
47 d->registerPluginPaths();
48+ d->registerOpacity();
49
50 //fire signal so all listeners know what active language is
51 Q_EMIT activeLanguageChanged(d->activeLanguage);
52@@ -658,6 +659,12 @@
53 return d->editor.text()->cursorPosition();
54 }
55
56+double InputMethod::opacity() const
57+{
58+ Q_D(const InputMethod);
59+ return d->m_settings.opacity();
60+}
61+
62 void InputMethod::replacePreedit(const QString &preedit)
63 {
64 Q_D(InputMethod);
65
66=== modified file 'src/plugin/inputmethod.h'
67--- src/plugin/inputmethod.h 2015-08-15 06:10:39 +0000
68+++ src/plugin/inputmethod.h 2016-12-10 01:18:10 +0000
69@@ -61,6 +61,7 @@
70 Q_PROPERTY(QString currentPluginPath READ currentPluginPath NOTIFY currentPluginPathChanged)
71 Q_PROPERTY(QString preedit READ preedit WRITE replacePreedit NOTIFY preeditChanged)
72 Q_PROPERTY(int cursorPosition READ cursorPosition WRITE setCursorPosition NOTIFY cursorPositionChanged)
73+ Q_PROPERTY(double opacity READ opacity NOTIFY opacityChanged)
74
75 Q_ENUMS(TextContentType)
76
77@@ -132,6 +133,7 @@
78 void replacePreedit(const QString &preedit);
79 int cursorPosition() const;
80 void setCursorPosition(const int pos);
81+ double opacity() const;
82
83 QObject* actionKeyOverride() const;
84
85@@ -163,6 +165,7 @@
86 void languagePluginChanged(QString pluginPath, QString languageId);
87 void preeditChanged(QString preedit);
88 void cursorPositionChanged(int cursor_position);
89+ void opacityChanged(double opacity);
90
91 private:
92 Q_SLOT void onAutoCorrectSettingChanged();
93
94=== modified file 'src/plugin/inputmethod_p.h'
95--- src/plugin/inputmethod_p.h 2016-10-12 12:42:51 +0000
96+++ src/plugin/inputmethod_p.h 2016-12-10 01:18:10 +0000
97@@ -325,6 +325,12 @@
98 q, SLOT(onPluginPathsChanged(QStringList)));
99 }
100
101+ void registerOpacity()
102+ {
103+ QObject::connect(&m_settings, SIGNAL(opacityChanged(double)),
104+ q, SIGNAL(opacityChanged(double)));
105+ }
106+
107 void closeOskWindow()
108 {
109 if (!view->isVisible())
110
111=== modified file 'src/plugin/keyboardsettings.cpp'
112--- src/plugin/keyboardsettings.cpp 2016-04-05 12:13:11 +0000
113+++ src/plugin/keyboardsettings.cpp 2016-12-10 01:18:10 +0000
114@@ -48,6 +48,7 @@
115 const QLatin1String STAY_HIDDEN_KEY = QLatin1String("stayHidden");
116 const QLatin1String DISABLE_HEIGHT_KEY = QLatin1String("disableHeight");
117 const QLatin1String PLUGIN_PATHS_KEY = QLatin1String("pluginPaths");
118+const QLatin1String OPACITY_KEY = QLatin1String("opacity");
119
120 /*!
121 * \brief KeyboardSettings::KeyboardSettings class to load the settings, and
122@@ -217,6 +218,15 @@
123 }
124
125 /*!
126+ * \brief KeyboardSettings::opacity returns the transparency value for the
127+ * keyboard between 0 and 1
128+ */
129+double KeyboardSettings::opacity() const
130+{
131+ return m_settings->get(OPACITY_KEY).toDouble();
132+}
133+
134+/*!
135 * \brief KeyboardSettings::settingUpdated slot to handle changes in the settings backend
136 * A specialized signal is emitted for the affected setting
137 * \param key
138@@ -264,6 +274,8 @@
139 return;
140 } else if (key == PLUGIN_PATHS_KEY) {
141 Q_EMIT pluginPathsChanged(pluginPaths());
142+ } else if (key == OPACITY_KEY) {
143+ Q_EMIT opacityChanged(opacity());
144 }
145
146 qWarning() << Q_FUNC_INFO << "unknown settings key:" << key;
147
148=== modified file 'src/plugin/keyboardsettings.h'
149--- src/plugin/keyboardsettings.h 2015-04-24 14:51:53 +0000
150+++ src/plugin/keyboardsettings.h 2016-12-10 01:18:10 +0000
151@@ -59,6 +59,7 @@
152 bool stayHidden() const;
153 bool disableHeight() const;
154 QStringList pluginPaths() const;
155+ double opacity() const;
156
157 Q_SIGNALS:
158 void activeLanguageChanged(QString);
159@@ -75,6 +76,7 @@
160 void stayHiddenChanged(bool);
161 void disableHeightChanged(bool);
162 void pluginPathsChanged(QStringList);
163+ void opacityChanged(double);
164
165 private:
166 Q_SLOT void settingUpdated(const QString &key);

Subscribers

People subscribed via source and target branches