Skip to content

Commit

Permalink
Merge pull request #108 from dobey/drop-themes
Browse files Browse the repository at this point in the history
Rely on QQC2 styles instead of internal themes
  • Loading branch information
dobey committed Jun 29, 2022
2 parents 6baeedc + 0b4f924 commit fa554a6
Show file tree
Hide file tree
Showing 40 changed files with 232 additions and 1,039 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
echo "deb [trusted=yes] http://archive.neon.kde.org/unstable focal main" >> /etc/apt/sources.list.d/neon.list
apt-get update
apt-get dist-upgrade --purge -y
apt-get -y install build-essential cmake doxygen gettext libanthy-dev libchewing3-dev libhunspell-dev libpinyin13-dev libpresage-dev maliit-framework-dev pkg-config qtbase5-dev qtdeclarative5-dev qtfeedback5-dev qtmultimedia5-dev presage
apt-get -y install build-essential cmake doxygen gettext libanthy-dev libchewing3-dev libhunspell-dev libpinyin13-dev libpresage-dev maliit-framework-dev pkg-config qtbase5-dev qtdeclarative5-dev qtfeedback5-dev qtmultimedia5-dev qtquickcontrols2-5-dev presage
- name: Build
run: |
Expand Down
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ find_package(GIO REQUIRED)

find_package(Qt5DBus)

find_package(Qt5QuickControls2 REQUIRED)
find_package(Qt5Multimedia)
find_package(Qt5Feedback)
find_package(Intl REQUIRED)
Expand Down Expand Up @@ -158,19 +159,18 @@ set(MALIIT_KEYBOARD_COMMON_SOURCES
src/plugin/gettext.h
src/plugin/updatenotifier.cpp
src/plugin/updatenotifier.h
src/plugin/iconprovider.cpp
src/plugin/iconprovider.h
src/plugin/inputmethod.cpp
src/plugin/inputmethod.h
src/plugin/inputmethod_p.h
src/plugin/keyboardgeometry.cpp
src/plugin/keyboardgeometry.h
src/plugin/keyboardsettings.cpp
src/plugin/keyboardsettings.h
src/plugin/theme.cpp src/plugin/theme.h src/plugin/device.cpp src/plugin/device.h)
src/plugin/device.cpp
src/plugin/device.h)

