pidgin/resources/Conversations/message.ui

Tue, 13 May 2025 00:44:44 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Tue, 13 May 2025 00:44:44 -0500
changeset 43248
55ff17a82093
parent 43163
b650ebd3e157
child 43277
286947581188
permissions
-rw-r--r--

Add a preference for toggling whether or not to show formatting

There is no user interface for this right now, but you can manually tweak the
setting in pidgin3.ini. This required turning off use-markup on the content
label because mixing attributes with that caused the label to never remove
attributes.

This means that we broke links which were being handled because
use-markup was true. To fix this, we're going to need to create a new widget
that can handle all of the link logic off of attributes intead.

Testing Done:
Joined an IRC channel and sent a message with formatting from Pidgin 2. Then toggled the setting via the file and verified that formatting was toggled correctly.

Also called in the turtles.

Bugs closed: PIDGIN-18081

Reviewed at https://reviews.imfreedom.org/r/3970/

<?xml version="1.0" encoding="UTF-8"?>
<!--
Pidgin - Internet Messenger
Copyright (C) Pidgin Developers <devel@pidgin.im>

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this library; if not, see <https://www.gnu.org/licenses/>.
-->
<interface>
  <requires lib="gtk" version="4.0"/>
  <template class="PidginMessage">
    <property name="orientation">horizontal</property>
    <child>
      <object class="GtkEventControllerMotion" id="motion_controller"/>
    </child>
    <child>
      <object class="GtkBox">
        <property name="hexpand">1</property>
        <property name="orientation">vertical</property>
        <child>
          <object class="GtkBox">
            <property name="spacing">8</property>
            <child>
              <object class="PidginConversationMember">
                <binding name="conversation-member">
                  <lookup name="author" type="PurpleMessage">
                    <lookup name="message">PidginMessage</lookup>
                  </lookup>
                </binding>
              </object>
            </child>
            <child>
              <object class="GtkLabel" id="edited">
                <binding name="visible">
                  <lookup name="edited" type="PurpleMessage">
                    <lookup name="message">PidginMessage</lookup>
                  </lookup>
                </binding>
                <property name="label" translatable="yes">(edited)</property>
                <property name="has-tooltip">1</property>
                <signal name="query-tooltip" handler="pidgin_message_query_tooltip_edited_cb"/>
                <style>
                  <class name="dim-label"/>
                </style>
              </object>
            </child>
            <child>
              <object class="GtkLabel" id="timestamp">
                <binding name="visible">
                  <lookup name="contains_pointer">motion_controller</lookup>
                </binding>
                <binding name="label">
                  <closure type="gchararray" function="pidgin_message_get_timestamp_string">
                    <lookup name="message">PidginMessage</lookup>
                  </closure>
                </binding>
                <property name="has-tooltip">1</property>
                <signal name="query-tooltip" handler="pidgin_message_query_tooltip_timestamp_cb"/>
              </object>
            </child>
          </object>
        </child>
        <child>
          <object class="GtkLabel" id="content">
            <property name="wrap">1</property>
            <property name="wrap-mode">word-char</property>
            <property name="xalign">0</property>
            <property name="yalign">0</property>
            <binding name="label">
              <lookup name="contents" type="PurpleMessage">
                <lookup name="message">PidginMessage</lookup>
              </lookup>
            </binding>
            <binding name="attributes">
              <closure type="PangoAttrList" function="pidgin_message_get_message_attributes">
                <lookup name="message">PidginMessage</lookup>
                <lookup name="show-formatting">PidginMessage</lookup>
              </closure>
            </binding>
            <property name="has-tooltip">1</property>
            <signal name="query-tooltip" handler="pidgin_message_query_tooltip_contents_cb"/>
          </object>
        </child>
      </object>
    </child>
  </template>
</interface>

mercurial