M image/system_a/data/lang/Deutsch.json => image/system_a/data/lang/Deutsch.json +1 -0
@@ 577,6 577,7 @@
"common_disconnect": "TRENNEN",
"common_edit": "\u00c4NDERN",
"common_emoji": "EMOJI",
+ "common_experimental": "(experimentell)",
"common_february": "Februar",
"common_forget": "VERGESSEN",
"common_fr": "FR",
M image/system_a/data/lang/English.json => image/system_a/data/lang/English.json +1 -0
@@ 579,6 579,7 @@
"common_disconnect": "DISCONNECT",
"common_edit": "EDIT",
"common_emoji": "EMOJI",
+ "common_experimental": "(experimental)",
"common_february": "February",
"common_forget": "FORGET",
"common_fr": "FR",
M image/system_a/data/lang/Espanol.json => image/system_a/data/lang/Espanol.json +1 -0
@@ 577,6 577,7 @@
"common_disconnect": "DESCONECTAR",
"common_edit": "EDITAR",
"common_emoji": "EMOJI",
+ "common_experimental": "(experimental)",
"common_february": "Febrero",
"common_forget": "OLVIDAR",
"common_fr": "V",
M image/system_a/data/lang/Francais.json => image/system_a/data/lang/Francais.json +1 -0
@@ 544,6 544,7 @@
"common_disconnect": "D\u00c9CONNECTER",
"common_edit": "MODIFIER",
"common_emoji": "EMOJI",
+ "common_experimental": "(expérimental)",
"common_february": "F\u00e9vrier",
"common_forget": "OUBLIER",
"common_fr": "VE",
M image/system_a/data/lang/Polski.json => image/system_a/data/lang/Polski.json +1 -0
@@ 571,6 571,7 @@
"common_disconnect": "ROZ\u0141\u0104CZ SI\u0118",
"common_edit": "EDYTUJ",
"common_emoji": "EMOJI",
+ "common_experimental": "(eksperymentalne)",
"common_february": "Luty",
"common_forget": "ZAPOMNIJ",
"common_fr": "PT",
M image/system_a/data/lang/Svenska.json => image/system_a/data/lang/Svenska.json +1 -0
@@ 401,6 401,7 @@
"common_december": "December",
"common_edit": "REDIGERA",
"common_emoji": "EMOJI",
+ "common_experimental": "(experimentell)",
"common_february": "Februari",
"common_fr": "FR",
"common_fri": "Fre",
M module-apps/application-settings/windows/network/NetworkWindow.cpp => module-apps/application-settings/windows/network/NetworkWindow.cpp +16 -6
@@ 46,7 46,7 @@ namespace gui
false));
optionsList.emplace_back(std::make_unique<gui::option::OptionSettings>(
- getVolteLabel(),
+ getVoltePrimaryLabel(),
[this]([[maybe_unused]] gui::Item &item) {
const auto volteState = getVolteStateFromSettingsApp(application);
if (!volteState.permitted) {
@@ 80,7 80,11 @@ namespace gui
return true;
},
nullptr,
- getRightItemSetting()));
+ getRightItemSetting(),
+ false,
+ UTF8(),
+ true,
+ getVolteSecondaryLabel()));
#if DISABLED_SETTINGS_OPTIONS == 1
auto operatorsOn = operatorsSettings->getOperatorsOn();
@@ 124,7 128,7 @@ namespace gui
return optionsList;
}
- auto NetworkWindow::getVolteLabel() -> std::string
+ auto NetworkWindow::getVoltePrimaryLabel() -> std::string
{
const auto &volteState = getVolteStateFromSettingsApp(application);
@@ 136,14 140,20 @@ namespace gui
labelText += ": ";
labelText += utils::translate("app_settings_network_volte_not_available");
}
- else if (volteState.beta) {
- labelText += " <b>" + utils::translate("common_beta") + "</b>";
- }
labelText += "</text>";
return labelText;
}
+ auto NetworkWindow::getVolteSecondaryLabel() -> std::string
+ {
+ const auto &volteState = getVolteStateFromSettingsApp(application);
+ if (volteState.permitted && volteState.beta) {
+ return "<text><b>" + utils::translate("common_experimental") + "</b><text>";
+ }
+ return {};
+ }
+
auto NetworkWindow::getRightItemSetting() -> option::SettingRightItem
{
const auto &volteState = getVolteStateFromSettingsApp(application);
M module-apps/application-settings/windows/network/NetworkWindow.hpp => module-apps/application-settings/windows/network/NetworkWindow.hpp +2 -1
@@ 20,7 20,8 @@ namespace gui
private:
auto buildOptionsList() -> std::list<Option> override;
- auto getVolteLabel() -> std::string;
+ auto getVoltePrimaryLabel() -> std::string;
+ auto getVolteSecondaryLabel() -> std::string;
auto getRightItemSetting() -> option::SettingRightItem;
app::settingsInterface::OperatorsSettings *operatorsSettings = nullptr;
M module-apps/apps-common/options/OptionStyle.hpp => module-apps/apps-common/options/OptionStyle.hpp +2 -1
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2022, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
@@ 48,6 48,7 @@ namespace gui::option
inline constexpr gui::Length option_left_margin = 10;
inline constexpr gui::Length option_right_margin = 10;
inline constexpr gui::Length option_bottom_margin = style::margins::big;
+ inline constexpr gui::Length option_label_spacer = style::margins::small;
inline constexpr uint32_t optionsListTopMargin = 10U;
inline constexpr uint32_t optionsListX = style::window::default_left_margin;
inline constexpr uint32_t optionsListY = style::window::default_vertical_pos + optionsListTopMargin;
M module-apps/apps-common/options/type/OptionSetting.cpp => module-apps/apps-common/options/type/OptionSetting.cpp +52 -15
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include <TextFixedSize.hpp>
@@ 8,15 8,29 @@
namespace gui::option
{
+ OptionSettings::OptionSettings(const UTF8 &primaryText,
+ std::function<bool(Item &)> activatedCallback,
+ std::function<bool(Item &)> focusChangedCallback,
+ gui::AppWindow *app,
+ gui::option::SettingRightItem rightItem,
+ bool indent,
+ const UTF8 &textOnRight,
+ bool isTextOnRightSmall,
+ const UTF8 &secondaryText)
+ : primaryText(primaryText), secondaryText(secondaryText), activatedCallback(std::move(activatedCallback)),
+ focusChangedCallback(std::move(focusChangedCallback)), app(app), rightItem(rightItem), indent(indent),
+ textOnRight(textOnRight), isTextOnRightSmall(isTextOnRightSmall)
+ {}
+
auto OptionSettings::build() const -> ListItem *
{
- auto optionItem = new gui::ListItem();
+ const auto optionItem = new gui::ListItem();
optionItem->setMinimumSize(style::window::default_body_width, style::window::label::big_h);
optionItem->setMargins(Margins(0, 0, 0, window::option_bottom_margin));
optionItem->activatedCallback = activatedCallback;
optionItem->focusChangedCallback = focusChangedCallback;
- auto optionBodyHBox = new HBox(optionItem, 0, 0, 0, 0);
+ const auto optionBodyHBox = new HBox(optionItem, 0, 0, 0, 0);
optionBodyHBox->setAlignment(Alignment(gui::Alignment::Horizontal::Center, gui::Alignment::Vertical::Center));
style::window::decorate(optionBodyHBox);
@@ 26,13 40,32 @@ namespace gui::option
return true;
};
- auto optionText = new TextFixedSize(optionBodyHBox, 0, 0, 0, 0);
- optionText->drawUnderline(false);
- optionText->setAlignment(gui::Alignment::Vertical::Center);
- optionText->setMaximumSize(style::window::default_body_width, style::window::label::big_h);
- optionText->setMargins(Margins(window::option_left_margin, 0, 0, 0));
- optionText->setFont(style::window::font::big);
- optionText->setRichText(text);
+ const auto primaryOptionText = new TextFixedSize(optionBodyHBox, 0, 0, 0, 0);
+ primaryOptionText->drawUnderline(false);
+ primaryOptionText->setAlignment(gui::Alignment::Vertical::Center);
+ primaryOptionText->setMargins(Margins(window::option_left_margin, 0, 0, 0));
+ primaryOptionText->setFont(style::window::font::big);
+ primaryOptionText->setRichText(primaryText);
+
+ if (!secondaryText.empty()) {
+ /* Set primary text box size to use only the space required for text to be shown */
+ primaryOptionText->setMinimumHeightToFitText();
+ primaryOptionText->setMinimumWidthToFitText();
+
+ /* Set secondary text box to take all the remaining space */
+ const auto secondaryOptionText = new TextFixedSize(optionBodyHBox, 0, 0, 0, 0);
+ secondaryOptionText->drawUnderline(false);
+ secondaryOptionText->setAlignment(
+ Alignment(gui::Alignment::Horizontal::Left, gui::Alignment::Vertical::Center));
+ secondaryOptionText->setMaximumSize(style::window::default_body_width, style::window::label::small_h);
+ secondaryOptionText->setMargins(Margins(window::option_label_spacer, 0, 0, 0));
+ secondaryOptionText->setFont(style::window::font::small);
+ secondaryOptionText->setRichText(secondaryText);
+ }
+ else {
+ /* Set primary text box to take all the space */
+ primaryOptionText->setMaximumSize(style::window::default_body_width, style::window::label::big_h);
+ }
std::string imageName;
ButtonTriState *button = nullptr;
@@ 66,10 99,9 @@ namespace gui::option
imageName = "sim2_option_32px_W_G";
break;
case SettingRightItem::Text: {
- auto optionTextRight = new TextFixedSize(optionBodyHBox, 0, 0, 0, 0);
+ const auto optionTextRight = new TextFixedSize(optionBodyHBox, 0, 0, 0, 0);
optionTextRight->drawUnderline(false);
- optionTextRight->setFont((textOnRightIsSmall) ? style::window::font::verysmall
- : style::window::font::medium);
+ optionTextRight->setFont(isTextOnRightSmall ? style::window::font::verysmall : style::window::font::medium);
optionTextRight->setMinimumWidthToFitText(textOnRight);
optionTextRight->setMinimumHeight(style::window::label::big_h);
optionTextRight->setAlignment(
@@ 86,14 118,19 @@ namespace gui::option
new gui::Image(optionBodyHBox, 0, 0, 0, 0, imageName);
}
- if (button) {
+ if (button != nullptr) {
button->setMargins(Margins(0, 0, window::option_right_margin, 0));
}
if (indent) {
- optionText->setMargins(Margins(window::option_left_margin * 2, 0, 0, 0));
+ primaryOptionText->setMargins(Margins(window::option_left_margin * 2, 0, 0, 0));
}
return optionItem;
}
+
+ auto OptionSettings::str() const -> std::string
+ {
+ return primaryText + secondaryText;
+ }
} // namespace gui::option
M module-apps/apps-common/options/type/OptionSetting.hpp => module-apps/apps-common/options/type/OptionSetting.hpp +17 -22
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#pragma once
@@ 10,33 10,28 @@ namespace gui::option
{
class OptionSettings : public option::Base
{
- protected:
- UTF8 text;
- std::function<bool(Item &)> activatedCallback = nullptr;
- std::function<bool(Item &)> focusChangedCallback = nullptr;
- AppWindow *app = nullptr;
- SettingRightItem rightItem = SettingRightItem::Disabled;
- bool indent = false;
- UTF8 textOnRight;
- bool textOnRightIsSmall = true;
-
public:
- OptionSettings(UTF8 text,
+ OptionSettings(const UTF8 &primaryText,
std::function<bool(Item &)> activatedCallback,
std::function<bool(Item &)> focusChangedCallback,
AppWindow *app,
SettingRightItem rightItem = SettingRightItem::Disabled,
bool indent = false,
- UTF8 textOnRight = UTF8(),
- bool textOnRightIsSmall = true)
- : text(std::move(text)), activatedCallback(std::move(activatedCallback)),
- focusChangedCallback(std::move(focusChangedCallback)), app(app), rightItem(rightItem), indent(indent),
- textOnRight(std::move(textOnRight)), textOnRightIsSmall(textOnRightIsSmall)
- {}
+ const UTF8 &textOnRight = UTF8(),
+ bool isTextOnRightSmall = true,
+ const UTF8 &secondaryText = UTF8());
[[nodiscard]] auto build() const -> ListItem * override;
- [[nodiscard]] auto str() const -> std::string override
- {
- return text;
- }
+ [[nodiscard]] auto str() const -> std::string override;
+
+ private:
+ UTF8 primaryText;
+ UTF8 secondaryText;
+ std::function<bool(Item &)> activatedCallback = nullptr;
+ std::function<bool(Item &)> focusChangedCallback = nullptr;
+ AppWindow *app = nullptr;
+ SettingRightItem rightItem = SettingRightItem::Disabled;
+ bool indent = false;
+ UTF8 textOnRight;
+ bool isTextOnRightSmall = true;
};
} // namespace gui::option
M module-apps/apps-common/widgets/ButtonTriState.cpp => module-apps/apps-common/widgets/ButtonTriState.cpp +2 -1
@@ 16,10 16,10 @@ namespace gui
void ButtonTriState::switchState(State requestedState)
{
- setFont(style::window::font::small);
setPenWidth(style::buttonTriState::penWidth);
const auto setRectangleStyle = [this](State state) {
+ setFont(style::window::font::small);
setAlignment(Alignment(gui::Alignment::Horizontal::Center, gui::Alignment::Vertical::Center));
setEdges(RectangleEdge::All);
setCorners(RectangleRoundedCorner::All);
@@ 30,6 30,7 @@ namespace gui
};
const auto setTextOnlyStyle = [this](const std::string &text) {
+ setFont(style::window::font::verysmall);
setAlignment(Alignment(gui::Alignment::Horizontal::Right, gui::Alignment::Vertical::Center));
setEdges(RectangleEdge::None);
setCorners(RectangleRoundedCorner::None);
M products/PurePhone/PurePhoneMain.cpp => products/PurePhone/PurePhoneMain.cpp +1 -1
@@ 131,7 131,7 @@ int main()
if (!sys::SystemWatchdog::getInstance().init()) {
LOG_ERROR("System watchdog failed to initialize");
// wait for the hardware watchdog (initialized in reset ISR) to reset the system
- while (1)
+ while (true)
;
}
M pure_changelog.md => pure_changelog.md +1 -0
@@ 10,6 10,7 @@
* Disabled USB MTP protocol
* Changed UI flow on discharged device window.
+* Changed VoLTE label from 'beta' to 'experimental'.
### Fixed