From bd8c7f84ddc27bf7051caa33b58bf8cd2d9d397a Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 24 Aug 2022 17:55:46 +0200 Subject: [PATCH] touch_keyboard: tweaks for PinePhone display This change increases the quota to allow the use of bigger fonts, and tweaks the style such that the keyboard gets a decent appearance on the PinePhone's 1440x720 display. --- repos/gems/recipes/pkg/touch_keyboard/runtime | 6 +- .../touch_keyboard_layout.config | 56 +++++++++---------- repos/gems/src/app/touch_keyboard/main.cc | 2 +- .../touch_keyboard/touch_keyboard_dialog.cc | 2 + .../touch_keyboard/touch_keyboard_dialog.h | 3 + 5 files changed, 37 insertions(+), 32 deletions(-) diff --git a/repos/gems/recipes/pkg/touch_keyboard/runtime b/repos/gems/recipes/pkg/touch_keyboard/runtime index 7a69ab255f..2754ebc584 100644 --- a/repos/gems/recipes/pkg/touch_keyboard/runtime +++ b/repos/gems/recipes/pkg/touch_keyboard/runtime @@ -1,4 +1,4 @@ - + @@ -20,9 +20,9 @@ - + - + diff --git a/repos/gems/recipes/raw/touch_keyboard/touch_keyboard_layout.config b/repos/gems/recipes/raw/touch_keyboard/touch_keyboard_layout.config index 2f57b2404f..88ef66657c 100644 --- a/repos/gems/recipes/raw/touch_keyboard/touch_keyboard_layout.config +++ b/repos/gems/recipes/raw/touch_keyboard/touch_keyboard_layout.config @@ -2,7 +2,7 @@ - + @@ -13,7 +13,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -41,8 +41,8 @@ - - + + @@ -50,26 +50,26 @@ - - + + - + - + - - - + + + - + @@ -80,7 +80,7 @@ - + @@ -95,7 +95,7 @@ - + @@ -108,8 +108,8 @@ - - + + @@ -117,26 +117,26 @@ - - + + - + - + - - - + + + - + @@ -147,7 +147,7 @@ - + @@ -196,12 +196,12 @@ - + - + diff --git a/repos/gems/src/app/touch_keyboard/main.cc b/repos/gems/src/app/touch_keyboard/main.cc index c5b3719f32..32a02bbffc 100644 --- a/repos/gems/src/app/touch_keyboard/main.cc +++ b/repos/gems/src/app/touch_keyboard/main.cc @@ -49,7 +49,7 @@ struct Touch_keyboard::Main : Sandbox::Local_service_base::Wakeup, Registry _children { }; Child_state _menu_view_child_state { _children, "menu_view", - Ram_quota { 4*1024*1024 }, + Ram_quota { 10*1024*1024 }, Cap_quota { 200 } }; /** * Sandbox::State_handler diff --git a/repos/gems/src/app/touch_keyboard/touch_keyboard_dialog.cc b/repos/gems/src/app/touch_keyboard/touch_keyboard_dialog.cc index 47d70011ff..0940dddc47 100644 --- a/repos/gems/src/app/touch_keyboard/touch_keyboard_dialog.cc +++ b/repos/gems/src/app/touch_keyboard/touch_keyboard_dialog.cc @@ -48,6 +48,8 @@ void Dialog::produce_xml(Xml_generator &xml) xml.node("label", [&] () { xml.attribute("name", "label"); xml.attribute("text", key.label); + if (key.small) + xml.attribute("font", "annotation/regular"); }); }); }); diff --git a/repos/gems/src/app/touch_keyboard/touch_keyboard_dialog.h b/repos/gems/src/app/touch_keyboard/touch_keyboard_dialog.h index 73398c27af..c19abcbea9 100644 --- a/repos/gems/src/app/touch_keyboard/touch_keyboard_dialog.h +++ b/repos/gems/src/app/touch_keyboard/touch_keyboard_dialog.h @@ -68,6 +68,8 @@ struct Touch_keyboard::Dialog : private Dynamic_rom_session::Xml_producer unsigned min_ex = 0; + bool small = false; + Key(Id id) : _id(id) { } bool matches(Xml_node const &node) const { return _id == id_attr(node); } @@ -80,6 +82,7 @@ struct Touch_keyboard::Dialog : private Dynamic_rom_session::Xml_producer emit = { }; map = key.attribute_value("map", Map()); min_ex = key.attribute_value("min_ex", 0U); + small = key.attribute_value("small", false); if (key.has_attribute("char")) { label = key.attribute_value("char", Label());