Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rely on QQC2 styles instead of internal themes #108

Merged
merged 19 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
0f4c988
qml: Fix border color and size on keyboard and popups to not use theme
dobey Mar 8, 2022
9de522f
qml: Use Page component for the Keyboard surface
dobey Mar 9, 2022
a8cdc96
qml: Use invisible TextField to get colors for selection mode
dobey Mar 9, 2022
9c84285
qml: Fix WordRibbon to follow qqc2 style
dobey Mar 9, 2022
17f16d4
qml: Fix ActionsToolbar to follow qqc2 style
dobey Mar 9, 2022
4a746fe
qml: Fix FloatingActionKey to follow qqc2 style for Button
dobey Mar 9, 2022
e8394f3
qml: Fix keys to have no borders and follow qqc2 style
dobey Mar 9, 2022
e6395eb
qml: Use an invisible ToolTip to get qqc2 style colors for Magnifier
dobey Mar 9, 2022
3f0d076
qml: Use invisible components to get colors for ExtendedKeySelector
dobey Mar 9, 2022
d7678ba
plugins: Fix Japanese layout to use qqc2 style colors too
dobey Mar 9, 2022
c20cbe9
Remove the now unused KeyIcon component and image provider code
dobey Mar 9, 2022
f864877
Remove internal themes support
dobey Mar 9, 2022
ceb8597
qml: Use correct icon fallbacks in state changes in CharKey
dobey Mar 11, 2022
b4dc2a2
qml: Move top border rectangle for Keyboard to optimal place
dobey Mar 11, 2022
e7a8da3
qml: Disable hover on buttons to avoid sticky highlights on touch
dobey Mar 11, 2022
4d2c575
ja: Fix size of label and icon on some keys
dobey Mar 11, 2022
4299e8c
plugin: Set icon theme to suru for Suru style, and breeze otherwise
dobey Mar 11, 2022
f419b20
qml: Add a neutral background for SpaceKey
dobey Mar 14, 2022
0b4f924
qml: Make annotations on CharKey appear larger to be more visible
dobey Jun 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
}
}