~aleteoryx/muditaos

06b21752261227945066f711981b8dbfbfd6025b — Piotr Tanski 5 years ago be057d2
[EGD-4561] Fixed displaying the special characters in a note title. (#1124)

M changelog.md => changelog.md +2 -1
@@ 17,7 17,8 @@

### Fixed

* `[meditation]` Fixed default counter settings 
* `[meditation]` Fixed default counter settings
* `[notes]` Fixed displaying the special characters in a note title.

### Other


M module-apps/application-notes/widgets/NotesItem.cpp => module-apps/application-notes/widgets/NotesItem.cpp +14 -18
@@ 25,33 25,29 @@ namespace gui
        setPenFocusWidth(style::window::default_border_focus_w);
        setPenWidth(style::window::default_border_no_focus_w);

        title = createEmptyLabel(this);
        title->setFont(style::window::font::bigbold);
        title->setAlignment(gui::Alignment{gui::Alignment::Horizontal::Left, gui::Alignment::Vertical::Top});

        date = createEmptyLabel(this);
        date = new gui::Label(this, 0, 0, 0, 0);
        date->setEdges(RectangleEdge::None);
        date->setFont(style::window::font::medium);
        date->setAlignment(gui::Alignment{gui::Alignment::Horizontal::Right, gui::Alignment::Vertical::Top});

        snippet = new gui::TextFixedSize(this, 0, 0, 0, 0);
        snippet->setFont(style::window::font::small);
        snippet->setAlignment(gui::Alignment{gui::Alignment::Horizontal::Left});
        snippet->setEdges(gui::RectangleEdge::None);
        snippet->setPenFocusWidth(::style::window::default_border_focus_w);
        snippet->setPenWidth(::style::window::default_border_rect_no_focus);
        snippet->setEditMode(gui::EditMode::BROWSE);
        snippet->setUnderline(false);
        title   = createTextField(this, style::window::font::bigbold);
        snippet = createTextField(this, style::window::font::small);

        setSnippet(note->snippet);
        setDateText(note->date);
    }

    gui::Label *NotesItem::createEmptyLabel(Item *parent)
    gui::TextFixedSize *NotesItem::createTextField(Item *parent, const UTF8 &fontName)
    {
        auto label = new gui::Label(parent, 0, 0, 0, 0);
        label->setPenFocusWidth(0);
        label->setPenWidth(0);
        return label;
        auto item = new gui::TextFixedSize(parent, 0, 0, 0, 0);
        item->setFont(fontName);
        item->setEdges(gui::RectangleEdge::None);
        item->setAlignment(gui::Alignment{gui::Alignment::Horizontal::Left, gui::Alignment::Vertical::Top});
        item->setPenFocusWidth(::style::window::default_border_focus_w);
        item->setPenWidth(::style::window::default_border_rect_no_focus);
        item->setEditMode(gui::EditMode::BROWSE);
        item->setUnderline(false);
        return item;
    }

    void NotesItem::setSnippet(const UTF8 &noteText)

M module-apps/application-notes/widgets/NotesItem.hpp => module-apps/application-notes/widgets/NotesItem.hpp +2 -2
@@ 19,7 19,7 @@ namespace gui
        bool onDimensionChanged(const BoundingBox &oldDim, const BoundingBox &newDim) override;

      private:
        static gui::Label *createEmptyLabel(Item *parent);
        static gui::TextFixedSize *createTextField(Item *parent, const UTF8 &fontName);

        void buildInterface();
        void setSnippet(const UTF8 &noteText);


@@ 27,7 27,7 @@ namespace gui

        std::shared_ptr<NotesRecord> note;
        gui::Label *date            = nullptr;
        gui::Label *title           = nullptr;
        gui::TextFixedSize *title   = nullptr;
        gui::TextFixedSize *snippet = nullptr;
    };
} // namespace gui