add_library(maliit-keyboard-common STATIC ${MALIIT_KEYBOARD_COMMON_SOURCES})
target_link_libraries(maliit-keyboard-common Qt5::DBus Maliit::Plugins maliit-keyboard-lib maliit-keyboard-view gsettings-qt Qt5::Multimedia ${Intl_LIBRARIES})
target_link_libraries(maliit-keyboard-common Qt5::DBus Qt5::QuickControls2 Maliit::Plugins maliit-keyboard-lib maliit-keyboard-view gsettings-qt Qt5::Multimedia ${Intl_LIBRARIES})
if (Qt5Feedback_FOUND)
target_link_libraries(maliit-keyboard-common Qt5::Feedback)
target_compile_definitions(maliit-keyboard-common PUBLIC HAVE_QT5_FEEDBACK)
Expand Down Expand Up @@ -403,8 +403,6 @@ install(DIRECTORY qml/keys qml/languages
install(FILES qml/ActionsToolbar.qml qml/FloatingActions.qml qml/Keyboard.qml qml/KeyboardContainer.qml qml/WordRibbon.qml
DESTINATION ${MALIIT_KEYBOARD_QML_DIR})

install(DIRECTORY data/themes
DESTINATION ${MALIIT_KEYBOARD_DATA_DIR})
install(DIRECTORY data/devices
DESTINATION ${MALIIT_KEYBOARD_DATA_DIR})
install(FILES data/schemas/org.maliit.keyboard.maliit.gschema.xml
Expand Down
17 changes: 0 additions & 17 deletions data/themes/Ambiance.json

This file was deleted.

17 changes: 0 additions & 17 deletions data/themes/BorderedBlack.json

This file was deleted.

17 changes: 0 additions & 17 deletions data/themes/BorderedGrey.json

This file was deleted.

17 changes: 0 additions & 17 deletions data/themes/BorderedWhite.json

This file was deleted.

17 changes: 0 additions & 17 deletions data/themes/Breeze.json

This file was deleted.

17 changes: 0 additions & 17 deletions data/themes/BreezeDark.json

This file was deleted.

15 changes: 0 additions & 15 deletions data/themes/JustBlack.json

This file was deleted.

15 changes: 0 additions & 15 deletions data/themes/JustGrey.json

This file was deleted.

15 changes: 0 additions & 15 deletions data/themes/JustWhite.json

This file was deleted.

17 changes: 0 additions & 17 deletions data/themes/SuruBlack.json

This file was deleted.

17 changes: 0 additions & 17 deletions data/themes/SuruDark.json

This file was deleted.

2 changes: 0 additions & 2 deletions plugins/ja/qml/keys/CommitKey.qml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ ActionKey {
enabled: actionKeyOverride ? actionKeyOverride.enabled : true
// overrideIcon has high priority over label
label: overrideIconName == "" ? overrideLabel : ""
// Scale the font so the label fits if a long word is set
fontSize: Device.symbolShiftKeyFontSize * (4 / (label.length >= 4 ? (label.length <= 6 ? label.length : 6) : 4));
shifted: label

iconNormal: (overrideIconName == "") && (overrideLabel == "") ? "keyboard-enter-symoblic" : overrideIconName
Expand Down
24 changes: 6 additions & 18 deletions plugins/ja/qml/keys/FlickCharKey.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

import QtQuick 2.4
import QtQuick.Controls 2.12

import MaliitKeyboard 2.0

Expand Down Expand Up @@ -50,10 +51,6 @@ Item {
readonly property double rightOffset: buttonRect.anchors.rightMargin

/* design */
property color normalColor: Theme.charKeyColor
property color pressedColor: Theme.charKeyPressedColor
property bool borderEnabled: Theme.keyBorderEnabled
property color borderColor: borderEnabled ? Theme.charKeyBorderColor : "transparent"
property int fontSize: (fullScreenItem.landscape ? (height / 2) : (height / 2.8));

/// annotation shows a small label in the upper right corner
Expand Down Expand Up @@ -81,47 +78,38 @@ Item {
height: panel.keyHeight
width: parent.width

Rectangle {
ToolButton {
id: buttonRect
color: key.currentlyPressed || key.highlight ? pressedColor : normalColor
anchors.fill: parent
anchors.leftMargin: key.leftSide ? (parent.width - panel.keyWidth) + key.keyMargin : key.keyMargin
anchors.rightMargin: key.rightSide ? (parent.width - panel.keyWidth) + key.keyMargin : key.keyMargin
anchors.bottomMargin: key.rowMargin
radius: (4)
border {
width: borderEnabled ? 8 * (0.1) : 0
color: borderColor
}

/// label of the key
// the label is also the value subitted to the app

Column {
spacing: Device.gu(0.3)
anchors.centerIn: parent

Text {
Label {
id: keyLabel
text: label
anchors.horizontalCenter: parent.horizontalCenter
font.family: Theme.fontFamily
font.pixelSize: fontSize
font.pixelSize: key.fontSize
font.weight: Font.Light
color: Theme.fontColor
textFormat: Text.StyledText
}

Text {
Label {
id: annotationLabel
text: annotation

anchors.horizontalCenter: parent.horizontalCenter
anchors.bottomMargin: Device.gu(0.3)

font.family: Theme.annotationFontFamily
font.pixelSize: Device.annotationFontSize
font.weight: Font.Light
color: Theme.annotationFontColor
visible: annotation != ""
}
}
Expand Down
10 changes: 5 additions & 5 deletions plugins/ja/qml/keys/FlickPop.qml
Original file line number Diff line number Diff line change
Expand Up @@ -36,34 +36,34 @@ Item {
labelChar: chars[0]
anchors.centerIn: parent
labelOpacity: index == 0 ? 1.0 : 0.6
labelColor: index == 0 ? Theme.selectionColor : Theme.fontColor
selected: index == 0
}
FlickPopKey {
labelChar: chars[1] ? chars[1] : ""
anchors.verticalCenter: center.verticalCenter
anchors.right: center.left
labelOpacity: index == 1 ? 1.0 : 0.6
labelColor: index == 1 ? Theme.selectionColor : Theme.fontColor
selected: index == 1
}
FlickPopKey {
labelChar: chars[2] ? chars[2] : ""
anchors.horizontalCenter: center.horizontalCenter
anchors.bottom: center.top
labelOpacity: index == 2 ? 1.0 : 0.6
labelColor: index == 2 ? Theme.selectionColor : Theme.fontColor
selected: index == 2
}
FlickPopKey {
labelChar: chars[3] ? chars[3] : ""
anchors.verticalCenter: center.verticalCenter
anchors.left: center.right
labelOpacity: index == 3 ? 1.0 : 0.6
labelColor: index == 3 ? Theme.selectionColor : Theme.fontColor
selected: index == 3
}
FlickPopKey {
labelChar: chars[4] ? chars[4] : ""
anchors.horizontalCenter: center.horizontalCenter
anchors.top: center.bottom
labelOpacity: index == 4 ? 1.0 : 0.6
labelColor: index == 4 ? Theme.selectionColor : Theme.fontColor
selected: index == 4
}
}

0 comments on commit fa554a6

Please sign in to comment.