Skip to content
This repository has been archived by the owner on Sep 1, 2021. It is now read-only.

Commit

Permalink
Merge pull request #117 from kugiigi/xenial_-_oskthemes
Browse files Browse the repository at this point in the history
Added on-screen keyboard theme settings
  • Loading branch information
mariogrip committed Dec 29, 2018
2 parents d6e9a69 + 349e035 commit 7f37ca8
Show file tree
Hide file tree
Showing 6 changed files with 2,324 additions and 2,213 deletions.
6 changes: 6 additions & 0 deletions debian/changelog
@@ -1,3 +1,9 @@
ubuntu-system-settings (0.4.3~0ubports0) xenial; urgency=medium

* Add settings for on-screen keyboard themes

-- Kugi Eusebio <kugiigi@users.noreply.github.com> Tue, 18 Dec 2018 11:58:28 -0600

ubuntu-system-settings (0.4.2~0ubports3) xenial; urgency=medium

* Replace dependency on ubuntu-wallpapers with ubports-wallpapers
Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Expand Up @@ -24,7 +24,7 @@ override_dh_auto_configure:
dh_auto_configure -- -DCMAKE_INSTALL_LOCALSTATEDIR="/var"

override_dh_auto_build:
dh_auto_build
dh_auto_build --parallel
$(MAKE) -j$(nproc) -C obj-$(DEB_HOST_GNU_TYPE) pot

override_dh_auto_clean:
Expand Down
1 change: 1 addition & 0 deletions plugins/language/CMakeLists.txt
Expand Up @@ -11,6 +11,7 @@ set(QML_SOURCES
RebootNecessary.qml
SpellChecking.qml
SubsetView.qml
ThemeValues.qml
)


Expand Down
35 changes: 29 additions & 6 deletions plugins/language/PageComponent.qml
Expand Up @@ -24,6 +24,7 @@ import GSettings 1.0
import SystemSettings 1.0
import Ubuntu.Components 1.3
import Ubuntu.Components.Popups 1.3
import SystemSettings.ListItems 1.0 as SettingsListItems
import Ubuntu.Components.ListItems 1.3 as ListItem
import Ubuntu.Settings.Menus 0.1 as Menus
import Ubuntu.SystemSettings.LanguagePlugin 1.0
Expand Down Expand Up @@ -157,10 +158,9 @@ ItemPage {
}
}

ListItem.SingleValue {
SettingsListItems.SingleValueProgression {
text: externalKeyboardPresent ? i18n.tr("On-screen keyboard") :
i18n.tr("Keyboard layouts")
progression: true
value: oskPlugin.keyboardLayoutsModel.subset.length == 1 ?
oskPlugin.keyboardLayoutsModel.superset[oskPlugin.keyboardLayoutsModel.subset[0]][0] :
oskPlugin.keyboardLayoutsModel.subset.length
Expand All @@ -169,24 +169,47 @@ ItemPage {
})
}

ListItem.Standard {
SettingsListItems.SingleValueProgression {
text: i18n.tr("External keyboard")
progression: true
showDivider: false
onClicked: pageStack.addPageToNextColumn(root, Qt.resolvedUrl("PageHardwareKeyboard.qml"))
visible: externalKeyboardPresent || showAllUI
}

ListItem.Divider {}

SettingsListItems.SingleValueProgression {
objectName: "oskTheme"

readonly property variant model: [{name: i18n.tr("Ambiance"), value: "Ambiance"}
,{name: i18n.tr("Suru Dark"), value: "SuruDark"}
,{name: i18n.tr("Suru Black"), value: "SuruBlack"}
,{name: i18n.tr("Just White"), value: "JustWhite"}
,{name: i18n.tr("Just Black"), value: "JustBlack"}
,{name: i18n.tr("Just Grey"), value: "JustGrey"}
,{name: i18n.tr("Bordered White"), value: "BorderedWhite"}
,{name: i18n.tr("Bordered Black"), value: "BorderedBlack"}
,{name: i18n.tr("Bordered Grey"), value: "BorderedGrey"}
]

text: externalKeyboardPresent ? i18n.tr("On-screen keyboard theme") :
i18n.tr("Keyboard theme")
value: model.find(function(data){return data.value === settings.theme}).name
onClicked:
pageStack.addPageToNextColumn(root,
Qt.resolvedUrl("ThemeValues.qml"),
{ title: text, themeModel: model } )
}

ListItem.Divider {}

ListItem.SingleValue {
SettingsListItems.SingleValueProgression {
visible: showAllUI

text: i18n.tr("Spell checking")
value: plugin.spellCheckingModel.subset.length == 1 ?
plugin.spellCheckingModel.superset[plugin.spellCheckingModel.subset[0]][0] :
plugin.spellCheckingModel.subset.length
progression: true

onClicked: pageStack.addPageToNextColumn(root, spellChecking)
}
Expand Down
75 changes: 75 additions & 0 deletions plugins/language/ThemeValues.qml
@@ -0,0 +1,75 @@
/*
* This file is part of system-settings
*
* Copyright (C) 2018 Kugi Eusebio
*
* Contact: Kugi Eusebio <kugi_igi@yahoo.com>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranties of
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import GSettings 1.0
import QtQuick 2.4
import Ubuntu.Components 1.3
import Ubuntu.Components.ListItems 1.3 as ListItem
import SystemSettings 1.0
import Ubuntu.SystemSettings.LanguagePlugin 1.0

ItemPage {
id: root
objectName: "themeValues"
flickable: scrollWidget

property variant themeModel

GSettings {
id: settings

schema.id: "com.canonical.keyboard.maliit"

onChanged: {
var curIndex = themeModel.findIndex(function(data){return data.value === value})
if( curIndex != -1)
themeSelector.selectedIndex = curIndex
}
Component.onCompleted: {
themeSelector.selectedIndex = themeModel.findIndex(function(data){return data.value === settings.theme})
}
}

Flickable {
id: scrollWidget
anchors.fill: parent
contentHeight: contentItem.childrenRect.height
boundsBehavior: (contentHeight > root.height) ? Flickable.DragAndOvershootBounds : Flickable.StopAtBounds

Column {
anchors.left: parent.left
anchors.right: parent.right

ListItem.ItemSelector {
id: themeSelector
objectName: "themeSelector"
delegate: OptionSelectorDelegate {
text: modelData.name
}
model: themeModel
expanded: true
onDelegateClicked: {
settings.theme = themeModel[index].value
highlightWhenPressed: false
}
}
}
}
}

0 comments on commit 7f37ca8

Please sign in to comment.