1
0
forked from blue/squawk

minor bugfixes about message body, automatic focus and that quirk with font becomming bigger

This commit is contained in:
Blue 2022-03-29 19:05:24 +03:00
parent 788c6ca556
commit 5f6691067a
Signed by untrusted user: blue
GPG Key ID: 9B203B252A63EE38
5 changed files with 18 additions and 2 deletions

View File

@ -5,9 +5,12 @@
- build in release mode now no longer spams warnings - build in release mode now no longer spams warnings
- build now correctly installs all build plugin libs - build now correctly installs all build plugin libs
- a bug where the correction message was received, the indication was on but the text didn't actually change - a bug where the correction message was received, the indication was on but the text didn't actually change
- message body now doesn't intecept context menu from the whole message
- message input now doesn't increase font when you remove everything from it
### Improvements ### Improvements
- reduced amount of places where platform specific path separator is used - reduced amount of places where platform specific path separator is used
- now message input is automatically focused when you open a dialog or a room
### New features ### New features
- the settings are here! You con config different stuff from there - the settings are here! You con config different stuff from there

View File

@ -94,7 +94,6 @@ Conversation::Conversation(bool muc, Models::Account* acc, Models::Element* el,
this, &Conversation::onTextEditDocSizeChanged); this, &Conversation::onTextEditDocSizeChanged);
m_ui->messageEditor->installEventFilter(&ker); m_ui->messageEditor->installEventFilter(&ker);
m_ui->messageEditor->setContextMenuPolicy(Qt::CustomContextMenu);
connect(m_ui->messageEditor, &QTextEdit::customContextMenuRequested, this, &Conversation::onMessageEditorContext); connect(m_ui->messageEditor, &QTextEdit::customContextMenuRequested, this, &Conversation::onMessageEditorContext);
connect(pasteImageAction, &QAction::triggered, this, &Conversation::onImagePasted); connect(pasteImageAction, &QAction::triggered, this, &Conversation::onImagePasted);
@ -555,3 +554,11 @@ void Conversation::onMessageEditRequested(const QString& id)
qDebug() << "Ignoring"; qDebug() << "Ignoring";
} }
} }
void Conversation::showEvent(QShowEvent* event)
{
QWidget::showEvent(event);
emit shown();
m_ui->messageEditor->setFocus();
}

View File

@ -103,6 +103,7 @@ protected:
void dropEvent(QDropEvent* event) override; void dropEvent(QDropEvent* event) override;
void initializeOverlay(); void initializeOverlay();
virtual void onMessage(const Shared::Message& msg); virtual void onMessage(const Shared::Message& msg);
virtual void showEvent(QShowEvent * event) override;
protected slots: protected slots:
void initiateMessageSending(); void initiateMessageSending();

View File

@ -402,6 +402,9 @@
<height>30</height> <height>30</height>
</size> </size>
</property> </property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="autoFillBackground"> <property name="autoFillBackground">
<bool>false</bool> <bool>false</bool>
</property> </property>
@ -424,7 +427,7 @@ background-color: transparent
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Noto Sans'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt; &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Noto Sans'; font-size:8pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Liberation Sans'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="acceptRichText"> <property name="acceptRichText">
<bool>false</bool> <bool>false</bool>
@ -447,6 +450,7 @@ p, li { white-space: pre-wrap; }
<class>Badge</class> <class>Badge</class>
<extends>QFrame</extends> <extends>QFrame</extends>
<header location="global">ui/utils/badge.h</header> <header location="global">ui/utils/badge.h</header>
<container>1</container>
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources> <resources>

View File

@ -582,6 +582,7 @@ QLabel * MessageDelegate::getBody(const Models::FeedItem& data) const
} else { } else {
result = new QLabel(); result = new QLabel();
result->setFont(bodyFont); result->setFont(bodyFont);
result->setContextMenuPolicy(Qt::NoContextMenu);
result->setWordWrap(true); result->setWordWrap(true);
result->setOpenExternalLinks(true); result->setOpenExternalLinks(true);
result->setTextInteractionFlags(result->textInteractionFlags() | Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse); result->setTextInteractionFlags(result->textInteractionFlags() | Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse);